@hiero-ledger/sdk 2.70.0 → 2.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/umd.js +158 -40
- package/dist/umd.min.js +2 -2
- package/lib/LedgerId.cjs +4 -4
- package/lib/LedgerId.js +1 -1
- package/lib/LedgerId.js.map +1 -1
- package/lib/channel/NativeChannel.cjs +3 -2
- package/lib/channel/NativeChannel.js +1 -1
- package/lib/channel/NativeChannel.js.map +1 -1
- package/lib/channel/NodeMirrorChannel.cjs +0 -2
- package/lib/channel/NodeMirrorChannel.js +1 -1
- package/lib/channel/NodeMirrorChannel.js.map +1 -1
- package/lib/client/Client.cjs +3 -2
- package/lib/client/Client.d.ts +2 -2
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.js.map +1 -1
- package/lib/client/NativeClient.cjs +141 -44
- package/lib/client/NativeClient.d.ts +48 -16
- package/lib/client/NativeClient.js +1 -1
- package/lib/client/NativeClient.js.map +1 -1
- package/lib/client/NodeClient.cjs +63 -2
- package/lib/client/NodeClient.d.ts +42 -0
- package/lib/client/NodeClient.js +1 -1
- package/lib/client/NodeClient.js.map +1 -1
- package/lib/client/WebClient.cjs +64 -34
- package/lib/client/WebClient.d.ts +35 -15
- package/lib/client/WebClient.js +1 -1
- package/lib/client/WebClient.js.map +1 -1
- package/lib/client/addressbooks/mainnet.cjs +1 -1
- package/lib/client/addressbooks/mainnet.d.ts +1 -1
- package/lib/client/addressbooks/mainnet.js +1 -1
- package/lib/client/addressbooks/mainnet.js.map +1 -1
- package/lib/client/addressbooks/previewnet.cjs +1 -1
- package/lib/client/addressbooks/previewnet.d.ts +1 -1
- package/lib/client/addressbooks/previewnet.js +1 -1
- package/lib/client/addressbooks/previewnet.js.map +1 -1
- package/lib/client/addressbooks/testnet.cjs +1 -1
- package/lib/client/addressbooks/testnet.d.ts +1 -1
- package/lib/client/addressbooks/testnet.js +1 -1
- package/lib/client/addressbooks/testnet.js.map +1 -1
- package/lib/constants/ClientConstants.cjs +22 -7
- package/lib/constants/ClientConstants.d.ts +12 -6
- package/lib/constants/ClientConstants.js +1 -1
- package/lib/constants/ClientConstants.js.map +1 -1
- package/lib/contract/ContractCreateTransaction.cjs +5 -0
- package/lib/contract/ContractCreateTransaction.js +1 -1
- package/lib/contract/ContractCreateTransaction.js.map +1 -1
- package/lib/contract/ContractDeleteTransaction.cjs +35 -2
- package/lib/contract/ContractDeleteTransaction.d.ts +18 -0
- package/lib/contract/ContractDeleteTransaction.js +1 -1
- package/lib/contract/ContractDeleteTransaction.js.map +1 -1
- package/lib/contract/ContractInfo.cjs +11 -2
- package/lib/contract/ContractInfo.d.ts +6 -0
- package/lib/contract/ContractInfo.js +1 -1
- package/lib/contract/ContractInfo.js.map +1 -1
- package/lib/contract/ContractUpdateTransaction.cjs +2 -1
- package/lib/contract/ContractUpdateTransaction.js +1 -1
- package/lib/contract/ContractUpdateTransaction.js.map +1 -1
- package/lib/encoding/hex.cjs +11 -0
- package/lib/encoding/hex.js +1 -1
- package/lib/encoding/hex.js.map +1 -1
- package/lib/native.cjs +2 -2
- package/lib/native.d.ts +1 -1
- package/lib/native.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/LedgerId.js +4 -4
- package/src/channel/NativeChannel.js +9 -1
- package/src/channel/NodeMirrorChannel.js +0 -2
- package/src/client/Client.js +4 -2
- package/src/client/NativeClient.js +151 -47
- package/src/client/NodeClient.js +56 -3
- package/src/client/WebClient.js +63 -44
- package/src/client/addressbooks/mainnet.js +1 -1
- package/src/client/addressbooks/previewnet.js +1 -1
- package/src/client/addressbooks/testnet.js +1 -1
- package/src/constants/ClientConstants.js +26 -8
- package/src/contract/ContractCreateTransaction.js +5 -3
- package/src/contract/ContractDeleteTransaction.js +34 -0
- package/src/contract/ContractInfo.js +16 -0
- package/src/contract/ContractUpdateTransaction.js +4 -1
- package/src/encoding/hex.js +20 -0
- package/src/native.js +1 -1
|
@@ -39,6 +39,7 @@ export default class ContractInfo {
|
|
|
39
39
|
* @param {TokenRelationshipMap} props.tokenRelationships
|
|
40
40
|
* @param {LedgerId|null} props.ledgerId
|
|
41
41
|
* @param {?StakingInfo} props.stakingInfo
|
|
42
|
+
* @param {Long} props.maxAutomaticTokenAssociations
|
|
42
43
|
*/
|
|
43
44
|
constructor(props) {
|
|
44
45
|
/**
|
|
@@ -137,6 +138,13 @@ export default class ContractInfo {
|
|
|
137
138
|
*/
|
|
138
139
|
this.tokenRelationships = props.tokenRelationships;
|
|
139
140
|
|
|
141
|
+
/**
|
|
142
|
+
* The maximum number of automatic token associations allowed for this contract.
|
|
143
|
+
* @readonly
|
|
144
|
+
*/
|
|
145
|
+
this.maxAutomaticTokenAssociations =
|
|
146
|
+
props.maxAutomaticTokenAssociations;
|
|
147
|
+
|
|
140
148
|
/**
|
|
141
149
|
* 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.
|
|
142
150
|
*/
|
|
@@ -204,6 +212,12 @@ export default class ContractInfo {
|
|
|
204
212
|
info.stakingInfo != null
|
|
205
213
|
? StakingInfo._fromProtobuf(info.stakingInfo)
|
|
206
214
|
: null,
|
|
215
|
+
maxAutomaticTokenAssociations:
|
|
216
|
+
info.maxAutomaticTokenAssociations != null
|
|
217
|
+
? Long.isLong(info.maxAutomaticTokenAssociations)
|
|
218
|
+
? info.maxAutomaticTokenAssociations
|
|
219
|
+
: Long.fromValue(info.maxAutomaticTokenAssociations)
|
|
220
|
+
: Long.ZERO,
|
|
207
221
|
});
|
|
208
222
|
}
|
|
209
223
|
|
|
@@ -240,6 +254,8 @@ export default class ContractInfo {
|
|
|
240
254
|
this.stakingInfo != null
|
|
241
255
|
? this.stakingInfo._toProtobuf()
|
|
242
256
|
: null,
|
|
257
|
+
maxAutomaticTokenAssociations:
|
|
258
|
+
this.maxAutomaticTokenAssociations.toNumber(),
|
|
243
259
|
};
|
|
244
260
|
}
|
|
245
261
|
|
|
@@ -10,6 +10,7 @@ import Duration from "../Duration.js";
|
|
|
10
10
|
import Timestamp from "../Timestamp.js";
|
|
11
11
|
import Key from "../Key.js";
|
|
12
12
|
import Long from "long";
|
|
13
|
+
import * as Proto from "@hashgraph/proto";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @namespace proto
|
|
@@ -642,7 +643,9 @@ export default class ContractUpdateTransaction extends Transaction {
|
|
|
642
643
|
: null,
|
|
643
644
|
autoRenewAccountId:
|
|
644
645
|
this._autoRenewAccountId != null
|
|
645
|
-
? this._autoRenewAccountId.
|
|
646
|
+
? this._autoRenewAccountId.toString() == "0.0.0"
|
|
647
|
+
? Proto.proto.AccountID.create()
|
|
648
|
+
: this._autoRenewAccountId._toProtobuf()
|
|
646
649
|
: null,
|
|
647
650
|
};
|
|
648
651
|
}
|
package/src/encoding/hex.js
CHANGED
|
@@ -14,6 +14,26 @@ export function encode(data) {
|
|
|
14
14
|
*/
|
|
15
15
|
export function decode(text) {
|
|
16
16
|
const str = text.startsWith("0x") ? text.substring(2) : text;
|
|
17
|
+
|
|
18
|
+
if (str.length % 2 !== 0) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
"Invalid hex string: Must have an even number of characters.",
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (/[^0-9a-fA-F]/.test(str)) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
"Invalid hex string: Contains non-hexadecimal characters.",
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const bytes = new Uint8Array(str.length / 2);
|
|
31
|
+
|
|
32
|
+
for (let i = 0; i < str.length; i += 2) {
|
|
33
|
+
const byte = parseInt(str.substring(i, i + 2), 16);
|
|
34
|
+
bytes[i / 2] = byte;
|
|
35
|
+
}
|
|
36
|
+
|
|
17
37
|
return Buffer.from(str, "hex");
|
|
18
38
|
}
|
|
19
39
|
|
package/src/native.js
CHANGED