Skip to content

Commit

Permalink
Metadata hips 646 657 765 (#319)
Browse files Browse the repository at this point in the history
* Protobuf changes for implementation of metadata hips 646, 657 and 765

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

* adding endpoint for updating an NFT, metadata and key field to getTokenInfo

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

* Temporary workaround for google.protobuf.BytesValue PBJ bug

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

* Addition of metadata to Token Entity

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

* Adding Invalid Metadata Key Response Code

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

* Removing partition verbiage

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

* Reverting to used google.protobuf.BytesValue

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>

---------

Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>
  • Loading branch information
thomas-swirlds-labs authored Jan 23, 2024
1 parent 12546c0 commit ffbd48e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
5 changes: 5 additions & 0 deletions services/response_code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1373,4 +1373,9 @@ enum ResponseCodeEnum {
* An alias that is assigned to an account or contract cannot be assigned to another account or contract.
*/
ALIAS_ALREADY_ASSIGNED = 332;

/**
* A provided metadata key was invalid. Verify the bytes for an Ed25519 public key are exactly 32 bytes; and the bytes for a compressed ECDSA(secp256k1) key are exactly 33 bytes, with the first byte either 0x02 or 0x03..
*/
INVALID_METADATA_KEY = 333;
}
11 changes: 11 additions & 0 deletions services/state/token/token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,15 @@ message Token {
* (Optional) The custom fees of this token.
*/
repeated CustomFee custom_fees = 26;

/**
* Metadata of the created token definition
*/
bytes metadata = 27;

/**
* The key which can change the metadata of a token
* (token definition and individual NFTs).
*/
Key metadata_key = 28;
}
4 changes: 2 additions & 2 deletions services/token_create.proto
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ message TokenCreateTransactionBody {
Key pause_key = 22;

/**
* Metadata of the created token definition.
*/
* Metadata of the created token definition.
*/
bytes metadata = 23;

/**
Expand Down
11 changes: 11 additions & 0 deletions services/token_get_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@ message TokenInfo {
* The ledger ID the response was returned from; please see <a href="https://github.com/hashgraph/hedera-improvement-proposal/blob/master/HIP/hip-198.md">HIP-198</a> for the network-specific IDs.
*/
bytes ledger_id = 26;

/**
* Represents the metadata of the token definition.
*/
bytes metadata = 27;

/**
* The key which can change the metadata of a token
* (token definition, partition definition, and individual NFTs).
*/
Key metadata_key = 28;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions services/token_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,7 @@ service TokenService {

// Unpause the token
rpc unpauseToken (Transaction) returns (TransactionResponse);

// Update an NFT
rpc updateNft (Transaction) returns (TransactionResponse);
}

0 comments on commit ffbd48e

Please sign in to comment.