@hiero-ledger/sdk 2.80.0 → 2.81.0-beta.1
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 +34 -7
- package/dist/umd.js +2213 -318
- package/dist/umd.js.map +1 -0
- package/dist/umd.min.js +6 -5
- package/dist/umd.min.js.map +1 -0
- package/lib/Executable.cjs +7 -4
- package/lib/Executable.js +1 -1
- package/lib/Executable.js.map +1 -1
- package/lib/PublicKey.cjs +45 -26
- package/lib/PublicKey.d.ts +12 -0
- package/lib/PublicKey.js +1 -1
- package/lib/PublicKey.js.map +1 -1
- package/lib/RequestType.cjs +19 -1
- package/lib/RequestType.d.ts +2 -0
- package/lib/RequestType.js +1 -1
- package/lib/RequestType.js.map +1 -1
- package/lib/Status.cjs +203 -252
- package/lib/Status.d.ts +8 -6
- package/lib/Status.js +1 -1
- package/lib/Status.js.map +1 -1
- package/lib/Transfer.cjs +25 -2
- package/lib/Transfer.d.ts +4 -0
- package/lib/Transfer.js +1 -1
- package/lib/Transfer.js.map +1 -1
- package/lib/account/AccountCreateTransaction.cjs +38 -0
- package/lib/account/AccountCreateTransaction.d.ts +21 -0
- package/lib/account/AccountCreateTransaction.js +1 -1
- package/lib/account/AccountCreateTransaction.js.map +1 -1
- package/lib/account/AccountUpdateTransaction.cjs +74 -1
- package/lib/account/AccountUpdateTransaction.d.ts +43 -0
- package/lib/account/AccountUpdateTransaction.js +1 -1
- package/lib/account/AccountUpdateTransaction.js.map +1 -1
- package/lib/account/TransferTransaction.cjs +57 -9
- package/lib/account/TransferTransaction.d.ts +31 -1
- package/lib/account/TransferTransaction.js +1 -1
- package/lib/account/TransferTransaction.js.map +1 -1
- package/lib/browser.js +1 -1
- package/lib/client/Client.cjs +38 -0
- package/lib/client/Client.d.ts +30 -0
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.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/contract/ContractCreateTransaction.cjs +37 -1
- package/lib/contract/ContractCreateTransaction.d.ts +21 -0
- package/lib/contract/ContractCreateTransaction.js +1 -1
- package/lib/contract/ContractCreateTransaction.js.map +1 -1
- package/lib/contract/ContractUpdateTransaction.cjs +74 -1
- package/lib/contract/ContractUpdateTransaction.d.ts +43 -0
- package/lib/contract/ContractUpdateTransaction.js +1 -1
- package/lib/contract/ContractUpdateTransaction.js.map +1 -1
- package/lib/exports.cjs +103 -0
- package/lib/exports.d.ts +13 -0
- package/lib/exports.js +1 -1
- package/lib/exports.js.map +1 -1
- package/lib/hooks/EvmHook.cjs +84 -0
- package/lib/hooks/EvmHook.d.ts +51 -0
- package/lib/hooks/EvmHook.js +2 -0
- package/lib/hooks/EvmHook.js.map +1 -0
- package/lib/hooks/EvmHookCall.cjs +103 -0
- package/lib/hooks/EvmHookCall.d.ts +69 -0
- package/lib/hooks/EvmHookCall.js +2 -0
- package/lib/hooks/EvmHookCall.js.map +1 -0
- package/lib/hooks/EvmHookMappingEntry.cjs +135 -0
- package/lib/hooks/EvmHookMappingEntry.d.ts +84 -0
- package/lib/hooks/EvmHookMappingEntry.js +2 -0
- package/lib/hooks/EvmHookMappingEntry.js.map +1 -0
- package/lib/hooks/EvmHookStorageUpdate.cjs +238 -0
- package/lib/hooks/EvmHookStorageUpdate.d.ts +144 -0
- package/lib/hooks/EvmHookStorageUpdate.js +2 -0
- package/lib/hooks/EvmHookStorageUpdate.js.map +1 -0
- package/lib/hooks/FungibleHookCall.cjs +67 -0
- package/lib/hooks/FungibleHookCall.d.ts +50 -0
- package/lib/hooks/FungibleHookCall.js +2 -0
- package/lib/hooks/FungibleHookCall.js.map +1 -0
- package/lib/hooks/FungibleHookType.cjs +11 -0
- package/lib/hooks/FungibleHookType.d.ts +5 -0
- package/lib/hooks/FungibleHookType.js +2 -0
- package/lib/hooks/FungibleHookType.js.map +1 -0
- package/lib/hooks/HookCall.cjs +99 -0
- package/lib/hooks/HookCall.d.ts +64 -0
- package/lib/hooks/HookCall.js +2 -0
- package/lib/hooks/HookCall.js.map +1 -0
- package/lib/hooks/HookCreationDetails.cjs +149 -0
- package/lib/hooks/HookCreationDetails.d.ts +91 -0
- package/lib/hooks/HookCreationDetails.js +2 -0
- package/lib/hooks/HookCreationDetails.js.map +1 -0
- package/lib/hooks/HookEntityId.cjs +67 -0
- package/lib/hooks/HookEntityId.d.ts +41 -0
- package/lib/hooks/HookEntityId.js +2 -0
- package/lib/hooks/HookEntityId.js.map +1 -0
- package/lib/hooks/HookExtensionPoint.cjs +31 -0
- package/lib/hooks/HookExtensionPoint.d.ts +16 -0
- package/lib/hooks/HookExtensionPoint.js +2 -0
- package/lib/hooks/HookExtensionPoint.js.map +1 -0
- package/lib/hooks/HookId.cjs +101 -0
- package/lib/hooks/HookId.d.ts +63 -0
- package/lib/hooks/HookId.js +2 -0
- package/lib/hooks/HookId.js.map +1 -0
- package/lib/hooks/HookStoreTransaction.cjs +157 -0
- package/lib/hooks/HookStoreTransaction.d.ts +77 -0
- package/lib/hooks/HookStoreTransaction.js +2 -0
- package/lib/hooks/HookStoreTransaction.js.map +1 -0
- package/lib/hooks/NftHookCall.cjs +67 -0
- package/lib/hooks/NftHookCall.d.ts +50 -0
- package/lib/hooks/NftHookCall.js +2 -0
- package/lib/hooks/NftHookCall.js.map +1 -0
- package/lib/hooks/NftHookType.cjs +13 -0
- package/lib/hooks/NftHookType.d.ts +7 -0
- package/lib/hooks/NftHookType.js +2 -0
- package/lib/hooks/NftHookType.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/native.js +1 -1
- package/lib/token/AbstractTokenTransferTransaction.cjs +17 -5
- package/lib/token/AbstractTokenTransferTransaction.d.ts +13 -2
- package/lib/token/AbstractTokenTransferTransaction.js +1 -1
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
- package/lib/token/TokenAirdropTransaction.cjs +1 -1
- package/lib/token/TokenAirdropTransaction.js +1 -1
- package/lib/token/TokenAirdropTransaction.js.map +1 -1
- package/lib/token/TokenNftTransfer.cjs +51 -2
- package/lib/token/TokenNftTransfer.d.ts +7 -0
- package/lib/token/TokenNftTransfer.js +1 -1
- package/lib/token/TokenNftTransfer.js.map +1 -1
- package/lib/token/TokenTransfer.cjs +26 -2
- package/lib/token/TokenTransfer.d.ts +4 -0
- package/lib/token/TokenTransfer.js +1 -1
- package/lib/token/TokenTransfer.js.map +1 -1
- package/lib/transaction/Transaction.cjs +2 -1
- package/lib/transaction/Transaction.js +1 -1
- package/lib/transaction/Transaction.js.map +1 -1
- package/lib/transaction/TransactionResponse.cjs +82 -9
- package/lib/transaction/TransactionResponse.d.ts +33 -2
- package/lib/transaction/TransactionResponse.js +1 -1
- package/lib/transaction/TransactionResponse.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +15 -13
- package/src/Executable.js +10 -7
- package/src/PublicKey.js +53 -36
- package/src/RequestType.js +18 -0
- package/src/Status.js +201 -252
- package/src/Transfer.js +33 -1
- package/src/account/AccountCreateTransaction.js +39 -0
- package/src/account/AccountUpdateTransaction.js +78 -0
- package/src/account/TransferTransaction.js +84 -8
- package/src/client/Client.js +38 -0
- 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/contract/ContractCreateTransaction.js +37 -0
- package/src/contract/ContractUpdateTransaction.js +80 -0
- package/src/exports.js +17 -0
- package/src/hooks/EvmHook.js +83 -0
- package/src/hooks/EvmHookCall.js +100 -0
- package/src/hooks/EvmHookMappingEntry.js +140 -0
- package/src/hooks/EvmHookStorageUpdate.js +257 -0
- package/src/hooks/FungibleHookCall.js +65 -0
- package/src/hooks/FungibleHookType.js +6 -0
- package/src/hooks/HookCall.js +97 -0
- package/src/hooks/HookCreationDetails.js +155 -0
- package/src/hooks/HookEntityId.js +67 -0
- package/src/hooks/HookExtensionPoint.js +25 -0
- package/src/hooks/HookId.js +102 -0
- package/src/hooks/HookStoreTransaction.js +185 -0
- package/src/hooks/NftHookCall.js +64 -0
- package/src/hooks/NftHookType.js +8 -0
- package/src/token/AbstractTokenTransferTransaction.js +16 -1
- package/src/token/TokenAirdropTransaction.js +1 -0
- package/src/token/TokenNftTransfer.js +68 -1
- package/src/token/TokenTransfer.js +34 -1
- package/src/transaction/Transaction.js +3 -0
- package/src/transaction/TransactionResponse.js +98 -13
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export default EvmHookMappingEntry;
|
|
2
|
+
/**
|
|
3
|
+
* An entry in a Solidity mapping. Very helpful for protocols that apply
|
|
4
|
+
* `HookStore` to manage the entries of a hook contract's mapping instead
|
|
5
|
+
* its raw storage slots.
|
|
6
|
+
* <p>
|
|
7
|
+
* This is especially attractive when the mapping value itself fits in a single
|
|
8
|
+
* word; for more complicated value storage layouts it becomes necessary to
|
|
9
|
+
* combine the mapping update with additional `EvmHookStorageSlot` updates that
|
|
10
|
+
* specify the complete storage slots of the value type.
|
|
11
|
+
*/
|
|
12
|
+
declare class EvmHookMappingEntry {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookMappingEntry} hookMappingEntry
|
|
16
|
+
* @returns {EvmHookMappingEntry}
|
|
17
|
+
*/
|
|
18
|
+
static _fromProtobuf(hookMappingEntry: import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookMappingEntry): EvmHookMappingEntry;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {object} props
|
|
22
|
+
* @param {Uint8Array} [props.key]
|
|
23
|
+
* @param {Uint8Array} [props.value]
|
|
24
|
+
* @param {Uint8Array} [props.preimage]
|
|
25
|
+
*/
|
|
26
|
+
constructor(props?: {
|
|
27
|
+
key?: Uint8Array<ArrayBufferLike> | undefined;
|
|
28
|
+
value?: Uint8Array<ArrayBufferLike> | undefined;
|
|
29
|
+
preimage?: Uint8Array<ArrayBufferLike> | undefined;
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* @type {?Uint8Array}
|
|
34
|
+
*/
|
|
35
|
+
private _key;
|
|
36
|
+
/**
|
|
37
|
+
* @private
|
|
38
|
+
* @type {?Uint8Array}
|
|
39
|
+
*/
|
|
40
|
+
private _value;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
* @type {?Uint8Array}
|
|
44
|
+
*/
|
|
45
|
+
private _preimage;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param {Uint8Array} key
|
|
49
|
+
* @returns {this}
|
|
50
|
+
*/
|
|
51
|
+
setKey(key: Uint8Array): this;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param {Uint8Array} value
|
|
55
|
+
* @returns {this}
|
|
56
|
+
*/
|
|
57
|
+
setValue(value: Uint8Array): this;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param {Uint8Array} preimage
|
|
61
|
+
* @returns {this}
|
|
62
|
+
*/
|
|
63
|
+
setPreimage(preimage: Uint8Array): this;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @returns {Uint8Array | null}
|
|
67
|
+
*/
|
|
68
|
+
get key(): Uint8Array | null;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @returns {Uint8Array | null}
|
|
72
|
+
*/
|
|
73
|
+
get value(): Uint8Array | null;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @returns {Uint8Array | null}
|
|
77
|
+
*/
|
|
78
|
+
get preimage(): Uint8Array | null;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookMappingEntry}
|
|
82
|
+
*/
|
|
83
|
+
_toProtobuf(): import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookMappingEntry;
|
|
84
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
class e{constructor(e={}){this._key=null,this._value=null,this._preimage=null,null!=e.preimage&&this.setPreimage(e.preimage),null!=e.key&&this.setKey(e.key),null!=e.value&&this.setValue(e.value)}setKey(e){return this._key=e,this._preimage=null,this}setValue(e){return this._value=e,this}setPreimage(e){return this._preimage=e,this._key=null,this}get key(){return this._key}get value(){return this._value}get preimage(){return this._preimage}static _fromProtobuf(t){return new e({key:null!=t.key?t.key:void 0,value:null!=t.value?t.value:void 0,preimage:null!=t.preimage?t.preimage:void 0})}_toProtobuf(){return{key:this._key,value:this._value,preimage:this._preimage}}}export{e as default};
|
|
2
|
+
//# sourceMappingURL=EvmHookMappingEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmHookMappingEntry.js","sources":["../../src/hooks/EvmHookMappingEntry.js"],"sourcesContent":["/**\n * An entry in a Solidity mapping. Very helpful for protocols that apply\n * `HookStore` to manage the entries of a hook contract's mapping instead\n * its raw storage slots.\n * <p>\n * This is especially attractive when the mapping value itself fits in a single\n * word; for more complicated value storage layouts it becomes necessary to\n * combine the mapping update with additional `EvmHookStorageSlot` updates that\n * specify the complete storage slots of the value type.\n */\nclass EvmHookMappingEntry {\n /**\n *\n * @param {object} props\n * @param {Uint8Array} [props.key]\n * @param {Uint8Array} [props.value]\n * @param {Uint8Array} [props.preimage]\n */\n constructor(props = {}) {\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._key = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._value = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._preimage = null;\n\n if (props.preimage != null) {\n this.setPreimage(props.preimage);\n }\n\n if (props.key != null) {\n this.setKey(props.key);\n }\n\n if (props.value != null) {\n this.setValue(props.value);\n }\n }\n\n /**\n *\n * @param {Uint8Array} key\n * @returns {this}\n */\n setKey(key) {\n this._key = key;\n this._preimage = null;\n return this;\n }\n\n /**\n *\n * @param {Uint8Array} value\n * @returns {this}\n */\n setValue(value) {\n this._value = value;\n return this;\n }\n\n /**\n *\n * @param {Uint8Array} preimage\n * @returns {this}\n */\n setPreimage(preimage) {\n this._preimage = preimage;\n this._key = null;\n return this;\n }\n\n /**\n *\n * @returns {Uint8Array | null}\n */\n get key() {\n return this._key;\n }\n\n /**\n *\n * @returns {Uint8Array | null}\n */\n get value() {\n return this._value;\n }\n\n /**\n *\n * @returns {Uint8Array | null}\n */\n get preimage() {\n return this._preimage;\n }\n\n /**\n *\n * @param {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.IEvmHookMappingEntry} hookMappingEntry\n * @returns {EvmHookMappingEntry}\n */\n static _fromProtobuf(hookMappingEntry) {\n return new EvmHookMappingEntry({\n key:\n hookMappingEntry.key != null ? hookMappingEntry.key : undefined,\n value:\n hookMappingEntry.value != null\n ? hookMappingEntry.value\n : undefined,\n preimage:\n hookMappingEntry.preimage != null\n ? hookMappingEntry.preimage\n : undefined,\n });\n }\n\n /**\n *\n * @returns {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.IEvmHookMappingEntry}\n */\n _toProtobuf() {\n return {\n key: this._key,\n value: this._value,\n preimage: this._preimage,\n };\n }\n}\n\nexport default EvmHookMappingEntry;\n"],"names":["EvmHookMappingEntry","constructor","props","this","_key","_value","_preimage","preimage","setPreimage","key","setKey","value","setValue","_fromProtobuf","hookMappingEntry","undefined","_toProtobuf"],"mappings":"AAUA,MAAMA,EAQF,WAAAC,CAAYC,EAAQ,IAKhBC,KAAKC,KAAO,KAMZD,KAAKE,OAAS,KAMdF,KAAKG,UAAY,KAEK,MAAlBJ,EAAMK,UACNJ,KAAKK,YAAYN,EAAMK,UAGV,MAAbL,EAAMO,KACNN,KAAKO,OAAOR,EAAMO,KAGH,MAAfP,EAAMS,OACNR,KAAKS,SAASV,EAAMS,MAEhC,CAOI,MAAAD,CAAOD,GAGH,OAFAN,KAAKC,KAAOK,EACZN,KAAKG,UAAY,KACVH,IACf,CAOI,QAAAS,CAASD,GAEL,OADAR,KAAKE,OAASM,EACPR,IACf,CAOI,WAAAK,CAAYD,GAGR,OAFAJ,KAAKG,UAAYC,EACjBJ,KAAKC,KAAO,KACLD,IACf,CAMI,OAAIM,GACA,OAAON,KAAKC,IACpB,CAMI,SAAIO,GACA,OAAOR,KAAKE,MACpB,CAMI,YAAIE,GACA,OAAOJ,KAAKG,SACpB,CAOI,oBAAOO,CAAcC,GACjB,OAAO,IAAId,EAAoB,CAC3BS,IAC4B,MAAxBK,EAAiBL,IAAcK,EAAiBL,SAAMM,EAC1DJ,MAC8B,MAA1BG,EAAiBH,MACXG,EAAiBH,WACjBI,EACVR,SACiC,MAA7BO,EAAiBP,SACXO,EAAiBP,cACjBQ,GAEtB,CAMI,WAAAC,GACI,MAAO,CACHP,IAAKN,KAAKC,KACVO,MAAOR,KAAKE,OACZE,SAAUJ,KAAKG,UAE3B"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EvmHookStorageUpdate = exports.EvmHookStorageSlot = exports.EvmHookMappingEntries = void 0;
|
|
7
|
+
var _EvmHookMappingEntry = _interopRequireDefault(require("./EvmHookMappingEntry.cjs"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @abstract
|
|
12
|
+
* Specifies a key/value pair in the storage of a EVM hook, either by the explicit storage
|
|
13
|
+
* slot contents; or by a combination of a Solidity mapping's slot key and the key into
|
|
14
|
+
* that mapping.
|
|
15
|
+
*/
|
|
16
|
+
class EvmHookStorageUpdate {
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageUpdate
|
|
20
|
+
* @returns {EvmHookStorageUpdate}
|
|
21
|
+
*/
|
|
22
|
+
static _fromProtobuf(hookStorageUpdate) {
|
|
23
|
+
if (hookStorageUpdate.storageSlot != null) {
|
|
24
|
+
return EvmHookStorageSlot._fromProtobuf(hookStorageUpdate);
|
|
25
|
+
}
|
|
26
|
+
if (hookStorageUpdate.mappingEntries != null) {
|
|
27
|
+
return EvmHookMappingEntries._fromProtobuf(hookStorageUpdate);
|
|
28
|
+
}
|
|
29
|
+
throw new Error("EvmHookStorageUpdate must have either storage_slot or mapping_entries set");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @abstract
|
|
34
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate}
|
|
35
|
+
*/
|
|
36
|
+
_toProtobuf() {
|
|
37
|
+
throw new Error("EvmHookStorageUpdate._toProtobuf must be implemented by a subclass");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A slot in the storage of a EVM hook.
|
|
43
|
+
*/
|
|
44
|
+
exports.EvmHookStorageUpdate = EvmHookStorageUpdate;
|
|
45
|
+
class EvmHookStorageSlot extends EvmHookStorageUpdate {
|
|
46
|
+
/**
|
|
47
|
+
* @param {object} props
|
|
48
|
+
* @param {Uint8Array} [props.key]
|
|
49
|
+
* @param {Uint8Array} [props.value]
|
|
50
|
+
*/
|
|
51
|
+
constructor(props = {}) {
|
|
52
|
+
super();
|
|
53
|
+
/**
|
|
54
|
+
* @private
|
|
55
|
+
* @type {?Uint8Array}
|
|
56
|
+
*/
|
|
57
|
+
this._key = null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @private
|
|
61
|
+
* @type {?Uint8Array}
|
|
62
|
+
*/
|
|
63
|
+
this._value = null;
|
|
64
|
+
if (props.key != null) {
|
|
65
|
+
this.setKey(props.key);
|
|
66
|
+
}
|
|
67
|
+
if (props.value != null) {
|
|
68
|
+
this.setValue(props.value);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param {Uint8Array} key
|
|
75
|
+
* @returns {this}
|
|
76
|
+
*/
|
|
77
|
+
setKey(key) {
|
|
78
|
+
this._key = key;
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @param {Uint8Array} value
|
|
85
|
+
* @returns {this}
|
|
86
|
+
*/
|
|
87
|
+
setValue(value) {
|
|
88
|
+
this._value = value;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @returns {Uint8Array | null}
|
|
95
|
+
*/
|
|
96
|
+
get key() {
|
|
97
|
+
return this._key;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @returns {Uint8Array | null}
|
|
103
|
+
*/
|
|
104
|
+
get value() {
|
|
105
|
+
return this._value;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageSlot
|
|
111
|
+
* @returns {EvmHookStorageSlot}
|
|
112
|
+
*/
|
|
113
|
+
static _fromProtobuf(hookStorageSlot) {
|
|
114
|
+
if (hookStorageSlot.storageSlot != null) {
|
|
115
|
+
return new EvmHookStorageSlot({
|
|
116
|
+
key: hookStorageSlot.storageSlot.key != null ? hookStorageSlot.storageSlot.key : undefined,
|
|
117
|
+
value: hookStorageSlot.storageSlot.value != null ? hookStorageSlot.storageSlot.value : undefined
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
throw new Error("EvmHookStorageSlot._fromProtobuf must be implemented by a subclass");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.EvmHookStorageUpdate}
|
|
125
|
+
*/
|
|
126
|
+
_toProtobuf() {
|
|
127
|
+
return {
|
|
128
|
+
storageSlot: {
|
|
129
|
+
key: this._key,
|
|
130
|
+
value: this._value
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Specifies storage slot updates via indirection into a Solidity mapping.
|
|
138
|
+
* <p>
|
|
139
|
+
* Concretely, if the Solidity mapping is itself at slot `mapping_slot`, then
|
|
140
|
+
* the * storage slot for key `key` in the mapping is defined by the relationship
|
|
141
|
+
* `key_storage_slot = keccak256(abi.encodePacked(mapping_slot, key))`.
|
|
142
|
+
* <p>
|
|
143
|
+
* This message lets a metaprotocol be specified in terms of changes to a
|
|
144
|
+
* Solidity mapping's entries. If only raw slots could be updated, then a block
|
|
145
|
+
* stream consumer following the metaprotocol would have to invert the Keccak256
|
|
146
|
+
* hash to determine which mapping entry was being updated, which is not possible.
|
|
147
|
+
*/
|
|
148
|
+
exports.EvmHookStorageSlot = EvmHookStorageSlot;
|
|
149
|
+
class EvmHookMappingEntries extends EvmHookStorageUpdate {
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @param {object} props
|
|
153
|
+
* @param {Uint8Array} [props.mappingSlot]
|
|
154
|
+
* @param {import("./EvmHookMappingEntry.js").default[]} [props.entries]
|
|
155
|
+
*/
|
|
156
|
+
constructor(props = {}) {
|
|
157
|
+
super();
|
|
158
|
+
/**
|
|
159
|
+
* @private
|
|
160
|
+
* @type {?Uint8Array}
|
|
161
|
+
*/
|
|
162
|
+
this._mappingSlot = null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @private
|
|
166
|
+
* @type {?import("./EvmHookMappingEntry.js").default[]}
|
|
167
|
+
*/
|
|
168
|
+
this._entries = null;
|
|
169
|
+
if (props.mappingSlot != null) {
|
|
170
|
+
this.setMappingSlot(props.mappingSlot);
|
|
171
|
+
}
|
|
172
|
+
if (props.entries != null) {
|
|
173
|
+
this.setEntries(props.entries);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @param {Uint8Array} mappingSlot
|
|
180
|
+
* @returns {this}
|
|
181
|
+
*/
|
|
182
|
+
setMappingSlot(mappingSlot) {
|
|
183
|
+
this._mappingSlot = mappingSlot;
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @param {import("./EvmHookMappingEntry.js").default[]} entries
|
|
190
|
+
* @returns {this}
|
|
191
|
+
*/
|
|
192
|
+
setEntries(entries) {
|
|
193
|
+
this._entries = entries;
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @returns {Uint8Array | null}
|
|
200
|
+
*/
|
|
201
|
+
get mappingSlot() {
|
|
202
|
+
return this._mappingSlot;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* @returns {import("./EvmHookMappingEntry.js").default[] | null}
|
|
208
|
+
*/
|
|
209
|
+
get entries() {
|
|
210
|
+
return this._entries;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageUpdate
|
|
216
|
+
* @returns {EvmHookMappingEntries}
|
|
217
|
+
*/
|
|
218
|
+
static _fromProtobuf(hookStorageUpdate) {
|
|
219
|
+
return new EvmHookMappingEntries({
|
|
220
|
+
mappingSlot: hookStorageUpdate.mappingEntries?.mappingSlot != null ? hookStorageUpdate.mappingEntries.mappingSlot : undefined,
|
|
221
|
+
entries: hookStorageUpdate.mappingEntries?.entries?.map(entry => _EvmHookMappingEntry.default._fromProtobuf(entry))
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
*
|
|
227
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.EvmHookStorageUpdate}
|
|
228
|
+
*/
|
|
229
|
+
_toProtobuf() {
|
|
230
|
+
return {
|
|
231
|
+
mappingEntries: {
|
|
232
|
+
mappingSlot: this._mappingSlot,
|
|
233
|
+
entries: this._entries != null ? this._entries.map(entry => entry._toProtobuf()) : null
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
exports.EvmHookMappingEntries = EvmHookMappingEntries;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @abstract
|
|
4
|
+
* Specifies a key/value pair in the storage of a EVM hook, either by the explicit storage
|
|
5
|
+
* slot contents; or by a combination of a Solidity mapping's slot key and the key into
|
|
6
|
+
* that mapping.
|
|
7
|
+
*/
|
|
8
|
+
export class EvmHookStorageUpdate {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageUpdate
|
|
12
|
+
* @returns {EvmHookStorageUpdate}
|
|
13
|
+
*/
|
|
14
|
+
static _fromProtobuf(hookStorageUpdate: import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate): EvmHookStorageUpdate;
|
|
15
|
+
/**
|
|
16
|
+
* @abstract
|
|
17
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate}
|
|
18
|
+
*/
|
|
19
|
+
_toProtobuf(): import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A slot in the storage of a EVM hook.
|
|
23
|
+
*/
|
|
24
|
+
export class EvmHookStorageSlot extends EvmHookStorageUpdate {
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageSlot
|
|
28
|
+
* @returns {EvmHookStorageSlot}
|
|
29
|
+
*/
|
|
30
|
+
static _fromProtobuf(hookStorageSlot: import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate): EvmHookStorageSlot;
|
|
31
|
+
/**
|
|
32
|
+
* @param {object} props
|
|
33
|
+
* @param {Uint8Array} [props.key]
|
|
34
|
+
* @param {Uint8Array} [props.value]
|
|
35
|
+
*/
|
|
36
|
+
constructor(props?: {
|
|
37
|
+
key?: Uint8Array<ArrayBufferLike> | undefined;
|
|
38
|
+
value?: Uint8Array<ArrayBufferLike> | undefined;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* @private
|
|
42
|
+
* @type {?Uint8Array}
|
|
43
|
+
*/
|
|
44
|
+
private _key;
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
* @type {?Uint8Array}
|
|
48
|
+
*/
|
|
49
|
+
private _value;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param {Uint8Array} key
|
|
53
|
+
* @returns {this}
|
|
54
|
+
*/
|
|
55
|
+
setKey(key: Uint8Array): this;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @param {Uint8Array} value
|
|
59
|
+
* @returns {this}
|
|
60
|
+
*/
|
|
61
|
+
setValue(value: Uint8Array): this;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @returns {Uint8Array | null}
|
|
65
|
+
*/
|
|
66
|
+
get key(): Uint8Array | null;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @returns {Uint8Array | null}
|
|
70
|
+
*/
|
|
71
|
+
get value(): Uint8Array | null;
|
|
72
|
+
/**
|
|
73
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.EvmHookStorageUpdate}
|
|
74
|
+
*/
|
|
75
|
+
_toProtobuf(): import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.EvmHookStorageUpdate;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Specifies storage slot updates via indirection into a Solidity mapping.
|
|
79
|
+
* <p>
|
|
80
|
+
* Concretely, if the Solidity mapping is itself at slot `mapping_slot`, then
|
|
81
|
+
* the * storage slot for key `key` in the mapping is defined by the relationship
|
|
82
|
+
* `key_storage_slot = keccak256(abi.encodePacked(mapping_slot, key))`.
|
|
83
|
+
* <p>
|
|
84
|
+
* This message lets a metaprotocol be specified in terms of changes to a
|
|
85
|
+
* Solidity mapping's entries. If only raw slots could be updated, then a block
|
|
86
|
+
* stream consumer following the metaprotocol would have to invert the Keccak256
|
|
87
|
+
* hash to determine which mapping entry was being updated, which is not possible.
|
|
88
|
+
*/
|
|
89
|
+
export class EvmHookMappingEntries extends EvmHookStorageUpdate {
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @param {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageUpdate
|
|
93
|
+
* @returns {EvmHookMappingEntries}
|
|
94
|
+
*/
|
|
95
|
+
static _fromProtobuf(hookStorageUpdate: import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate): EvmHookMappingEntries;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @param {object} props
|
|
99
|
+
* @param {Uint8Array} [props.mappingSlot]
|
|
100
|
+
* @param {import("./EvmHookMappingEntry.js").default[]} [props.entries]
|
|
101
|
+
*/
|
|
102
|
+
constructor(props?: {
|
|
103
|
+
mappingSlot?: Uint8Array<ArrayBufferLike> | undefined;
|
|
104
|
+
entries?: EvmHookMappingEntry[] | undefined;
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* @private
|
|
108
|
+
* @type {?Uint8Array}
|
|
109
|
+
*/
|
|
110
|
+
private _mappingSlot;
|
|
111
|
+
/**
|
|
112
|
+
* @private
|
|
113
|
+
* @type {?import("./EvmHookMappingEntry.js").default[]}
|
|
114
|
+
*/
|
|
115
|
+
private _entries;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param {Uint8Array} mappingSlot
|
|
119
|
+
* @returns {this}
|
|
120
|
+
*/
|
|
121
|
+
setMappingSlot(mappingSlot: Uint8Array): this;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param {import("./EvmHookMappingEntry.js").default[]} entries
|
|
125
|
+
* @returns {this}
|
|
126
|
+
*/
|
|
127
|
+
setEntries(entries: import("./EvmHookMappingEntry.js").default[]): this;
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* @returns {Uint8Array | null}
|
|
131
|
+
*/
|
|
132
|
+
get mappingSlot(): Uint8Array | null;
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
* @returns {import("./EvmHookMappingEntry.js").default[] | null}
|
|
136
|
+
*/
|
|
137
|
+
get entries(): import("./EvmHookMappingEntry.js").default[] | null;
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
* @returns {import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.EvmHookStorageUpdate}
|
|
141
|
+
*/
|
|
142
|
+
_toProtobuf(): import("@hiero-ledger/proto").com.hedera.hapi.node.hooks.EvmHookStorageUpdate;
|
|
143
|
+
}
|
|
144
|
+
import EvmHookMappingEntry from "./EvmHookMappingEntry.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import t from"./EvmHookMappingEntry.js";class e{static _fromProtobuf(t){if(null!=t.storageSlot)return r._fromProtobuf(t);if(null!=t.mappingEntries)return o._fromProtobuf(t);throw new Error("EvmHookStorageUpdate must have either storage_slot or mapping_entries set")}_toProtobuf(){throw new Error("EvmHookStorageUpdate._toProtobuf must be implemented by a subclass")}}class r extends e{constructor(t={}){super(),this._key=null,this._value=null,null!=t.key&&this.setKey(t.key),null!=t.value&&this.setValue(t.value)}setKey(t){return this._key=t,this}setValue(t){return this._value=t,this}get key(){return this._key}get value(){return this._value}static _fromProtobuf(t){if(null!=t.storageSlot)return new r({key:null!=t.storageSlot.key?t.storageSlot.key:void 0,value:null!=t.storageSlot.value?t.storageSlot.value:void 0});throw new Error("EvmHookStorageSlot._fromProtobuf must be implemented by a subclass")}_toProtobuf(){return{storageSlot:{key:this._key,value:this._value}}}}class o extends e{constructor(t={}){super(),this._mappingSlot=null,this._entries=null,null!=t.mappingSlot&&this.setMappingSlot(t.mappingSlot),null!=t.entries&&this.setEntries(t.entries)}setMappingSlot(t){return this._mappingSlot=t,this}setEntries(t){return this._entries=t,this}get mappingSlot(){return this._mappingSlot}get entries(){return this._entries}static _fromProtobuf(e){return new o({mappingSlot:null!=e.mappingEntries?.mappingSlot?e.mappingEntries.mappingSlot:void 0,entries:e.mappingEntries?.entries?.map(e=>t._fromProtobuf(e))})}_toProtobuf(){return{mappingEntries:{mappingSlot:this._mappingSlot,entries:null!=this._entries?this._entries.map(t=>t._toProtobuf()):null}}}}export{o as EvmHookMappingEntries,r as EvmHookStorageSlot,e as EvmHookStorageUpdate};
|
|
2
|
+
//# sourceMappingURL=EvmHookStorageUpdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmHookStorageUpdate.js","sources":["../../src/hooks/EvmHookStorageUpdate.js"],"sourcesContent":["import EvmHookMappingEntry from \"./EvmHookMappingEntry.js\";\n\n/**\n *\n * @abstract\n * Specifies a key/value pair in the storage of a EVM hook, either by the explicit storage\n * slot contents; or by a combination of a Solidity mapping's slot key and the key into\n * that mapping.\n */\nclass EvmHookStorageUpdate {\n /**\n *\n * @param {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageUpdate\n * @returns {EvmHookStorageUpdate}\n */\n static _fromProtobuf(hookStorageUpdate) {\n if (hookStorageUpdate.storageSlot != null) {\n return EvmHookStorageSlot._fromProtobuf(hookStorageUpdate);\n }\n\n if (hookStorageUpdate.mappingEntries != null) {\n return EvmHookMappingEntries._fromProtobuf(hookStorageUpdate);\n }\n\n throw new Error(\n \"EvmHookStorageUpdate must have either storage_slot or mapping_entries set\",\n );\n }\n\n /**\n * @abstract\n * @returns {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate}\n */\n _toProtobuf() {\n throw new Error(\n \"EvmHookStorageUpdate._toProtobuf must be implemented by a subclass\",\n );\n }\n}\n\n/**\n * A slot in the storage of a EVM hook.\n */\nclass EvmHookStorageSlot extends EvmHookStorageUpdate {\n /**\n * @param {object} props\n * @param {Uint8Array} [props.key]\n * @param {Uint8Array} [props.value]\n */\n constructor(props = {}) {\n super();\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._key = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._value = null;\n\n if (props.key != null) {\n this.setKey(props.key);\n }\n\n if (props.value != null) {\n this.setValue(props.value);\n }\n }\n\n /**\n *\n * @param {Uint8Array} key\n * @returns {this}\n */\n setKey(key) {\n this._key = key;\n return this;\n }\n\n /**\n *\n * @param {Uint8Array} value\n * @returns {this}\n */\n setValue(value) {\n this._value = value;\n return this;\n }\n\n /**\n *\n * @returns {Uint8Array | null}\n */\n get key() {\n return this._key;\n }\n\n /**\n *\n * @returns {Uint8Array | null}\n */\n get value() {\n return this._value;\n }\n\n /**\n *\n * @param {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageSlot\n * @returns {EvmHookStorageSlot}\n */\n static _fromProtobuf(hookStorageSlot) {\n if (hookStorageSlot.storageSlot != null) {\n return new EvmHookStorageSlot({\n key:\n hookStorageSlot.storageSlot.key != null\n ? hookStorageSlot.storageSlot.key\n : undefined,\n value:\n hookStorageSlot.storageSlot.value != null\n ? hookStorageSlot.storageSlot.value\n : undefined,\n });\n }\n throw new Error(\n \"EvmHookStorageSlot._fromProtobuf must be implemented by a subclass\",\n );\n }\n\n /**\n * @returns {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.EvmHookStorageUpdate}\n */\n _toProtobuf() {\n return {\n storageSlot: {\n key: this._key,\n value: this._value,\n },\n };\n }\n}\n\n/**\n * Specifies storage slot updates via indirection into a Solidity mapping.\n * <p>\n * Concretely, if the Solidity mapping is itself at slot `mapping_slot`, then\n * the * storage slot for key `key` in the mapping is defined by the relationship\n * `key_storage_slot = keccak256(abi.encodePacked(mapping_slot, key))`.\n * <p>\n * This message lets a metaprotocol be specified in terms of changes to a\n * Solidity mapping's entries. If only raw slots could be updated, then a block\n * stream consumer following the metaprotocol would have to invert the Keccak256\n * hash to determine which mapping entry was being updated, which is not possible.\n */\nclass EvmHookMappingEntries extends EvmHookStorageUpdate {\n /**\n *\n * @param {object} props\n * @param {Uint8Array} [props.mappingSlot]\n * @param {import(\"./EvmHookMappingEntry.js\").default[]} [props.entries]\n */\n constructor(props = {}) {\n super();\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._mappingSlot = null;\n\n /**\n * @private\n * @type {?import(\"./EvmHookMappingEntry.js\").default[]}\n */\n this._entries = null;\n\n if (props.mappingSlot != null) {\n this.setMappingSlot(props.mappingSlot);\n }\n\n if (props.entries != null) {\n this.setEntries(props.entries);\n }\n }\n\n /**\n *\n * @param {Uint8Array} mappingSlot\n * @returns {this}\n */\n setMappingSlot(mappingSlot) {\n this._mappingSlot = mappingSlot;\n return this;\n }\n\n /**\n *\n * @param {import(\"./EvmHookMappingEntry.js\").default[]} entries\n * @returns {this}\n */\n setEntries(entries) {\n this._entries = entries;\n return this;\n }\n\n /**\n *\n * @returns {Uint8Array | null}\n */\n get mappingSlot() {\n return this._mappingSlot;\n }\n\n /**\n *\n * @returns {import(\"./EvmHookMappingEntry.js\").default[] | null}\n */\n get entries() {\n return this._entries;\n }\n\n /**\n *\n * @param {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.IEvmHookStorageUpdate} hookStorageUpdate\n * @returns {EvmHookMappingEntries}\n */\n static _fromProtobuf(hookStorageUpdate) {\n return new EvmHookMappingEntries({\n mappingSlot:\n hookStorageUpdate.mappingEntries?.mappingSlot != null\n ? hookStorageUpdate.mappingEntries.mappingSlot\n : undefined,\n entries: hookStorageUpdate.mappingEntries?.entries?.map((entry) =>\n EvmHookMappingEntry._fromProtobuf(entry),\n ),\n });\n }\n\n /**\n *\n * @returns {import(\"@hiero-ledger/proto\").com.hedera.hapi.node.hooks.EvmHookStorageUpdate}\n */\n _toProtobuf() {\n return {\n mappingEntries: {\n mappingSlot: this._mappingSlot,\n entries:\n this._entries != null\n ? this._entries.map((entry) => entry._toProtobuf())\n : null,\n },\n };\n }\n}\n\nexport { EvmHookStorageUpdate, EvmHookStorageSlot, EvmHookMappingEntries };\n"],"names":["EvmHookStorageUpdate","_fromProtobuf","hookStorageUpdate","storageSlot","EvmHookStorageSlot","mappingEntries","EvmHookMappingEntries","Error","_toProtobuf","constructor","props","super","this","_key","_value","key","setKey","value","setValue","hookStorageSlot","undefined","_mappingSlot","_entries","mappingSlot","setMappingSlot","entries","setEntries","map","entry","EvmHookMappingEntry"],"mappings":"wCASA,MAAMA,EAMF,oBAAOC,CAAcC,GACjB,GAAqC,MAAjCA,EAAkBC,YAClB,OAAOC,EAAmBH,cAAcC,GAG5C,GAAwC,MAApCA,EAAkBG,eAClB,OAAOC,EAAsBL,cAAcC,GAG/C,MAAM,IAAIK,MACN,4EAEZ,CAMI,WAAAC,GACI,MAAM,IAAID,MACN,qEAEZ,EAMA,MAAMH,UAA2BJ,EAM7B,WAAAS,CAAYC,EAAQ,IAChBC,QAKAC,KAAKC,KAAO,KAMZD,KAAKE,OAAS,KAEG,MAAbJ,EAAMK,KACNH,KAAKI,OAAON,EAAMK,KAGH,MAAfL,EAAMO,OACNL,KAAKM,SAASR,EAAMO,MAEhC,CAOI,MAAAD,CAAOD,GAEH,OADAH,KAAKC,KAAOE,EACLH,IACf,CAOI,QAAAM,CAASD,GAEL,OADAL,KAAKE,OAASG,EACPL,IACf,CAMI,OAAIG,GACA,OAAOH,KAAKC,IACpB,CAMI,SAAII,GACA,OAAOL,KAAKE,MACpB,CAOI,oBAAOb,CAAckB,GACjB,GAAmC,MAA/BA,EAAgBhB,YAChB,OAAO,IAAIC,EAAmB,CAC1BW,IACuC,MAAnCI,EAAgBhB,YAAYY,IACtBI,EAAgBhB,YAAYY,SAC5BK,EACVH,MACyC,MAArCE,EAAgBhB,YAAYc,MACtBE,EAAgBhB,YAAYc,WAC5BG,IAGlB,MAAM,IAAIb,MACN,qEAEZ,CAKI,WAAAC,GACI,MAAO,CACHL,YAAa,CACTY,IAAKH,KAAKC,KACVI,MAAOL,KAAKE,QAG5B,EAeA,MAAMR,UAA8BN,EAOhC,WAAAS,CAAYC,EAAQ,IAChBC,QAKAC,KAAKS,aAAe,KAMpBT,KAAKU,SAAW,KAES,MAArBZ,EAAMa,aACNX,KAAKY,eAAed,EAAMa,aAGT,MAAjBb,EAAMe,SACNb,KAAKc,WAAWhB,EAAMe,QAElC,CAOI,cAAAD,CAAeD,GAEX,OADAX,KAAKS,aAAeE,EACbX,IACf,CAOI,UAAAc,CAAWD,GAEP,OADAb,KAAKU,SAAWG,EACTb,IACf,CAMI,eAAIW,GACA,OAAOX,KAAKS,YACpB,CAMI,WAAII,GACA,OAAOb,KAAKU,QACpB,CAOI,oBAAOrB,CAAcC,GACjB,OAAO,IAAII,EAAsB,CAC7BiB,YACqD,MAAjDrB,EAAkBG,gBAAgBkB,YAC5BrB,EAAkBG,eAAekB,iBACjCH,EACVK,QAASvB,EAAkBG,gBAAgBoB,SAASE,IAAKC,GACrDC,EAAoB5B,cAAc2B,KAGlD,CAMI,WAAApB,GACI,MAAO,CACHH,eAAgB,CACZkB,YAAaX,KAAKS,aAClBI,QACqB,MAAjBb,KAAKU,SACCV,KAAKU,SAASK,IAAKC,GAAUA,EAAMpB,eACnC,MAG1B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _HookCall = _interopRequireDefault(require("./HookCall.cjs"));
|
|
8
|
+
var _EvmHookCall = _interopRequireDefault(require("./EvmHookCall.cjs"));
|
|
9
|
+
var _FungibleHookType = _interopRequireDefault(require("./FungibleHookType.cjs"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @namespace proto
|
|
15
|
+
* @typedef {import("@hiero-ledger/proto").proto.IHookCall} HieroProto.proto.IHookCall
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {typeof FungibleHookType[keyof typeof FungibleHookType]} FungibleHookTypeValue
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A typed hook call for fungible (HBAR and FT) transfers.
|
|
24
|
+
*/
|
|
25
|
+
class FungibleHookCall extends _HookCall.default {
|
|
26
|
+
/**
|
|
27
|
+
* @param {object} props
|
|
28
|
+
* @param {Long} [props.hookId]
|
|
29
|
+
* @param {import("../hooks/EvmHookCall.js").default} [props.evmHookCall]
|
|
30
|
+
* @param {FungibleHookTypeValue} props.type - One of FungibleHookType.PRE_TX_ALLOWANCE_HOOK or FungibleHookType.PRE_POST_TX_ALLOWANCE_HOOK
|
|
31
|
+
*/
|
|
32
|
+
constructor(props) {
|
|
33
|
+
super(props);
|
|
34
|
+
if (props.type == null) {
|
|
35
|
+
throw new Error("type cannot be null");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The type of fungible hook
|
|
40
|
+
* @private
|
|
41
|
+
* @type {FungibleHookTypeValue}
|
|
42
|
+
*/
|
|
43
|
+
this._type = props.type;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @returns {FungibleHookTypeValue}
|
|
48
|
+
*/
|
|
49
|
+
get type() {
|
|
50
|
+
return this._type;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @param {HieroProto.proto.IHookCall} hookCall
|
|
56
|
+
* @param {FungibleHookTypeValue} type
|
|
57
|
+
* @returns {FungibleHookCall}
|
|
58
|
+
*/
|
|
59
|
+
static _fromProtobufWithType(hookCall, type) {
|
|
60
|
+
return new FungibleHookCall({
|
|
61
|
+
hookId: hookCall.hookId != null ? hookCall.hookId : undefined,
|
|
62
|
+
evmHookCall: hookCall.evmHookCall ? _EvmHookCall.default._fromProtobuf(hookCall.evmHookCall) : undefined,
|
|
63
|
+
type
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var _default = exports.default = FungibleHookCall;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export default FungibleHookCall;
|
|
2
|
+
export namespace HieroProto {
|
|
3
|
+
namespace proto {
|
|
4
|
+
type IHookCall = import("@hiero-ledger/proto").proto.IHookCall;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export type FungibleHookTypeValue = (typeof FungibleHookType)[keyof typeof FungibleHookType];
|
|
8
|
+
/**
|
|
9
|
+
* @namespace proto
|
|
10
|
+
* @typedef {import("@hiero-ledger/proto").proto.IHookCall} HieroProto.proto.IHookCall
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {typeof FungibleHookType[keyof typeof FungibleHookType]} FungibleHookTypeValue
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A typed hook call for fungible (HBAR and FT) transfers.
|
|
17
|
+
*/
|
|
18
|
+
declare class FungibleHookCall extends HookCall {
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
* @param {HieroProto.proto.IHookCall} hookCall
|
|
22
|
+
* @param {FungibleHookTypeValue} type
|
|
23
|
+
* @returns {FungibleHookCall}
|
|
24
|
+
*/
|
|
25
|
+
static _fromProtobufWithType(hookCall: HieroProto.proto.IHookCall, type: FungibleHookTypeValue): FungibleHookCall;
|
|
26
|
+
/**
|
|
27
|
+
* @param {object} props
|
|
28
|
+
* @param {Long} [props.hookId]
|
|
29
|
+
* @param {import("../hooks/EvmHookCall.js").default} [props.evmHookCall]
|
|
30
|
+
* @param {FungibleHookTypeValue} props.type - One of FungibleHookType.PRE_TX_ALLOWANCE_HOOK or FungibleHookType.PRE_POST_TX_ALLOWANCE_HOOK
|
|
31
|
+
*/
|
|
32
|
+
constructor(props: {
|
|
33
|
+
hookId?: import("long") | undefined;
|
|
34
|
+
evmHookCall?: EvmHookCall | undefined;
|
|
35
|
+
type: FungibleHookTypeValue;
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* The type of fungible hook
|
|
39
|
+
* @private
|
|
40
|
+
* @type {FungibleHookTypeValue}
|
|
41
|
+
*/
|
|
42
|
+
private _type;
|
|
43
|
+
/**
|
|
44
|
+
* @returns {FungibleHookTypeValue}
|
|
45
|
+
*/
|
|
46
|
+
get type(): FungibleHookTypeValue;
|
|
47
|
+
}
|
|
48
|
+
import FungibleHookType from "./FungibleHookType.js";
|
|
49
|
+
import HookCall from "./HookCall.js";
|
|
50
|
+
import EvmHookCall from "./EvmHookCall.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"./HookCall.js";import t from"./EvmHookCall.js";class e extends o{constructor(o){if(super(o),null==o.type)throw new Error("type cannot be null");this._type=o.type}get type(){return this._type}static _fromProtobufWithType(o,r){return new e({hookId:null!=o.hookId?o.hookId:void 0,evmHookCall:o.evmHookCall?t._fromProtobuf(o.evmHookCall):void 0,type:r})}}export{e as default};
|
|
2
|
+
//# sourceMappingURL=FungibleHookCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FungibleHookCall.js","sources":["../../src/hooks/FungibleHookCall.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport HookCall from \"./HookCall.js\";\nimport EvmHookCall from \"./EvmHookCall.js\";\nimport FungibleHookType from \"./FungibleHookType.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IHookCall} HieroProto.proto.IHookCall\n */\n\n/**\n * @typedef {typeof FungibleHookType[keyof typeof FungibleHookType]} FungibleHookTypeValue\n */\n\n/**\n * A typed hook call for fungible (HBAR and FT) transfers.\n */\nclass FungibleHookCall extends HookCall {\n /**\n * @param {object} props\n * @param {Long} [props.hookId]\n * @param {import(\"../hooks/EvmHookCall.js\").default} [props.evmHookCall]\n * @param {FungibleHookTypeValue} props.type - One of FungibleHookType.PRE_TX_ALLOWANCE_HOOK or FungibleHookType.PRE_POST_TX_ALLOWANCE_HOOK\n */\n constructor(props) {\n super(props);\n\n if (props.type == null) {\n throw new Error(\"type cannot be null\");\n }\n\n /**\n * The type of fungible hook\n * @private\n * @type {FungibleHookTypeValue}\n */\n this._type = props.type;\n }\n\n /**\n * @returns {FungibleHookTypeValue}\n */\n get type() {\n return this._type;\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IHookCall} hookCall\n * @param {FungibleHookTypeValue} type\n * @returns {FungibleHookCall}\n */\n static _fromProtobufWithType(hookCall, type) {\n return new FungibleHookCall({\n hookId: hookCall.hookId != null ? hookCall.hookId : undefined,\n evmHookCall: hookCall.evmHookCall\n ? EvmHookCall._fromProtobuf(hookCall.evmHookCall)\n : undefined,\n type,\n });\n }\n}\n\nexport default FungibleHookCall;\n"],"names":["FungibleHookCall","HookCall","constructor","props","super","type","Error","this","_type","_fromProtobufWithType","hookCall","hookId","undefined","evmHookCall","EvmHookCall","_fromProtobuf"],"mappings":"6DAkBA,MAAMA,UAAyBC,EAO3B,WAAAC,CAAYC,GAGR,GAFAC,MAAMD,GAEY,MAAdA,EAAME,KACN,MAAM,IAAIC,MAAM,uBAQpBC,KAAKC,MAAQL,EAAME,IAC3B,CAKI,QAAIA,GACA,OAAOE,KAAKC,KACpB,CAQI,4BAAOC,CAAsBC,EAAUL,GACnC,OAAO,IAAIL,EAAiB,CACxBW,OAA2B,MAAnBD,EAASC,OAAiBD,EAASC,YAASC,EACpDC,YAAaH,EAASG,YAChBC,EAAYC,cAAcL,EAASG,kBACnCD,EACNP,QAEZ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const FungibleHookType = Object.freeze({
|
|
8
|
+
PRE_TX_ALLOWANCE_HOOK: 0,
|
|
9
|
+
PRE_POST_TX_ALLOWANCE_HOOK: 1
|
|
10
|
+
});
|
|
11
|
+
var _default = exports.default = FungibleHookType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FungibleHookType.js","sources":["../../src/hooks/FungibleHookType.js"],"sourcesContent":["const FungibleHookType = Object.freeze({\n PRE_TX_ALLOWANCE_HOOK: 0,\n PRE_POST_TX_ALLOWANCE_HOOK: 1,\n});\n\nexport default FungibleHookType;\n"],"names":["FungibleHookType","Object","freeze","PRE_TX_ALLOWANCE_HOOK","PRE_POST_TX_ALLOWANCE_HOOK"],"mappings":"AAAK,MAACA,EAAmBC,OAAOC,OAAO,CACnCC,sBAAuB,EACvBC,2BAA4B"}
|