@typus/typus-perp-sdk 1.1.29 → 1.1.30-codegen
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/sentio.js +604 -538
- package/dist/src/client.d.ts +27 -0
- package/dist/src/client.js +108 -0
- package/dist/src/fetch.d.ts +160 -34
- package/dist/src/fetch.js +365 -665
- package/dist/src/generated/typus_perp/admin.d.ts +117 -0
- package/dist/src/generated/typus_perp/admin.js +110 -0
- package/dist/src/generated/typus_perp/competition.d.ts +22 -0
- package/dist/src/generated/typus_perp/competition.js +58 -0
- package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/typus_perp/deps/std/type_name.js +25 -0
- package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/typus_perp/deps/sui/balance.js +20 -0
- package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
- package/dist/src/generated/typus_perp/deps/sui/object.js +16 -0
- package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +19 -0
- package/dist/src/generated/typus_perp/deps/sui/object_table.js +59 -0
- package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +18 -0
- package/dist/src/generated/typus_perp/deps/sui/vec_set.js +25 -0
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +30 -0
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +67 -0
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +32 -0
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +71 -0
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +23 -0
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +61 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +59 -0
- package/dist/src/generated/typus_perp/escrow.js +76 -0
- package/dist/src/generated/typus_perp/lending.d.ts +47 -0
- package/dist/src/generated/typus_perp/lending.js +50 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +2327 -0
- package/dist/src/generated/typus_perp/lp_pool.js +1956 -0
- package/dist/src/generated/typus_perp/math.d.ts +95 -0
- package/dist/src/generated/typus_perp/math.js +97 -0
- package/dist/src/generated/typus_perp/position.d.ts +234 -0
- package/dist/src/generated/typus_perp/position.js +204 -0
- package/dist/src/generated/typus_perp/symbol.d.ts +18 -0
- package/dist/src/generated/typus_perp/symbol.js +55 -0
- package/dist/src/generated/typus_perp/tlp.d.ts +13 -0
- package/dist/src/generated/typus_perp/tlp.js +56 -0
- package/dist/src/generated/typus_perp/trading.d.ts +2486 -0
- package/dist/src/generated/typus_perp/trading.js +2476 -0
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +13 -0
- package/dist/src/{_framework/init-loader.js → generated/typus_perp/treasury_caps.js} +17 -10
- package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
- package/dist/src/generated/typus_perp/user_account.js +72 -0
- package/dist/src/generated/typus_stake_pool/admin.d.ts +100 -0
- package/dist/src/generated/typus_stake_pool/admin.js +91 -0
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +25 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/object.js +16 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +30 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +37 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +18 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +25 -0
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +1023 -0
- package/dist/src/generated/typus_stake_pool/stake_pool.js +918 -0
- package/dist/src/generated/utils/index.d.ts +11 -0
- package/dist/src/generated/utils/index.js +135 -0
- package/dist/src/grpc/graphql.d.ts +26 -0
- package/dist/src/grpc/graphql.js +126 -0
- package/dist/src/grpc/grpc.d.ts +1 -0
- package/dist/src/grpc/grpc.js +38 -0
- package/dist/src/grpc/ledgerService.js +64 -0
- package/dist/src/grpc/liveDataService.d.ts +0 -0
- package/dist/src/grpc/liveDataService.js +49 -0
- package/dist/src/index.d.ts +1 -4
- package/dist/src/index.js +21 -39
- package/dist/src/user/history.js +611 -680
- package/dist/src/user/order.d.ts +11 -11
- package/dist/src/user/order.js +171 -302
- package/dist/src/user/orderWithBidReceipt.d.ts +8 -5
- package/dist/src/user/orderWithBidReceipt.js +127 -225
- package/dist/src/user/tlp.d.ts +32 -23
- package/dist/src/user/tlp.js +316 -468
- package/package.json +12 -3
- package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -92
- package/dist/src/_dependencies/source/0x1/ascii/structs.js +0 -398
- package/dist/src/_dependencies/source/0x1/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0x1/index.js +0 -6
- package/dist/src/_dependencies/source/0x1/option/structs.d.ts +0 -52
- package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
- package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0x1/string/structs.js +0 -256
- package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +0 -53
- package/dist/src/_dependencies/source/0x1/type-name/structs.js +0 -223
- package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -61
- package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
- package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
- package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -460
- package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
- package/dist/src/_dependencies/source/0x2/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0x2/index.js +0 -6
- package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -153
- package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
- package/dist/src/_dependencies/source/0x2/object/structs.d.ts +0 -92
- package/dist/src/_dependencies/source/0x2/object/structs.js +0 -364
- package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +0 -61
- package/dist/src/_dependencies/source/0x2/object-table/structs.js +0 -248
- package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
- package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -61
- package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
- package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -68
- package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
- package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -449
- package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
- package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -370
- package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
- package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -53
- package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
- package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +0 -111
- package/dist/src/_dependencies/source/0x2/vec-map/structs.js +0 -446
- package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +0 -51
- package/dist/src/_dependencies/source/0x2/vec-set/structs.js +0 -270
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +0 -489
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +0 -1084
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +0 -147
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +0 -456
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +0 -239
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -405
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +0 -899
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +0 -8
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +0 -11
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +0 -102
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +0 -227
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +0 -632
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +0 -699
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +0 -1459
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +0 -161
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +0 -438
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +0 -147
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +0 -430
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +0 -1071
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +0 -2261
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +0 -279
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -328
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +0 -263
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +0 -347
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +0 -591
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +0 -73
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +0 -258
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +0 -876
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +0 -222
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +0 -6
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +0 -89
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +0 -155
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +0 -444
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +0 -2386
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +0 -4952
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +0 -446
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +0 -844
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +0 -6
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +0 -9
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +0 -69
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +0 -94
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +0 -376
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +0 -454
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +0 -881
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +0 -68
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +0 -274
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +0 -1117
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +0 -2387
- package/dist/src/_framework/init-loader.d.ts +0 -2
- package/dist/src/_framework/loader.d.ts +0 -17
- package/dist/src/_framework/loader.js +0 -108
- package/dist/src/_framework/reified.d.ts +0 -108
- package/dist/src/_framework/reified.js +0 -237
- package/dist/src/_framework/util.d.ts +0 -35
- package/dist/src/_framework/util.js +0 -396
- package/dist/src/_framework/vector.d.ts +0 -35
- package/dist/src/_framework/vector.js +0 -112
- package/dist/src/pyth.js +0 -1
- package/dist/src/typus_perp/admin/functions.d.ts +0 -59
- package/dist/src/typus_perp/admin/functions.js +0 -122
- package/dist/src/typus_perp/admin/structs.d.ts +0 -529
- package/dist/src/typus_perp/admin/structs.js +0 -1065
- package/dist/src/typus_perp/competition/functions.d.ts +0 -24
- package/dist/src/typus_perp/competition/functions.js +0 -38
- package/dist/src/typus_perp/competition/structs.d.ts +0 -92
- package/dist/src/typus_perp/competition/structs.js +0 -288
- package/dist/src/typus_perp/error/functions.d.ts +0 -73
- package/dist/src/typus_perp/error/functions.js +0 -363
- package/dist/src/typus_perp/escrow/functions.d.ts +0 -17
- package/dist/src/typus_perp/escrow/functions.js +0 -36
- package/dist/src/typus_perp/escrow/structs.d.ts +0 -172
- package/dist/src/typus_perp/escrow/structs.js +0 -324
- package/dist/src/typus_perp/index.d.ts +0 -1
- package/dist/src/typus_perp/index.js +0 -7
- package/dist/src/typus_perp/init.d.ts +0 -2
- package/dist/src/typus_perp/init.js +0 -118
- package/dist/src/typus_perp/lending/functions.d.ts +0 -15
- package/dist/src/typus_perp/lending/functions.js +0 -22
- package/dist/src/typus_perp/lp-pool/functions.d.ts +0 -460
- package/dist/src/typus_perp/lp-pool/functions.js +0 -732
- package/dist/src/typus_perp/lp-pool/structs.d.ts +0 -4268
- package/dist/src/typus_perp/lp-pool/structs.js +0 -6789
- package/dist/src/typus_perp/math/functions.d.ts +0 -29
- package/dist/src/typus_perp/math/functions.js +0 -61
- package/dist/src/typus_perp/position/functions.d.ts +0 -379
- package/dist/src/typus_perp/position/functions.js +0 -713
- package/dist/src/typus_perp/position/structs.d.ts +0 -1064
- package/dist/src/typus_perp/position/structs.js +0 -1450
- package/dist/src/typus_perp/symbol/functions.d.ts +0 -9
- package/dist/src/typus_perp/symbol/functions.js +0 -24
- package/dist/src/typus_perp/symbol/structs.d.ts +0 -81
- package/dist/src/typus_perp/symbol/structs.js +0 -235
- package/dist/src/typus_perp/tlp/functions.d.ts +0 -19
- package/dist/src/typus_perp/tlp/functions.js +0 -40
- package/dist/src/typus_perp/tlp/structs.d.ts +0 -97
- package/dist/src/typus_perp/tlp/structs.js +0 -365
- package/dist/src/typus_perp/token-interface/functions.d.ts +0 -11
- package/dist/src/typus_perp/token-interface/functions.js +0 -22
- package/dist/src/typus_perp/trading/functions.d.ts +0 -812
- package/dist/src/typus_perp/trading/functions.js +0 -1218
- package/dist/src/typus_perp/trading/structs.d.ts +0 -3613
- package/dist/src/typus_perp/trading/structs.js +0 -5813
- package/dist/src/typus_perp/treasury-caps/functions.d.ts +0 -9
- package/dist/src/typus_perp/treasury-caps/functions.js +0 -36
- package/dist/src/typus_perp/treasury-caps/structs.d.ts +0 -55
- package/dist/src/typus_perp/treasury-caps/structs.js +0 -223
- package/dist/src/typus_perp/user-account/functions.d.ts +0 -36
- package/dist/src/typus_perp/user-account/functions.js +0 -70
- package/dist/src/typus_perp/user-account/structs.d.ts +0 -168
- package/dist/src/typus_perp/user-account/structs.js +0 -448
- package/dist/src/typus_stake_pool/admin/functions.d.ts +0 -49
- package/dist/src/typus_stake_pool/admin/functions.js +0 -105
- package/dist/src/typus_stake_pool/admin/structs.d.ts +0 -413
- package/dist/src/typus_stake_pool/admin/structs.js +0 -789
- package/dist/src/typus_stake_pool/index.d.ts +0 -1
- package/dist/src/typus_stake_pool/index.js +0 -7
- package/dist/src/typus_stake_pool/init.d.ts +0 -2
- package/dist/src/typus_stake_pool/init.js +0 -69
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -229
- package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -380
- package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +0 -2477
- package/dist/src/typus_stake_pool/stake-pool/structs.js +0 -4653
- /package/dist/src/{pyth.d.ts → grpc/ledgerService.d.ts} +0 -0
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
-
if (ar || !(i in from)) {
|
|
68
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
-
ar[i] = from[i];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
|
-
};
|
|
74
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
exports.TypeName = void 0;
|
|
76
|
-
exports.isTypeName = isTypeName;
|
|
77
|
-
var reified_1 = require("../../../../_framework/reified");
|
|
78
|
-
var util_1 = require("../../../../_framework/util");
|
|
79
|
-
var structs_1 = require("../ascii/structs");
|
|
80
|
-
var index_1 = require("../index");
|
|
81
|
-
var bcs_1 = require("@mysten/sui/bcs");
|
|
82
|
-
var utils_1 = require("@mysten/sui/utils");
|
|
83
|
-
/* ============================== TypeName =============================== */
|
|
84
|
-
function isTypeName(type) {
|
|
85
|
-
type = (0, util_1.compressSuiType)(type);
|
|
86
|
-
return type === "".concat(index_1.PKG_V13, "::type_name::TypeName");
|
|
87
|
-
}
|
|
88
|
-
var TypeName = /** @class */ (function () {
|
|
89
|
-
function TypeName(typeArgs, fields) {
|
|
90
|
-
this.__StructClass = true;
|
|
91
|
-
this.$typeName = TypeName.$typeName;
|
|
92
|
-
this.$isPhantom = TypeName.$isPhantom;
|
|
93
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TypeName.$typeName], __read(typeArgs), false));
|
|
94
|
-
this.$typeArgs = typeArgs;
|
|
95
|
-
this.name = fields.name;
|
|
96
|
-
}
|
|
97
|
-
TypeName.reified = function () {
|
|
98
|
-
var _this = this;
|
|
99
|
-
return {
|
|
100
|
-
typeName: TypeName.$typeName,
|
|
101
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TypeName.$typeName], [], false)),
|
|
102
|
-
typeArgs: [],
|
|
103
|
-
isPhantom: TypeName.$isPhantom,
|
|
104
|
-
reifiedTypeArgs: [],
|
|
105
|
-
fromFields: function (fields) { return TypeName.fromFields(fields); },
|
|
106
|
-
fromFieldsWithTypes: function (item) { return TypeName.fromFieldsWithTypes(item); },
|
|
107
|
-
fromBcs: function (data) { return TypeName.fromBcs(data); },
|
|
108
|
-
bcs: TypeName.bcs,
|
|
109
|
-
fromJSONField: function (field) { return TypeName.fromJSONField(field); },
|
|
110
|
-
fromJSON: function (json) { return TypeName.fromJSON(json); },
|
|
111
|
-
fromSuiParsedData: function (content) { return TypeName.fromSuiParsedData(content); },
|
|
112
|
-
fromSuiObjectData: function (content) { return TypeName.fromSuiObjectData(content); },
|
|
113
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
114
|
-
return [2 /*return*/, TypeName.fetch(client, id)];
|
|
115
|
-
}); }); },
|
|
116
|
-
new: function (fields) {
|
|
117
|
-
return new TypeName([], fields);
|
|
118
|
-
},
|
|
119
|
-
kind: "StructClassReified",
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
Object.defineProperty(TypeName, "r", {
|
|
123
|
-
get: function () {
|
|
124
|
-
return TypeName.reified();
|
|
125
|
-
},
|
|
126
|
-
enumerable: false,
|
|
127
|
-
configurable: true
|
|
128
|
-
});
|
|
129
|
-
TypeName.phantom = function () {
|
|
130
|
-
return (0, reified_1.phantom)(TypeName.reified());
|
|
131
|
-
};
|
|
132
|
-
Object.defineProperty(TypeName, "p", {
|
|
133
|
-
get: function () {
|
|
134
|
-
return TypeName.phantom();
|
|
135
|
-
},
|
|
136
|
-
enumerable: false,
|
|
137
|
-
configurable: true
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(TypeName, "bcs", {
|
|
140
|
-
get: function () {
|
|
141
|
-
return bcs_1.bcs.struct("TypeName", {
|
|
142
|
-
name: structs_1.String.bcs,
|
|
143
|
-
});
|
|
144
|
-
},
|
|
145
|
-
enumerable: false,
|
|
146
|
-
configurable: true
|
|
147
|
-
});
|
|
148
|
-
TypeName.fromFields = function (fields) {
|
|
149
|
-
return TypeName.reified().new({ name: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.name) });
|
|
150
|
-
};
|
|
151
|
-
TypeName.fromFieldsWithTypes = function (item) {
|
|
152
|
-
if (!isTypeName(item.type)) {
|
|
153
|
-
throw new Error("not a TypeName type");
|
|
154
|
-
}
|
|
155
|
-
return TypeName.reified().new({ name: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.name) });
|
|
156
|
-
};
|
|
157
|
-
TypeName.fromBcs = function (data) {
|
|
158
|
-
return TypeName.fromFields(TypeName.bcs.parse(data));
|
|
159
|
-
};
|
|
160
|
-
TypeName.prototype.toJSONField = function () {
|
|
161
|
-
return {
|
|
162
|
-
name: this.name,
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
TypeName.prototype.toJSON = function () {
|
|
166
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
167
|
-
};
|
|
168
|
-
TypeName.fromJSONField = function (field) {
|
|
169
|
-
return TypeName.reified().new({ name: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.name) });
|
|
170
|
-
};
|
|
171
|
-
TypeName.fromJSON = function (json) {
|
|
172
|
-
if (json.$typeName !== TypeName.$typeName) {
|
|
173
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
174
|
-
}
|
|
175
|
-
return TypeName.fromJSONField(json);
|
|
176
|
-
};
|
|
177
|
-
TypeName.fromSuiParsedData = function (content) {
|
|
178
|
-
if (content.dataType !== "moveObject") {
|
|
179
|
-
throw new Error("not an object");
|
|
180
|
-
}
|
|
181
|
-
if (!isTypeName(content.type)) {
|
|
182
|
-
throw new Error("object at ".concat(content.fields.id, " is not a TypeName object"));
|
|
183
|
-
}
|
|
184
|
-
return TypeName.fromFieldsWithTypes(content);
|
|
185
|
-
};
|
|
186
|
-
TypeName.fromSuiObjectData = function (data) {
|
|
187
|
-
if (data.bcs) {
|
|
188
|
-
if (data.bcs.dataType !== "moveObject" || !isTypeName(data.bcs.type)) {
|
|
189
|
-
throw new Error("object at is not a TypeName object");
|
|
190
|
-
}
|
|
191
|
-
return TypeName.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
192
|
-
}
|
|
193
|
-
if (data.content) {
|
|
194
|
-
return TypeName.fromSuiParsedData(data.content);
|
|
195
|
-
}
|
|
196
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
197
|
-
};
|
|
198
|
-
TypeName.fetch = function (client, id) {
|
|
199
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
-
var res;
|
|
201
|
-
var _a, _b;
|
|
202
|
-
return __generator(this, function (_c) {
|
|
203
|
-
switch (_c.label) {
|
|
204
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
205
|
-
case 1:
|
|
206
|
-
res = _c.sent();
|
|
207
|
-
if (res.error) {
|
|
208
|
-
throw new Error("error fetching TypeName object at id ".concat(id, ": ").concat(res.error.code));
|
|
209
|
-
}
|
|
210
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTypeName(res.data.bcs.type)) {
|
|
211
|
-
throw new Error("object at id ".concat(id, " is not a TypeName object"));
|
|
212
|
-
}
|
|
213
|
-
return [2 /*return*/, TypeName.fromSuiObjectData(res.data)];
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
|
-
TypeName.$typeName = "".concat(index_1.PKG_V13, "::type_name::TypeName");
|
|
219
|
-
TypeName.$numTypeParams = 0;
|
|
220
|
-
TypeName.$isPhantom = [];
|
|
221
|
-
return TypeName;
|
|
222
|
-
}());
|
|
223
|
-
exports.TypeName = TypeName;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
|
-
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import { PKG_V26 } from "../index";
|
|
4
|
-
import { UID } from "../object/structs";
|
|
5
|
-
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
6
|
-
export declare function isBag(type: string): boolean;
|
|
7
|
-
export interface BagFields {
|
|
8
|
-
id: ToField<UID>;
|
|
9
|
-
size: ToField<"u64">;
|
|
10
|
-
}
|
|
11
|
-
export type BagReified = Reified<Bag, BagFields>;
|
|
12
|
-
export declare class Bag implements StructClass {
|
|
13
|
-
__StructClass: true;
|
|
14
|
-
static readonly $typeName = "0x2::bag::Bag";
|
|
15
|
-
static readonly $numTypeParams = 0;
|
|
16
|
-
static readonly $isPhantom: readonly [];
|
|
17
|
-
readonly $typeName = "0x2::bag::Bag";
|
|
18
|
-
readonly $fullTypeName: `${typeof PKG_V26}::bag::Bag`;
|
|
19
|
-
readonly $typeArgs: [];
|
|
20
|
-
readonly $isPhantom: readonly [];
|
|
21
|
-
readonly id: ToField<UID>;
|
|
22
|
-
readonly size: ToField<"u64">;
|
|
23
|
-
private constructor();
|
|
24
|
-
static reified(): BagReified;
|
|
25
|
-
static get r(): import("../../../../_framework/reified").StructClassReified<Bag, BagFields>;
|
|
26
|
-
static phantom(): PhantomReified<ToTypeStr<Bag>>;
|
|
27
|
-
static get p(): PhantomReified<"0x2::bag::Bag">;
|
|
28
|
-
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
29
|
-
id: {
|
|
30
|
-
id: {
|
|
31
|
-
bytes: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
size: string;
|
|
35
|
-
}, {
|
|
36
|
-
id: {
|
|
37
|
-
id: {
|
|
38
|
-
bytes: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
size: string | number | bigint;
|
|
42
|
-
}>;
|
|
43
|
-
static fromFields(fields: Record<string, any>): Bag;
|
|
44
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): Bag;
|
|
45
|
-
static fromBcs(data: Uint8Array): Bag;
|
|
46
|
-
toJSONField(): {
|
|
47
|
-
id: string;
|
|
48
|
-
size: string;
|
|
49
|
-
};
|
|
50
|
-
toJSON(): {
|
|
51
|
-
id: string;
|
|
52
|
-
size: string;
|
|
53
|
-
$typeName: string;
|
|
54
|
-
$typeArgs: [];
|
|
55
|
-
};
|
|
56
|
-
static fromJSONField(field: any): Bag;
|
|
57
|
-
static fromJSON(json: Record<string, any>): Bag;
|
|
58
|
-
static fromSuiParsedData(content: SuiParsedData): Bag;
|
|
59
|
-
static fromSuiObjectData(data: SuiObjectData): Bag;
|
|
60
|
-
static fetch(client: SuiClient, id: string): Promise<Bag>;
|
|
61
|
-
}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
-
if (ar || !(i in from)) {
|
|
68
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
-
ar[i] = from[i];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
|
-
};
|
|
74
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
exports.Bag = void 0;
|
|
76
|
-
exports.isBag = isBag;
|
|
77
|
-
var reified_1 = require("../../../../_framework/reified");
|
|
78
|
-
var util_1 = require("../../../../_framework/util");
|
|
79
|
-
var index_1 = require("../index");
|
|
80
|
-
var structs_1 = require("../object/structs");
|
|
81
|
-
var bcs_1 = require("@mysten/sui/bcs");
|
|
82
|
-
var utils_1 = require("@mysten/sui/utils");
|
|
83
|
-
/* ============================== Bag =============================== */
|
|
84
|
-
function isBag(type) {
|
|
85
|
-
type = (0, util_1.compressSuiType)(type);
|
|
86
|
-
return type === "".concat(index_1.PKG_V26, "::bag::Bag");
|
|
87
|
-
}
|
|
88
|
-
var Bag = /** @class */ (function () {
|
|
89
|
-
function Bag(typeArgs, fields) {
|
|
90
|
-
this.__StructClass = true;
|
|
91
|
-
this.$typeName = Bag.$typeName;
|
|
92
|
-
this.$isPhantom = Bag.$isPhantom;
|
|
93
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Bag.$typeName], __read(typeArgs), false));
|
|
94
|
-
this.$typeArgs = typeArgs;
|
|
95
|
-
this.id = fields.id;
|
|
96
|
-
this.size = fields.size;
|
|
97
|
-
}
|
|
98
|
-
Bag.reified = function () {
|
|
99
|
-
var _this = this;
|
|
100
|
-
return {
|
|
101
|
-
typeName: Bag.$typeName,
|
|
102
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Bag.$typeName], [], false)),
|
|
103
|
-
typeArgs: [],
|
|
104
|
-
isPhantom: Bag.$isPhantom,
|
|
105
|
-
reifiedTypeArgs: [],
|
|
106
|
-
fromFields: function (fields) { return Bag.fromFields(fields); },
|
|
107
|
-
fromFieldsWithTypes: function (item) { return Bag.fromFieldsWithTypes(item); },
|
|
108
|
-
fromBcs: function (data) { return Bag.fromBcs(data); },
|
|
109
|
-
bcs: Bag.bcs,
|
|
110
|
-
fromJSONField: function (field) { return Bag.fromJSONField(field); },
|
|
111
|
-
fromJSON: function (json) { return Bag.fromJSON(json); },
|
|
112
|
-
fromSuiParsedData: function (content) { return Bag.fromSuiParsedData(content); },
|
|
113
|
-
fromSuiObjectData: function (content) { return Bag.fromSuiObjectData(content); },
|
|
114
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
115
|
-
return [2 /*return*/, Bag.fetch(client, id)];
|
|
116
|
-
}); }); },
|
|
117
|
-
new: function (fields) {
|
|
118
|
-
return new Bag([], fields);
|
|
119
|
-
},
|
|
120
|
-
kind: "StructClassReified",
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
Object.defineProperty(Bag, "r", {
|
|
124
|
-
get: function () {
|
|
125
|
-
return Bag.reified();
|
|
126
|
-
},
|
|
127
|
-
enumerable: false,
|
|
128
|
-
configurable: true
|
|
129
|
-
});
|
|
130
|
-
Bag.phantom = function () {
|
|
131
|
-
return (0, reified_1.phantom)(Bag.reified());
|
|
132
|
-
};
|
|
133
|
-
Object.defineProperty(Bag, "p", {
|
|
134
|
-
get: function () {
|
|
135
|
-
return Bag.phantom();
|
|
136
|
-
},
|
|
137
|
-
enumerable: false,
|
|
138
|
-
configurable: true
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(Bag, "bcs", {
|
|
141
|
-
get: function () {
|
|
142
|
-
return bcs_1.bcs.struct("Bag", {
|
|
143
|
-
id: structs_1.UID.bcs,
|
|
144
|
-
size: bcs_1.bcs.u64(),
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
enumerable: false,
|
|
148
|
-
configurable: true
|
|
149
|
-
});
|
|
150
|
-
Bag.fromFields = function (fields) {
|
|
151
|
-
return Bag.reified().new({ id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id), size: (0, reified_1.decodeFromFields)("u64", fields.size) });
|
|
152
|
-
};
|
|
153
|
-
Bag.fromFieldsWithTypes = function (item) {
|
|
154
|
-
if (!isBag(item.type)) {
|
|
155
|
-
throw new Error("not a Bag type");
|
|
156
|
-
}
|
|
157
|
-
return Bag.reified().new({
|
|
158
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
|
|
159
|
-
size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
Bag.fromBcs = function (data) {
|
|
163
|
-
return Bag.fromFields(Bag.bcs.parse(data));
|
|
164
|
-
};
|
|
165
|
-
Bag.prototype.toJSONField = function () {
|
|
166
|
-
return {
|
|
167
|
-
id: this.id,
|
|
168
|
-
size: this.size.toString(),
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
Bag.prototype.toJSON = function () {
|
|
172
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
173
|
-
};
|
|
174
|
-
Bag.fromJSONField = function (field) {
|
|
175
|
-
return Bag.reified().new({ id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id), size: (0, reified_1.decodeFromJSONField)("u64", field.size) });
|
|
176
|
-
};
|
|
177
|
-
Bag.fromJSON = function (json) {
|
|
178
|
-
if (json.$typeName !== Bag.$typeName) {
|
|
179
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
180
|
-
}
|
|
181
|
-
return Bag.fromJSONField(json);
|
|
182
|
-
};
|
|
183
|
-
Bag.fromSuiParsedData = function (content) {
|
|
184
|
-
if (content.dataType !== "moveObject") {
|
|
185
|
-
throw new Error("not an object");
|
|
186
|
-
}
|
|
187
|
-
if (!isBag(content.type)) {
|
|
188
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Bag object"));
|
|
189
|
-
}
|
|
190
|
-
return Bag.fromFieldsWithTypes(content);
|
|
191
|
-
};
|
|
192
|
-
Bag.fromSuiObjectData = function (data) {
|
|
193
|
-
if (data.bcs) {
|
|
194
|
-
if (data.bcs.dataType !== "moveObject" || !isBag(data.bcs.type)) {
|
|
195
|
-
throw new Error("object at is not a Bag object");
|
|
196
|
-
}
|
|
197
|
-
return Bag.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
198
|
-
}
|
|
199
|
-
if (data.content) {
|
|
200
|
-
return Bag.fromSuiParsedData(data.content);
|
|
201
|
-
}
|
|
202
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
203
|
-
};
|
|
204
|
-
Bag.fetch = function (client, id) {
|
|
205
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
206
|
-
var res;
|
|
207
|
-
var _a, _b;
|
|
208
|
-
return __generator(this, function (_c) {
|
|
209
|
-
switch (_c.label) {
|
|
210
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
211
|
-
case 1:
|
|
212
|
-
res = _c.sent();
|
|
213
|
-
if (res.error) {
|
|
214
|
-
throw new Error("error fetching Bag object at id ".concat(id, ": ").concat(res.error.code));
|
|
215
|
-
}
|
|
216
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isBag(res.data.bcs.type)) {
|
|
217
|
-
throw new Error("object at id ".concat(id, " is not a Bag object"));
|
|
218
|
-
}
|
|
219
|
-
return [2 /*return*/, Bag.fromSuiObjectData(res.data)];
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
|
-
Bag.$typeName = "".concat(index_1.PKG_V26, "::bag::Bag");
|
|
225
|
-
Bag.$numTypeParams = 0;
|
|
226
|
-
Bag.$isPhantom = [];
|
|
227
|
-
return Bag;
|
|
228
|
-
}());
|
|
229
|
-
exports.Bag = Bag;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from "../../../../_framework/reified";
|
|
2
|
-
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
-
import { PKG_V26 } from "../index";
|
|
4
|
-
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
5
|
-
export declare function isBalance(type: string): boolean;
|
|
6
|
-
export interface BalanceFields<T extends PhantomTypeArgument> {
|
|
7
|
-
value: ToField<"u64">;
|
|
8
|
-
}
|
|
9
|
-
export type BalanceReified<T extends PhantomTypeArgument> = Reified<Balance<T>, BalanceFields<T>>;
|
|
10
|
-
export declare class Balance<T extends PhantomTypeArgument> implements StructClass {
|
|
11
|
-
__StructClass: true;
|
|
12
|
-
static readonly $typeName = "0x2::balance::Balance";
|
|
13
|
-
static readonly $numTypeParams = 1;
|
|
14
|
-
static readonly $isPhantom: readonly [true];
|
|
15
|
-
readonly $typeName = "0x2::balance::Balance";
|
|
16
|
-
readonly $fullTypeName: `${typeof PKG_V26}::balance::Balance<${PhantomToTypeStr<T>}>`;
|
|
17
|
-
readonly $typeArgs: [PhantomToTypeStr<T>];
|
|
18
|
-
readonly $isPhantom: readonly [true];
|
|
19
|
-
readonly value: ToField<"u64">;
|
|
20
|
-
private constructor();
|
|
21
|
-
static reified<T extends PhantomReified<PhantomTypeArgument>>(T: T): BalanceReified<ToPhantomTypeArgument<T>>;
|
|
22
|
-
static get r(): typeof Balance.reified;
|
|
23
|
-
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<Balance<ToPhantomTypeArgument<T>>>>;
|
|
24
|
-
static get p(): typeof Balance.phantom;
|
|
25
|
-
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
26
|
-
value: string;
|
|
27
|
-
}, {
|
|
28
|
-
value: string | number | bigint;
|
|
29
|
-
}>;
|
|
30
|
-
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): Balance<ToPhantomTypeArgument<T>>;
|
|
31
|
-
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): Balance<ToPhantomTypeArgument<T>>;
|
|
32
|
-
static fromBcs<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: Uint8Array): Balance<ToPhantomTypeArgument<T>>;
|
|
33
|
-
toJSONField(): {
|
|
34
|
-
value: string;
|
|
35
|
-
};
|
|
36
|
-
toJSON(): {
|
|
37
|
-
value: string;
|
|
38
|
-
$typeName: string;
|
|
39
|
-
$typeArgs: [PhantomToTypeStr<T>];
|
|
40
|
-
};
|
|
41
|
-
static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, field: any): Balance<ToPhantomTypeArgument<T>>;
|
|
42
|
-
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): Balance<ToPhantomTypeArgument<T>>;
|
|
43
|
-
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): Balance<ToPhantomTypeArgument<T>>;
|
|
44
|
-
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): Balance<ToPhantomTypeArgument<T>>;
|
|
45
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiClient, typeArg: T, id: string): Promise<Balance<ToPhantomTypeArgument<T>>>;
|
|
46
|
-
}
|
|
47
|
-
export declare function isSupply(type: string): boolean;
|
|
48
|
-
export interface SupplyFields<T extends PhantomTypeArgument> {
|
|
49
|
-
value: ToField<"u64">;
|
|
50
|
-
}
|
|
51
|
-
export type SupplyReified<T extends PhantomTypeArgument> = Reified<Supply<T>, SupplyFields<T>>;
|
|
52
|
-
export declare class Supply<T extends PhantomTypeArgument> implements StructClass {
|
|
53
|
-
__StructClass: true;
|
|
54
|
-
static readonly $typeName = "0x2::balance::Supply";
|
|
55
|
-
static readonly $numTypeParams = 1;
|
|
56
|
-
static readonly $isPhantom: readonly [true];
|
|
57
|
-
readonly $typeName = "0x2::balance::Supply";
|
|
58
|
-
readonly $fullTypeName: `${typeof PKG_V26}::balance::Supply<${PhantomToTypeStr<T>}>`;
|
|
59
|
-
readonly $typeArgs: [PhantomToTypeStr<T>];
|
|
60
|
-
readonly $isPhantom: readonly [true];
|
|
61
|
-
readonly value: ToField<"u64">;
|
|
62
|
-
private constructor();
|
|
63
|
-
static reified<T extends PhantomReified<PhantomTypeArgument>>(T: T): SupplyReified<ToPhantomTypeArgument<T>>;
|
|
64
|
-
static get r(): typeof Supply.reified;
|
|
65
|
-
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<Supply<ToPhantomTypeArgument<T>>>>;
|
|
66
|
-
static get p(): typeof Supply.phantom;
|
|
67
|
-
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
68
|
-
value: string;
|
|
69
|
-
}, {
|
|
70
|
-
value: string | number | bigint;
|
|
71
|
-
}>;
|
|
72
|
-
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): Supply<ToPhantomTypeArgument<T>>;
|
|
73
|
-
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): Supply<ToPhantomTypeArgument<T>>;
|
|
74
|
-
static fromBcs<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: Uint8Array): Supply<ToPhantomTypeArgument<T>>;
|
|
75
|
-
toJSONField(): {
|
|
76
|
-
value: string;
|
|
77
|
-
};
|
|
78
|
-
toJSON(): {
|
|
79
|
-
value: string;
|
|
80
|
-
$typeName: string;
|
|
81
|
-
$typeArgs: [PhantomToTypeStr<T>];
|
|
82
|
-
};
|
|
83
|
-
static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, field: any): Supply<ToPhantomTypeArgument<T>>;
|
|
84
|
-
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): Supply<ToPhantomTypeArgument<T>>;
|
|
85
|
-
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): Supply<ToPhantomTypeArgument<T>>;
|
|
86
|
-
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): Supply<ToPhantomTypeArgument<T>>;
|
|
87
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiClient, typeArg: T, id: string): Promise<Supply<ToPhantomTypeArgument<T>>>;
|
|
88
|
-
}
|