@aeternity/aepp-sdk 12.0.0 → 12.1.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/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -15
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +2 -1
- package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +20764 -1
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +7 -7
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +4 -3
- package/es/AeSdkAepp.mjs +2 -1
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.d.ts +22 -21
- package/es/AeSdkBase.mjs +25 -21
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkWallet.d.ts +4 -3
- package/es/AeSdkWallet.mjs +5 -1
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +7 -10
- package/es/Node.mjs +63 -57
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +7 -4
- package/es/account/Base.mjs +3 -3
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Memory.d.ts +5 -4
- package/es/account/Memory.mjs +24 -2
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.d.ts +6 -6
- package/es/account/Rpc.mjs +3 -2
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +27 -14
- package/es/aens.mjs +27 -21
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.d.ts +2 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +5 -2
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +5 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.d.ts +1 -0
- package/es/aepp-wallet-communication/connection-proxy.mjs +1 -0
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +1 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -5
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +8 -8
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.d.ts +17 -2
- package/es/aepp-wallet-communication/schema.mjs +54 -17
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.d.ts +2 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +2 -3
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +6 -2
- package/es/apis/node/models/index.mjs.map +1 -1
- package/es/apis/node/models/mappers.mjs +4 -2
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/chain.d.ts +92 -64
- package/es/chain.mjs +190 -154
- package/es/chain.mjs.map +1 -1
- package/es/channel/handlers.d.ts +3 -3
- package/es/channel/handlers.mjs +42 -44
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/index.d.ts +43 -52
- package/es/channel/index.mjs +46 -49
- package/es/channel/index.mjs.map +1 -1
- package/es/channel/internal.d.ts +16 -15
- package/es/channel/internal.mjs +67 -62
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Compiler.d.ts +1 -0
- package/es/contract/Compiler.mjs +5 -4
- package/es/contract/Compiler.mjs.map +1 -1
- package/es/contract/aci.d.ts +17 -15
- package/es/contract/aci.mjs +58 -45
- package/es/contract/aci.mjs.map +1 -1
- package/es/contract/ga.d.ts +16 -15
- package/es/contract/ga.mjs +12 -7
- package/es/contract/ga.mjs.map +1 -1
- package/es/contract/methods.d.ts +9 -6
- package/es/contract/methods.mjs +9 -6
- package/es/contract/methods.mjs.map +1 -1
- package/es/deprecated/index.d.ts +143 -0
- package/es/deprecated/index.mjs +162 -0
- package/es/deprecated/index.mjs.map +1 -0
- package/es/deprecated/methods.d.ts +18 -0
- package/es/deprecated/methods.mjs +26 -0
- package/es/deprecated/methods.mjs.map +1 -0
- package/es/index.d.ts +4 -1
- package/es/index.mjs +4 -1
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +69 -62
- package/es/oracle.mjs +121 -103
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +16 -15
- package/es/spend.mjs +19 -30
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/address.d.ts +25 -0
- package/es/tx/builder/address.mjs +45 -0
- package/es/tx/builder/address.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +55 -26
- package/es/tx/builder/constants.mjs +60 -38
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
- package/es/tx/builder/field-types/coin-amount.mjs +26 -0
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
- package/es/tx/builder/field-types/deposit.d.ts +15 -0
- package/es/tx/builder/field-types/deposit.mjs +19 -0
- package/es/tx/builder/field-types/deposit.mjs.map +1 -0
- package/es/tx/builder/field-types/fee.d.ts +25 -0
- package/es/tx/{min-fee.mjs → builder/field-types/fee.mjs} +62 -60
- package/es/tx/builder/field-types/fee.mjs.map +1 -0
- package/es/tx/builder/field-types/field.d.ts +6 -0
- package/es/tx/builder/field-types/field.mjs +15 -0
- package/es/tx/builder/field-types/field.mjs.map +1 -0
- package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
- package/es/tx/builder/field-types/gas-limit.mjs +33 -0
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
- package/es/tx/builder/field-types/gas-price.d.ts +8 -0
- package/es/tx/builder/field-types/gas-price.mjs +18 -0
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
- package/es/tx/builder/field-types/index.d.ts +70 -0
- package/es/tx/builder/field-types/index.mjs +25 -0
- package/es/tx/builder/field-types/index.mjs.map +1 -0
- package/es/tx/builder/field-types/name-fee.d.ts +20 -0
- package/es/tx/builder/field-types/name-fee.mjs +24 -0
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
- package/es/tx/builder/field-types/name-id.d.ts +14 -0
- package/es/tx/builder/field-types/name-id.mjs +19 -0
- package/es/tx/builder/field-types/name-id.mjs.map +1 -0
- package/es/tx/builder/field-types/name.d.ts +13 -0
- package/es/tx/builder/field-types/name.mjs +18 -0
- package/es/tx/builder/field-types/name.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/es/tx/builder/field-types/short-u-int.mjs +12 -0
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.d.ts +8 -0
- package/es/tx/builder/field-types/u-int.mjs +14 -0
- package/es/tx/builder/field-types/u-int.mjs.map +1 -0
- package/es/tx/builder/helpers.d.ts +27 -33
- package/es/tx/builder/helpers.mjs +41 -47
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +25 -12
- package/es/tx/builder/index.mjs +74 -83
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +995 -144
- package/es/tx/builder/schema.mjs +121 -170
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/index.d.ts +28 -27
- package/es/tx/index.mjs +97 -117
- package/es/tx/index.mjs.map +1 -1
- package/es/tx/validator.d.ts +4 -3
- package/es/tx/validator.mjs +79 -92
- package/es/tx/validator.mjs.map +1 -1
- package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -1
- package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -1
- package/es/typings/bip32-path/index.d.mjs.map +1 -1
- package/es/typings/blakejs/index.d.mjs.map +1 -1
- package/es/typings/sha-js/index.d.mjs +2 -0
- package/es/typings/sha-js/index.d.mjs.map +1 -0
- package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -1
- package/es/utils/amount-formatter.d.ts +9 -9
- package/es/utils/amount-formatter.mjs +17 -17
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.mjs +7 -7
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bignumber.mjs +2 -1
- package/es/utils/bignumber.mjs.map +1 -1
- package/es/utils/bytes.mjs +1 -1
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.d.ts +8 -23
- package/es/utils/crypto.mjs +15 -41
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder-types.d.ts +61 -0
- package/es/utils/encoder-types.mjs +36 -0
- package/es/utils/encoder-types.mjs.map +1 -0
- package/es/utils/encoder.d.ts +6 -7
- package/es/utils/encoder.mjs +42 -26
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +1 -11
- package/es/utils/errors.mjs +4 -20
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.d.ts +18 -2
- package/es/utils/hd-wallet.mjs +64 -34
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs +2 -2
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.mjs +4 -2
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/mptree.d.ts +2 -2
- package/es/utils/mptree.mjs +11 -6
- package/es/utils/mptree.mjs.map +1 -1
- package/es/utils/other.d.ts +8 -2
- package/es/utils/other.mjs +15 -3
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.d.ts +1 -1
- package/es/utils/semver-satisfies.mjs +2 -2
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.mjs.map +1 -1
- package/package.json +35 -33
- package/src/AeSdk.ts +30 -27
- package/src/AeSdkAepp.ts +93 -84
- package/src/AeSdkBase.ts +148 -130
- package/src/AeSdkWallet.ts +172 -156
- package/src/Node.ts +108 -102
- package/src/account/Base.ts +42 -32
- package/src/account/Memory.ts +45 -30
- package/src/account/Rpc.ts +32 -30
- package/src/aens.ts +124 -108
- package/src/aepp-wallet-communication/connection/Browser.ts +18 -15
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +22 -21
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +63 -52
- package/src/aepp-wallet-communication/connection-proxy.ts +8 -7
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +67 -61
- package/src/aepp-wallet-communication/rpc/types.ts +32 -32
- package/src/aepp-wallet-communication/schema.ts +117 -74
- package/src/aepp-wallet-communication/wallet-detector.ts +29 -28
- package/src/apis/node/code-model-v4.yaml +54 -20
- package/src/apis/node/models/index.ts +6 -2
- package/src/apis/node/models/mappers.ts +4 -2
- package/src/chain.ts +286 -228
- package/src/channel/handlers.ts +424 -372
- package/src/channel/index.ts +285 -251
- package/src/channel/internal.ts +248 -232
- package/src/contract/Compiler.ts +22 -21
- package/src/contract/aci.ts +267 -258
- package/src/contract/ga.ts +93 -72
- package/src/contract/methods.ts +32 -27
- package/src/deprecated/index.ts +170 -0
- package/src/deprecated/methods.ts +25 -0
- package/src/index.ts +37 -32
- package/src/oracle.ts +211 -189
- package/src/spend.ts +82 -70
- package/src/tx/builder/address.ts +50 -0
- package/src/tx/builder/constants.ts +82 -52
- package/src/tx/builder/field-types/coin-amount.ts +27 -0
- package/src/tx/builder/field-types/deposit.ts +21 -0
- package/src/tx/builder/field-types/fee.ts +143 -0
- package/src/tx/builder/field-types/field.ts +9 -0
- package/src/tx/builder/field-types/gas-limit.ts +41 -0
- package/src/tx/builder/field-types/gas-price.ts +16 -0
- package/src/tx/builder/field-types/index.ts +45 -0
- package/src/tx/builder/field-types/name-fee.ts +32 -0
- package/src/tx/builder/field-types/name-id.ts +20 -0
- package/src/tx/builder/field-types/name.ts +18 -0
- package/src/tx/builder/field-types/short-u-int.ts +11 -0
- package/src/tx/builder/field-types/u-int.ts +16 -0
- package/src/tx/builder/helpers.ts +112 -117
- package/src/tx/builder/index.ts +203 -197
- package/src/tx/builder/schema.ts +421 -465
- package/src/tx/index.ts +128 -135
- package/src/tx/validator.ts +165 -161
- package/src/typings/@aeternity__argon2-browser/index.d.ts +1 -1
- package/src/typings/@aeternity__uuid/index.d.ts +3 -1
- package/src/typings/bip32-path/index.d.ts +6 -6
- package/src/typings/blakejs/index.d.ts +4 -32
- package/src/typings/sha-js/index.d.ts +5 -0
- package/src/typings/tweetnacl-auth/index.d.ts +2 -2
- package/src/utils/amount-formatter.ts +41 -41
- package/src/utils/autorest.ts +57 -54
- package/src/utils/bignumber.ts +7 -6
- package/src/utils/bytes.ts +19 -19
- package/src/utils/crypto.ts +82 -94
- package/src/utils/encoder-types.ts +63 -0
- package/src/utils/encoder.ts +104 -56
- package/src/utils/errors.ts +246 -264
- package/src/utils/hd-wallet.ts +114 -82
- package/src/utils/json-big.ts +16 -15
- package/src/utils/keystore.ts +65 -62
- package/src/utils/mptree.ts +59 -56
- package/src/utils/other.ts +26 -18
- package/src/utils/semver-satisfies.ts +15 -11
- package/src/utils/string.ts +10 -10
- package/es/tx/builder/field-types.d.ts +0 -62
- package/es/tx/builder/field-types.mjs +0 -126
- package/es/tx/builder/field-types.mjs.map +0 -1
- package/es/tx/min-fee.d.ts +0 -20
- package/es/tx/min-fee.mjs.map +0 -1
- package/src/tx/builder/field-types.ts +0 -111
- package/src/tx/min-fee.ts +0 -136
package/es/chain.d.ts
CHANGED
|
@@ -1,16 +1,79 @@
|
|
|
1
1
|
import { AE_AMOUNT_FORMATS } from './utils/amount-formatter';
|
|
2
|
-
import {
|
|
2
|
+
import { ValidatorResult } from './tx/validator';
|
|
3
|
+
import { AensName } from './tx/builder/constants';
|
|
4
|
+
import { TransactionError } from './utils/errors';
|
|
3
5
|
import Node, { TransformNodeType } from './Node';
|
|
4
6
|
import { Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults, Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx } from './apis/node';
|
|
5
|
-
import {
|
|
7
|
+
import { Encoded, Encoding } from './utils/encoder';
|
|
6
8
|
import AccountBase from './account/Base';
|
|
9
|
+
/**
|
|
10
|
+
* @category chain
|
|
11
|
+
*/
|
|
7
12
|
export declare function _getPollInterval(type: 'block' | 'microblock', { _expectedMineRate, _microBlockCycle, _maxPollInterval }: {
|
|
8
13
|
_expectedMineRate?: number;
|
|
9
14
|
_microBlockCycle?: number;
|
|
10
15
|
_maxPollInterval?: number;
|
|
11
16
|
}): number;
|
|
17
|
+
/**
|
|
18
|
+
* @category exception
|
|
19
|
+
*/
|
|
20
|
+
export declare class InvalidTxError extends TransactionError {
|
|
21
|
+
validation: ValidatorResult[];
|
|
22
|
+
transaction: Encoded.Transaction;
|
|
23
|
+
constructor(message: string, validation: ValidatorResult[], transaction: Encoded.Transaction);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Obtain current height of the chain
|
|
27
|
+
* @category chain
|
|
28
|
+
* @returns Current chain height
|
|
29
|
+
*/
|
|
30
|
+
export declare function getHeight({ onNode }: {
|
|
31
|
+
onNode: Node;
|
|
32
|
+
}): Promise<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Wait for a transaction to be mined
|
|
35
|
+
* @category chain
|
|
36
|
+
* @param th - The hash of transaction to poll
|
|
37
|
+
* @param options - Options
|
|
38
|
+
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
39
|
+
* @param options.blocks - Number of blocks mined after which to fail
|
|
40
|
+
* @param options.onNode - Node to use
|
|
41
|
+
* @returns The transaction as it was mined
|
|
42
|
+
*/
|
|
43
|
+
export declare function poll(th: Encoded.TxHash, { blocks, interval, onNode, ...options }: {
|
|
44
|
+
blocks?: number;
|
|
45
|
+
interval?: number;
|
|
46
|
+
onNode: Node;
|
|
47
|
+
} & Parameters<typeof _getPollInterval>[1]): Promise<TransformNodeType<SignedTx>>;
|
|
48
|
+
/**
|
|
49
|
+
* Wait for the chain to reach a specific height
|
|
50
|
+
* @category chain
|
|
51
|
+
* @param height - Height to wait for
|
|
52
|
+
* @param options - Options
|
|
53
|
+
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
54
|
+
* @param options.onNode - Node to use
|
|
55
|
+
* @returns Current chain height
|
|
56
|
+
*/
|
|
57
|
+
export declare function awaitHeight(height: number, { interval, onNode, ...options }: {
|
|
58
|
+
interval?: number;
|
|
59
|
+
onNode: Node;
|
|
60
|
+
} & Parameters<typeof _getPollInterval>[1]): Promise<number>;
|
|
61
|
+
/**
|
|
62
|
+
* Wait for transaction confirmation
|
|
63
|
+
* @category chain
|
|
64
|
+
* @param txHash - Transaction hash
|
|
65
|
+
* @param options - Options
|
|
66
|
+
* @param options.confirm - Number of micro blocks to wait for transaction confirmation
|
|
67
|
+
* @param options.onNode - Node to use
|
|
68
|
+
* @returns Current Height
|
|
69
|
+
*/
|
|
70
|
+
export declare function waitForTxConfirm(txHash: Encoded.TxHash, { confirm, onNode, ...options }: {
|
|
71
|
+
confirm?: number;
|
|
72
|
+
onNode: Node;
|
|
73
|
+
} & Parameters<typeof awaitHeight>[1]): Promise<number>;
|
|
12
74
|
/**
|
|
13
75
|
* Submit a signed transaction for mining
|
|
76
|
+
* @category chain
|
|
14
77
|
* @param tx - Transaction to submit
|
|
15
78
|
* @param options - Options
|
|
16
79
|
* @param options.onNode - Node to use
|
|
@@ -20,7 +83,7 @@ export declare function _getPollInterval(type: 'block' | 'microblock', { _expect
|
|
|
20
83
|
* @param options.confirm - Number of micro blocks that should be mined after tx get included
|
|
21
84
|
* @returns Transaction details
|
|
22
85
|
*/
|
|
23
|
-
export declare function sendTransaction(tx:
|
|
86
|
+
export declare function sendTransaction(tx: Encoded.Transaction, { onNode, onAccount, verify, waitMined, confirm, ...options }: SendTransactionOptions): Promise<SendTransactionReturnType>;
|
|
24
87
|
declare type SendTransactionOptionsType = {
|
|
25
88
|
onNode: Node;
|
|
26
89
|
onAccount?: AccountBase;
|
|
@@ -31,37 +94,27 @@ declare type SendTransactionOptionsType = {
|
|
|
31
94
|
interface SendTransactionOptions extends SendTransactionOptionsType {
|
|
32
95
|
}
|
|
33
96
|
interface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {
|
|
34
|
-
hash:
|
|
35
|
-
rawTx:
|
|
97
|
+
hash: Encoded.TxHash;
|
|
98
|
+
rawTx: Encoded.Transaction;
|
|
36
99
|
confirmationHeight?: number;
|
|
37
100
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Wait for transaction confirmation
|
|
40
|
-
* @param txHash - Transaction hash
|
|
41
|
-
* @param options - Options
|
|
42
|
-
* @param options.confirm - Number of micro blocks to wait for transaction confirmation
|
|
43
|
-
* @param options.onNode - Node to use
|
|
44
|
-
* @returns Current Height
|
|
45
|
-
*/
|
|
46
|
-
export declare function waitForTxConfirm(txHash: EncodedData<'th'>, { confirm, onNode, ...options }: {
|
|
47
|
-
confirm?: number;
|
|
48
|
-
onNode: Node;
|
|
49
|
-
} & Parameters<typeof awaitHeight>[1]): Promise<number>;
|
|
50
101
|
/**
|
|
51
102
|
* Get account by account public key
|
|
103
|
+
* @category chain
|
|
52
104
|
* @param address - Account address (public key)
|
|
53
105
|
* @param options - Options
|
|
54
106
|
* @param options.height - Get account on specific block by block height
|
|
55
107
|
* @param options.hash - Get account on specific block by micro block hash or key block hash
|
|
56
108
|
* @param options.onNode - Node to use
|
|
57
109
|
*/
|
|
58
|
-
export declare function getAccount(address:
|
|
110
|
+
export declare function getAccount(address: Encoded.AccountAddress | Encoded.ContractAddress, { height, hash, onNode }: {
|
|
59
111
|
height?: number;
|
|
60
|
-
hash?:
|
|
112
|
+
hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash;
|
|
61
113
|
onNode: Node;
|
|
62
114
|
}): Promise<TransformNodeType<AccountNode>>;
|
|
63
115
|
/**
|
|
64
116
|
* Request the balance of specified account
|
|
117
|
+
* @category chain
|
|
65
118
|
* @param address - The public account address to obtain the balance for
|
|
66
119
|
* @param options - Options
|
|
67
120
|
* @param options.format
|
|
@@ -69,46 +122,12 @@ export declare function getAccount(address: EncodedData<'ak' | 'ct'>, { height,
|
|
|
69
122
|
* (default: top of chain)
|
|
70
123
|
* @param options.hash - The block hash on which to obtain the balance for (default: top of chain)
|
|
71
124
|
*/
|
|
72
|
-
export declare function getBalance(address:
|
|
125
|
+
export declare function getBalance(address: Encoded.AccountAddress | Encoded.ContractAddress, { format, ...options }: {
|
|
73
126
|
format?: AE_AMOUNT_FORMATS;
|
|
74
127
|
} & Parameters<typeof getAccount>[1]): Promise<string>;
|
|
75
|
-
/**
|
|
76
|
-
* Obtain current height of the chain
|
|
77
|
-
* @returns Current chain height
|
|
78
|
-
*/
|
|
79
|
-
export declare function height({ onNode }: {
|
|
80
|
-
onNode: Node;
|
|
81
|
-
}): Promise<number>;
|
|
82
|
-
/**
|
|
83
|
-
* Wait for the chain to reach a specific height
|
|
84
|
-
* @param height - Height to wait for
|
|
85
|
-
* @param options - Options
|
|
86
|
-
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
87
|
-
* @param options.attempts - Number of polling attempts after which to fail
|
|
88
|
-
* @param options.onNode - Node to use
|
|
89
|
-
* @returns Current chain height
|
|
90
|
-
*/
|
|
91
|
-
export declare function awaitHeight(height: number, { interval, attempts, onNode, ...options }: {
|
|
92
|
-
interval?: number;
|
|
93
|
-
attempts?: number;
|
|
94
|
-
onNode: Node;
|
|
95
|
-
} & Parameters<typeof _getPollInterval>[1]): Promise<number>;
|
|
96
|
-
/**
|
|
97
|
-
* Wait for a transaction to be mined
|
|
98
|
-
* @param th - The hash of transaction to poll
|
|
99
|
-
* @param options - Options
|
|
100
|
-
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
101
|
-
* @param options.blocks - Number of blocks mined after which to fail
|
|
102
|
-
* @param options.onNode - Node to use
|
|
103
|
-
* @returns The transaction as it was mined
|
|
104
|
-
*/
|
|
105
|
-
export declare function poll(th: EncodedData<'th'>, { blocks, interval, onNode, ...options }: {
|
|
106
|
-
blocks?: number;
|
|
107
|
-
interval?: number;
|
|
108
|
-
onNode: Node;
|
|
109
|
-
} & Parameters<typeof _getPollInterval>[1]): Promise<TransformNodeType<SignedTx>>;
|
|
110
128
|
/**
|
|
111
129
|
* Obtain current generation
|
|
130
|
+
* @category chain
|
|
112
131
|
* @param options - Options
|
|
113
132
|
* @param options.onNode - Node to use
|
|
114
133
|
* @returns Current Generation
|
|
@@ -118,46 +137,51 @@ export declare function getCurrentGeneration({ onNode }: {
|
|
|
118
137
|
}): Promise<TransformNodeType<Generation>>;
|
|
119
138
|
/**
|
|
120
139
|
* Get generation by hash or height
|
|
140
|
+
* @category chain
|
|
121
141
|
* @param hashOrHeight - Generation hash or height
|
|
122
142
|
* @param options - Options
|
|
123
143
|
* @param options.onNode - Node to use
|
|
124
144
|
* @returns Generation
|
|
125
145
|
*/
|
|
126
|
-
export declare function getGeneration(hashOrHeight:
|
|
146
|
+
export declare function getGeneration(hashOrHeight: Encoded.KeyBlockHash | number, { onNode }: {
|
|
127
147
|
onNode: Node;
|
|
128
148
|
}): Promise<TransformNodeType<Generation>>;
|
|
129
149
|
/**
|
|
130
150
|
* Get micro block transactions
|
|
151
|
+
* @category chain
|
|
131
152
|
* @param hash - Micro block hash
|
|
132
153
|
* @param options - Options
|
|
133
154
|
* @param options.onNode - Node to use
|
|
134
155
|
* @returns Transactions
|
|
135
156
|
*/
|
|
136
|
-
export declare function getMicroBlockTransactions(hash:
|
|
157
|
+
export declare function getMicroBlockTransactions(hash: Encoded.MicroBlockHash, { onNode }: {
|
|
137
158
|
onNode: Node;
|
|
138
159
|
}): Promise<TransformNodeType<SignedTx[]>>;
|
|
139
160
|
/**
|
|
140
161
|
* Get key block
|
|
162
|
+
* @category chain
|
|
141
163
|
* @param hashOrHeight - Key block hash or height
|
|
142
164
|
* @param options - Options
|
|
143
165
|
* @param options.onNode - Node to use
|
|
144
166
|
* @returns Key Block
|
|
145
167
|
*/
|
|
146
|
-
export declare function getKeyBlock(hashOrHeight:
|
|
168
|
+
export declare function getKeyBlock(hashOrHeight: Encoded.KeyBlockHash | number, { onNode }: {
|
|
147
169
|
onNode: Node;
|
|
148
170
|
}): Promise<TransformNodeType<KeyBlock>>;
|
|
149
171
|
/**
|
|
150
172
|
* Get micro block header
|
|
173
|
+
* @category chain
|
|
151
174
|
* @param hash - Micro block hash
|
|
152
175
|
* @param options - Options
|
|
153
176
|
* @param options.onNode - Node to use
|
|
154
177
|
* @returns Micro block header
|
|
155
178
|
*/
|
|
156
|
-
export declare function getMicroBlockHeader(hash:
|
|
179
|
+
export declare function getMicroBlockHeader(hash: Encoded.MicroBlockHash, { onNode }: {
|
|
157
180
|
onNode: Node;
|
|
158
181
|
}): Promise<TransformNodeType<MicroBlockHeader>>;
|
|
159
182
|
/**
|
|
160
183
|
* Transaction dry-run
|
|
184
|
+
* @category chain
|
|
161
185
|
* @param tx - transaction to execute
|
|
162
186
|
* @param accountAddress - address that will be used to execute transaction
|
|
163
187
|
* @param options - Options
|
|
@@ -166,7 +190,7 @@ export declare function getMicroBlockHeader(hash: EncodedData<'mh'>, { onNode }:
|
|
|
166
190
|
* @param options.combine - Enables combining of similar requests to a single dry-run call
|
|
167
191
|
* @param options.onNode - Node to use
|
|
168
192
|
*/
|
|
169
|
-
export declare function txDryRun(tx:
|
|
193
|
+
export declare function txDryRun(tx: Encoded.Transaction, accountAddress: Encoded.AccountAddress, { top, txEvents, combine, onNode, }: {
|
|
170
194
|
top?: number;
|
|
171
195
|
txEvents?: boolean;
|
|
172
196
|
combine?: boolean;
|
|
@@ -176,24 +200,27 @@ export declare function txDryRun(tx: EncodedData<'tx'>, accountAddress: EncodedD
|
|
|
176
200
|
} & TransformNodeType<DryRunResult>>;
|
|
177
201
|
/**
|
|
178
202
|
* Get contract byte code
|
|
203
|
+
* @category contract
|
|
179
204
|
* @param contractId - Contract address
|
|
180
205
|
* @param options - Options
|
|
181
206
|
* @param options.onNode - Node to use
|
|
182
207
|
*/
|
|
183
|
-
export declare function getContractByteCode(contractId:
|
|
208
|
+
export declare function getContractByteCode(contractId: Encoded.ContractAddress, { onNode }: {
|
|
184
209
|
onNode: Node;
|
|
185
210
|
}): Promise<TransformNodeType<ByteCode>>;
|
|
186
211
|
/**
|
|
187
212
|
* Get contract entry
|
|
213
|
+
* @category contract
|
|
188
214
|
* @param contractId - Contract address
|
|
189
215
|
* @param options - Options
|
|
190
216
|
* @param options.onNode - Node to use
|
|
191
217
|
*/
|
|
192
|
-
export declare function getContract(contractId:
|
|
218
|
+
export declare function getContract(contractId: Encoded.ContractAddress, { onNode }: {
|
|
193
219
|
onNode: Node;
|
|
194
220
|
}): Promise<TransformNodeType<ContractObject>>;
|
|
195
221
|
/**
|
|
196
222
|
* Get name entry
|
|
223
|
+
* @category AENS
|
|
197
224
|
* @param name - AENS name
|
|
198
225
|
* @param options - Options
|
|
199
226
|
* @param options.onNode - Node to use
|
|
@@ -203,6 +230,7 @@ export declare function getName(name: AensName, { onNode }: {
|
|
|
203
230
|
}): Promise<TransformNodeType<NameEntry>>;
|
|
204
231
|
/**
|
|
205
232
|
* Resolve AENS name and return name hash
|
|
233
|
+
* @category AENS
|
|
206
234
|
* @param nameOrId - AENS name or address
|
|
207
235
|
* @param key - in AENS pointers record
|
|
208
236
|
* @param options - Options
|
|
@@ -212,9 +240,9 @@ export declare function getName(name: AensName, { onNode }: {
|
|
|
212
240
|
* @param options.onNode - Node to use
|
|
213
241
|
* @returns Address or AENS name hash
|
|
214
242
|
*/
|
|
215
|
-
export declare function resolveName<Type extends
|
|
243
|
+
export declare function resolveName<Type extends Encoding.AccountAddress | Encoding.ContractAddress>(nameOrId: AensName | Encoded.Generic<Type>, key: string, { verify, resolveByNode, onNode }: {
|
|
216
244
|
verify?: boolean;
|
|
217
245
|
resolveByNode?: boolean;
|
|
218
246
|
onNode: Node;
|
|
219
|
-
}): Promise<
|
|
247
|
+
}): Promise<Encoded.Generic<Type | Encoding.Name>>;
|
|
220
248
|
export {};
|