Skip to content

Commit

Permalink
release: v2.37.0 (#1933)
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Lebedev <[email protected]>
  • Loading branch information
thenswan authored Aug 5, 2024
1 parent 04b1298 commit ab2510f
Show file tree
Hide file tree
Showing 21 changed files with 650 additions and 49 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.37.0

### Changed
- updated `bouncycastle` dependency
- updated `protoc` dependency
- other various codebase chores

## 2.36.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/android-app/android-app-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To get started with an Android project, you'll need to add the following **two**

1. **Hedera™ Java SDK:**
```groovy
implementation 'com.hedera.hashgraph:sdk:2.36.0'
implementation 'com.hedera.hashgraph:sdk:2.37.0'
```

2. **gRPC implementation:**
Expand Down
4 changes: 2 additions & 2 deletions docs/java-app/java-app-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ To get started with a Java project, you'll need to add the following **three** d

_Gradle:_
```groovy
implementation 'com.hedera.hashgraph:sdk:2.36.0'
implementation 'com.hedera.hashgraph:sdk:2.37.0'
```

_Maven:_
```xml
<dependency>
<groupId>com.hedera.hashgraph</groupId>
<artifactId>sdk</artifactId>
<version>2.36.0</version>
<version>2.37.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion example-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies {
implementation(platform("com.hedera.hashgraph:sdk-dependency-versions"))
// ---------------------------------------------

implementation("com.hedera.hashgraph:sdk:2.36.0")
implementation("com.hedera.hashgraph:sdk:2.37.0")

implementation("com.google.android.material:material:1.11.0")

Expand Down
4 changes: 2 additions & 2 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ mainModuleInfo {
}

dependencies.constraints {
implementation("com.hedera.hashgraph:sdk:2.36.0")
implementation("com.hedera.hashgraph:sdk-full:2.36.0")
implementation("com.hedera.hashgraph:sdk:2.37.0")
implementation("com.hedera.hashgraph:sdk-full:2.37.0")
}
23 changes: 22 additions & 1 deletion sdk/src/main/java/com/hedera/hashgraph/sdk/RequestType.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,22 @@ public enum RequestType {
/**
* Transfer one or more token balances held by the requesting account to the treasury for each token type.
*/
TOKEN_REJECT(HederaFunctionality.TokenReject);
TOKEN_REJECT(HederaFunctionality.TokenReject),

/**
* Airdrop one or more tokens to one or more accounts.
*/
TOKEN_AIRDROP(HederaFunctionality.TokenAirdrop),

/**
* Remove one or more pending airdrops from state on behalf of the sender(s) for each airdrop.
*/
TOKEN_CANCEL_AIRDROP(HederaFunctionality.TokenCancelAirdrop),

/**
* Claim one or more pending airdrops
*/
TOKEN_CLAIM_AIRDROP(HederaFunctionality.TokenClaimAirdrop);

final HederaFunctionality code;

Expand Down Expand Up @@ -506,6 +521,9 @@ static RequestType valueOf(HederaFunctionality code) {
case NodeUpdate -> NODE_UPDATE;
case NodeDelete -> NODE_DELETE;
case TokenReject -> TOKEN_REJECT;
case TokenAirdrop -> TOKEN_AIRDROP;
case TokenCancelAirdrop -> TOKEN_CANCEL_AIRDROP;
case TokenClaimAirdrop -> TOKEN_CLAIM_AIRDROP;
default -> throw new IllegalStateException("(BUG) unhandled HederaFunctionality");
};
}
Expand Down Expand Up @@ -592,6 +610,9 @@ public String toString() {
case NODE_UPDATE -> "NODE_UPDATE";
case NODE_DELETE -> "NODE_DELETE";
case TOKEN_REJECT -> "TOKEN_REJECT";
case TOKEN_AIRDROP -> "TOKEN_AIRDROP";
case TOKEN_CANCEL_AIRDROP -> "TOKEN_CANCEL_AIRDROP";
case TOKEN_CLAIM_AIRDROP -> "TOKEN_CLAIM_AIRDROP";
};
}
}
41 changes: 40 additions & 1 deletion sdk/src/main/java/com/hedera/hashgraph/sdk/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,40 @@ public enum Status {
/**
* The node account is not allowed to be updated
*/
UPDATE_NODE_ACCOUNT_NOT_ALLOWED(ResponseCodeEnum.UPDATE_NODE_ACCOUNT_NOT_ALLOWED);
UPDATE_NODE_ACCOUNT_NOT_ALLOWED(ResponseCodeEnum.UPDATE_NODE_ACCOUNT_NOT_ALLOWED),

/**
* The token has no metadata or supply key
*/
TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY(ResponseCodeEnum.TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY),

/**
* The transaction attempted to the use an empty List of `PendingAirdropId`.
*/
EMPTY_PENDING_AIRDROP_ID_LIST(ResponseCodeEnum.EMPTY_PENDING_AIRDROP_ID_LIST),

/**
* The transaction attempted to the same `PendingAirdropId` twice.
*/
PENDING_AIRDROP_ID_REPEATED(ResponseCodeEnum.PENDING_AIRDROP_ID_REPEATED),

/**
* The transaction attempted to use more than the allowed number of `PendingAirdropId`.
*/
MAX_PENDING_AIRDROP_ID_EXCEEDED(ResponseCodeEnum.MAX_PENDING_AIRDROP_ID_EXCEEDED),

/**
* A pending airdrop already exists for the specified NFT.
*/
PENDING_NFT_AIRDROP_ALREADY_EXISTS(ResponseCodeEnum.PENDING_NFT_AIRDROP_ALREADY_EXISTS),

/**
* The identified account is sender for one or more pending airdrop(s)
* and cannot be deleted.<br/>
* Requester should cancel all pending airdrops before resending
* this transaction.
*/
ACCOUNT_HAS_PENDING_AIRDROPS(ResponseCodeEnum.ACCOUNT_HAS_PENDING_AIRDROPS);

final ResponseCodeEnum code;

Expand Down Expand Up @@ -2013,6 +2046,12 @@ static Status valueOf(ResponseCodeEnum code) {
case INVALID_IPV4_ADDRESS -> INVALID_IPV4_ADDRESS;
case EMPTY_TOKEN_REFERENCE_LIST -> EMPTY_TOKEN_REFERENCE_LIST;
case UPDATE_NODE_ACCOUNT_NOT_ALLOWED -> UPDATE_NODE_ACCOUNT_NOT_ALLOWED;
case TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY -> TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY;
case EMPTY_PENDING_AIRDROP_ID_LIST -> EMPTY_PENDING_AIRDROP_ID_LIST;
case PENDING_AIRDROP_ID_REPEATED -> PENDING_AIRDROP_ID_REPEATED;
case MAX_PENDING_AIRDROP_ID_EXCEEDED -> MAX_PENDING_AIRDROP_ID_EXCEEDED;
case PENDING_NFT_AIRDROP_ALREADY_EXISTS -> PENDING_NFT_AIRDROP_ALREADY_EXISTS;
case ACCOUNT_HAS_PENDING_AIRDROPS -> ACCOUNT_HAS_PENDING_AIRDROPS;
case UNRECOGNIZED ->
// NOTE: Protobuf deserialization will not give us the code on the wire
throw new IllegalArgumentException(
Expand Down
11 changes: 11 additions & 0 deletions sdk/src/main/proto/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ message Account {
* It will be null if if the account is not a contract or the contract has no storage mappings.
*/
bytes first_contract_storage_key = 33;

/**
* A pending airdrop ID at the head of the linked list for this account
* from the account airdrops map.<br/>
* The account airdrops are connected by including the "next" and "previous"
* `PendingAirdropID` in each `AccountAirdrop` message.
* <p>
* This value SHALL NOT be empty if this account is "sender" for any
* pending airdrop, and SHALL be empty otherwise.
*/
PendingAirdropId head_pending_airdrop_id = 34;
}

/**
Expand Down
70 changes: 70 additions & 0 deletions sdk/src/main/proto/account_pending_airdrop.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
syntax = "proto3";

package proto;

/*
* 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.
*/

import "basic_types.proto";

option java_package = "com.hedera.hashgraph.sdk.proto";
// <<<pbj.java_package = "com.hedera.hapi.node.state.token">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;


/**
* A node within a doubly linked list of pending airdrop references.<br/>
* This internal state message forms the entries in a doubly-linked list
* of references to pending airdrop entries that are "owed" by a particular
* account as "sender".
*
* Each entry in this list MUST refer to an existing pending airdrop.<br/>
* The pending airdrop MUST NOT be claimed.<br/>
* The pending airdrop MUST NOT be canceled.<br/>
* The pending airdrop `sender` account's `head_pending_airdrop_id` field
* MUST match the `pending_airdrop_id` field in this message.
*
* ### Record Stream Effects
* This value is not currently published in the record stream.
*/
message AccountPendingAirdrop {
/**
* The value of the current airdrop id. SHALL NOT be set for non fungible tokens
*/
PendingAirdropValue pending_airdrop_value = 1;

/**
* A pending airdrop identifier.<br/>
* This identifies the specific pending airdrop that precedes this position
* within the doubly linked list of pending airdrops "owed" by the sending
* account associated with this account airdrop "list".
* <p>
* This SHALL match `pending_airdrop_id` if this is the only entry
* in the "list".
*/
PendingAirdropId previous_airdrop = 2;

/**
* A pending airdrop identifier.<br/>
* This identifies the specific pending airdrop that follows this position
* within the doubly linked list of pending airdrops "owed" by the sending
* account associated with this account airdrop "list".
* <p>
* This SHALL match `pending_airdrop_id` if this is the only entry
* in the "list".
*/
PendingAirdropId next_airdrop = 3;
}
81 changes: 81 additions & 0 deletions sdk/src/main/proto/basic_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,21 @@ enum HederaFunctionality {
* Transfer one or more token balances held by the requesting account to the treasury for each token type.
*/
TokenReject = 92;

/**
* Airdrop one or more tokens to one or more accounts.
*/
TokenAirdrop = 93;

/**
* Remove one or more pending airdrops from state on behalf of the sender(s) for each airdrop.
*/
TokenCancelAirdrop = 94;

/**
* Claim one or more pending airdrops
*/
TokenClaimAirdrop = 95;
}

/**
Expand Down Expand Up @@ -1669,3 +1684,69 @@ message StakingInfo {
int64 staked_node_id = 6;
}
}

/**
* A unique, composite, identifier for a pending airdrop.
*
* Each pending airdrop SHALL be uniquely identified by a PendingAirdropId.
* A PendingAirdropId SHALL be recorded when created and MUST be provided in any transaction
* that would modify that pending airdrop (such as a `claimAirdrop` or `cancelAirdrop`).
*/
message PendingAirdropId {
/**
* A sending account.<br/>
* This is the account that initiated, and SHALL fund, this pending airdrop.<br/>
* This field is REQUIRED.
*/
AccountID sender_id = 1;

/**
* A receiving account.<br/>
* This is the ID of the account that SHALL receive the airdrop.<br/>
* This field is REQUIRED.
*/
AccountID receiver_id = 2;

oneof token_reference {
/**
* A token ID.<br/>
* This is the type of token for a fungible/common token airdrop.<br/>
* This field is REQUIRED for a fungible/common token and MUST NOT be used for a
* non-fungible/unique token.
*/
TokenID fungible_token_type = 3;

/**
* The id of a single NFT, consisting of a Token ID and serial number.<br/>
* This is the type of token for a non-fungible/unique token airdrop.<br/>
* This field is REQUIRED for a non-fungible/unique token and MUST NOT be used for a
* fungible/common token.
*/
NftID non_fungible_token = 4;
}
}

/**
* A single pending airdrop value.
*
* This message SHALL record the airdrop amount for a fungible/common token.<br/>
* This message SHOULD be null for a non-fungible/unique token.<br/>
* If a non-null `PendingAirdropValue` is set for a non-fungible/unique token, the amount
* field MUST be `0`.
*
* It is RECOMMENDED that implementations store pending airdrop information as a key-value map
* from `PendingAirdropId` to `PendingAirdropValue`, with a `null` value used for non-fungible
* pending airdrops.
*/
message PendingAirdropValue {
/**
* An amount to transfer for fungible/common tokens.<br/>
* This is expressed in the smallest available units for that token
* (i.e. 10<sup>-`decimals`</sup> whole tokens).<br/>
* This amount SHALL be transferred from the sender to the receiver, if claimed.<br/>
* If the token is a fungible/common token, this value MUST be strictly greater than `0`.
* If the token is a non-fungible/unique token, this message SHOULD NOT be set, and if
* set, this field MUST be `0`.
*/
uint64 amount = 1;
}
33 changes: 33 additions & 0 deletions sdk/src/main/proto/response_code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1529,4 +1529,37 @@ enum ResponseCodeEnum {
* The node account is not allowed to be updated
*/
UPDATE_NODE_ACCOUNT_NOT_ALLOWED = 359;

/*
* The token has no metadata or supply key
*/
TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY = 360;

/**
* The transaction attempted to the use an empty List of `PendingAirdropId`.
*/
EMPTY_PENDING_AIRDROP_ID_LIST = 361;

/**
* The transaction attempted to the same `PendingAirdropId` twice.
*/
PENDING_AIRDROP_ID_REPEATED = 362;

/**
* The transaction attempted to use more than the allowed number of `PendingAirdropId`.
*/
MAX_PENDING_AIRDROP_ID_EXCEEDED = 363;

/*
* A pending airdrop already exists for the specified NFT.
*/
PENDING_NFT_AIRDROP_ALREADY_EXISTS = 364;

/*
* The identified account is sender for one or more pending airdrop(s)
* and cannot be deleted.<br/>
* Requester should cancel all pending airdrops before resending
* this transaction.
*/
ACCOUNT_HAS_PENDING_AIRDROPS = 365;
}
Loading

0 comments on commit ab2510f

Please sign in to comment.