@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,737 @@
|
|
|
1
|
+
import * as Types from "./operations";
|
|
2
|
+
|
|
3
|
+
import { GraphQLClient } from "graphql-request";
|
|
4
|
+
import * as Dom from "graphql-request/dist/types.dom";
|
|
5
|
+
export const CurrentTokenOwnershipFieldsFragmentDoc = `
|
|
6
|
+
fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
|
|
7
|
+
token_standard
|
|
8
|
+
token_properties_mutated_v1
|
|
9
|
+
token_data_id
|
|
10
|
+
table_type_v1
|
|
11
|
+
storage_id
|
|
12
|
+
property_version_v1
|
|
13
|
+
owner_address
|
|
14
|
+
last_transaction_version
|
|
15
|
+
last_transaction_timestamp
|
|
16
|
+
is_soulbound_v2
|
|
17
|
+
is_fungible_v2
|
|
18
|
+
amount
|
|
19
|
+
current_token_data {
|
|
20
|
+
collection_id
|
|
21
|
+
description
|
|
22
|
+
is_fungible_v2
|
|
23
|
+
largest_property_version_v1
|
|
24
|
+
last_transaction_timestamp
|
|
25
|
+
last_transaction_version
|
|
26
|
+
maximum
|
|
27
|
+
supply
|
|
28
|
+
token_data_id
|
|
29
|
+
token_name
|
|
30
|
+
token_properties
|
|
31
|
+
token_standard
|
|
32
|
+
token_uri
|
|
33
|
+
current_collection {
|
|
34
|
+
collection_id
|
|
35
|
+
collection_name
|
|
36
|
+
creator_address
|
|
37
|
+
current_supply
|
|
38
|
+
description
|
|
39
|
+
last_transaction_timestamp
|
|
40
|
+
last_transaction_version
|
|
41
|
+
max_supply
|
|
42
|
+
mutable_description
|
|
43
|
+
mutable_uri
|
|
44
|
+
table_handle_v1
|
|
45
|
+
token_standard
|
|
46
|
+
total_minted_v2
|
|
47
|
+
uri
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
export const TokenActivitiesFieldsFragmentDoc = `
|
|
53
|
+
fragment TokenActivitiesFields on token_activities_v2 {
|
|
54
|
+
after_value
|
|
55
|
+
before_value
|
|
56
|
+
entry_function_id_str
|
|
57
|
+
event_account_address
|
|
58
|
+
event_index
|
|
59
|
+
from_address
|
|
60
|
+
is_fungible_v2
|
|
61
|
+
property_version_v1
|
|
62
|
+
to_address
|
|
63
|
+
token_amount
|
|
64
|
+
token_data_id
|
|
65
|
+
token_standard
|
|
66
|
+
transaction_timestamp
|
|
67
|
+
transaction_version
|
|
68
|
+
type
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
export const GetAccountCoinsCount = `
|
|
72
|
+
query getAccountCoinsCount($address: String) {
|
|
73
|
+
current_fungible_asset_balances_aggregate(
|
|
74
|
+
where: {owner_address: {_eq: $address}}
|
|
75
|
+
) {
|
|
76
|
+
aggregate {
|
|
77
|
+
count
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
export const GetAccountCoinsData = `
|
|
83
|
+
query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {
|
|
84
|
+
current_fungible_asset_balances(
|
|
85
|
+
where: $where_condition
|
|
86
|
+
offset: $offset
|
|
87
|
+
limit: $limit
|
|
88
|
+
order_by: $order_by
|
|
89
|
+
) {
|
|
90
|
+
amount
|
|
91
|
+
asset_type
|
|
92
|
+
is_frozen
|
|
93
|
+
is_primary
|
|
94
|
+
last_transaction_timestamp
|
|
95
|
+
last_transaction_version
|
|
96
|
+
owner_address
|
|
97
|
+
storage_id
|
|
98
|
+
token_standard
|
|
99
|
+
metadata {
|
|
100
|
+
token_standard
|
|
101
|
+
symbol
|
|
102
|
+
supply_aggregator_table_key_v1
|
|
103
|
+
supply_aggregator_table_handle_v1
|
|
104
|
+
project_uri
|
|
105
|
+
name
|
|
106
|
+
last_transaction_version
|
|
107
|
+
last_transaction_timestamp
|
|
108
|
+
icon_uri
|
|
109
|
+
decimals
|
|
110
|
+
creator_address
|
|
111
|
+
asset_type
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
export const GetAccountCollectionsWithOwnedTokens = `
|
|
117
|
+
query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {
|
|
118
|
+
current_collection_ownership_v2_view(
|
|
119
|
+
where: $where_condition
|
|
120
|
+
offset: $offset
|
|
121
|
+
limit: $limit
|
|
122
|
+
order_by: $order_by
|
|
123
|
+
) {
|
|
124
|
+
current_collection {
|
|
125
|
+
collection_id
|
|
126
|
+
collection_name
|
|
127
|
+
creator_address
|
|
128
|
+
current_supply
|
|
129
|
+
description
|
|
130
|
+
last_transaction_timestamp
|
|
131
|
+
last_transaction_version
|
|
132
|
+
mutable_description
|
|
133
|
+
max_supply
|
|
134
|
+
mutable_uri
|
|
135
|
+
table_handle_v1
|
|
136
|
+
token_standard
|
|
137
|
+
total_minted_v2
|
|
138
|
+
uri
|
|
139
|
+
}
|
|
140
|
+
collection_id
|
|
141
|
+
collection_name
|
|
142
|
+
collection_uri
|
|
143
|
+
creator_address
|
|
144
|
+
distinct_tokens
|
|
145
|
+
last_transaction_version
|
|
146
|
+
owner_address
|
|
147
|
+
single_token_uri
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
export const GetAccountOwnedObjects = `
|
|
152
|
+
query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {
|
|
153
|
+
current_objects(
|
|
154
|
+
where: $where_condition
|
|
155
|
+
offset: $offset
|
|
156
|
+
limit: $limit
|
|
157
|
+
order_by: $order_by
|
|
158
|
+
) {
|
|
159
|
+
allow_ungated_transfer
|
|
160
|
+
state_key_hash
|
|
161
|
+
owner_address
|
|
162
|
+
object_address
|
|
163
|
+
last_transaction_version
|
|
164
|
+
last_guid_creation_num
|
|
165
|
+
is_deleted
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
export const GetAccountOwnedTokens = `
|
|
170
|
+
query getAccountOwnedTokens($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
171
|
+
current_token_ownerships_v2(
|
|
172
|
+
where: $where_condition
|
|
173
|
+
offset: $offset
|
|
174
|
+
limit: $limit
|
|
175
|
+
order_by: $order_by
|
|
176
|
+
) {
|
|
177
|
+
...CurrentTokenOwnershipFields
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
${CurrentTokenOwnershipFieldsFragmentDoc}`;
|
|
181
|
+
export const GetAccountOwnedTokensByTokenData = `
|
|
182
|
+
query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
183
|
+
current_token_ownerships_v2(
|
|
184
|
+
where: $where_condition
|
|
185
|
+
offset: $offset
|
|
186
|
+
limit: $limit
|
|
187
|
+
order_by: $order_by
|
|
188
|
+
) {
|
|
189
|
+
...CurrentTokenOwnershipFields
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
${CurrentTokenOwnershipFieldsFragmentDoc}`;
|
|
193
|
+
export const GetAccountOwnedTokensFromCollection = `
|
|
194
|
+
query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
195
|
+
current_token_ownerships_v2(
|
|
196
|
+
where: $where_condition
|
|
197
|
+
offset: $offset
|
|
198
|
+
limit: $limit
|
|
199
|
+
order_by: $order_by
|
|
200
|
+
) {
|
|
201
|
+
...CurrentTokenOwnershipFields
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
${CurrentTokenOwnershipFieldsFragmentDoc}`;
|
|
205
|
+
export const GetAccountTokensCount = `
|
|
206
|
+
query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
|
|
207
|
+
current_token_ownerships_v2_aggregate(
|
|
208
|
+
where: $where_condition
|
|
209
|
+
offset: $offset
|
|
210
|
+
limit: $limit
|
|
211
|
+
) {
|
|
212
|
+
aggregate {
|
|
213
|
+
count
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
`;
|
|
218
|
+
export const GetAccountTransactionsCount = `
|
|
219
|
+
query getAccountTransactionsCount($address: String) {
|
|
220
|
+
account_transactions_aggregate(where: {account_address: {_eq: $address}}) {
|
|
221
|
+
aggregate {
|
|
222
|
+
count
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
`;
|
|
227
|
+
export const GetChainTopUserTransactions = `
|
|
228
|
+
query getChainTopUserTransactions($limit: Int) {
|
|
229
|
+
user_transactions(limit: $limit, order_by: {version: desc}) {
|
|
230
|
+
version
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
`;
|
|
234
|
+
export const GetCollectionData = `
|
|
235
|
+
query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
|
|
236
|
+
current_collections_v2(where: $where_condition) {
|
|
237
|
+
collection_id
|
|
238
|
+
collection_name
|
|
239
|
+
creator_address
|
|
240
|
+
current_supply
|
|
241
|
+
description
|
|
242
|
+
last_transaction_timestamp
|
|
243
|
+
last_transaction_version
|
|
244
|
+
max_supply
|
|
245
|
+
mutable_description
|
|
246
|
+
mutable_uri
|
|
247
|
+
table_handle_v1
|
|
248
|
+
token_standard
|
|
249
|
+
total_minted_v2
|
|
250
|
+
uri
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
`;
|
|
254
|
+
export const GetCurrentFungibleAssetBalances = `
|
|
255
|
+
query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {
|
|
256
|
+
current_fungible_asset_balances(
|
|
257
|
+
where: $where_condition
|
|
258
|
+
offset: $offset
|
|
259
|
+
limit: $limit
|
|
260
|
+
) {
|
|
261
|
+
amount
|
|
262
|
+
asset_type
|
|
263
|
+
is_frozen
|
|
264
|
+
is_primary
|
|
265
|
+
last_transaction_timestamp
|
|
266
|
+
last_transaction_version
|
|
267
|
+
owner_address
|
|
268
|
+
storage_id
|
|
269
|
+
token_standard
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
`;
|
|
273
|
+
export const GetDelegatedStakingActivities = `
|
|
274
|
+
query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
|
|
275
|
+
delegated_staking_activities(
|
|
276
|
+
where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}
|
|
277
|
+
) {
|
|
278
|
+
amount
|
|
279
|
+
delegator_address
|
|
280
|
+
event_index
|
|
281
|
+
event_type
|
|
282
|
+
pool_address
|
|
283
|
+
transaction_version
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
`;
|
|
287
|
+
export const GetEvents = `
|
|
288
|
+
query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
|
|
289
|
+
events(
|
|
290
|
+
where: $where_condition
|
|
291
|
+
offset: $offset
|
|
292
|
+
limit: $limit
|
|
293
|
+
order_by: $order_by
|
|
294
|
+
) {
|
|
295
|
+
account_address
|
|
296
|
+
creation_number
|
|
297
|
+
data
|
|
298
|
+
event_index
|
|
299
|
+
sequence_number
|
|
300
|
+
transaction_block_height
|
|
301
|
+
transaction_version
|
|
302
|
+
type
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
`;
|
|
306
|
+
export const GetFungibleAssetActivities = `
|
|
307
|
+
query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
|
|
308
|
+
fungible_asset_activities(
|
|
309
|
+
where: $where_condition
|
|
310
|
+
offset: $offset
|
|
311
|
+
limit: $limit
|
|
312
|
+
) {
|
|
313
|
+
amount
|
|
314
|
+
asset_type
|
|
315
|
+
block_height
|
|
316
|
+
entry_function_id_str
|
|
317
|
+
event_index
|
|
318
|
+
gas_fee_payer_address
|
|
319
|
+
is_frozen
|
|
320
|
+
is_gas_fee
|
|
321
|
+
is_transaction_success
|
|
322
|
+
owner_address
|
|
323
|
+
storage_id
|
|
324
|
+
storage_refund_amount
|
|
325
|
+
token_standard
|
|
326
|
+
transaction_timestamp
|
|
327
|
+
transaction_version
|
|
328
|
+
type
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
`;
|
|
332
|
+
export const GetFungibleAssetMetadata = `
|
|
333
|
+
query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
|
|
334
|
+
fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
|
|
335
|
+
icon_uri
|
|
336
|
+
project_uri
|
|
337
|
+
supply_aggregator_table_handle_v1
|
|
338
|
+
supply_aggregator_table_key_v1
|
|
339
|
+
creator_address
|
|
340
|
+
asset_type
|
|
341
|
+
decimals
|
|
342
|
+
last_transaction_timestamp
|
|
343
|
+
last_transaction_version
|
|
344
|
+
name
|
|
345
|
+
symbol
|
|
346
|
+
token_standard
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
`;
|
|
350
|
+
export const GetNumberOfDelegators = `
|
|
351
|
+
query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp!, $order_by: [num_active_delegator_per_pool_order_by!]) {
|
|
352
|
+
num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
|
|
353
|
+
num_active_delegator
|
|
354
|
+
pool_address
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
`;
|
|
358
|
+
export const GetProcessorStatus = `
|
|
359
|
+
query getProcessorStatus {
|
|
360
|
+
processor_status {
|
|
361
|
+
last_success_version
|
|
362
|
+
processor
|
|
363
|
+
last_updated
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
`;
|
|
367
|
+
export const GetTokenActivity = `
|
|
368
|
+
query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {
|
|
369
|
+
token_activities_v2(
|
|
370
|
+
where: $where_condition
|
|
371
|
+
order_by: $order_by
|
|
372
|
+
offset: $offset
|
|
373
|
+
limit: $limit
|
|
374
|
+
) {
|
|
375
|
+
...TokenActivitiesFields
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
${TokenActivitiesFieldsFragmentDoc}`;
|
|
379
|
+
export const GetCurrentTokenOwnership = `
|
|
380
|
+
query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
381
|
+
current_token_ownerships_v2(
|
|
382
|
+
where: $where_condition
|
|
383
|
+
offset: $offset
|
|
384
|
+
limit: $limit
|
|
385
|
+
order_by: $order_by
|
|
386
|
+
) {
|
|
387
|
+
...CurrentTokenOwnershipFields
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
${CurrentTokenOwnershipFieldsFragmentDoc}`;
|
|
391
|
+
export const GetTokenData = `
|
|
392
|
+
query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {
|
|
393
|
+
current_token_datas_v2(
|
|
394
|
+
where: $where_condition
|
|
395
|
+
offset: $offset
|
|
396
|
+
limit: $limit
|
|
397
|
+
order_by: $order_by
|
|
398
|
+
) {
|
|
399
|
+
collection_id
|
|
400
|
+
description
|
|
401
|
+
is_fungible_v2
|
|
402
|
+
largest_property_version_v1
|
|
403
|
+
last_transaction_timestamp
|
|
404
|
+
last_transaction_version
|
|
405
|
+
maximum
|
|
406
|
+
supply
|
|
407
|
+
token_data_id
|
|
408
|
+
token_name
|
|
409
|
+
token_properties
|
|
410
|
+
token_standard
|
|
411
|
+
token_uri
|
|
412
|
+
current_collection {
|
|
413
|
+
collection_id
|
|
414
|
+
collection_name
|
|
415
|
+
creator_address
|
|
416
|
+
current_supply
|
|
417
|
+
description
|
|
418
|
+
last_transaction_timestamp
|
|
419
|
+
last_transaction_version
|
|
420
|
+
max_supply
|
|
421
|
+
mutable_description
|
|
422
|
+
mutable_uri
|
|
423
|
+
table_handle_v1
|
|
424
|
+
token_standard
|
|
425
|
+
total_minted_v2
|
|
426
|
+
uri
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
`;
|
|
431
|
+
|
|
432
|
+
export type SdkFunctionWrapper = <T>(
|
|
433
|
+
action: (requestHeaders?: Record<string, string>) => Promise<T>,
|
|
434
|
+
operationName: string,
|
|
435
|
+
operationType?: string,
|
|
436
|
+
) => Promise<T>;
|
|
437
|
+
|
|
438
|
+
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action();
|
|
439
|
+
|
|
440
|
+
export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) {
|
|
441
|
+
return {
|
|
442
|
+
getAccountCoinsCount(
|
|
443
|
+
variables?: Types.GetAccountCoinsCountQueryVariables,
|
|
444
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
445
|
+
): Promise<Types.GetAccountCoinsCountQuery> {
|
|
446
|
+
return withWrapper(
|
|
447
|
+
(wrappedRequestHeaders) =>
|
|
448
|
+
client.request<Types.GetAccountCoinsCountQuery>(GetAccountCoinsCount, variables, {
|
|
449
|
+
...requestHeaders,
|
|
450
|
+
...wrappedRequestHeaders,
|
|
451
|
+
}),
|
|
452
|
+
"getAccountCoinsCount",
|
|
453
|
+
"query",
|
|
454
|
+
);
|
|
455
|
+
},
|
|
456
|
+
getAccountCoinsData(
|
|
457
|
+
variables: Types.GetAccountCoinsDataQueryVariables,
|
|
458
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
459
|
+
): Promise<Types.GetAccountCoinsDataQuery> {
|
|
460
|
+
return withWrapper(
|
|
461
|
+
(wrappedRequestHeaders) =>
|
|
462
|
+
client.request<Types.GetAccountCoinsDataQuery>(GetAccountCoinsData, variables, {
|
|
463
|
+
...requestHeaders,
|
|
464
|
+
...wrappedRequestHeaders,
|
|
465
|
+
}),
|
|
466
|
+
"getAccountCoinsData",
|
|
467
|
+
"query",
|
|
468
|
+
);
|
|
469
|
+
},
|
|
470
|
+
getAccountCollectionsWithOwnedTokens(
|
|
471
|
+
variables: Types.GetAccountCollectionsWithOwnedTokensQueryVariables,
|
|
472
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
473
|
+
): Promise<Types.GetAccountCollectionsWithOwnedTokensQuery> {
|
|
474
|
+
return withWrapper(
|
|
475
|
+
(wrappedRequestHeaders) =>
|
|
476
|
+
client.request<Types.GetAccountCollectionsWithOwnedTokensQuery>(
|
|
477
|
+
GetAccountCollectionsWithOwnedTokens,
|
|
478
|
+
variables,
|
|
479
|
+
{ ...requestHeaders, ...wrappedRequestHeaders },
|
|
480
|
+
),
|
|
481
|
+
"getAccountCollectionsWithOwnedTokens",
|
|
482
|
+
"query",
|
|
483
|
+
);
|
|
484
|
+
},
|
|
485
|
+
getAccountOwnedObjects(
|
|
486
|
+
variables?: Types.GetAccountOwnedObjectsQueryVariables,
|
|
487
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
488
|
+
): Promise<Types.GetAccountOwnedObjectsQuery> {
|
|
489
|
+
return withWrapper(
|
|
490
|
+
(wrappedRequestHeaders) =>
|
|
491
|
+
client.request<Types.GetAccountOwnedObjectsQuery>(GetAccountOwnedObjects, variables, {
|
|
492
|
+
...requestHeaders,
|
|
493
|
+
...wrappedRequestHeaders,
|
|
494
|
+
}),
|
|
495
|
+
"getAccountOwnedObjects",
|
|
496
|
+
"query",
|
|
497
|
+
);
|
|
498
|
+
},
|
|
499
|
+
getAccountOwnedTokens(
|
|
500
|
+
variables: Types.GetAccountOwnedTokensQueryVariables,
|
|
501
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
502
|
+
): Promise<Types.GetAccountOwnedTokensQuery> {
|
|
503
|
+
return withWrapper(
|
|
504
|
+
(wrappedRequestHeaders) =>
|
|
505
|
+
client.request<Types.GetAccountOwnedTokensQuery>(GetAccountOwnedTokens, variables, {
|
|
506
|
+
...requestHeaders,
|
|
507
|
+
...wrappedRequestHeaders,
|
|
508
|
+
}),
|
|
509
|
+
"getAccountOwnedTokens",
|
|
510
|
+
"query",
|
|
511
|
+
);
|
|
512
|
+
},
|
|
513
|
+
getAccountOwnedTokensByTokenData(
|
|
514
|
+
variables: Types.GetAccountOwnedTokensByTokenDataQueryVariables,
|
|
515
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
516
|
+
): Promise<Types.GetAccountOwnedTokensByTokenDataQuery> {
|
|
517
|
+
return withWrapper(
|
|
518
|
+
(wrappedRequestHeaders) =>
|
|
519
|
+
client.request<Types.GetAccountOwnedTokensByTokenDataQuery>(GetAccountOwnedTokensByTokenData, variables, {
|
|
520
|
+
...requestHeaders,
|
|
521
|
+
...wrappedRequestHeaders,
|
|
522
|
+
}),
|
|
523
|
+
"getAccountOwnedTokensByTokenData",
|
|
524
|
+
"query",
|
|
525
|
+
);
|
|
526
|
+
},
|
|
527
|
+
getAccountOwnedTokensFromCollection(
|
|
528
|
+
variables: Types.GetAccountOwnedTokensFromCollectionQueryVariables,
|
|
529
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
530
|
+
): Promise<Types.GetAccountOwnedTokensFromCollectionQuery> {
|
|
531
|
+
return withWrapper(
|
|
532
|
+
(wrappedRequestHeaders) =>
|
|
533
|
+
client.request<Types.GetAccountOwnedTokensFromCollectionQuery>(
|
|
534
|
+
GetAccountOwnedTokensFromCollection,
|
|
535
|
+
variables,
|
|
536
|
+
{ ...requestHeaders, ...wrappedRequestHeaders },
|
|
537
|
+
),
|
|
538
|
+
"getAccountOwnedTokensFromCollection",
|
|
539
|
+
"query",
|
|
540
|
+
);
|
|
541
|
+
},
|
|
542
|
+
getAccountTokensCount(
|
|
543
|
+
variables?: Types.GetAccountTokensCountQueryVariables,
|
|
544
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
545
|
+
): Promise<Types.GetAccountTokensCountQuery> {
|
|
546
|
+
return withWrapper(
|
|
547
|
+
(wrappedRequestHeaders) =>
|
|
548
|
+
client.request<Types.GetAccountTokensCountQuery>(GetAccountTokensCount, variables, {
|
|
549
|
+
...requestHeaders,
|
|
550
|
+
...wrappedRequestHeaders,
|
|
551
|
+
}),
|
|
552
|
+
"getAccountTokensCount",
|
|
553
|
+
"query",
|
|
554
|
+
);
|
|
555
|
+
},
|
|
556
|
+
getAccountTransactionsCount(
|
|
557
|
+
variables?: Types.GetAccountTransactionsCountQueryVariables,
|
|
558
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
559
|
+
): Promise<Types.GetAccountTransactionsCountQuery> {
|
|
560
|
+
return withWrapper(
|
|
561
|
+
(wrappedRequestHeaders) =>
|
|
562
|
+
client.request<Types.GetAccountTransactionsCountQuery>(GetAccountTransactionsCount, variables, {
|
|
563
|
+
...requestHeaders,
|
|
564
|
+
...wrappedRequestHeaders,
|
|
565
|
+
}),
|
|
566
|
+
"getAccountTransactionsCount",
|
|
567
|
+
"query",
|
|
568
|
+
);
|
|
569
|
+
},
|
|
570
|
+
getChainTopUserTransactions(
|
|
571
|
+
variables?: Types.GetChainTopUserTransactionsQueryVariables,
|
|
572
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
573
|
+
): Promise<Types.GetChainTopUserTransactionsQuery> {
|
|
574
|
+
return withWrapper(
|
|
575
|
+
(wrappedRequestHeaders) =>
|
|
576
|
+
client.request<Types.GetChainTopUserTransactionsQuery>(GetChainTopUserTransactions, variables, {
|
|
577
|
+
...requestHeaders,
|
|
578
|
+
...wrappedRequestHeaders,
|
|
579
|
+
}),
|
|
580
|
+
"getChainTopUserTransactions",
|
|
581
|
+
"query",
|
|
582
|
+
);
|
|
583
|
+
},
|
|
584
|
+
getCollectionData(
|
|
585
|
+
variables: Types.GetCollectionDataQueryVariables,
|
|
586
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
587
|
+
): Promise<Types.GetCollectionDataQuery> {
|
|
588
|
+
return withWrapper(
|
|
589
|
+
(wrappedRequestHeaders) =>
|
|
590
|
+
client.request<Types.GetCollectionDataQuery>(GetCollectionData, variables, {
|
|
591
|
+
...requestHeaders,
|
|
592
|
+
...wrappedRequestHeaders,
|
|
593
|
+
}),
|
|
594
|
+
"getCollectionData",
|
|
595
|
+
"query",
|
|
596
|
+
);
|
|
597
|
+
},
|
|
598
|
+
getCurrentFungibleAssetBalances(
|
|
599
|
+
variables?: Types.GetCurrentFungibleAssetBalancesQueryVariables,
|
|
600
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
601
|
+
): Promise<Types.GetCurrentFungibleAssetBalancesQuery> {
|
|
602
|
+
return withWrapper(
|
|
603
|
+
(wrappedRequestHeaders) =>
|
|
604
|
+
client.request<Types.GetCurrentFungibleAssetBalancesQuery>(GetCurrentFungibleAssetBalances, variables, {
|
|
605
|
+
...requestHeaders,
|
|
606
|
+
...wrappedRequestHeaders,
|
|
607
|
+
}),
|
|
608
|
+
"getCurrentFungibleAssetBalances",
|
|
609
|
+
"query",
|
|
610
|
+
);
|
|
611
|
+
},
|
|
612
|
+
getDelegatedStakingActivities(
|
|
613
|
+
variables?: Types.GetDelegatedStakingActivitiesQueryVariables,
|
|
614
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
615
|
+
): Promise<Types.GetDelegatedStakingActivitiesQuery> {
|
|
616
|
+
return withWrapper(
|
|
617
|
+
(wrappedRequestHeaders) =>
|
|
618
|
+
client.request<Types.GetDelegatedStakingActivitiesQuery>(GetDelegatedStakingActivities, variables, {
|
|
619
|
+
...requestHeaders,
|
|
620
|
+
...wrappedRequestHeaders,
|
|
621
|
+
}),
|
|
622
|
+
"getDelegatedStakingActivities",
|
|
623
|
+
"query",
|
|
624
|
+
);
|
|
625
|
+
},
|
|
626
|
+
getEvents(
|
|
627
|
+
variables?: Types.GetEventsQueryVariables,
|
|
628
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
629
|
+
): Promise<Types.GetEventsQuery> {
|
|
630
|
+
return withWrapper(
|
|
631
|
+
(wrappedRequestHeaders) =>
|
|
632
|
+
client.request<Types.GetEventsQuery>(GetEvents, variables, { ...requestHeaders, ...wrappedRequestHeaders }),
|
|
633
|
+
"getEvents",
|
|
634
|
+
"query",
|
|
635
|
+
);
|
|
636
|
+
},
|
|
637
|
+
getFungibleAssetActivities(
|
|
638
|
+
variables?: Types.GetFungibleAssetActivitiesQueryVariables,
|
|
639
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
640
|
+
): Promise<Types.GetFungibleAssetActivitiesQuery> {
|
|
641
|
+
return withWrapper(
|
|
642
|
+
(wrappedRequestHeaders) =>
|
|
643
|
+
client.request<Types.GetFungibleAssetActivitiesQuery>(GetFungibleAssetActivities, variables, {
|
|
644
|
+
...requestHeaders,
|
|
645
|
+
...wrappedRequestHeaders,
|
|
646
|
+
}),
|
|
647
|
+
"getFungibleAssetActivities",
|
|
648
|
+
"query",
|
|
649
|
+
);
|
|
650
|
+
},
|
|
651
|
+
getFungibleAssetMetadata(
|
|
652
|
+
variables?: Types.GetFungibleAssetMetadataQueryVariables,
|
|
653
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
654
|
+
): Promise<Types.GetFungibleAssetMetadataQuery> {
|
|
655
|
+
return withWrapper(
|
|
656
|
+
(wrappedRequestHeaders) =>
|
|
657
|
+
client.request<Types.GetFungibleAssetMetadataQuery>(GetFungibleAssetMetadata, variables, {
|
|
658
|
+
...requestHeaders,
|
|
659
|
+
...wrappedRequestHeaders,
|
|
660
|
+
}),
|
|
661
|
+
"getFungibleAssetMetadata",
|
|
662
|
+
"query",
|
|
663
|
+
);
|
|
664
|
+
},
|
|
665
|
+
getNumberOfDelegators(
|
|
666
|
+
variables: Types.GetNumberOfDelegatorsQueryVariables,
|
|
667
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
668
|
+
): Promise<Types.GetNumberOfDelegatorsQuery> {
|
|
669
|
+
return withWrapper(
|
|
670
|
+
(wrappedRequestHeaders) =>
|
|
671
|
+
client.request<Types.GetNumberOfDelegatorsQuery>(GetNumberOfDelegators, variables, {
|
|
672
|
+
...requestHeaders,
|
|
673
|
+
...wrappedRequestHeaders,
|
|
674
|
+
}),
|
|
675
|
+
"getNumberOfDelegators",
|
|
676
|
+
"query",
|
|
677
|
+
);
|
|
678
|
+
},
|
|
679
|
+
getProcessorStatus(
|
|
680
|
+
variables?: Types.GetProcessorStatusQueryVariables,
|
|
681
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
682
|
+
): Promise<Types.GetProcessorStatusQuery> {
|
|
683
|
+
return withWrapper(
|
|
684
|
+
(wrappedRequestHeaders) =>
|
|
685
|
+
client.request<Types.GetProcessorStatusQuery>(GetProcessorStatus, variables, {
|
|
686
|
+
...requestHeaders,
|
|
687
|
+
...wrappedRequestHeaders,
|
|
688
|
+
}),
|
|
689
|
+
"getProcessorStatus",
|
|
690
|
+
"query",
|
|
691
|
+
);
|
|
692
|
+
},
|
|
693
|
+
getTokenActivity(
|
|
694
|
+
variables: Types.GetTokenActivityQueryVariables,
|
|
695
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
696
|
+
): Promise<Types.GetTokenActivityQuery> {
|
|
697
|
+
return withWrapper(
|
|
698
|
+
(wrappedRequestHeaders) =>
|
|
699
|
+
client.request<Types.GetTokenActivityQuery>(GetTokenActivity, variables, {
|
|
700
|
+
...requestHeaders,
|
|
701
|
+
...wrappedRequestHeaders,
|
|
702
|
+
}),
|
|
703
|
+
"getTokenActivity",
|
|
704
|
+
"query",
|
|
705
|
+
);
|
|
706
|
+
},
|
|
707
|
+
getCurrentTokenOwnership(
|
|
708
|
+
variables: Types.GetCurrentTokenOwnershipQueryVariables,
|
|
709
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
710
|
+
): Promise<Types.GetCurrentTokenOwnershipQuery> {
|
|
711
|
+
return withWrapper(
|
|
712
|
+
(wrappedRequestHeaders) =>
|
|
713
|
+
client.request<Types.GetCurrentTokenOwnershipQuery>(GetCurrentTokenOwnership, variables, {
|
|
714
|
+
...requestHeaders,
|
|
715
|
+
...wrappedRequestHeaders,
|
|
716
|
+
}),
|
|
717
|
+
"getCurrentTokenOwnership",
|
|
718
|
+
"query",
|
|
719
|
+
);
|
|
720
|
+
},
|
|
721
|
+
getTokenData(
|
|
722
|
+
variables?: Types.GetTokenDataQueryVariables,
|
|
723
|
+
requestHeaders?: Dom.RequestInit["headers"],
|
|
724
|
+
): Promise<Types.GetTokenDataQuery> {
|
|
725
|
+
return withWrapper(
|
|
726
|
+
(wrappedRequestHeaders) =>
|
|
727
|
+
client.request<Types.GetTokenDataQuery>(GetTokenData, variables, {
|
|
728
|
+
...requestHeaders,
|
|
729
|
+
...wrappedRequestHeaders,
|
|
730
|
+
}),
|
|
731
|
+
"getTokenData",
|
|
732
|
+
"query",
|
|
733
|
+
);
|
|
734
|
+
},
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
export type Sdk = ReturnType<typeof getSdk>;
|