-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add token reject transaction (#351)
- Loading branch information
1 parent
45b72af
commit 42b61af
Showing
4 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* # Token Reject | ||
* Messages used to implement a transaction to reject a token type from an | ||
* account. | ||
* | ||
* ### Keywords | ||
* The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | ||
* "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | ||
* document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119). | ||
*/ | ||
syntax = "proto3"; | ||
|
||
package proto; | ||
|
||
/*- | ||
* | ||
* Hedera Network Services Protobuf | ||
* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
option java_package = "com.hederahashgraph.api.proto.java"; | ||
// <<<pbj.java_package = "com.hedera.hapi.node.token">>> This comment is special code for setting PBJ Compiler java package | ||
option java_multiple_files = true; | ||
|
||
import "basic_types.proto"; | ||
|
||
/** | ||
* Reject undesired token(s).<br/> | ||
* Transfer one or more token balances held by the requesting account to the treasury for each | ||
* token type.<br/> | ||
* Each transfer SHALL be one of the following | ||
* - A single non-fungible/unique token. | ||
* - The full balance held for a fungible/common token type. | ||
* | ||
* A single tokenReject transaction SHALL support a maximum of 10 transfers. | ||
* | ||
* ### Transaction Record Effects | ||
* - Each successful transfer from `payer` to `treasury` SHALL be recorded in `token_transfer_list` for the transaction record. | ||
*/ | ||
message TokenRejectTransactionBody { | ||
/** | ||
* An account holding the tokens to be rejected.<br/> | ||
* If set, this account MUST sign this transaction. | ||
* If not set, the payer for this transaction SHALL be the account rejecting tokens. | ||
*/ | ||
AccountID owner = 1; | ||
|
||
/** | ||
* A list of one or more token rejections.<br/> | ||
* On success each rejected token serial number or balance SHALL be transferred from | ||
* the requesting account to the treasury account for that token type.<br/> | ||
* After rejection the requesting account SHALL continue to be associated with the token.<br/> | ||
* if dissociation is desired then a separate TokenDissociate transaction MUST be submitted to remove the association. | ||
*/ | ||
repeated TokenReference rejections = 2; | ||
} | ||
|
||
/** | ||
* A union token identifier. | ||
* | ||
* Identify a fungible/common token type, or a single non-fungible/unique token serial. | ||
*/ | ||
message TokenReference { | ||
oneof token_identifier { | ||
/** | ||
* A fungible/common token type. | ||
*/ | ||
TokenID fungible_token = 1; | ||
|
||
/** | ||
* A single specific serialized non-fungible/unique token. | ||
*/ | ||
NftID nft = 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters