@amadeus-protocol/sdk 1.0.8 → 1.1.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 +215 -30
- package/dist/api/chain.d.ts +144 -117
- package/dist/api/chain.d.ts.map +1 -1
- package/dist/api/chain.js +175 -146
- package/dist/api/chain.js.map +1 -1
- package/dist/api/contract.d.ts +78 -60
- package/dist/api/contract.d.ts.map +1 -1
- package/dist/api/contract.js +102 -75
- package/dist/api/contract.js.map +1 -1
- package/dist/api/epoch.d.ts +65 -66
- package/dist/api/epoch.d.ts.map +1 -1
- package/dist/api/epoch.js +90 -98
- package/dist/api/epoch.js.map +1 -1
- package/dist/api/peer.d.ts +77 -78
- package/dist/api/peer.d.ts.map +1 -1
- package/dist/api/peer.js +93 -94
- package/dist/api/peer.js.map +1 -1
- package/dist/api/proof.d.ts +44 -23
- package/dist/api/proof.d.ts.map +1 -1
- package/dist/api/proof.js +56 -29
- package/dist/api/proof.js.map +1 -1
- package/dist/api/transaction.d.ts +68 -69
- package/dist/api/transaction.d.ts.map +1 -1
- package/dist/api/transaction.js +84 -84
- package/dist/api/transaction.js.map +1 -1
- package/dist/api/wallet.d.ts +36 -37
- package/dist/api/wallet.d.ts.map +1 -1
- package/dist/api/wallet.js +47 -50
- package/dist/api/wallet.js.map +1 -1
- package/dist/client.d.ts +66 -68
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +231 -276
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +13 -10
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +49 -45
- package/dist/constants.js.map +1 -1
- package/dist/contract-state.d.ts +6 -3
- package/dist/contract-state.d.ts.map +1 -1
- package/dist/contract-state.js +88 -106
- package/dist/contract-state.js.map +1 -1
- package/dist/contracts/abi-types.d.ts +32 -32
- package/dist/contracts/abi-types.d.ts.map +1 -1
- package/dist/contracts/coin.d.ts +13 -20
- package/dist/contracts/coin.d.ts.map +1 -1
- package/dist/contracts/coin.js +42 -38
- package/dist/contracts/coin.js.map +1 -1
- package/dist/contracts/contract-call.d.ts +14 -16
- package/dist/contracts/contract-call.d.ts.map +1 -1
- package/dist/contracts/contract-call.js +45 -54
- package/dist/contracts/contract-call.js.map +1 -1
- package/dist/contracts/contract.d.ts +24 -55
- package/dist/contracts/contract.d.ts.map +1 -1
- package/dist/contracts/contract.js +63 -101
- package/dist/contracts/contract.js.map +1 -1
- package/dist/contracts/lockup/abi.d.ts +54 -51
- package/dist/contracts/lockup/abi.d.ts.map +1 -1
- package/dist/contracts/lockup/abi.js +65 -74
- package/dist/contracts/lockup/abi.js.map +1 -1
- package/dist/contracts/lockup/helpers.d.ts +22 -18
- package/dist/contracts/lockup/helpers.d.ts.map +1 -1
- package/dist/contracts/lockup/helpers.js +44 -47
- package/dist/contracts/lockup/helpers.js.map +1 -1
- package/dist/contracts/lockup/parsers.d.ts +7 -3
- package/dist/contracts/lockup/parsers.d.ts.map +1 -1
- package/dist/contracts/lockup/parsers.js +51 -55
- package/dist/contracts/lockup/parsers.js.map +1 -1
- package/dist/contracts/lockup/storage-keys.d.ts +5 -2
- package/dist/contracts/lockup/storage-keys.d.ts.map +1 -1
- package/dist/contracts/lockup/storage-keys.js +54 -70
- package/dist/contracts/lockup/storage-keys.js.map +1 -1
- package/dist/contracts/lockup/types.d.ts +73 -70
- package/dist/contracts/lockup/types.d.ts.map +1 -1
- package/dist/contracts/lockup-prime/abi.d.ts +328 -325
- package/dist/contracts/lockup-prime/abi.d.ts.map +1 -1
- package/dist/contracts/lockup-prime/abi.js +397 -417
- package/dist/contracts/lockup-prime/abi.js.map +1 -1
- package/dist/contracts/lockup-prime/helpers.d.ts +35 -31
- package/dist/contracts/lockup-prime/helpers.d.ts.map +1 -1
- package/dist/contracts/lockup-prime/helpers.js +131 -137
- package/dist/contracts/lockup-prime/helpers.js.map +1 -1
- package/dist/contracts/lockup-prime/parsers.d.ts +9 -5
- package/dist/contracts/lockup-prime/parsers.d.ts.map +1 -1
- package/dist/contracts/lockup-prime/parsers.js +61 -61
- package/dist/contracts/lockup-prime/parsers.js.map +1 -1
- package/dist/contracts/lockup-prime/storage-keys.d.ts +7 -4
- package/dist/contracts/lockup-prime/storage-keys.d.ts.map +1 -1
- package/dist/contracts/lockup-prime/storage-keys.js +64 -80
- package/dist/contracts/lockup-prime/storage-keys.js.map +1 -1
- package/dist/contracts/lockup-prime/types.d.ts +92 -89
- package/dist/contracts/lockup-prime/types.d.ts.map +1 -1
- package/dist/contracts/lockup-prime/types.js +12 -13
- package/dist/contracts/lockup-prime/types.js.map +1 -1
- package/dist/contracts/nft/abi.d.ts +104 -0
- package/dist/contracts/nft/abi.d.ts.map +1 -0
- package/dist/contracts/nft/abi.js +135 -0
- package/dist/contracts/nft/abi.js.map +1 -0
- package/dist/contracts/nft/helpers.d.ts +21 -0
- package/dist/contracts/nft/helpers.d.ts.map +1 -0
- package/dist/contracts/nft/helpers.js +61 -0
- package/dist/contracts/nft/helpers.js.map +1 -0
- package/dist/contracts/nft/types.d.ts +47 -0
- package/dist/contracts/nft/types.d.ts.map +1 -0
- package/dist/conversion.d.ts +5 -2
- package/dist/conversion.d.ts.map +1 -1
- package/dist/conversion.js +45 -50
- package/dist/conversion.js.map +1 -1
- package/dist/crypto.d.ts +14 -16
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +121 -140
- package/dist/crypto.js.map +1 -1
- package/dist/encoding.d.ts +11 -8
- package/dist/encoding.d.ts.map +1 -1
- package/dist/encoding.js +123 -144
- package/dist/encoding.js.map +1 -1
- package/dist/encryption.d.ts +15 -12
- package/dist/encryption.d.ts.map +1 -1
- package/dist/encryption.js +119 -117
- package/dist/encryption.js.map +1 -1
- package/dist/explorer.d.ts +10 -7
- package/dist/explorer.d.ts.map +1 -1
- package/dist/explorer.js +51 -48
- package/dist/explorer.js.map +1 -1
- package/dist/formatters.d.ts +8 -5
- package/dist/formatters.d.ts.map +1 -1
- package/dist/formatters.js +67 -68
- package/dist/formatters.js.map +1 -1
- package/dist/index.d.ts +42 -55
- package/dist/index.js +39 -55
- package/dist/mnemonic.d.ts +12 -9
- package/dist/mnemonic.d.ts.map +1 -1
- package/dist/mnemonic.js +105 -114
- package/dist/mnemonic.js.map +1 -1
- package/dist/networks.d.ts +14 -17
- package/dist/networks.d.ts.map +1 -1
- package/dist/networks.js +40 -36
- package/dist/networks.js.map +1 -1
- package/dist/schemas.js +75 -79
- package/dist/schemas.js.map +1 -1
- package/dist/sdk.d.ts +69 -65
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +126 -117
- package/dist/sdk.js.map +1 -1
- package/dist/serialization.d.ts +8 -18
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +207 -260
- package/dist/serialization.js.map +1 -1
- package/dist/signing.js +67 -67
- package/dist/signing.js.map +1 -1
- package/dist/transaction-builder.d.ts +175 -184
- package/dist/transaction-builder.d.ts.map +1 -1
- package/dist/transaction-builder.js +295 -344
- package/dist/transaction-builder.js.map +1 -1
- package/dist/transaction-errors.d.ts +10 -12
- package/dist/transaction-errors.d.ts.map +1 -1
- package/dist/transaction-errors.js +145 -166
- package/dist/transaction-errors.js.map +1 -1
- package/dist/types.d.ts +530 -450
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +169 -183
- package/dist/types.js.map +1 -1
- package/dist/validation.d.ts +24 -26
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +194 -192
- package/dist/validation.js.map +1 -1
- package/package.json +4 -3
- package/dist/api/index.d.ts +0 -8
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -8
- package/dist/api/index.js.map +0 -1
- package/dist/contracts/abi-types.js +0 -8
- package/dist/contracts/abi-types.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -7
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js +0 -7
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/lockup/calls.d.ts +0 -23
- package/dist/contracts/lockup/calls.d.ts.map +0 -1
- package/dist/contracts/lockup/calls.js +0 -25
- package/dist/contracts/lockup/calls.js.map +0 -1
- package/dist/contracts/lockup/index.d.ts +0 -6
- package/dist/contracts/lockup/index.d.ts.map +0 -1
- package/dist/contracts/lockup/index.js +0 -6
- package/dist/contracts/lockup/index.js.map +0 -1
- package/dist/contracts/lockup/types.js +0 -7
- package/dist/contracts/lockup/types.js.map +0 -1
- package/dist/contracts/lockup-prime/calls.d.ts +0 -53
- package/dist/contracts/lockup-prime/calls.d.ts.map +0 -1
- package/dist/contracts/lockup-prime/calls.js +0 -60
- package/dist/contracts/lockup-prime/calls.js.map +0 -1
- package/dist/contracts/lockup-prime/index.d.ts +0 -6
- package/dist/contracts/lockup-prime/index.d.ts.map +0 -1
- package/dist/contracts/lockup-prime/index.js +0 -6
- package/dist/contracts/lockup-prime/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/schemas.d.ts +0 -67
- package/dist/schemas.d.ts.map +0 -1
- package/dist/signing.d.ts +0 -39
- package/dist/signing.d.ts.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Type Definitions
|
|
3
4
|
*
|
|
@@ -6,676 +7,755 @@
|
|
|
6
7
|
/**
|
|
7
8
|
* Serializable value types for canonical encoding (VecPack)
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
type SerializableValue = null | boolean | number | bigint | string | Uint8Array | SerializableValue[] | Map<SerializableValue, SerializableValue> | {
|
|
11
|
+
[key: string]: SerializableValue;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Decoded value types (Map is returned for objects during decode)
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
type DecodedValue = null | boolean | bigint | Uint8Array | DecodedValue[] | Map<DecodedValue, DecodedValue>;
|
|
16
17
|
/**
|
|
17
18
|
* Key pair structure containing public and private keys as Base58 strings
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
interface KeyPair {
|
|
21
|
+
/** Base58 encoded public key */
|
|
22
|
+
publicKey: string;
|
|
23
|
+
/** Base58 encoded private key (seed) */
|
|
24
|
+
privateKey: string;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* SDK configuration
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
interface AmadeusSDKConfig {
|
|
30
|
+
/** Base URL of the Amadeus node API (defaults to NODE_API_URL) */
|
|
31
|
+
baseUrl?: string;
|
|
32
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
33
|
+
timeout?: number;
|
|
34
|
+
/** Custom headers to include in requests */
|
|
35
|
+
headers?: Record<string, string>;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* API response wrapper
|
|
38
39
|
* Note: Index signature needed for dynamic response properties
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
interface ApiResponse {
|
|
42
|
+
error: 'ok' | 'not_found' | string;
|
|
43
|
+
[key: string]: unknown;
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* SDK error class
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
declare class AmadeusSDKError extends Error {
|
|
49
|
+
status?: number | undefined;
|
|
50
|
+
response?: Record<string, unknown> | undefined;
|
|
51
|
+
constructor(message: string, status?: number | undefined, response?: Record<string, unknown> | undefined);
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Transaction validation error codes
|
|
54
55
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
declare enum TransactionValidationError {
|
|
57
|
+
OK = "ok",
|
|
58
|
+
TOO_LARGE = "too_large",
|
|
59
|
+
TX_NOT_CANONICAL = "tx_not_canonical",
|
|
60
|
+
INVALID_HASH = "invalid_hash",
|
|
61
|
+
INVALID_SIGNATURE = "invalid_signature",
|
|
62
|
+
NONCE_NOT_INTEGER = "nonce_not_integer",
|
|
63
|
+
NONCE_TOO_HIGH = "nonce_too_high",
|
|
64
|
+
ACTIONS_MUST_BE_LIST = "actions_must_be_list",
|
|
65
|
+
ACTIONS_LENGTH_MUST_BE_1 = "actions_length_must_be_1",
|
|
66
|
+
OP_MUST_BE_CALL = "op_must_be_call",
|
|
67
|
+
CONTRACT_MUST_BE_BINARY = "contract_must_be_binary",
|
|
68
|
+
FUNCTION_MUST_BE_BINARY = "function_must_be_binary",
|
|
69
|
+
ARGS_MUST_BE_LIST = "args_must_be_list",
|
|
70
|
+
ARG_MUST_BE_BINARY = "arg_must_be_binary",
|
|
71
|
+
INVALID_MODULE = "invalid_module",
|
|
72
|
+
INVALID_FUNCTION = "invalid_function",
|
|
73
|
+
INVALID_MODULE_FOR_SPECIAL_MEETING = "invalid_module_for_special_meeting",
|
|
74
|
+
INVALID_FUNCTION_FOR_SPECIAL_MEETING = "invalid_function_for_special_meeting",
|
|
75
|
+
UNKNOWN = "unknown"
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
78
|
* Transaction execution error codes.
|
|
78
79
|
* These are returned when contract execution fails.
|
|
79
80
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
81
|
+
declare enum TransactionExecutionError {
|
|
82
|
+
/** Success - execution completed successfully */
|
|
83
|
+
OK = "ok",
|
|
84
|
+
/** Unknown error (when panic payload cannot be converted to string) */
|
|
85
|
+
UNKNOWN = "unknown",
|
|
86
|
+
/** Contract execution was aborted */
|
|
87
|
+
AS_ABORT = "as_abort",
|
|
88
|
+
EXEC_INVALID_AMOUNT_NEGATIVE = "exec_invalid_amount_negative",
|
|
89
|
+
EXEC_INSUFFICIENT_EXEC_BUDGET = "exec_insufficient_exec_budget",
|
|
90
|
+
EXEC_CRITICAL_UNDERFLOW = "exec_critical_underflow",
|
|
91
|
+
EXEC_STORAGE_INVALID_AMOUNT_NEGATIVE = "exec_storage_invalid_amount_negative",
|
|
92
|
+
EXEC_INSUFFICIENT_STORAGE_BUDGET = "exec_insufficient_storage_budget",
|
|
93
|
+
EXEC_STORAGE_CRITICAL_UNDERFLOW = "exec_storage_critical_underflow",
|
|
94
|
+
EXEC_TOO_LARGE_KEY_SIZE = "exec_too_large_key_size",
|
|
95
|
+
EXEC_TOO_LARGE_VALUE_SIZE = "exec_too_large_value_size",
|
|
96
|
+
EXEC_KV_PUT_FAILED = "exec_kv_put_failed",
|
|
97
|
+
EXEC_KV_INCREMENT_FAILED = "exec_kv_increment_failed",
|
|
98
|
+
EXEC_KV_INCREMENT_INVALID_INTEGER = "exec_kv_increment_invalid_integer",
|
|
99
|
+
EXEC_KV_INCREMENT_INTEGER_OVERFLOW = "exec_kv_increment_integer_overflow",
|
|
100
|
+
KV_PUT_FAILED = "kv_put_failed",
|
|
101
|
+
EXEC_KV_DELETE_FAILED = "exec_kv_delete_failed",
|
|
102
|
+
EXEC_KV_SET_BIT_FAILED = "exec_kv_set_bit_failed",
|
|
103
|
+
EXEC_CANNOT_WRITE_DURING_VIEW = "exec_cannot_write_during_view",
|
|
104
|
+
EXEC_RETURN_VALUE_TOO_LARGE = "exec_return_value_too_large",
|
|
105
|
+
EXEC_INSTANCE_NOT_INJECTED = "exec_instance_not_injected",
|
|
106
|
+
EXEC_PTR_TERM_TOO_SHORT = "exec_ptr_term_too_short",
|
|
107
|
+
EXEC_PTR_TERM_TOO_LONG = "exec_ptr_term_too_long",
|
|
108
|
+
EXEC_LOG_INVALID_PTR = "exec_log_invalid_ptr",
|
|
109
|
+
EXEC_CALL_TABLE_INVALID_PTR = "exec_call_table_invalid_ptr",
|
|
110
|
+
EXEC_CALL_TOO_MANY_ARGS = "exec_call_too_many_args",
|
|
111
|
+
EXEC_READ_CALL_TABLE_ERROR = "exec_read_call_table_error",
|
|
112
|
+
EXEC_CALL_PTR_TERM_TOO_LONG = "exec_call_ptr_term_too_long",
|
|
113
|
+
EXEC_READ_CALL_TABLE_DATA_ERROR = "exec_read_call_table_data_error",
|
|
114
|
+
EXEC_CALL_EXTRA_INVALID = "exec_call_extra_invalid",
|
|
115
|
+
EXEC_CALL_EXTRA_TOO_MANY = "exec_call_extra_too_many",
|
|
116
|
+
EXEC_READ_EXTRA_ROW = "exec_read_extra_row",
|
|
117
|
+
EXEC_READ_EXTRA_DATA = "exec_read_extra_data",
|
|
118
|
+
EXEC_CALL_MISSING_ARGS = "exec_call_missing_args",
|
|
119
|
+
EXEC_MEMWRITE = "exec_memwrite",
|
|
120
|
+
EXEC_LOG_MSG_SIZE_EXCEEDED = "exec_log_msg_size_exceeded",
|
|
121
|
+
EXEC_LOGS_TOTAL_SIZE_EXCEEDED = "exec_logs_total_size_exceeded",
|
|
122
|
+
EXEC_LOGS_TOTAL_ELEMENTS_EXCEEDED = "exec_logs_total_elements_exceeded",
|
|
123
|
+
EXEC_INVALID_MODULE = "exec_invalid_module",
|
|
124
|
+
EXEC_MEMORY_ALLOC = "exec_memory_alloc",
|
|
125
|
+
EXEC_ARG_LEN_WRITE = "exec_arg_len_write",
|
|
126
|
+
EXEC_ARG_WRITE = "exec_arg_write",
|
|
127
|
+
EXEC_INSTANCE = "exec_instance",
|
|
128
|
+
EXEC_INIT_MEMWRITE = "exec_init_memwrite",
|
|
129
|
+
EXEC_DESERIALIZE_ERR = "exec_deserialize_err",
|
|
130
|
+
EXEC_SERIALIZE_ERR = "exec_serialize_err",
|
|
131
|
+
EXEC_FUNCTION_NOT_FOUND = "exec_function_not_found",
|
|
132
|
+
EXEC_ERROR = "exec_error",
|
|
133
|
+
INVALID_EPOCH = "invalid_epoch",
|
|
134
|
+
INVALID_BIC_ACTION = "invalid_bic_action",
|
|
135
|
+
INVALID_FUNCTION = "invalid_function",
|
|
136
|
+
ACCOUNT_HAS_NO_BYTECODE = "account_has_no_bytecode",
|
|
137
|
+
INVALID_ATTACHED_AMOUNT = "invalid_attached_amount",
|
|
138
|
+
ATTACHED_AMOUNT_INSUFFICIENT_FUNDS = "attached_amount_insufficient_funds",
|
|
139
|
+
WASM_NOOP = "wasm_noop",
|
|
140
|
+
INVALID_BYTECODE = "invalid_bytecode",
|
|
141
|
+
INVALID_ARGS = "invalid_args",
|
|
142
|
+
INVALID_AMOUNT = "invalid_amount",
|
|
143
|
+
INVALID_RECEIVER_PK = "invalid_receiver_pk",
|
|
144
|
+
INSUFFICIENT_FUNDS = "insufficient_funds",
|
|
145
|
+
PAUSED = "paused",
|
|
146
|
+
SOULBOUND = "soulbound",
|
|
147
|
+
INVALID_BALANCE = "invalid_balance",
|
|
148
|
+
INVALID_TOTAL_SUPPLY = "invalid_total_supply",
|
|
149
|
+
INVALID_SYMBOL = "invalid_symbol",
|
|
150
|
+
SYMBOL_TOO_SHORT = "symbol_too_short",
|
|
151
|
+
SYMBOL_TOO_LONG = "symbol_too_long",
|
|
152
|
+
SYMBOL_RESERVED = "symbol_reserved",
|
|
153
|
+
SYMBOL_EXISTS = "symbol_exists",
|
|
154
|
+
INVALID_DECIMALS = "invalid_decimals",
|
|
155
|
+
NO_PERMISSIONS = "no_permissions",
|
|
156
|
+
SYMBOL_DOESNT_EXIST = "symbol_doesnt_exist",
|
|
157
|
+
NOT_MINTABLE = "not_mintable",
|
|
158
|
+
INVALID_DIRECTION = "invalid_direction",
|
|
159
|
+
NOT_PAUSABLE = "not_pausable",
|
|
160
|
+
INVALID_DURATION = "invalid_duration",
|
|
161
|
+
INVALID_VAULT = "invalid_vault",
|
|
162
|
+
INVALID_UNLOCK_HEIGHT = "invalid_unlock_height",
|
|
163
|
+
INVALID_UNLOCK_AMOUNT = "invalid_unlock_amount",
|
|
164
|
+
VAULT_IS_LOCKED = "vault_is_locked",
|
|
165
|
+
INVALID_TIER = "invalid_tier",
|
|
166
|
+
INVALID_MULTIPLIER = "invalid_multiplier",
|
|
167
|
+
INVALID_UNLOCK_EPOCH = "invalid_unlock_epoch",
|
|
168
|
+
INVALID_NEXT_CHECKIN_EPOCH = "invalid_next_checkin_epoch",
|
|
169
|
+
INSUFFICIENT_TOKENS = "insufficient_tokens",
|
|
170
|
+
INVALID_COLLECTION = "invalid_collection",
|
|
171
|
+
COLLECTION_TOO_SHORT = "collection_too_short",
|
|
172
|
+
COLLECTION_TOO_LONG = "collection_too_long",
|
|
173
|
+
COLLECTION_RESERVED = "collection_reserved",
|
|
174
|
+
COLLECTION_EXISTS = "collection_exists",
|
|
175
|
+
COLLECTION_DOESNT_EXIST = "collection_doesnt_exist",
|
|
176
|
+
INVALID_INTEGER = "invalid_integer"
|
|
176
177
|
}
|
|
177
178
|
/**
|
|
178
179
|
* Transaction event type
|
|
179
180
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
declare enum TransactionEventType {
|
|
182
|
+
SENT = "sent",
|
|
183
|
+
RECEIVED = "recv"
|
|
183
184
|
}
|
|
184
185
|
/**
|
|
185
186
|
* Contract names
|
|
186
187
|
*/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
declare enum Contract {
|
|
189
|
+
EPOCH = "Epoch",
|
|
190
|
+
COIN = "Coin",
|
|
191
|
+
CONTRACT = "Contract"
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
193
194
|
* Contract function names
|
|
194
195
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
declare enum ContractFunction {
|
|
197
|
+
TRANSFER = "transfer",
|
|
198
|
+
SUBMIT_SOL = "submit_sol",
|
|
199
|
+
SET_EMISSION_ADDRESS = "set_emission_address",
|
|
200
|
+
SLASH_TRAINER = "slash_trainer",
|
|
201
|
+
DEPLOY = "deploy",
|
|
202
|
+
CREATE_AND_MINT = "create_and_mint",
|
|
203
|
+
MINT = "mint",
|
|
204
|
+
PAUSE = "pause"
|
|
204
205
|
}
|
|
205
206
|
/**
|
|
206
207
|
* Transaction action structure (for building transactions)
|
|
207
208
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
interface TransactionAction extends Record<string, SerializableValue> {
|
|
210
|
+
op: 'call';
|
|
211
|
+
contract: string;
|
|
212
|
+
function: string;
|
|
213
|
+
args: SerializableValue[];
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
216
|
* Transaction action structure (as returned by API)
|
|
216
217
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
interface TransactionActionResponse {
|
|
219
|
+
op: 'call';
|
|
220
|
+
contract: string;
|
|
221
|
+
function: string | ContractFunction;
|
|
222
|
+
args: (string | number | boolean)[];
|
|
223
|
+
attached_symbol?: string;
|
|
224
|
+
attached_amount?: string;
|
|
224
225
|
}
|
|
225
226
|
/**
|
|
226
227
|
* Transaction action structure (legacy/alternative format)
|
|
227
228
|
*/
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
interface TransactionActionBody {
|
|
230
|
+
op: 'call';
|
|
231
|
+
contract: string;
|
|
232
|
+
function: ContractFunction;
|
|
233
|
+
args: (string | Uint8Array)[];
|
|
233
234
|
}
|
|
234
235
|
/**
|
|
235
236
|
* Transaction body structure
|
|
236
237
|
*/
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
interface TransactionBody {
|
|
239
|
+
signer: Uint8Array | string;
|
|
240
|
+
nonce: number;
|
|
241
|
+
action: TransactionActionBody;
|
|
241
242
|
}
|
|
242
243
|
/**
|
|
243
244
|
* Unsigned transaction structure
|
|
244
245
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
interface UnsignedTransaction extends Record<string, SerializableValue> {
|
|
247
|
+
signer: Uint8Array;
|
|
248
|
+
nonce: bigint;
|
|
249
|
+
action: TransactionAction;
|
|
249
250
|
}
|
|
250
251
|
/**
|
|
251
252
|
* Unsigned transaction with its hash
|
|
252
253
|
*/
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
interface UnsignedTransactionWithHash {
|
|
255
|
+
/** Unsigned transaction structure */
|
|
256
|
+
tx: UnsignedTransaction;
|
|
257
|
+
/** Transaction hash as Uint8Array */
|
|
258
|
+
hash: Uint8Array;
|
|
258
259
|
}
|
|
259
260
|
/**
|
|
260
261
|
* Packed transaction type
|
|
261
262
|
*/
|
|
262
|
-
|
|
263
|
+
type TransactionPacked = Uint8Array;
|
|
263
264
|
/**
|
|
264
265
|
* Unpacked transaction structure
|
|
265
266
|
*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
267
|
+
interface TransactionUnpacked {
|
|
268
|
+
tx: TransactionBody;
|
|
269
|
+
tx_encoded: Uint8Array;
|
|
270
|
+
hash: Uint8Array;
|
|
271
|
+
signature: Uint8Array;
|
|
272
|
+
metadata?: {
|
|
273
|
+
entry_hash: Uint8Array | string;
|
|
274
|
+
entry_height: number;
|
|
275
|
+
tx_event?: TransactionEventType;
|
|
276
|
+
};
|
|
276
277
|
}
|
|
277
278
|
/**
|
|
278
279
|
* Transaction validation result
|
|
279
280
|
*/
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
type TransactionValidationResult = {
|
|
282
|
+
error: 'ok';
|
|
283
|
+
txu: TransactionUnpacked;
|
|
283
284
|
} | {
|
|
284
|
-
|
|
285
|
+
error: TransactionValidationError;
|
|
285
286
|
};
|
|
286
287
|
/**
|
|
287
288
|
* Result of building a transaction
|
|
288
289
|
*/
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
290
|
+
interface BuildTransactionResult {
|
|
291
|
+
/** Transaction hash as Base58 string */
|
|
292
|
+
txHash: string;
|
|
293
|
+
/** Packed transaction ready for submission */
|
|
294
|
+
txPacked: Uint8Array;
|
|
294
295
|
}
|
|
295
296
|
/**
|
|
296
297
|
* Input parameters for building a transfer transaction
|
|
297
298
|
*/
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
299
|
+
interface TransferTransactionInput {
|
|
300
|
+
/** Base58 encoded sender private key (seed) */
|
|
301
|
+
senderPrivkey: string;
|
|
302
|
+
/** Base58 encoded recipient address */
|
|
303
|
+
recipient: string;
|
|
304
|
+
/** Amount in human-readable format */
|
|
305
|
+
amount: number;
|
|
306
|
+
/** Token symbol (e.g., 'AMA') */
|
|
307
|
+
symbol: string;
|
|
307
308
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
interface LockupPrimeLockInput {
|
|
310
|
+
senderPrivkey: string;
|
|
311
|
+
amount: number | string;
|
|
312
|
+
tier: string;
|
|
312
313
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
interface LockupPrimeUnlockInput {
|
|
315
|
+
senderPrivkey: string;
|
|
316
|
+
vaultIndex: number;
|
|
316
317
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
interface LockupPrimeDailyCheckinInput {
|
|
319
|
+
senderPrivkey: string;
|
|
320
|
+
vaultIndex: number;
|
|
320
321
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
interface LockupUnlockInput {
|
|
323
|
+
senderPrivkey: string;
|
|
324
|
+
vaultIndex: number;
|
|
324
325
|
}
|
|
325
326
|
/**
|
|
326
327
|
* Transaction metadata
|
|
327
328
|
*/
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
329
|
+
interface TransactionMetadata {
|
|
330
|
+
entry_hash: string;
|
|
331
|
+
entry_height: number;
|
|
332
|
+
tx_event?: TransactionEventType;
|
|
332
333
|
}
|
|
333
334
|
/**
|
|
334
335
|
* Transaction receipt structure
|
|
335
336
|
*/
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
337
|
+
interface TransactionReceipt {
|
|
338
|
+
/** Execution result */
|
|
339
|
+
result: TransactionExecutionError | string;
|
|
340
|
+
/** Execution logs (array of ASCII dump strings) */
|
|
341
|
+
logs: string[];
|
|
342
|
+
/** Success flag */
|
|
343
|
+
success: boolean;
|
|
344
|
+
/** Execution cost used */
|
|
345
|
+
exec_used: string;
|
|
345
346
|
}
|
|
346
347
|
/**
|
|
347
348
|
* Transaction result
|
|
348
349
|
*/
|
|
349
|
-
|
|
350
|
-
|
|
350
|
+
interface TransactionResult {
|
|
351
|
+
error: TransactionValidationError | string;
|
|
351
352
|
}
|
|
352
353
|
/**
|
|
353
354
|
* Transaction data returned from the API
|
|
354
355
|
*/
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
result: TransactionResult;
|
|
373
|
-
/** Transaction receipt (execution result and logs) */
|
|
374
|
-
receipt: TransactionReceipt;
|
|
356
|
+
interface Transaction {
|
|
357
|
+
/** Transaction hash (Base58 encoded) */
|
|
358
|
+
hash: string;
|
|
359
|
+
/** Transaction signature (Base58 encoded) */
|
|
360
|
+
signature: string;
|
|
361
|
+
/** Transaction data */
|
|
362
|
+
tx: {
|
|
363
|
+
/** Signer's public key (Base58 encoded) */signer: string; /** Transaction nonce */
|
|
364
|
+
nonce: number; /** Transaction action */
|
|
365
|
+
action: TransactionActionResponse;
|
|
366
|
+
};
|
|
367
|
+
/** Transaction metadata */
|
|
368
|
+
metadata: TransactionMetadata;
|
|
369
|
+
/** Transaction result @deprecated use receipt instead */
|
|
370
|
+
result: TransactionResult;
|
|
371
|
+
/** Transaction receipt (execution result and logs) */
|
|
372
|
+
receipt: TransactionReceipt;
|
|
375
373
|
}
|
|
376
374
|
/**
|
|
377
375
|
* Transaction event structure
|
|
378
376
|
*/
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
377
|
+
interface TransactionEvent {
|
|
378
|
+
type: TransactionEventType;
|
|
379
|
+
txid: string;
|
|
380
|
+
amount: string;
|
|
381
|
+
symbol: string;
|
|
382
|
+
timestamp: number;
|
|
385
383
|
}
|
|
386
384
|
/**
|
|
387
385
|
* Transaction filters for querying transactions
|
|
388
386
|
*/
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
387
|
+
interface TransactionFilters {
|
|
388
|
+
limit?: number;
|
|
389
|
+
offset?: number;
|
|
390
|
+
sort?: 'asc' | 'desc';
|
|
391
|
+
cursor?: string;
|
|
392
|
+
cursor_b58?: string;
|
|
393
|
+
contract?: string | Contract;
|
|
394
|
+
contract_b58?: string;
|
|
395
|
+
function?: string | ContractFunction;
|
|
396
|
+
type?: TransactionEventType;
|
|
399
397
|
}
|
|
400
398
|
/**
|
|
401
399
|
* Chain entry header structure
|
|
402
400
|
*/
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
401
|
+
interface ChainEntryHeader {
|
|
402
|
+
height: number;
|
|
403
|
+
timestamp: number;
|
|
404
|
+
mutations_hash: string;
|
|
405
|
+
slot: number;
|
|
406
|
+
prev_slot: number;
|
|
407
|
+
prev_hash: string;
|
|
408
|
+
dr: string;
|
|
409
|
+
vr: string;
|
|
410
|
+
signer: string;
|
|
411
|
+
txs_hash: string;
|
|
412
|
+
root_tx?: string;
|
|
413
|
+
root_validator?: string;
|
|
416
414
|
}
|
|
417
415
|
/**
|
|
418
416
|
* Chain entry structure
|
|
419
417
|
*/
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
418
|
+
interface ChainEntry {
|
|
419
|
+
hash: string;
|
|
420
|
+
height: number;
|
|
421
|
+
timestamp: number;
|
|
422
|
+
mutations_hash: string;
|
|
423
|
+
tx_count?: number;
|
|
424
|
+
mask?: string;
|
|
425
|
+
consensus?: {
|
|
426
|
+
score: number;
|
|
427
|
+
finality_reached: boolean;
|
|
428
|
+
mut_hash: string;
|
|
429
|
+
};
|
|
430
|
+
header_unpacked: ChainEntryHeader;
|
|
433
431
|
}
|
|
434
432
|
/**
|
|
435
433
|
* Chain statistics
|
|
436
434
|
*/
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
435
|
+
interface ChainStats {
|
|
436
|
+
height: number;
|
|
437
|
+
total_entries: number;
|
|
438
|
+
total_transactions: number;
|
|
439
|
+
tip_hash?: string;
|
|
440
|
+
tip?: ChainEntry;
|
|
441
|
+
tx_pool_size?: number;
|
|
442
|
+
cur_validator?: string;
|
|
443
|
+
next_validator?: string;
|
|
444
|
+
emission_for_epoch?: number;
|
|
445
|
+
circulating?: number;
|
|
446
|
+
total_supply_y3?: number;
|
|
447
|
+
total_supply_y30?: number;
|
|
448
|
+
pflops?: number;
|
|
451
449
|
}
|
|
452
450
|
/**
|
|
453
451
|
* Token balance structure
|
|
454
452
|
*/
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
453
|
+
interface TokenBalance {
|
|
454
|
+
float: number;
|
|
455
|
+
symbol: string;
|
|
456
|
+
flat: number;
|
|
459
457
|
}
|
|
460
458
|
/**
|
|
461
459
|
* Wallet balance wrapper
|
|
462
460
|
*/
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
461
|
+
interface WalletBalance {
|
|
462
|
+
balance: {
|
|
463
|
+
float: number;
|
|
464
|
+
flat: number;
|
|
465
|
+
symbol: string;
|
|
466
|
+
};
|
|
469
467
|
}
|
|
470
468
|
/**
|
|
471
469
|
* Wallet balances map
|
|
472
470
|
*/
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
471
|
+
interface WalletBalances {
|
|
472
|
+
[symbol: string]: {
|
|
473
|
+
float: number;
|
|
474
|
+
flat: number;
|
|
475
|
+
symbol: string;
|
|
476
|
+
};
|
|
479
477
|
}
|
|
480
478
|
/**
|
|
481
479
|
* Contract data value can be any JSON-serializable value
|
|
482
480
|
*/
|
|
483
|
-
|
|
484
|
-
|
|
481
|
+
type ContractDataValue = string | number | boolean | null | ContractDataValue[] | {
|
|
482
|
+
[key: string]: ContractDataValue;
|
|
485
483
|
};
|
|
486
484
|
/**
|
|
487
485
|
* Contract data structure
|
|
488
486
|
*/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
487
|
+
interface ContractData {
|
|
488
|
+
contract: string;
|
|
489
|
+
key: string;
|
|
490
|
+
value: ContractDataValue;
|
|
493
491
|
}
|
|
494
492
|
/**
|
|
495
493
|
* Richlist entry structure
|
|
496
494
|
*/
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
495
|
+
interface RichlistEntry {
|
|
496
|
+
address: string;
|
|
497
|
+
balance: string;
|
|
498
|
+
symbol: string;
|
|
499
|
+
rank: number;
|
|
502
500
|
}
|
|
503
501
|
/**
|
|
504
502
|
* Epoch score structure
|
|
505
503
|
*/
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
504
|
+
type EpochScoreAll = [string, number][];
|
|
505
|
+
type EpochScoreSingle = {
|
|
506
|
+
error: 'ok';
|
|
507
|
+
score: number;
|
|
510
508
|
};
|
|
511
|
-
|
|
509
|
+
type EpochScore = EpochScoreAll | EpochScoreSingle;
|
|
512
510
|
/**
|
|
513
511
|
* Emission address structure
|
|
514
512
|
*/
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
513
|
+
interface EmissionAddress {
|
|
514
|
+
address: string;
|
|
515
|
+
pk: string;
|
|
518
516
|
}
|
|
519
517
|
/**
|
|
520
518
|
* Peer information structure
|
|
521
519
|
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
520
|
+
interface PeerInfo {
|
|
521
|
+
pk: string;
|
|
522
|
+
version: string;
|
|
523
|
+
latency?: number;
|
|
524
|
+
temporal_height?: number;
|
|
525
|
+
temporal_hash?: string;
|
|
526
|
+
rooted_height?: number;
|
|
527
|
+
rooted_hash?: string;
|
|
528
|
+
is_trainer?: boolean;
|
|
529
|
+
slot_speed?: number;
|
|
530
|
+
online?: boolean;
|
|
531
|
+
in_slot?: boolean;
|
|
534
532
|
}
|
|
535
533
|
/**
|
|
536
534
|
* ANR (Autonomous Network Registry) information structure
|
|
537
535
|
*/
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
536
|
+
interface ANRInfo {
|
|
537
|
+
pk: string;
|
|
538
|
+
pop: string;
|
|
539
|
+
signature: string;
|
|
540
|
+
ip4: string;
|
|
541
|
+
port: number;
|
|
542
|
+
handshaked: boolean;
|
|
543
|
+
isChainPop: boolean;
|
|
544
|
+
version: string;
|
|
545
|
+
ts: number;
|
|
548
546
|
}
|
|
549
547
|
/**
|
|
550
548
|
* Validator proof node structure
|
|
551
549
|
*/
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
550
|
+
interface ValidatorProofNode {
|
|
551
|
+
direction: string;
|
|
552
|
+
hash: string;
|
|
555
553
|
}
|
|
556
554
|
/**
|
|
557
555
|
* Validator proof data structure
|
|
558
556
|
*/
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
557
|
+
interface ValidatorProofData {
|
|
558
|
+
root: string;
|
|
559
|
+
path: string;
|
|
560
|
+
hash: string;
|
|
561
|
+
nodes: ValidatorProofNode[];
|
|
564
562
|
}
|
|
565
|
-
|
|
566
|
-
|
|
563
|
+
interface GetTipResponse {
|
|
564
|
+
entry: ChainEntry;
|
|
567
565
|
}
|
|
568
|
-
|
|
569
|
-
|
|
566
|
+
interface GetStatsResponse {
|
|
567
|
+
stats: ChainStats;
|
|
570
568
|
}
|
|
571
|
-
|
|
572
|
-
|
|
569
|
+
interface GetByHashResponse {
|
|
570
|
+
entry: ChainEntry;
|
|
573
571
|
}
|
|
574
|
-
|
|
575
|
-
|
|
572
|
+
interface GetByHeightResponse {
|
|
573
|
+
entries: ChainEntry[];
|
|
576
574
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
575
|
+
interface GetTransactionEventsByAccountResponse {
|
|
576
|
+
cursor: string;
|
|
577
|
+
txs: TransactionEvent[];
|
|
580
578
|
}
|
|
581
|
-
|
|
582
|
-
|
|
579
|
+
interface GetTransactionsInEntryResponse {
|
|
580
|
+
txs: Transaction[];
|
|
583
581
|
}
|
|
584
582
|
/**
|
|
585
583
|
* Query parameters for getting token balance
|
|
586
584
|
*/
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
585
|
+
interface GetTokenBalanceQuery {
|
|
586
|
+
address: string;
|
|
587
|
+
symbol?: string;
|
|
590
588
|
}
|
|
591
589
|
/**
|
|
592
590
|
* Response for getting token balance
|
|
593
591
|
*/
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
592
|
+
interface GetTokenBalanceResponse {
|
|
593
|
+
error: string;
|
|
594
|
+
data: TokenBalance;
|
|
597
595
|
}
|
|
598
596
|
/**
|
|
599
597
|
* Query parameters for getting wallet transactions
|
|
600
598
|
*/
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
599
|
+
interface GetWalletTransactionsQuery {
|
|
600
|
+
address: string;
|
|
601
|
+
contract?: Contract;
|
|
602
|
+
function?: ContractFunction;
|
|
603
|
+
type?: TransactionEventType;
|
|
604
|
+
sort?: 'asc' | 'desc';
|
|
605
|
+
limit?: number;
|
|
606
|
+
offset?: number;
|
|
607
|
+
cursor?: string;
|
|
610
608
|
}
|
|
611
609
|
/**
|
|
612
610
|
* Response for getting wallet transactions
|
|
613
611
|
*/
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
612
|
+
interface GetWalletTransactionsResponse {
|
|
613
|
+
cursor: string;
|
|
614
|
+
txs: Transaction[];
|
|
617
615
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
616
|
+
interface GetAllBalancesResponse {
|
|
617
|
+
error?: string;
|
|
618
|
+
balances: TokenBalance[] | WalletBalances;
|
|
621
619
|
}
|
|
622
|
-
|
|
623
|
-
|
|
620
|
+
interface ValidateBytecodeResponse {
|
|
621
|
+
error: string;
|
|
624
622
|
}
|
|
625
|
-
|
|
626
|
-
|
|
623
|
+
interface GetRichlistResponse {
|
|
624
|
+
richlist: RichlistEntry[];
|
|
627
625
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
626
|
+
interface GetEmissionAddressResponse {
|
|
627
|
+
error: 'ok';
|
|
628
|
+
emission_address: string | null;
|
|
631
629
|
}
|
|
632
630
|
/**
|
|
633
631
|
* Response for checking if solution is in epoch
|
|
634
632
|
*/
|
|
635
|
-
|
|
636
|
-
|
|
633
|
+
interface GetSolInEpochResponse {
|
|
634
|
+
error: 'ok' | 'invalid_epoch' | 'sol_not_found';
|
|
637
635
|
}
|
|
638
|
-
|
|
639
|
-
|
|
636
|
+
interface GetNodesResponse {
|
|
637
|
+
nodes: PeerInfo[];
|
|
640
638
|
}
|
|
641
|
-
|
|
642
|
-
|
|
639
|
+
interface GetTrainersResponse {
|
|
640
|
+
trainers: PeerInfo[];
|
|
643
641
|
}
|
|
644
|
-
|
|
645
|
-
|
|
642
|
+
interface GetRemovedTrainersResponse {
|
|
643
|
+
removed_trainers: PeerInfo[];
|
|
646
644
|
}
|
|
647
|
-
|
|
648
|
-
|
|
645
|
+
interface GetANRsResponse {
|
|
646
|
+
anrs: ANRInfo[];
|
|
649
647
|
}
|
|
650
|
-
|
|
651
|
-
|
|
648
|
+
interface GetANRByPkResponse {
|
|
649
|
+
anr: ANRInfo;
|
|
652
650
|
}
|
|
653
651
|
/**
|
|
654
652
|
* Query parameters for submitting a transaction
|
|
655
653
|
*/
|
|
656
|
-
|
|
657
|
-
|
|
654
|
+
interface SubmitTransactionRequestQuery {
|
|
655
|
+
txPacked: Uint8Array;
|
|
658
656
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
657
|
+
interface SubmitTransactionResponse {
|
|
658
|
+
error: TransactionValidationError | string;
|
|
659
|
+
hash?: string;
|
|
662
660
|
}
|
|
663
661
|
/**
|
|
664
662
|
* Response for submit and wait transaction
|
|
665
663
|
*/
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
664
|
+
interface SubmitAndWaitTransactionResponse {
|
|
665
|
+
error: TransactionValidationError | string;
|
|
666
|
+
hash?: string;
|
|
667
|
+
metadata?: TransactionMetadata;
|
|
668
|
+
receipt?: TransactionReceipt;
|
|
671
669
|
}
|
|
672
670
|
/**
|
|
673
671
|
* Validator proof response structure
|
|
674
672
|
*/
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
673
|
+
interface ProofValidators {
|
|
674
|
+
key: string;
|
|
675
|
+
value: string;
|
|
676
|
+
validators: string[];
|
|
677
|
+
proof: ValidatorProofData;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Contract state proof response structure (`/api/proof/contractstate`).
|
|
681
|
+
* `value` and `result` are present only when a value is supplied for verification.
|
|
682
|
+
*/
|
|
683
|
+
interface ContractStateProof {
|
|
684
|
+
namespace: string;
|
|
685
|
+
key: string;
|
|
686
|
+
proof: ValidatorProofData;
|
|
687
|
+
value?: string;
|
|
688
|
+
result?: boolean;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Parameters for `/api/contract/view` (read-only on-chain function execution).
|
|
692
|
+
*/
|
|
693
|
+
interface ContractViewParams {
|
|
694
|
+
/** Contract name (e.g. 'Coin', 'Lockup') or Base58-encoded contract address */
|
|
695
|
+
contract: string;
|
|
696
|
+
/** Function name to invoke */
|
|
697
|
+
function: string;
|
|
698
|
+
/** Function args (strings or raw bytes) */
|
|
699
|
+
args?: SerializableValue[];
|
|
700
|
+
/** Optional caller public key as 48-byte raw bytes; defaults to 48 zero bytes */
|
|
701
|
+
pk?: Uint8Array;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Response from `/api/contract/view`.
|
|
705
|
+
*/
|
|
706
|
+
interface ContractViewResponse {
|
|
707
|
+
success: boolean;
|
|
708
|
+
result: string;
|
|
709
|
+
logs: string[];
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Protocol-level KPIs returned by `/api/chain/kpi`.
|
|
713
|
+
*/
|
|
714
|
+
interface ChainKpi {
|
|
715
|
+
ama_burned: number;
|
|
716
|
+
fees_paid: number;
|
|
717
|
+
active_validator_keys: number;
|
|
718
|
+
active_peers: number;
|
|
719
|
+
block_time: number;
|
|
720
|
+
total_tx: number;
|
|
721
|
+
uaw: number;
|
|
722
|
+
}
|
|
723
|
+
interface GetKpiResponse {
|
|
724
|
+
kpi: ChainKpi;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Filters accepted by `/api/chain/tx_by_filter`.
|
|
728
|
+
* All fields are optional. `signer`/`arg0`/`cursor` are Base58-encoded strings.
|
|
729
|
+
*/
|
|
730
|
+
interface TxByFilterParams {
|
|
731
|
+
/** Base58 signer public key (also accepted as `sender` or `pk` aliases on the node) */
|
|
732
|
+
signer?: string;
|
|
733
|
+
/** Base58 first-arg value — typically the receiver address */
|
|
734
|
+
arg0?: string;
|
|
735
|
+
/** Contract name (ASCII) — for Base58-encoded contracts use `contract_b58` */
|
|
736
|
+
contract?: string;
|
|
737
|
+
/** Base58-encoded contract address (mutually exclusive with `contract`) */
|
|
738
|
+
contract_b58?: string;
|
|
739
|
+
/** Function name */
|
|
740
|
+
function?: string;
|
|
741
|
+
/** Page size (default 100, max 1000 enforced server-side) */
|
|
742
|
+
limit?: number;
|
|
743
|
+
/** Sort order (default 'asc') */
|
|
744
|
+
sort?: 'asc' | 'desc';
|
|
745
|
+
/** Base58-encoded cursor from a previous response */
|
|
746
|
+
cursor?: string;
|
|
747
|
+
}
|
|
748
|
+
interface TxByFilterResponse {
|
|
749
|
+
cursor: string | null;
|
|
750
|
+
txs: Transaction[];
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Optional flags for `/api/tx/submit_and_wait`.
|
|
754
|
+
*/
|
|
755
|
+
interface SubmitAndWaitOptions {
|
|
756
|
+
/** Wait until the transaction is finalized (consensus reached) instead of just confirmed */
|
|
757
|
+
finalized?: boolean;
|
|
680
758
|
}
|
|
759
|
+
//#endregion
|
|
760
|
+
export { ANRInfo, AmadeusSDKConfig, AmadeusSDKError, ApiResponse, BuildTransactionResult, ChainEntry, ChainEntryHeader, ChainKpi, ChainStats, Contract, ContractData, ContractDataValue, ContractFunction, ContractStateProof, ContractViewParams, ContractViewResponse, DecodedValue, EmissionAddress, EpochScore, EpochScoreAll, EpochScoreSingle, GetANRByPkResponse, GetANRsResponse, GetAllBalancesResponse, GetByHashResponse, GetByHeightResponse, GetEmissionAddressResponse, GetKpiResponse, GetNodesResponse, GetRemovedTrainersResponse, GetRichlistResponse, GetSolInEpochResponse, GetStatsResponse, GetTipResponse, GetTokenBalanceQuery, GetTokenBalanceResponse, GetTrainersResponse, GetTransactionEventsByAccountResponse, GetTransactionsInEntryResponse, GetWalletTransactionsQuery, GetWalletTransactionsResponse, KeyPair, LockupPrimeDailyCheckinInput, LockupPrimeLockInput, LockupPrimeUnlockInput, LockupUnlockInput, PeerInfo, ProofValidators, RichlistEntry, SerializableValue, SubmitAndWaitOptions, SubmitAndWaitTransactionResponse, SubmitTransactionRequestQuery, SubmitTransactionResponse, TokenBalance, Transaction, TransactionAction, TransactionActionBody, TransactionActionResponse, TransactionBody, TransactionEvent, TransactionEventType, TransactionExecutionError, TransactionFilters, TransactionMetadata, TransactionPacked, TransactionReceipt, TransactionResult, TransactionUnpacked, TransactionValidationError, TransactionValidationResult, TransferTransactionInput, TxByFilterParams, TxByFilterResponse, UnsignedTransaction, UnsignedTransactionWithHash, ValidateBytecodeResponse, ValidatorProofData, ValidatorProofNode, WalletBalance, WalletBalances };
|
|
681
761
|
//# sourceMappingURL=types.d.ts.map
|