@aptos-labs/ts-sdk 0.0.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/LICENSE +201 -0
- package/README.md +144 -0
- package/dist/browser/index.global.js +410 -0
- package/dist/browser/index.global.js.map +1 -0
- package/dist/cjs/index.d.ts +4965 -0
- package/dist/cjs/index.js +4762 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.d.ts +4965 -0
- package/dist/esm/index.mjs +4645 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/types/index.d.ts +1247 -0
- package/dist/types/index.js +151 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +79 -0
- package/src/api/account.ts +360 -0
- package/src/api/aptos.ts +103 -0
- package/src/api/aptosConfig.ts +77 -0
- package/src/api/coin.ts +39 -0
- package/src/api/digitalAsset.ts +192 -0
- package/src/api/event.ts +78 -0
- package/src/api/faucet.ts +30 -0
- package/src/api/fungibleAsset.ts +82 -0
- package/src/api/general.ts +188 -0
- package/src/api/index.ts +5 -0
- package/src/api/staking.ts +58 -0
- package/src/api/transaction.ts +135 -0
- package/src/api/transactionSubmission.ts +168 -0
- package/src/bcs/consts.ts +12 -0
- package/src/bcs/deserializer.ts +248 -0
- package/src/bcs/index.ts +9 -0
- package/src/bcs/serializable/entryFunctionBytes.ts +61 -0
- package/src/bcs/serializable/fixedBytes.ts +65 -0
- package/src/bcs/serializable/movePrimitives.ts +211 -0
- package/src/bcs/serializable/moveStructs.ts +462 -0
- package/src/bcs/serializer.ts +353 -0
- package/src/client/core.ts +106 -0
- package/src/client/get.ts +109 -0
- package/src/client/index.ts +7 -0
- package/src/client/post.ts +90 -0
- package/src/client/types.ts +58 -0
- package/src/core/account.ts +180 -0
- package/src/core/accountAddress.ts +407 -0
- package/src/core/authenticationKey.ts +102 -0
- package/src/core/common.ts +40 -0
- package/src/core/crypto/asymmetricCrypto.ts +77 -0
- package/src/core/crypto/ed25519.ts +224 -0
- package/src/core/crypto/index.ts +7 -0
- package/src/core/crypto/multiEd25519.ts +251 -0
- package/src/core/crypto/secp256k1.ts +227 -0
- package/src/core/hex.ts +177 -0
- package/src/core/index.ts +9 -0
- package/src/index.ts +12 -0
- package/src/internal/account.ts +484 -0
- package/src/internal/coin.ts +32 -0
- package/src/internal/digitalAsset.ts +302 -0
- package/src/internal/event.ts +88 -0
- package/src/internal/faucet.ts +41 -0
- package/src/internal/fungibleAsset.ts +114 -0
- package/src/internal/general.ts +160 -0
- package/src/internal/queries/TokenActivitiesFieldsFragment.graphql +17 -0
- package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +45 -0
- package/src/internal/queries/getAccountCoinCount.graphql +7 -0
- package/src/internal/queries/getAccountCoinsData.graphql +32 -0
- package/src/internal/queries/getAccountCollectionsWithOwnedTokens.graphql +33 -0
- package/src/internal/queries/getAccountOwnedObjects.graphql +16 -0
- package/src/internal/queries/getAccountOwnedTokens.graphql +11 -0
- package/src/internal/queries/getAccountOwnedTokensByTokenData.graphql +11 -0
- package/src/internal/queries/getAccountOwnedTokensFromCollectionAddress.graphql +11 -0
- package/src/internal/queries/getAccountTokensCount.graphql +7 -0
- package/src/internal/queries/getAccountTransactionsCount.graphql +7 -0
- package/src/internal/queries/getChainTopUserTransactions.graphql +5 -0
- package/src/internal/queries/getCollectionData.graphql +20 -0
- package/src/internal/queries/getCurrentFungibleAssetBalances.graphql +17 -0
- package/src/internal/queries/getDelegatedStakingActivities.graphql +12 -0
- package/src/internal/queries/getEvents.graphql +12 -0
- package/src/internal/queries/getFungibleAssetActivities.graphql +20 -0
- package/src/internal/queries/getFungibleAssetMetadata.graphql +16 -0
- package/src/internal/queries/getNumberOfDelegatorsQuery.graphql +9 -0
- package/src/internal/queries/getProcessorStatus.graphql +7 -0
- package/src/internal/queries/getTokenActivity.graphql +11 -0
- package/src/internal/queries/getTokenCurrentOwner.graphql +11 -0
- package/src/internal/queries/getTokenData.graphql +38 -0
- package/src/internal/staking.ts +68 -0
- package/src/internal/transaction.ts +245 -0
- package/src/internal/transactionSubmission.ts +162 -0
- package/src/transactions/authenticator/account.ts +121 -0
- package/src/transactions/authenticator/transaction.ts +222 -0
- package/src/transactions/instances/chainId.ts +26 -0
- package/src/transactions/instances/identifier.ts +28 -0
- package/src/transactions/instances/index.ts +9 -0
- package/src/transactions/instances/moduleId.ts +53 -0
- package/src/transactions/instances/rawTransaction.ts +199 -0
- package/src/transactions/instances/signedTransaction.ts +43 -0
- package/src/transactions/instances/transactionArgument.ts +37 -0
- package/src/transactions/instances/transactionPayload.ts +407 -0
- package/src/transactions/transaction_builder/transaction_builder.ts +541 -0
- package/src/transactions/typeTag/typeTag.ts +487 -0
- package/src/transactions/types.ts +262 -0
- package/src/types/codegen.yaml +33 -0
- package/src/types/generated/operations.ts +623 -0
- package/src/types/generated/queries.ts +737 -0
- package/src/types/generated/types.ts +10387 -0
- package/src/types/index.ts +944 -0
- package/src/types/indexer.ts +93 -0
- package/src/utils/apiEndpoints.ts +36 -0
- package/src/utils/const.ts +51 -0
- package/src/utils/hdKey.ts +113 -0
- package/src/utils/helpers.ts +12 -0
- package/src/utils/memoize.ts +68 -0
- package/src/version.ts +9 -0
|
@@ -0,0 +1,1247 @@
|
|
|
1
|
+
declare enum Network {
|
|
2
|
+
MAINNET = "mainnet",
|
|
3
|
+
TESTNET = "testnet",
|
|
4
|
+
DEVNET = "devnet",
|
|
5
|
+
LOCAL = "local",
|
|
6
|
+
CUSTOM = "custom"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare type GetAccountCoinsDataQuery = {
|
|
10
|
+
current_fungible_asset_balances: Array<{
|
|
11
|
+
amount: any;
|
|
12
|
+
asset_type: string;
|
|
13
|
+
is_frozen: boolean;
|
|
14
|
+
is_primary: boolean;
|
|
15
|
+
last_transaction_timestamp: any;
|
|
16
|
+
last_transaction_version: any;
|
|
17
|
+
owner_address: string;
|
|
18
|
+
storage_id: string;
|
|
19
|
+
token_standard: string;
|
|
20
|
+
metadata?: {
|
|
21
|
+
token_standard: string;
|
|
22
|
+
symbol: string;
|
|
23
|
+
supply_aggregator_table_key_v1?: string | null;
|
|
24
|
+
supply_aggregator_table_handle_v1?: string | null;
|
|
25
|
+
project_uri?: string | null;
|
|
26
|
+
name: string;
|
|
27
|
+
last_transaction_version: any;
|
|
28
|
+
last_transaction_timestamp: any;
|
|
29
|
+
icon_uri?: string | null;
|
|
30
|
+
decimals: number;
|
|
31
|
+
creator_address: string;
|
|
32
|
+
asset_type: string;
|
|
33
|
+
} | null;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
declare type GetAccountCollectionsWithOwnedTokensQuery = {
|
|
37
|
+
current_collection_ownership_v2_view: Array<{
|
|
38
|
+
collection_id?: string | null;
|
|
39
|
+
collection_name?: string | null;
|
|
40
|
+
collection_uri?: string | null;
|
|
41
|
+
creator_address?: string | null;
|
|
42
|
+
distinct_tokens?: any | null;
|
|
43
|
+
last_transaction_version?: any | null;
|
|
44
|
+
owner_address?: string | null;
|
|
45
|
+
single_token_uri?: string | null;
|
|
46
|
+
current_collection?: {
|
|
47
|
+
collection_id: string;
|
|
48
|
+
collection_name: string;
|
|
49
|
+
creator_address: string;
|
|
50
|
+
current_supply: any;
|
|
51
|
+
description: string;
|
|
52
|
+
last_transaction_timestamp: any;
|
|
53
|
+
last_transaction_version: any;
|
|
54
|
+
mutable_description?: boolean | null;
|
|
55
|
+
max_supply?: any | null;
|
|
56
|
+
mutable_uri?: boolean | null;
|
|
57
|
+
table_handle_v1?: string | null;
|
|
58
|
+
token_standard: string;
|
|
59
|
+
total_minted_v2?: any | null;
|
|
60
|
+
uri: string;
|
|
61
|
+
} | null;
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
64
|
+
declare type GetAccountOwnedObjectsQuery = {
|
|
65
|
+
current_objects: Array<{
|
|
66
|
+
allow_ungated_transfer: boolean;
|
|
67
|
+
state_key_hash: string;
|
|
68
|
+
owner_address: string;
|
|
69
|
+
object_address: string;
|
|
70
|
+
last_transaction_version: any;
|
|
71
|
+
last_guid_creation_num: any;
|
|
72
|
+
is_deleted: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
declare type GetAccountOwnedTokensQuery = {
|
|
76
|
+
current_token_ownerships_v2: Array<{
|
|
77
|
+
token_standard: string;
|
|
78
|
+
token_properties_mutated_v1?: any | null;
|
|
79
|
+
token_data_id: string;
|
|
80
|
+
table_type_v1?: string | null;
|
|
81
|
+
storage_id: string;
|
|
82
|
+
property_version_v1: any;
|
|
83
|
+
owner_address: string;
|
|
84
|
+
last_transaction_version: any;
|
|
85
|
+
last_transaction_timestamp: any;
|
|
86
|
+
is_soulbound_v2?: boolean | null;
|
|
87
|
+
is_fungible_v2?: boolean | null;
|
|
88
|
+
amount: any;
|
|
89
|
+
current_token_data?: {
|
|
90
|
+
collection_id: string;
|
|
91
|
+
description: string;
|
|
92
|
+
is_fungible_v2?: boolean | null;
|
|
93
|
+
largest_property_version_v1?: any | null;
|
|
94
|
+
last_transaction_timestamp: any;
|
|
95
|
+
last_transaction_version: any;
|
|
96
|
+
maximum?: any | null;
|
|
97
|
+
supply: any;
|
|
98
|
+
token_data_id: string;
|
|
99
|
+
token_name: string;
|
|
100
|
+
token_properties: any;
|
|
101
|
+
token_standard: string;
|
|
102
|
+
token_uri: string;
|
|
103
|
+
current_collection?: {
|
|
104
|
+
collection_id: string;
|
|
105
|
+
collection_name: string;
|
|
106
|
+
creator_address: string;
|
|
107
|
+
current_supply: any;
|
|
108
|
+
description: string;
|
|
109
|
+
last_transaction_timestamp: any;
|
|
110
|
+
last_transaction_version: any;
|
|
111
|
+
max_supply?: any | null;
|
|
112
|
+
mutable_description?: boolean | null;
|
|
113
|
+
mutable_uri?: boolean | null;
|
|
114
|
+
table_handle_v1?: string | null;
|
|
115
|
+
token_standard: string;
|
|
116
|
+
total_minted_v2?: any | null;
|
|
117
|
+
uri: string;
|
|
118
|
+
} | null;
|
|
119
|
+
} | null;
|
|
120
|
+
}>;
|
|
121
|
+
};
|
|
122
|
+
declare type GetAccountOwnedTokensFromCollectionQuery = {
|
|
123
|
+
current_token_ownerships_v2: Array<{
|
|
124
|
+
token_standard: string;
|
|
125
|
+
token_properties_mutated_v1?: any | null;
|
|
126
|
+
token_data_id: string;
|
|
127
|
+
table_type_v1?: string | null;
|
|
128
|
+
storage_id: string;
|
|
129
|
+
property_version_v1: any;
|
|
130
|
+
owner_address: string;
|
|
131
|
+
last_transaction_version: any;
|
|
132
|
+
last_transaction_timestamp: any;
|
|
133
|
+
is_soulbound_v2?: boolean | null;
|
|
134
|
+
is_fungible_v2?: boolean | null;
|
|
135
|
+
amount: any;
|
|
136
|
+
current_token_data?: {
|
|
137
|
+
collection_id: string;
|
|
138
|
+
description: string;
|
|
139
|
+
is_fungible_v2?: boolean | null;
|
|
140
|
+
largest_property_version_v1?: any | null;
|
|
141
|
+
last_transaction_timestamp: any;
|
|
142
|
+
last_transaction_version: any;
|
|
143
|
+
maximum?: any | null;
|
|
144
|
+
supply: any;
|
|
145
|
+
token_data_id: string;
|
|
146
|
+
token_name: string;
|
|
147
|
+
token_properties: any;
|
|
148
|
+
token_standard: string;
|
|
149
|
+
token_uri: string;
|
|
150
|
+
current_collection?: {
|
|
151
|
+
collection_id: string;
|
|
152
|
+
collection_name: string;
|
|
153
|
+
creator_address: string;
|
|
154
|
+
current_supply: any;
|
|
155
|
+
description: string;
|
|
156
|
+
last_transaction_timestamp: any;
|
|
157
|
+
last_transaction_version: any;
|
|
158
|
+
max_supply?: any | null;
|
|
159
|
+
mutable_description?: boolean | null;
|
|
160
|
+
mutable_uri?: boolean | null;
|
|
161
|
+
table_handle_v1?: string | null;
|
|
162
|
+
token_standard: string;
|
|
163
|
+
total_minted_v2?: any | null;
|
|
164
|
+
uri: string;
|
|
165
|
+
} | null;
|
|
166
|
+
} | null;
|
|
167
|
+
}>;
|
|
168
|
+
};
|
|
169
|
+
declare type GetChainTopUserTransactionsQuery = {
|
|
170
|
+
user_transactions: Array<{
|
|
171
|
+
version: any;
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
declare type GetCollectionDataQuery = {
|
|
175
|
+
current_collections_v2: Array<{
|
|
176
|
+
collection_id: string;
|
|
177
|
+
collection_name: string;
|
|
178
|
+
creator_address: string;
|
|
179
|
+
current_supply: any;
|
|
180
|
+
description: string;
|
|
181
|
+
last_transaction_timestamp: any;
|
|
182
|
+
last_transaction_version: any;
|
|
183
|
+
max_supply?: any | null;
|
|
184
|
+
mutable_description?: boolean | null;
|
|
185
|
+
mutable_uri?: boolean | null;
|
|
186
|
+
table_handle_v1?: string | null;
|
|
187
|
+
token_standard: string;
|
|
188
|
+
total_minted_v2?: any | null;
|
|
189
|
+
uri: string;
|
|
190
|
+
}>;
|
|
191
|
+
};
|
|
192
|
+
declare type GetCurrentFungibleAssetBalancesQuery = {
|
|
193
|
+
current_fungible_asset_balances: Array<{
|
|
194
|
+
amount: any;
|
|
195
|
+
asset_type: string;
|
|
196
|
+
is_frozen: boolean;
|
|
197
|
+
is_primary: boolean;
|
|
198
|
+
last_transaction_timestamp: any;
|
|
199
|
+
last_transaction_version: any;
|
|
200
|
+
owner_address: string;
|
|
201
|
+
storage_id: string;
|
|
202
|
+
token_standard: string;
|
|
203
|
+
}>;
|
|
204
|
+
};
|
|
205
|
+
declare type GetDelegatedStakingActivitiesQuery = {
|
|
206
|
+
delegated_staking_activities: Array<{
|
|
207
|
+
amount: any;
|
|
208
|
+
delegator_address: string;
|
|
209
|
+
event_index: any;
|
|
210
|
+
event_type: string;
|
|
211
|
+
pool_address: string;
|
|
212
|
+
transaction_version: any;
|
|
213
|
+
}>;
|
|
214
|
+
};
|
|
215
|
+
declare type GetEventsQuery = {
|
|
216
|
+
events: Array<{
|
|
217
|
+
account_address: string;
|
|
218
|
+
creation_number: any;
|
|
219
|
+
data: any;
|
|
220
|
+
event_index: any;
|
|
221
|
+
sequence_number: any;
|
|
222
|
+
transaction_block_height: any;
|
|
223
|
+
transaction_version: any;
|
|
224
|
+
type: string;
|
|
225
|
+
}>;
|
|
226
|
+
};
|
|
227
|
+
declare type GetFungibleAssetActivitiesQuery = {
|
|
228
|
+
fungible_asset_activities: Array<{
|
|
229
|
+
amount?: any | null;
|
|
230
|
+
asset_type: string;
|
|
231
|
+
block_height: any;
|
|
232
|
+
entry_function_id_str?: string | null;
|
|
233
|
+
event_index: any;
|
|
234
|
+
gas_fee_payer_address?: string | null;
|
|
235
|
+
is_frozen?: boolean | null;
|
|
236
|
+
is_gas_fee: boolean;
|
|
237
|
+
is_transaction_success: boolean;
|
|
238
|
+
owner_address: string;
|
|
239
|
+
storage_id: string;
|
|
240
|
+
storage_refund_amount: any;
|
|
241
|
+
token_standard: string;
|
|
242
|
+
transaction_timestamp: any;
|
|
243
|
+
transaction_version: any;
|
|
244
|
+
type: string;
|
|
245
|
+
}>;
|
|
246
|
+
};
|
|
247
|
+
declare type GetFungibleAssetMetadataQuery = {
|
|
248
|
+
fungible_asset_metadata: Array<{
|
|
249
|
+
icon_uri?: string | null;
|
|
250
|
+
project_uri?: string | null;
|
|
251
|
+
supply_aggregator_table_handle_v1?: string | null;
|
|
252
|
+
supply_aggregator_table_key_v1?: string | null;
|
|
253
|
+
creator_address: string;
|
|
254
|
+
asset_type: string;
|
|
255
|
+
decimals: number;
|
|
256
|
+
last_transaction_timestamp: any;
|
|
257
|
+
last_transaction_version: any;
|
|
258
|
+
name: string;
|
|
259
|
+
symbol: string;
|
|
260
|
+
token_standard: string;
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
declare type GetNumberOfDelegatorsQuery = {
|
|
264
|
+
num_active_delegator_per_pool: Array<{
|
|
265
|
+
num_active_delegator?: any | null;
|
|
266
|
+
pool_address?: string | null;
|
|
267
|
+
}>;
|
|
268
|
+
};
|
|
269
|
+
declare type GetProcessorStatusQuery = {
|
|
270
|
+
processor_status: Array<{
|
|
271
|
+
last_success_version: any;
|
|
272
|
+
processor: string;
|
|
273
|
+
last_updated: any;
|
|
274
|
+
}>;
|
|
275
|
+
};
|
|
276
|
+
declare type GetTokenActivityQuery = {
|
|
277
|
+
token_activities_v2: Array<{
|
|
278
|
+
after_value?: string | null;
|
|
279
|
+
before_value?: string | null;
|
|
280
|
+
entry_function_id_str?: string | null;
|
|
281
|
+
event_account_address: string;
|
|
282
|
+
event_index: any;
|
|
283
|
+
from_address?: string | null;
|
|
284
|
+
is_fungible_v2?: boolean | null;
|
|
285
|
+
property_version_v1: any;
|
|
286
|
+
to_address?: string | null;
|
|
287
|
+
token_amount: any;
|
|
288
|
+
token_data_id: string;
|
|
289
|
+
token_standard: string;
|
|
290
|
+
transaction_timestamp: any;
|
|
291
|
+
transaction_version: any;
|
|
292
|
+
type: string;
|
|
293
|
+
}>;
|
|
294
|
+
};
|
|
295
|
+
declare type GetCurrentTokenOwnershipQuery = {
|
|
296
|
+
current_token_ownerships_v2: Array<{
|
|
297
|
+
token_standard: string;
|
|
298
|
+
token_properties_mutated_v1?: any | null;
|
|
299
|
+
token_data_id: string;
|
|
300
|
+
table_type_v1?: string | null;
|
|
301
|
+
storage_id: string;
|
|
302
|
+
property_version_v1: any;
|
|
303
|
+
owner_address: string;
|
|
304
|
+
last_transaction_version: any;
|
|
305
|
+
last_transaction_timestamp: any;
|
|
306
|
+
is_soulbound_v2?: boolean | null;
|
|
307
|
+
is_fungible_v2?: boolean | null;
|
|
308
|
+
amount: any;
|
|
309
|
+
current_token_data?: {
|
|
310
|
+
collection_id: string;
|
|
311
|
+
description: string;
|
|
312
|
+
is_fungible_v2?: boolean | null;
|
|
313
|
+
largest_property_version_v1?: any | null;
|
|
314
|
+
last_transaction_timestamp: any;
|
|
315
|
+
last_transaction_version: any;
|
|
316
|
+
maximum?: any | null;
|
|
317
|
+
supply: any;
|
|
318
|
+
token_data_id: string;
|
|
319
|
+
token_name: string;
|
|
320
|
+
token_properties: any;
|
|
321
|
+
token_standard: string;
|
|
322
|
+
token_uri: string;
|
|
323
|
+
current_collection?: {
|
|
324
|
+
collection_id: string;
|
|
325
|
+
collection_name: string;
|
|
326
|
+
creator_address: string;
|
|
327
|
+
current_supply: any;
|
|
328
|
+
description: string;
|
|
329
|
+
last_transaction_timestamp: any;
|
|
330
|
+
last_transaction_version: any;
|
|
331
|
+
max_supply?: any | null;
|
|
332
|
+
mutable_description?: boolean | null;
|
|
333
|
+
mutable_uri?: boolean | null;
|
|
334
|
+
table_handle_v1?: string | null;
|
|
335
|
+
token_standard: string;
|
|
336
|
+
total_minted_v2?: any | null;
|
|
337
|
+
uri: string;
|
|
338
|
+
} | null;
|
|
339
|
+
} | null;
|
|
340
|
+
}>;
|
|
341
|
+
};
|
|
342
|
+
declare type GetTokenDataQuery = {
|
|
343
|
+
current_token_datas_v2: Array<{
|
|
344
|
+
collection_id: string;
|
|
345
|
+
description: string;
|
|
346
|
+
is_fungible_v2?: boolean | null;
|
|
347
|
+
largest_property_version_v1?: any | null;
|
|
348
|
+
last_transaction_timestamp: any;
|
|
349
|
+
last_transaction_version: any;
|
|
350
|
+
maximum?: any | null;
|
|
351
|
+
supply: any;
|
|
352
|
+
token_data_id: string;
|
|
353
|
+
token_name: string;
|
|
354
|
+
token_properties: any;
|
|
355
|
+
token_standard: string;
|
|
356
|
+
token_uri: string;
|
|
357
|
+
current_collection?: {
|
|
358
|
+
collection_id: string;
|
|
359
|
+
collection_name: string;
|
|
360
|
+
creator_address: string;
|
|
361
|
+
current_supply: any;
|
|
362
|
+
description: string;
|
|
363
|
+
last_transaction_timestamp: any;
|
|
364
|
+
last_transaction_version: any;
|
|
365
|
+
max_supply?: any | null;
|
|
366
|
+
mutable_description?: boolean | null;
|
|
367
|
+
mutable_uri?: boolean | null;
|
|
368
|
+
table_handle_v1?: string | null;
|
|
369
|
+
token_standard: string;
|
|
370
|
+
total_minted_v2?: any | null;
|
|
371
|
+
uri: string;
|
|
372
|
+
} | null;
|
|
373
|
+
}>;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* GENERATED QUERY TYPES FROM GRAPHQL SCHEMA
|
|
378
|
+
*
|
|
379
|
+
* generated types we generate from graphql schema that match the structure of the
|
|
380
|
+
* response type when querying from Hasura schema.
|
|
381
|
+
*
|
|
382
|
+
* These types are used as the return type when making the actual request (usually
|
|
383
|
+
* under the /internal/ folder)
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* CUSTOM RESPONSE TYPES FOR THE END USER
|
|
388
|
+
*
|
|
389
|
+
* To provide a good dev exp, we build custom types derived from the
|
|
390
|
+
* query types to be the response type the end developer/user will
|
|
391
|
+
* work with.
|
|
392
|
+
*
|
|
393
|
+
* These types are used as the return type when calling a sdk api function
|
|
394
|
+
* that calls the function that queries the server (usually under the /api/ folder)
|
|
395
|
+
*/
|
|
396
|
+
declare type GetAccountOwnedObjectsResponse = GetAccountOwnedObjectsQuery["current_objects"];
|
|
397
|
+
declare type GetAccountOwnedTokensQueryResponse = GetAccountOwnedTokensQuery["current_token_ownerships_v2"];
|
|
398
|
+
declare type GetAccountOwnedTokensFromCollectionResponse = GetAccountOwnedTokensFromCollectionQuery["current_token_ownerships_v2"];
|
|
399
|
+
declare type GetAccountCollectionsWithOwnedTokenResponse = GetAccountCollectionsWithOwnedTokensQuery["current_collection_ownership_v2_view"];
|
|
400
|
+
declare type GetAccountCoinsDataResponse = GetAccountCoinsDataQuery["current_fungible_asset_balances"];
|
|
401
|
+
declare type GetChainTopUserTransactionsResponse = GetChainTopUserTransactionsQuery["user_transactions"];
|
|
402
|
+
declare type GetEventsResponse = GetEventsQuery["events"];
|
|
403
|
+
declare type GetNumberOfDelegatorsResponse = GetNumberOfDelegatorsQuery["num_active_delegator_per_pool"];
|
|
404
|
+
declare type GetDelegatedStakingActivitiesResponse = GetDelegatedStakingActivitiesQuery["delegated_staking_activities"];
|
|
405
|
+
declare type GetCollectionDataResponse = GetCollectionDataQuery["current_collections_v2"][0];
|
|
406
|
+
declare type GetTokenDataResponse = GetTokenDataQuery["current_token_datas_v2"][0];
|
|
407
|
+
declare type GetProcessorStatusResponse = GetProcessorStatusQuery["processor_status"];
|
|
408
|
+
declare type GetFungibleAssetMetadataResponse = GetFungibleAssetMetadataQuery["fungible_asset_metadata"];
|
|
409
|
+
declare type GetFungibleAssetActivitiesResponse = GetFungibleAssetActivitiesQuery["fungible_asset_activities"];
|
|
410
|
+
declare type GetCurrentFungibleAssetBalancesResponse = GetCurrentFungibleAssetBalancesQuery["current_fungible_asset_balances"];
|
|
411
|
+
declare type GetTokenActivityResponse = GetTokenActivityQuery["token_activities_v2"];
|
|
412
|
+
declare type GetCurrentTokenOwnershipResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"][0];
|
|
413
|
+
declare type GetOwnedTokensResponse = GetCurrentTokenOwnershipQuery["current_token_ownerships_v2"];
|
|
414
|
+
/**
|
|
415
|
+
* A generic type that being passed by each function and holds an
|
|
416
|
+
* array of properties we can sort the query by
|
|
417
|
+
*/
|
|
418
|
+
declare type OrderBy<T> = Array<{
|
|
419
|
+
[K in keyof T]?: OrderByValue;
|
|
420
|
+
}>;
|
|
421
|
+
declare type OrderByValue = "asc" | "asc_nulls_first" | "asc_nulls_last" | "desc" | "desc_nulls_first" | "desc_nulls_last";
|
|
422
|
+
/**
|
|
423
|
+
* Refers to the token standard we want to query for
|
|
424
|
+
*/
|
|
425
|
+
declare type TokenStandard = "v1" | "v2";
|
|
426
|
+
/**
|
|
427
|
+
* The graphql query type to pass into the `queryIndexer` function
|
|
428
|
+
*/
|
|
429
|
+
declare type GraphqlQuery = {
|
|
430
|
+
query: string;
|
|
431
|
+
variables?: {};
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
declare enum MimeType {
|
|
435
|
+
/**
|
|
436
|
+
* JSON representation, used for transaction submission and accept type JSON output
|
|
437
|
+
*/
|
|
438
|
+
JSON = "application/json",
|
|
439
|
+
/**
|
|
440
|
+
* BCS representation, used for accept type BCS output
|
|
441
|
+
*/
|
|
442
|
+
BCS = "application/x-bcs",
|
|
443
|
+
/**
|
|
444
|
+
* BCS representation, used for transaction submission in BCS input
|
|
445
|
+
*/
|
|
446
|
+
BCS_SIGNED_TRANSACTION = "application/x.aptos.signed_transaction+bcs"
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Hex data as input to a function
|
|
450
|
+
*/
|
|
451
|
+
declare type HexInput = string | Uint8Array;
|
|
452
|
+
/**
|
|
453
|
+
* Script transaction arguments enum as they are represented in Rust
|
|
454
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}
|
|
455
|
+
*/
|
|
456
|
+
declare enum TypeTagVariants {
|
|
457
|
+
Bool = 0,
|
|
458
|
+
U8 = 1,
|
|
459
|
+
U64 = 2,
|
|
460
|
+
U128 = 3,
|
|
461
|
+
Address = 4,
|
|
462
|
+
Signer = 5,
|
|
463
|
+
Vector = 6,
|
|
464
|
+
Struct = 7,
|
|
465
|
+
U16 = 8,
|
|
466
|
+
U32 = 9,
|
|
467
|
+
U256 = 10
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Script transaction arguments enum as they are represented in Rust
|
|
471
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}
|
|
472
|
+
*/
|
|
473
|
+
declare enum ScriptTransactionArgumentVariants {
|
|
474
|
+
U8 = 0,
|
|
475
|
+
U64 = 1,
|
|
476
|
+
U128 = 2,
|
|
477
|
+
Address = 3,
|
|
478
|
+
U8Vector = 4,
|
|
479
|
+
Bool = 5,
|
|
480
|
+
U16 = 6,
|
|
481
|
+
U32 = 7,
|
|
482
|
+
U256 = 8
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Transaction payload enum as they are represented in Rust
|
|
486
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}
|
|
487
|
+
*/
|
|
488
|
+
declare enum TransactionPayloadVariants {
|
|
489
|
+
Script = 0,
|
|
490
|
+
EntryFunction = 2,
|
|
491
|
+
Multisig = 3
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Transaction variants enum as they are represented in Rust
|
|
495
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}
|
|
496
|
+
*/
|
|
497
|
+
declare enum TransactionVariants {
|
|
498
|
+
MultiAgentTransaction = 0,
|
|
499
|
+
FeePayerTransaction = 1
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Transaction Authenticator enum as they are represented in Rust
|
|
503
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}
|
|
504
|
+
*/
|
|
505
|
+
declare enum TransactionAuthenticatorVariant {
|
|
506
|
+
Ed25519 = 0,
|
|
507
|
+
MultiEd25519 = 1,
|
|
508
|
+
MultiAgent = 2,
|
|
509
|
+
FeePayer = 3,
|
|
510
|
+
Secp256k1Ecdsa = 4
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Transaction Authenticator enum as they are represented in Rust
|
|
514
|
+
* {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}
|
|
515
|
+
*/
|
|
516
|
+
declare enum AccountAuthenticatorVariant {
|
|
517
|
+
Ed25519 = 0,
|
|
518
|
+
MultiEd25519 = 1,
|
|
519
|
+
Secp256k1 = 2
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* BCS types
|
|
523
|
+
*/
|
|
524
|
+
declare type Uint8 = number;
|
|
525
|
+
declare type Uint16 = number;
|
|
526
|
+
declare type Uint32 = number;
|
|
527
|
+
declare type Uint64 = bigint;
|
|
528
|
+
declare type Uint128 = bigint;
|
|
529
|
+
declare type Uint256 = bigint;
|
|
530
|
+
declare type AnyNumber = number | bigint;
|
|
531
|
+
/**
|
|
532
|
+
* Set of configuration options that can be provided when initializing the SDK.
|
|
533
|
+
* The purpose of these options is to configure various aspects of the SDK's
|
|
534
|
+
* behavior and interaction with the Aptos network
|
|
535
|
+
*/
|
|
536
|
+
declare type AptosSettings = {
|
|
537
|
+
readonly network: Network;
|
|
538
|
+
readonly fullnode?: string;
|
|
539
|
+
readonly faucet?: string;
|
|
540
|
+
readonly indexer?: string;
|
|
541
|
+
readonly clientConfig?: ClientConfig;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
*
|
|
545
|
+
* Controls the number of results that are returned and the starting position of those results.
|
|
546
|
+
* @param offset parameter specifies the starting position of the query result within the set of data. Default is 0.
|
|
547
|
+
* @param limit specifies the maximum number of items or records to return in a query result. Default is 25.
|
|
548
|
+
*/
|
|
549
|
+
interface PaginationArgs {
|
|
550
|
+
offset?: AnyNumber;
|
|
551
|
+
limit?: number;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* QUERY TYPES
|
|
555
|
+
*/
|
|
556
|
+
/**
|
|
557
|
+
* A configuration object we can pass with the request to the server.
|
|
558
|
+
*
|
|
559
|
+
* @param TOKEN - an auth token to send with the request
|
|
560
|
+
* @param HEADERS - extra headers we want to send with the request
|
|
561
|
+
* @param WITH_CREDENTIALS - whether to carry cookies. By default, it is set to true and cookies will be sent
|
|
562
|
+
*/
|
|
563
|
+
declare type ClientConfig = {
|
|
564
|
+
TOKEN?: string;
|
|
565
|
+
HEADERS?: Record<string, string | number | boolean>;
|
|
566
|
+
WITH_CREDENTIALS?: boolean;
|
|
567
|
+
};
|
|
568
|
+
/**
|
|
569
|
+
* The API request type
|
|
570
|
+
*
|
|
571
|
+
* @param url - the url to make the request to, i.e https://fullnode.aptoslabs.devnet.com/v1
|
|
572
|
+
* @param method - the request method "GET" | "POST"
|
|
573
|
+
* @param endpoint (optional) - the endpoint to make the request to, i.e transactions
|
|
574
|
+
* @param body (optional) - the body of the request
|
|
575
|
+
* @param contentType (optional) - the content type to set the `content-type` header to,
|
|
576
|
+
* by default is set to `application/json`
|
|
577
|
+
* @param params (optional) - query params to add to the request
|
|
578
|
+
* @param originMethod (optional) - the local method the request came from
|
|
579
|
+
* @param overrides (optional) - a `ClientConfig` object type to override request data
|
|
580
|
+
*/
|
|
581
|
+
declare type AptosRequest = {
|
|
582
|
+
url: string;
|
|
583
|
+
method: "GET" | "POST";
|
|
584
|
+
path?: string;
|
|
585
|
+
body?: any;
|
|
586
|
+
contentType?: string;
|
|
587
|
+
acceptType?: string;
|
|
588
|
+
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
589
|
+
originMethod?: string;
|
|
590
|
+
overrides?: ClientConfig;
|
|
591
|
+
};
|
|
592
|
+
/**
|
|
593
|
+
* Specifies ledger version of transactions. By default latest version will be used
|
|
594
|
+
*/
|
|
595
|
+
declare type LedgerVersion = {
|
|
596
|
+
ledgerVersion?: AnyNumber;
|
|
597
|
+
};
|
|
598
|
+
/**
|
|
599
|
+
* RESPONSE TYPES
|
|
600
|
+
*/
|
|
601
|
+
/**
|
|
602
|
+
* Type holding the outputs of the estimate gas API
|
|
603
|
+
*/
|
|
604
|
+
declare type GasEstimation = {
|
|
605
|
+
/**
|
|
606
|
+
* The deprioritized estimate for the gas unit price
|
|
607
|
+
*/
|
|
608
|
+
deprioritized_gas_estimate?: number;
|
|
609
|
+
/**
|
|
610
|
+
* The current estimate for the gas unit price
|
|
611
|
+
*/
|
|
612
|
+
gas_estimate: number;
|
|
613
|
+
/**
|
|
614
|
+
* The prioritized estimate for the gas unit price
|
|
615
|
+
*/
|
|
616
|
+
prioritized_gas_estimate?: number;
|
|
617
|
+
};
|
|
618
|
+
declare type MoveResource = {
|
|
619
|
+
type: MoveResourceType;
|
|
620
|
+
data: {};
|
|
621
|
+
};
|
|
622
|
+
declare type AccountData = {
|
|
623
|
+
sequence_number: string;
|
|
624
|
+
authentication_key: string;
|
|
625
|
+
};
|
|
626
|
+
declare type MoveModuleBytecode = {
|
|
627
|
+
bytecode: string;
|
|
628
|
+
abi?: MoveModule;
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* TRANSACTION TYPES
|
|
632
|
+
*/
|
|
633
|
+
declare enum TransactionResponseType {
|
|
634
|
+
Pending = "pending_transaction",
|
|
635
|
+
User = "user_transaction",
|
|
636
|
+
Genesis = "genesis_transaction",
|
|
637
|
+
BlockMetadata = "block_metadata_transaction",
|
|
638
|
+
StateCheckpoint = "state_checkpoint_transaction"
|
|
639
|
+
}
|
|
640
|
+
declare type TransactionResponse = PendingTransactionResponse | UserTransactionResponse | GenesisTransactionResponse | BlockMetadataTransactionResponse | StateCheckpointTransactionResponse;
|
|
641
|
+
declare type PendingTransactionResponse = {
|
|
642
|
+
type: TransactionResponseType.Pending;
|
|
643
|
+
hash: string;
|
|
644
|
+
sender: string;
|
|
645
|
+
sequence_number: string;
|
|
646
|
+
max_gas_amount: string;
|
|
647
|
+
gas_unit_price: string;
|
|
648
|
+
expiration_timestamp_secs: string;
|
|
649
|
+
payload: TransactionPayloadResponse;
|
|
650
|
+
signature?: TransactionSignature;
|
|
651
|
+
};
|
|
652
|
+
declare type UserTransactionResponse = {
|
|
653
|
+
type: TransactionResponseType.User;
|
|
654
|
+
version: string;
|
|
655
|
+
hash: string;
|
|
656
|
+
state_change_hash: string;
|
|
657
|
+
event_root_hash: string;
|
|
658
|
+
state_checkpoint_hash?: string;
|
|
659
|
+
gas_used: string;
|
|
660
|
+
/**
|
|
661
|
+
* Whether the transaction was successful
|
|
662
|
+
*/
|
|
663
|
+
success: boolean;
|
|
664
|
+
/**
|
|
665
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
666
|
+
*/
|
|
667
|
+
vm_status: string;
|
|
668
|
+
accumulator_root_hash: string;
|
|
669
|
+
/**
|
|
670
|
+
* Final state of resources changed by the transaction
|
|
671
|
+
*/
|
|
672
|
+
changes: Array<WriteSetChange>;
|
|
673
|
+
sender: string;
|
|
674
|
+
sequence_number: string;
|
|
675
|
+
max_gas_amount: string;
|
|
676
|
+
gas_unit_price: string;
|
|
677
|
+
expiration_timestamp_secs: string;
|
|
678
|
+
payload: TransactionPayloadResponse;
|
|
679
|
+
signature?: TransactionSignature;
|
|
680
|
+
/**
|
|
681
|
+
* Events generated by the transaction
|
|
682
|
+
*/
|
|
683
|
+
events: Array<Event>;
|
|
684
|
+
timestamp: string;
|
|
685
|
+
};
|
|
686
|
+
declare type GenesisTransactionResponse = {
|
|
687
|
+
type: TransactionResponseType.Genesis;
|
|
688
|
+
version: string;
|
|
689
|
+
hash: string;
|
|
690
|
+
state_change_hash: string;
|
|
691
|
+
event_root_hash: string;
|
|
692
|
+
state_checkpoint_hash?: string;
|
|
693
|
+
gas_used: string;
|
|
694
|
+
/**
|
|
695
|
+
* Whether the transaction was successful
|
|
696
|
+
*/
|
|
697
|
+
success: boolean;
|
|
698
|
+
/**
|
|
699
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
700
|
+
*/
|
|
701
|
+
vm_status: string;
|
|
702
|
+
accumulator_root_hash: string;
|
|
703
|
+
/**
|
|
704
|
+
* Final state of resources changed by the transaction
|
|
705
|
+
*/
|
|
706
|
+
changes: Array<WriteSetChange>;
|
|
707
|
+
payload: GenesisPayload;
|
|
708
|
+
/**
|
|
709
|
+
* Events emitted during genesis
|
|
710
|
+
*/
|
|
711
|
+
events: Array<Event>;
|
|
712
|
+
};
|
|
713
|
+
declare type BlockMetadataTransactionResponse = {
|
|
714
|
+
type: TransactionResponseType.BlockMetadata;
|
|
715
|
+
version: string;
|
|
716
|
+
hash: string;
|
|
717
|
+
state_change_hash: string;
|
|
718
|
+
event_root_hash: string;
|
|
719
|
+
state_checkpoint_hash?: string;
|
|
720
|
+
gas_used: string;
|
|
721
|
+
/**
|
|
722
|
+
* Whether the transaction was successful
|
|
723
|
+
*/
|
|
724
|
+
success: boolean;
|
|
725
|
+
/**
|
|
726
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
727
|
+
*/
|
|
728
|
+
vm_status: string;
|
|
729
|
+
accumulator_root_hash: string;
|
|
730
|
+
/**
|
|
731
|
+
* Final state of resources changed by the transaction
|
|
732
|
+
*/
|
|
733
|
+
changes: Array<WriteSetChange>;
|
|
734
|
+
id: string;
|
|
735
|
+
epoch: string;
|
|
736
|
+
round: string;
|
|
737
|
+
/**
|
|
738
|
+
* The events emitted at the block creation
|
|
739
|
+
*/
|
|
740
|
+
events: Array<Event>;
|
|
741
|
+
/**
|
|
742
|
+
* Previous block votes
|
|
743
|
+
*/
|
|
744
|
+
previous_block_votes_bitvec: Array<number>;
|
|
745
|
+
proposer: string;
|
|
746
|
+
/**
|
|
747
|
+
* The indices of the proposers who failed to propose
|
|
748
|
+
*/
|
|
749
|
+
failed_proposer_indices: Array<number>;
|
|
750
|
+
timestamp: string;
|
|
751
|
+
};
|
|
752
|
+
declare type StateCheckpointTransactionResponse = {
|
|
753
|
+
type: TransactionResponseType.StateCheckpoint;
|
|
754
|
+
version: string;
|
|
755
|
+
hash: string;
|
|
756
|
+
state_change_hash: string;
|
|
757
|
+
event_root_hash: string;
|
|
758
|
+
state_checkpoint_hash?: string;
|
|
759
|
+
gas_used: string;
|
|
760
|
+
/**
|
|
761
|
+
* Whether the transaction was successful
|
|
762
|
+
*/
|
|
763
|
+
success: boolean;
|
|
764
|
+
/**
|
|
765
|
+
* The VM status of the transaction, can tell useful information in a failure
|
|
766
|
+
*/
|
|
767
|
+
vm_status: string;
|
|
768
|
+
accumulator_root_hash: string;
|
|
769
|
+
/**
|
|
770
|
+
* Final state of resources changed by the transaction
|
|
771
|
+
*/
|
|
772
|
+
changes: Array<WriteSetChange>;
|
|
773
|
+
timestamp: string;
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* WRITESET CHANGE TYPES
|
|
777
|
+
*/
|
|
778
|
+
declare type WriteSetChange = WriteSetChangeDeleteModule | WriteSetChangeDeleteResource | WriteSetChangeDeleteTableItem | WriteSetChangeWriteModule | WriteSetChangeWriteResource | WriteSetChangeWriteTableItem;
|
|
779
|
+
declare type WriteSetChangeDeleteModule = {
|
|
780
|
+
type: string;
|
|
781
|
+
address: string;
|
|
782
|
+
/**
|
|
783
|
+
* State key hash
|
|
784
|
+
*/
|
|
785
|
+
state_key_hash: string;
|
|
786
|
+
module: MoveModuleId;
|
|
787
|
+
};
|
|
788
|
+
declare type WriteSetChangeDeleteResource = {
|
|
789
|
+
type: string;
|
|
790
|
+
address: string;
|
|
791
|
+
state_key_hash: string;
|
|
792
|
+
resource: string;
|
|
793
|
+
};
|
|
794
|
+
declare type WriteSetChangeDeleteTableItem = {
|
|
795
|
+
type: string;
|
|
796
|
+
state_key_hash: string;
|
|
797
|
+
handle: string;
|
|
798
|
+
key: string;
|
|
799
|
+
data?: DeletedTableData;
|
|
800
|
+
};
|
|
801
|
+
declare type WriteSetChangeWriteModule = {
|
|
802
|
+
type: string;
|
|
803
|
+
address: string;
|
|
804
|
+
state_key_hash: string;
|
|
805
|
+
data: MoveModuleBytecode;
|
|
806
|
+
};
|
|
807
|
+
declare type WriteSetChangeWriteResource = {
|
|
808
|
+
type: string;
|
|
809
|
+
address: string;
|
|
810
|
+
state_key_hash: string;
|
|
811
|
+
data: MoveResource;
|
|
812
|
+
};
|
|
813
|
+
declare type WriteSetChangeWriteTableItem = {
|
|
814
|
+
type: string;
|
|
815
|
+
state_key_hash: string;
|
|
816
|
+
handle: string;
|
|
817
|
+
key: string;
|
|
818
|
+
value: string;
|
|
819
|
+
data?: DecodedTableData;
|
|
820
|
+
};
|
|
821
|
+
declare type DecodedTableData = {
|
|
822
|
+
/**
|
|
823
|
+
* Key of table in JSON
|
|
824
|
+
*/
|
|
825
|
+
key: any;
|
|
826
|
+
/**
|
|
827
|
+
* Type of key
|
|
828
|
+
*/
|
|
829
|
+
key_type: string;
|
|
830
|
+
/**
|
|
831
|
+
* Value of table in JSON
|
|
832
|
+
*/
|
|
833
|
+
value: any;
|
|
834
|
+
/**
|
|
835
|
+
* Type of value
|
|
836
|
+
*/
|
|
837
|
+
value_type: string;
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* Deleted table data
|
|
841
|
+
*/
|
|
842
|
+
declare type DeletedTableData = {
|
|
843
|
+
/**
|
|
844
|
+
* Deleted key
|
|
845
|
+
*/
|
|
846
|
+
key: any;
|
|
847
|
+
/**
|
|
848
|
+
* Deleted key type
|
|
849
|
+
*/
|
|
850
|
+
key_type: string;
|
|
851
|
+
};
|
|
852
|
+
declare type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;
|
|
853
|
+
declare type EntryFunctionPayloadResponse = {
|
|
854
|
+
type: string;
|
|
855
|
+
function: MoveResourceType;
|
|
856
|
+
/**
|
|
857
|
+
* Type arguments of the function
|
|
858
|
+
*/
|
|
859
|
+
type_arguments: Array<string>;
|
|
860
|
+
/**
|
|
861
|
+
* Arguments of the function
|
|
862
|
+
*/
|
|
863
|
+
arguments: Array<any>;
|
|
864
|
+
};
|
|
865
|
+
declare type ScriptPayloadResponse = {
|
|
866
|
+
type: string;
|
|
867
|
+
code: MoveScriptBytecode;
|
|
868
|
+
/**
|
|
869
|
+
* Type arguments of the function
|
|
870
|
+
*/
|
|
871
|
+
type_arguments: Array<string>;
|
|
872
|
+
/**
|
|
873
|
+
* Arguments of the function
|
|
874
|
+
*/
|
|
875
|
+
arguments: Array<any>;
|
|
876
|
+
};
|
|
877
|
+
declare type MultisigPayloadResponse = {
|
|
878
|
+
type: string;
|
|
879
|
+
multisig_address: string;
|
|
880
|
+
transaction_payload?: EntryFunctionPayloadResponse;
|
|
881
|
+
};
|
|
882
|
+
declare type GenesisPayload = {
|
|
883
|
+
type: string;
|
|
884
|
+
write_set: WriteSet;
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Move script bytecode
|
|
888
|
+
*/
|
|
889
|
+
declare type MoveScriptBytecode = {
|
|
890
|
+
bytecode: string;
|
|
891
|
+
abi?: MoveFunction;
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* These are the JSON representations of transaction signatures returned from the node API.
|
|
895
|
+
*/
|
|
896
|
+
declare type TransactionSignature = TransactionEd25519Signature | TransactionSecp256k1Signature | TransactionMultiEd25519Signature | TransactionMultiAgentSignature | TransactionFeePayerSignature;
|
|
897
|
+
declare type TransactionEd25519Signature = {
|
|
898
|
+
type: string;
|
|
899
|
+
public_key: string;
|
|
900
|
+
signature: "ed25519_signature";
|
|
901
|
+
};
|
|
902
|
+
declare type TransactionSecp256k1Signature = {
|
|
903
|
+
type: string;
|
|
904
|
+
public_key: string;
|
|
905
|
+
signature: "secp256k1_ecdsa_signature";
|
|
906
|
+
};
|
|
907
|
+
declare type TransactionMultiEd25519Signature = {
|
|
908
|
+
type: "multi_ed25519_signature";
|
|
909
|
+
/**
|
|
910
|
+
* The public keys for the Ed25519 signature
|
|
911
|
+
*/
|
|
912
|
+
public_keys: Array<string>;
|
|
913
|
+
/**
|
|
914
|
+
* Signature associated with the public keys in the same order
|
|
915
|
+
*/
|
|
916
|
+
signatures: Array<string>;
|
|
917
|
+
/**
|
|
918
|
+
* The number of signatures required for a successful transaction
|
|
919
|
+
*/
|
|
920
|
+
threshold: number;
|
|
921
|
+
bitmap: string;
|
|
922
|
+
};
|
|
923
|
+
declare type TransactionMultiAgentSignature = {
|
|
924
|
+
type: "multi_agent_signature";
|
|
925
|
+
sender: AccountSignature;
|
|
926
|
+
/**
|
|
927
|
+
* The other involved parties' addresses
|
|
928
|
+
*/
|
|
929
|
+
secondary_signer_addresses: Array<string>;
|
|
930
|
+
/**
|
|
931
|
+
* The associated signatures, in the same order as the secondary addresses
|
|
932
|
+
*/
|
|
933
|
+
secondary_signers: Array<AccountSignature>;
|
|
934
|
+
};
|
|
935
|
+
declare type TransactionFeePayerSignature = {
|
|
936
|
+
type: "fee_payer_signature";
|
|
937
|
+
sender: AccountSignature;
|
|
938
|
+
/**
|
|
939
|
+
* The other involved parties' addresses
|
|
940
|
+
*/
|
|
941
|
+
secondary_signer_addresses: Array<string>;
|
|
942
|
+
/**
|
|
943
|
+
* The associated signatures, in the same order as the secondary addresses
|
|
944
|
+
*/
|
|
945
|
+
secondary_signers: Array<AccountSignature>;
|
|
946
|
+
fee_payer_address: string;
|
|
947
|
+
fee_payer_signer: AccountSignature;
|
|
948
|
+
};
|
|
949
|
+
/**
|
|
950
|
+
* The union of all single account signatures.
|
|
951
|
+
*/
|
|
952
|
+
declare type AccountSignature = AccountEd25519Signature | AccountSecp256k1Signature | AccountMultiEd25519Signature;
|
|
953
|
+
declare type AccountEd25519Signature = TransactionEd25519Signature;
|
|
954
|
+
declare type AccountSecp256k1Signature = TransactionSecp256k1Signature;
|
|
955
|
+
declare type AccountMultiEd25519Signature = TransactionMultiEd25519Signature;
|
|
956
|
+
declare type WriteSet = ScriptWriteSet | DirectWriteSet;
|
|
957
|
+
declare type ScriptWriteSet = {
|
|
958
|
+
type: string;
|
|
959
|
+
execute_as: string;
|
|
960
|
+
script: ScriptPayloadResponse;
|
|
961
|
+
};
|
|
962
|
+
declare type DirectWriteSet = {
|
|
963
|
+
type: string;
|
|
964
|
+
changes: Array<WriteSetChange>;
|
|
965
|
+
events: Array<Event>;
|
|
966
|
+
};
|
|
967
|
+
declare type EventGuid = {
|
|
968
|
+
creation_number: string;
|
|
969
|
+
account_address: string;
|
|
970
|
+
};
|
|
971
|
+
declare type Event = {
|
|
972
|
+
guid: EventGuid;
|
|
973
|
+
sequence_number: string;
|
|
974
|
+
type: string;
|
|
975
|
+
/**
|
|
976
|
+
* The JSON representation of the event
|
|
977
|
+
*/
|
|
978
|
+
data: any;
|
|
979
|
+
};
|
|
980
|
+
/**
|
|
981
|
+
* Map of Move types to local TypeScript types
|
|
982
|
+
*/
|
|
983
|
+
declare type MoveUint8Type = number;
|
|
984
|
+
declare type MoveUint16Type = number;
|
|
985
|
+
declare type MoveUint32Type = number;
|
|
986
|
+
declare type MoveUint64Type = string;
|
|
987
|
+
declare type MoveUint128Type = string;
|
|
988
|
+
declare type MoveUint256Type = string;
|
|
989
|
+
declare type MoveAddressType = `0x${string}`;
|
|
990
|
+
declare type MoveObjectType = `0x${string}`;
|
|
991
|
+
declare type MoveStructType = `0x${string}::${string}::${string}`;
|
|
992
|
+
declare type MoveOptionType = MoveType | null | undefined;
|
|
993
|
+
/**
|
|
994
|
+
* String representation of a on-chain Move struct type.
|
|
995
|
+
*/
|
|
996
|
+
declare type MoveResourceType = `${string}::${string}::${string}`;
|
|
997
|
+
declare type MoveType = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructType | Array<MoveType>;
|
|
998
|
+
/**
|
|
999
|
+
* Possible Move values acceptable by move functions (entry, view)
|
|
1000
|
+
*
|
|
1001
|
+
* Map of a Move value to the corresponding TypeScript value
|
|
1002
|
+
*
|
|
1003
|
+
* `Bool -> boolean`
|
|
1004
|
+
*
|
|
1005
|
+
* `u8, u16, u32 -> number`
|
|
1006
|
+
*
|
|
1007
|
+
* `u64, u128, u256 -> string`
|
|
1008
|
+
*
|
|
1009
|
+
* `String -> string`
|
|
1010
|
+
*
|
|
1011
|
+
* `Address -> 0x${string}`
|
|
1012
|
+
*
|
|
1013
|
+
* `Struct - 0x${string}::${string}::${string}`
|
|
1014
|
+
*
|
|
1015
|
+
* `Object -> 0x${string}`
|
|
1016
|
+
*
|
|
1017
|
+
* `Vector -> Array<MoveValue>`
|
|
1018
|
+
*
|
|
1019
|
+
* `Option -> MoveValue | null | undefined`
|
|
1020
|
+
*/
|
|
1021
|
+
declare type MoveValue = boolean | string | MoveUint8Type | MoveUint16Type | MoveUint32Type | MoveUint64Type | MoveUint128Type | MoveUint256Type | MoveAddressType | MoveObjectType | MoveStructType | MoveOptionType | Array<MoveValue>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Move module id is a string representation of Move module.
|
|
1024
|
+
* Module name is case-sensitive.
|
|
1025
|
+
*/
|
|
1026
|
+
declare type MoveModuleId = `${string}::${string}`;
|
|
1027
|
+
/**
|
|
1028
|
+
* Move function visibility
|
|
1029
|
+
*/
|
|
1030
|
+
declare enum MoveFunctionVisibility {
|
|
1031
|
+
PRIVATE = "private",
|
|
1032
|
+
PUBLIC = "public",
|
|
1033
|
+
FRIEND = "friend"
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Move function ability
|
|
1037
|
+
*/
|
|
1038
|
+
declare enum MoveAbility {
|
|
1039
|
+
STORE = "store",
|
|
1040
|
+
DROP = "drop",
|
|
1041
|
+
KEY = "key",
|
|
1042
|
+
COPY = "copy"
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Move abilities tied to the generic type param and associated with the function that uses it
|
|
1046
|
+
*/
|
|
1047
|
+
declare type MoveFunctionGenericTypeParam = {
|
|
1048
|
+
constraints: Array<MoveAbility>;
|
|
1049
|
+
};
|
|
1050
|
+
/**
|
|
1051
|
+
* Move struct field
|
|
1052
|
+
*/
|
|
1053
|
+
declare type MoveStructField = {
|
|
1054
|
+
name: string;
|
|
1055
|
+
type: string;
|
|
1056
|
+
};
|
|
1057
|
+
/**
|
|
1058
|
+
* A Move module
|
|
1059
|
+
*/
|
|
1060
|
+
declare type MoveModule = {
|
|
1061
|
+
address: string;
|
|
1062
|
+
name: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* Friends of the module
|
|
1065
|
+
*/
|
|
1066
|
+
friends: Array<MoveModuleId>;
|
|
1067
|
+
/**
|
|
1068
|
+
* Public functions of the module
|
|
1069
|
+
*/
|
|
1070
|
+
exposed_functions: Array<MoveFunction>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Structs of the module
|
|
1073
|
+
*/
|
|
1074
|
+
structs: Array<MoveStruct>;
|
|
1075
|
+
};
|
|
1076
|
+
/**
|
|
1077
|
+
* A move struct
|
|
1078
|
+
*/
|
|
1079
|
+
declare type MoveStruct = {
|
|
1080
|
+
name: string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Whether the struct is a native struct of Move
|
|
1083
|
+
*/
|
|
1084
|
+
is_native: boolean;
|
|
1085
|
+
/**
|
|
1086
|
+
* Abilities associated with the struct
|
|
1087
|
+
*/
|
|
1088
|
+
abilities: Array<MoveAbility>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Generic types associated with the struct
|
|
1091
|
+
*/
|
|
1092
|
+
generic_type_params: Array<MoveFunctionGenericTypeParam>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Fields associated with the struct
|
|
1095
|
+
*/
|
|
1096
|
+
fields: Array<MoveStructField>;
|
|
1097
|
+
};
|
|
1098
|
+
/**
|
|
1099
|
+
* Move function
|
|
1100
|
+
*/
|
|
1101
|
+
declare type MoveFunction = {
|
|
1102
|
+
name: string;
|
|
1103
|
+
visibility: MoveFunctionVisibility;
|
|
1104
|
+
/**
|
|
1105
|
+
* Whether the function can be called as an entry function directly in a transaction
|
|
1106
|
+
*/
|
|
1107
|
+
is_entry: boolean;
|
|
1108
|
+
/**
|
|
1109
|
+
* Whether the function is a view function or not
|
|
1110
|
+
*/
|
|
1111
|
+
is_view: boolean;
|
|
1112
|
+
/**
|
|
1113
|
+
* Generic type params associated with the Move function
|
|
1114
|
+
*/
|
|
1115
|
+
generic_type_params: Array<MoveFunctionGenericTypeParam>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Parameters associated with the move function
|
|
1118
|
+
*/
|
|
1119
|
+
params: Array<string>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Return type of the function
|
|
1122
|
+
*/
|
|
1123
|
+
return: Array<string>;
|
|
1124
|
+
};
|
|
1125
|
+
declare enum RoleType {
|
|
1126
|
+
VALIDATOR = "validator",
|
|
1127
|
+
FULL_NODE = "full_node"
|
|
1128
|
+
}
|
|
1129
|
+
declare type LedgerInfo = {
|
|
1130
|
+
/**
|
|
1131
|
+
* Chain ID of the current chain
|
|
1132
|
+
*/
|
|
1133
|
+
chain_id: number;
|
|
1134
|
+
epoch: string;
|
|
1135
|
+
ledger_version: string;
|
|
1136
|
+
oldest_ledger_version: string;
|
|
1137
|
+
ledger_timestamp: string;
|
|
1138
|
+
node_role: RoleType;
|
|
1139
|
+
oldest_block_height: string;
|
|
1140
|
+
block_height: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Git hash of the build of the API endpoint. Can be used to determine the exact
|
|
1143
|
+
* software version used by the API endpoint.
|
|
1144
|
+
*/
|
|
1145
|
+
git_hash?: string;
|
|
1146
|
+
};
|
|
1147
|
+
/**
|
|
1148
|
+
* A Block type
|
|
1149
|
+
*/
|
|
1150
|
+
declare type Block = {
|
|
1151
|
+
block_height: string;
|
|
1152
|
+
block_hash: `0x${string}`;
|
|
1153
|
+
block_timestamp: string;
|
|
1154
|
+
first_version: string;
|
|
1155
|
+
last_version: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* The transactions in the block in sequential order
|
|
1158
|
+
*/
|
|
1159
|
+
transactions?: Array<TransactionResponse>;
|
|
1160
|
+
};
|
|
1161
|
+
/**
|
|
1162
|
+
* The data needed to generate a View Request payload
|
|
1163
|
+
*/
|
|
1164
|
+
declare type ViewRequestData = {
|
|
1165
|
+
function: MoveStructType;
|
|
1166
|
+
typeArguments?: Array<MoveResourceType>;
|
|
1167
|
+
arguments?: Array<MoveValue>;
|
|
1168
|
+
};
|
|
1169
|
+
/**
|
|
1170
|
+
* View request for the Move view function API
|
|
1171
|
+
*
|
|
1172
|
+
* `type MoveResourceType = ${string}::${string}::${string}`;
|
|
1173
|
+
*/
|
|
1174
|
+
declare type ViewRequest = {
|
|
1175
|
+
function: MoveResourceType;
|
|
1176
|
+
/**
|
|
1177
|
+
* Type arguments of the function
|
|
1178
|
+
*/
|
|
1179
|
+
type_arguments: Array<MoveResourceType>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Arguments of the function
|
|
1182
|
+
*/
|
|
1183
|
+
arguments: Array<MoveValue>;
|
|
1184
|
+
};
|
|
1185
|
+
/**
|
|
1186
|
+
* Table Item request for the GetTableItem API
|
|
1187
|
+
*/
|
|
1188
|
+
declare type TableItemRequest = {
|
|
1189
|
+
key_type: MoveValue;
|
|
1190
|
+
value_type: MoveValue;
|
|
1191
|
+
/**
|
|
1192
|
+
* The value of the table item's key
|
|
1193
|
+
*/
|
|
1194
|
+
key: any;
|
|
1195
|
+
};
|
|
1196
|
+
/**
|
|
1197
|
+
* A list of Authentication Key schemes that are supported by Aptos.
|
|
1198
|
+
*
|
|
1199
|
+
* They are combinations of signing schemes and derive schemes.
|
|
1200
|
+
*/
|
|
1201
|
+
declare type AuthenticationKeyScheme = SigningScheme | DeriveScheme;
|
|
1202
|
+
/**
|
|
1203
|
+
* A list of signing schemes that are supported by Aptos.
|
|
1204
|
+
*
|
|
1205
|
+
* https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L375-L378
|
|
1206
|
+
*/
|
|
1207
|
+
declare enum SigningScheme {
|
|
1208
|
+
/**
|
|
1209
|
+
* For Ed25519PublicKey
|
|
1210
|
+
*/
|
|
1211
|
+
Ed25519 = 0,
|
|
1212
|
+
/**
|
|
1213
|
+
* For MultiEd25519PublicKey
|
|
1214
|
+
*/
|
|
1215
|
+
MultiEd25519 = 1,
|
|
1216
|
+
/**
|
|
1217
|
+
* For Secp256k1 ecdsa
|
|
1218
|
+
*/
|
|
1219
|
+
Secp256k1Ecdsa = 2
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Scheme used for deriving account addresses from other data
|
|
1223
|
+
*/
|
|
1224
|
+
declare enum DeriveScheme {
|
|
1225
|
+
/**
|
|
1226
|
+
* Derives an address using an AUID, used for objects
|
|
1227
|
+
*/
|
|
1228
|
+
DeriveAuid = 251,
|
|
1229
|
+
/**
|
|
1230
|
+
* Derives an address from another object address
|
|
1231
|
+
*/
|
|
1232
|
+
DeriveObjectAddressFromObject = 252,
|
|
1233
|
+
/**
|
|
1234
|
+
* Derives an address from a GUID, used for objects
|
|
1235
|
+
*/
|
|
1236
|
+
DeriveObjectAddressFromGuid = 253,
|
|
1237
|
+
/**
|
|
1238
|
+
* Derives an address from seed bytes, used for named objects
|
|
1239
|
+
*/
|
|
1240
|
+
DeriveObjectAddressFromSeed = 254,
|
|
1241
|
+
/**
|
|
1242
|
+
* Derives an address from seed bytes, used for resource accounts
|
|
1243
|
+
*/
|
|
1244
|
+
DeriveResourceAccountAddress = 255
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
export { AccountAuthenticatorVariant, AccountData, AccountEd25519Signature, AccountMultiEd25519Signature, AccountSecp256k1Signature, AccountSignature, AnyNumber, AptosRequest, AptosSettings, AuthenticationKeyScheme, Block, BlockMetadataTransactionResponse, ClientConfig, DecodedTableData, DeletedTableData, DeriveScheme, DirectWriteSet, EntryFunctionPayloadResponse, Event, EventGuid, GasEstimation, GenesisPayload, GenesisTransactionResponse, GetAccountCoinsDataResponse, GetAccountCollectionsWithOwnedTokenResponse, GetAccountOwnedObjectsResponse, GetAccountOwnedTokensFromCollectionResponse, GetAccountOwnedTokensQueryResponse, GetChainTopUserTransactionsResponse, GetCollectionDataResponse, GetCurrentFungibleAssetBalancesResponse, GetCurrentTokenOwnershipResponse, GetDelegatedStakingActivitiesResponse, GetEventsResponse, GetFungibleAssetActivitiesResponse, GetFungibleAssetMetadataResponse, GetNumberOfDelegatorsResponse, GetOwnedTokensResponse, GetProcessorStatusResponse, GetTokenActivityResponse, GetTokenDataResponse, GraphqlQuery, HexInput, LedgerInfo, LedgerVersion, MimeType, MoveAbility, MoveAddressType, MoveFunction, MoveFunctionGenericTypeParam, MoveFunctionVisibility, MoveModule, MoveModuleBytecode, MoveModuleId, MoveObjectType, MoveOptionType, MoveResource, MoveResourceType, MoveScriptBytecode, MoveStruct, MoveStructField, MoveStructType, MoveType, MoveUint128Type, MoveUint16Type, MoveUint256Type, MoveUint32Type, MoveUint64Type, MoveUint8Type, MoveValue, MultisigPayloadResponse, OrderBy, OrderByValue, PaginationArgs, PendingTransactionResponse, RoleType, ScriptPayloadResponse, ScriptTransactionArgumentVariants, ScriptWriteSet, SigningScheme, StateCheckpointTransactionResponse, TableItemRequest, TokenStandard, TransactionAuthenticatorVariant, TransactionEd25519Signature, TransactionFeePayerSignature, TransactionMultiAgentSignature, TransactionMultiEd25519Signature, TransactionPayloadResponse, TransactionPayloadVariants, TransactionResponse, TransactionResponseType, TransactionSecp256k1Signature, TransactionSignature, TransactionVariants, TypeTagVariants, Uint128, Uint16, Uint256, Uint32, Uint64, Uint8, UserTransactionResponse, ViewRequest, ViewRequestData, WriteSet, WriteSetChange, WriteSetChangeDeleteModule, WriteSetChangeDeleteResource, WriteSetChangeDeleteTableItem, WriteSetChangeWriteModule, WriteSetChangeWriteResource, WriteSetChangeWriteTableItem };
|