@typus/typus-perp-sdk 1.1.32-codegen-exp3 → 1.1.32-testnet-exp1
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/_dependencies/source/0x1/ascii/structs.d.ts +88 -0
- package/dist/src/_dependencies/source/0x1/ascii/structs.js +398 -0
- package/dist/src/_dependencies/source/0x1/index.d.ts +3 -0
- package/dist/src/_dependencies/source/0x1/index.js +6 -0
- package/dist/src/_dependencies/source/0x1/option/structs.d.ts +50 -0
- package/dist/src/_dependencies/source/0x1/option/structs.js +271 -0
- package/dist/src/_dependencies/source/0x1/string/structs.d.ts +48 -0
- package/dist/src/_dependencies/source/0x1/string/structs.js +256 -0
- package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +49 -0
- package/dist/src/_dependencies/source/0x1/type-name/structs.js +223 -0
- package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +54 -0
- package/dist/src/_dependencies/source/0x2/bag/structs.js +229 -0
- package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +84 -0
- package/dist/src/_dependencies/source/0x2/balance/structs.js +386 -0
- package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +406 -0
- package/dist/src/_dependencies/source/0x2/coin/structs.js +1247 -0
- package/dist/src/_dependencies/source/0x2/index.d.ts +3 -0
- package/dist/src/_dependencies/source/0x2/index.js +6 -0
- package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +132 -0
- package/dist/src/_dependencies/source/0x2/linked-table/structs.js +438 -0
- package/dist/src/_dependencies/source/0x2/object/structs.d.ts +86 -0
- package/dist/src/_dependencies/source/0x2/object/structs.js +364 -0
- package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +54 -0
- package/dist/src/_dependencies/source/0x2/object-table/structs.js +248 -0
- package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +44 -0
- package/dist/src/_dependencies/source/0x2/sui/structs.js +222 -0
- package/dist/src/_dependencies/source/0x2/table/structs.d.ts +54 -0
- package/dist/src/_dependencies/source/0x2/table/structs.js +248 -0
- package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +59 -0
- package/dist/src/_dependencies/source/0x2/table-vec/structs.js +274 -0
- package/dist/src/_dependencies/source/0x2/token/structs.d.ts +421 -0
- package/dist/src/_dependencies/source/0x2/token/structs.js +1095 -0
- package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +348 -0
- package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +1091 -0
- package/dist/src/_dependencies/source/0x2/url/structs.d.ts +49 -0
- package/dist/src/_dependencies/source/0x2/url/structs.js +223 -0
- package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +106 -0
- package/dist/src/_dependencies/source/0x2/vec-map/structs.js +446 -0
- package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +49 -0
- package/dist/src/_dependencies/source/0x2/vec-set/structs.js +270 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +422 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +1084 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +130 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +456 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +208 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +653 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +362 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +899 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +8 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +11 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +2 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +102 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +202 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +632 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +600 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +1459 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +136 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +438 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +127 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +430 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +957 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +2261 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +244 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +733 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +294 -0
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +892 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +73 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +263 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +294 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +591 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +64 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +258 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +756 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +1721 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +44 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +222 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +3 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +6 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +2 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +89 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +135 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +444 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +2106 -0
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +4952 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +390 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +844 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +6 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +9 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +2 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +69 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +89 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +376 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +386 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +881 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +59 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +274 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +974 -0
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +2387 -0
- package/dist/src/_framework/init-loader.d.ts +2 -0
- package/dist/src/{generated/typus_perp/treasury_caps.js → _framework/init-loader.js} +10 -17
- package/dist/src/_framework/loader.d.ts +17 -0
- package/dist/src/_framework/loader.js +108 -0
- package/dist/src/_framework/reified.d.ts +108 -0
- package/dist/src/_framework/reified.js +237 -0
- package/dist/src/_framework/util.d.ts +35 -0
- package/dist/src/_framework/util.js +396 -0
- package/dist/src/_framework/vector.d.ts +42 -0
- package/dist/src/_framework/vector.js +112 -0
- package/dist/src/api/sentio.js +538 -604
- package/dist/src/fetch.d.ts +36 -577
- package/dist/src/fetch.js +665 -367
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +39 -20
- package/dist/src/pyth.js +1 -0
- package/dist/src/typus_perp/admin/functions.d.ts +59 -0
- package/dist/src/typus_perp/admin/functions.js +122 -0
- package/dist/src/typus_perp/admin/structs.d.ts +467 -0
- package/dist/src/typus_perp/admin/structs.js +1065 -0
- package/dist/src/typus_perp/competition/functions.d.ts +24 -0
- package/dist/src/typus_perp/competition/functions.js +38 -0
- package/dist/src/typus_perp/competition/structs.d.ts +80 -0
- package/dist/src/typus_perp/competition/structs.js +288 -0
- package/dist/src/typus_perp/error/functions.d.ts +73 -0
- package/dist/src/typus_perp/error/functions.js +363 -0
- package/dist/src/typus_perp/escrow/functions.d.ts +17 -0
- package/dist/src/typus_perp/escrow/functions.js +36 -0
- package/dist/src/typus_perp/escrow/structs.d.ts +160 -0
- package/dist/src/typus_perp/escrow/structs.js +324 -0
- package/dist/src/typus_perp/index.d.ts +1 -0
- package/dist/src/typus_perp/index.js +7 -0
- package/dist/src/typus_perp/init.d.ts +2 -0
- package/dist/src/typus_perp/init.js +118 -0
- package/dist/src/typus_perp/lending/functions.d.ts +15 -0
- package/dist/src/typus_perp/lending/functions.js +22 -0
- package/dist/src/typus_perp/lp-pool/functions.d.ts +460 -0
- package/dist/src/typus_perp/lp-pool/functions.js +732 -0
- package/dist/src/typus_perp/lp-pool/structs.d.ts +3705 -0
- package/dist/src/typus_perp/lp-pool/structs.js +6789 -0
- package/dist/src/typus_perp/math/functions.d.ts +29 -0
- package/dist/src/typus_perp/math/functions.js +61 -0
- package/dist/src/typus_perp/position/functions.d.ts +379 -0
- package/dist/src/typus_perp/position/functions.js +713 -0
- package/dist/src/typus_perp/position/structs.d.ts +905 -0
- package/dist/src/typus_perp/position/structs.js +1450 -0
- package/dist/src/typus_perp/symbol/functions.d.ts +9 -0
- package/dist/src/typus_perp/symbol/functions.js +24 -0
- package/dist/src/typus_perp/symbol/structs.d.ts +70 -0
- package/dist/src/typus_perp/symbol/structs.js +235 -0
- package/dist/src/typus_perp/tlp/functions.d.ts +19 -0
- package/dist/src/typus_perp/tlp/functions.js +40 -0
- package/dist/src/typus_perp/tlp/structs.d.ts +89 -0
- package/dist/src/typus_perp/tlp/structs.js +365 -0
- package/dist/src/typus_perp/token-interface/functions.d.ts +11 -0
- package/dist/src/typus_perp/token-interface/functions.js +22 -0
- package/dist/src/typus_perp/trading/functions.d.ts +812 -0
- package/dist/src/typus_perp/trading/functions.js +1218 -0
- package/dist/src/typus_perp/trading/structs.d.ts +3060 -0
- package/dist/src/typus_perp/trading/structs.js +5813 -0
- package/dist/src/typus_perp/treasury-caps/functions.d.ts +9 -0
- package/dist/src/typus_perp/treasury-caps/functions.js +36 -0
- package/dist/src/typus_perp/treasury-caps/structs.d.ts +49 -0
- package/dist/src/typus_perp/treasury-caps/structs.js +223 -0
- package/dist/src/typus_perp/user-account/functions.d.ts +36 -0
- package/dist/src/typus_perp/user-account/functions.js +70 -0
- package/dist/src/typus_perp/user-account/structs.d.ts +148 -0
- package/dist/src/typus_perp/user-account/structs.js +448 -0
- package/dist/src/typus_stake_pool/admin/functions.d.ts +49 -0
- package/dist/src/typus_stake_pool/admin/functions.js +105 -0
- package/dist/src/typus_stake_pool/admin/structs.d.ts +365 -0
- package/dist/src/typus_stake_pool/admin/structs.js +789 -0
- package/dist/src/typus_stake_pool/index.d.ts +1 -0
- package/dist/src/typus_stake_pool/index.js +7 -0
- package/dist/src/typus_stake_pool/init.d.ts +2 -0
- package/dist/src/typus_stake_pool/init.js +69 -0
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +229 -0
- package/dist/src/typus_stake_pool/stake-pool/functions.js +380 -0
- package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +2199 -0
- package/dist/src/typus_stake_pool/stake-pool/structs.js +4653 -0
- package/dist/src/user/history.js +685 -614
- package/dist/src/user/order.d.ts +11 -16
- package/dist/src/user/order.js +302 -171
- package/dist/src/user/orderWithBidReceipt.d.ts +6 -8
- package/dist/src/user/orderWithBidReceipt.js +225 -127
- package/dist/src/user/tlp.d.ts +24 -25
- package/dist/src/user/tlp.js +468 -317
- package/package.json +3 -11
- package/dist/src/client.d.ts +0 -27
- package/dist/src/client.js +0 -108
- package/dist/src/generated/typus_perp/admin.d.ts +0 -117
- package/dist/src/generated/typus_perp/admin.js +0 -110
- package/dist/src/generated/typus_perp/competition.d.ts +0 -22
- package/dist/src/generated/typus_perp/competition.js +0 -58
- package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +0 -17
- package/dist/src/generated/typus_perp/deps/std/type_name.js +0 -25
- package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +0 -12
- package/dist/src/generated/typus_perp/deps/sui/balance.js +0 -20
- package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
- package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
- package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +0 -19
- package/dist/src/generated/typus_perp/deps/sui/object_table.js +0 -59
- package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +0 -18
- package/dist/src/generated/typus_perp/deps/sui/vec_set.js +0 -25
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +0 -30
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +0 -67
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +0 -32
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +0 -71
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +0 -23
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +0 -61
- package/dist/src/generated/typus_perp/escrow.d.ts +0 -59
- package/dist/src/generated/typus_perp/escrow.js +0 -76
- package/dist/src/generated/typus_perp/lending.d.ts +0 -47
- package/dist/src/generated/typus_perp/lending.js +0 -50
- package/dist/src/generated/typus_perp/lp_pool.d.ts +0 -2327
- package/dist/src/generated/typus_perp/lp_pool.js +0 -1956
- package/dist/src/generated/typus_perp/math.d.ts +0 -95
- package/dist/src/generated/typus_perp/math.js +0 -97
- package/dist/src/generated/typus_perp/position.d.ts +0 -234
- package/dist/src/generated/typus_perp/position.js +0 -204
- package/dist/src/generated/typus_perp/symbol.d.ts +0 -18
- package/dist/src/generated/typus_perp/symbol.js +0 -55
- package/dist/src/generated/typus_perp/tlp.d.ts +0 -13
- package/dist/src/generated/typus_perp/tlp.js +0 -56
- package/dist/src/generated/typus_perp/trading.d.ts +0 -2486
- package/dist/src/generated/typus_perp/trading.js +0 -2476
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +0 -13
- package/dist/src/generated/typus_perp/user_account.d.ts +0 -40
- package/dist/src/generated/typus_perp/user_account.js +0 -72
- package/dist/src/generated/typus_stake_pool/admin.d.ts +0 -234
- package/dist/src/generated/typus_stake_pool/admin.js +0 -272
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +0 -17
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +0 -25
- package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
- package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +0 -18
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +0 -25
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +0 -986
- package/dist/src/generated/typus_stake_pool/stake_pool.js +0 -874
- package/dist/src/generated/utils/index.d.ts +0 -11
- package/dist/src/generated/utils/index.js +0 -135
- package/dist/src/grpc/graphql.d.ts +0 -26
- package/dist/src/grpc/graphql.js +0 -126
- package/dist/src/grpc/grpc.d.ts +0 -1
- package/dist/src/grpc/grpc.js +0 -38
- package/dist/src/grpc/ledgerService.js +0 -64
- package/dist/src/grpc/liveDataService.d.ts +0 -0
- package/dist/src/grpc/liveDataService.js +0 -49
- /package/dist/src/{grpc/ledgerService.d.ts → pyth.d.ts} +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
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.Table = void 0;
|
|
76
|
+
exports.isTable = isTable;
|
|
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
|
+
/* ============================== Table =============================== */
|
|
84
|
+
function isTable(type) {
|
|
85
|
+
type = (0, util_1.compressSuiType)(type);
|
|
86
|
+
return type.startsWith("".concat(index_1.PKG_V26, "::table::Table") + "<");
|
|
87
|
+
}
|
|
88
|
+
var Table = /** @class */ (function () {
|
|
89
|
+
function Table(typeArgs, fields) {
|
|
90
|
+
this.__StructClass = true;
|
|
91
|
+
this.$typeName = Table.$typeName;
|
|
92
|
+
this.$isPhantom = Table.$isPhantom;
|
|
93
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Table.$typeName], __read(typeArgs), false));
|
|
94
|
+
this.$typeArgs = typeArgs;
|
|
95
|
+
this.id = fields.id;
|
|
96
|
+
this.size = fields.size;
|
|
97
|
+
}
|
|
98
|
+
Table.reified = function (K, V) {
|
|
99
|
+
var _this = this;
|
|
100
|
+
return {
|
|
101
|
+
typeName: Table.$typeName,
|
|
102
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Table.$typeName], [(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)], false)),
|
|
103
|
+
typeArgs: [(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)],
|
|
104
|
+
isPhantom: Table.$isPhantom,
|
|
105
|
+
reifiedTypeArgs: [K, V],
|
|
106
|
+
fromFields: function (fields) { return Table.fromFields([K, V], fields); },
|
|
107
|
+
fromFieldsWithTypes: function (item) { return Table.fromFieldsWithTypes([K, V], item); },
|
|
108
|
+
fromBcs: function (data) { return Table.fromBcs([K, V], data); },
|
|
109
|
+
bcs: Table.bcs,
|
|
110
|
+
fromJSONField: function (field) { return Table.fromJSONField([K, V], field); },
|
|
111
|
+
fromJSON: function (json) { return Table.fromJSON([K, V], json); },
|
|
112
|
+
fromSuiParsedData: function (content) { return Table.fromSuiParsedData([K, V], content); },
|
|
113
|
+
fromSuiObjectData: function (content) { return Table.fromSuiObjectData([K, V], content); },
|
|
114
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
115
|
+
return [2 /*return*/, Table.fetch(client, [K, V], id)];
|
|
116
|
+
}); }); },
|
|
117
|
+
new: function (fields) {
|
|
118
|
+
return new Table([(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)], fields);
|
|
119
|
+
},
|
|
120
|
+
kind: "StructClassReified",
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
Object.defineProperty(Table, "r", {
|
|
124
|
+
get: function () {
|
|
125
|
+
return Table.reified;
|
|
126
|
+
},
|
|
127
|
+
enumerable: false,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
130
|
+
Table.phantom = function (K, V) {
|
|
131
|
+
return (0, reified_1.phantom)(Table.reified(K, V));
|
|
132
|
+
};
|
|
133
|
+
Object.defineProperty(Table, "p", {
|
|
134
|
+
get: function () {
|
|
135
|
+
return Table.phantom;
|
|
136
|
+
},
|
|
137
|
+
enumerable: false,
|
|
138
|
+
configurable: true
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(Table, "bcs", {
|
|
141
|
+
get: function () {
|
|
142
|
+
return bcs_1.bcs.struct("Table", {
|
|
143
|
+
id: structs_1.UID.bcs,
|
|
144
|
+
size: bcs_1.bcs.u64(),
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
enumerable: false,
|
|
148
|
+
configurable: true
|
|
149
|
+
});
|
|
150
|
+
Table.fromFields = function (typeArgs, fields) {
|
|
151
|
+
return Table.reified(typeArgs[0], typeArgs[1]).new({
|
|
152
|
+
id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id),
|
|
153
|
+
size: (0, reified_1.decodeFromFields)("u64", fields.size),
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
Table.fromFieldsWithTypes = function (typeArgs, item) {
|
|
157
|
+
if (!isTable(item.type)) {
|
|
158
|
+
throw new Error("not a Table type");
|
|
159
|
+
}
|
|
160
|
+
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, typeArgs);
|
|
161
|
+
return Table.reified(typeArgs[0], typeArgs[1]).new({
|
|
162
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
|
|
163
|
+
size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
Table.fromBcs = function (typeArgs, data) {
|
|
167
|
+
return Table.fromFields(typeArgs, Table.bcs.parse(data));
|
|
168
|
+
};
|
|
169
|
+
Table.prototype.toJSONField = function () {
|
|
170
|
+
return {
|
|
171
|
+
id: this.id,
|
|
172
|
+
size: this.size.toString(),
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
Table.prototype.toJSON = function () {
|
|
176
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
177
|
+
};
|
|
178
|
+
Table.fromJSONField = function (typeArgs, field) {
|
|
179
|
+
return Table.reified(typeArgs[0], typeArgs[1]).new({
|
|
180
|
+
id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id),
|
|
181
|
+
size: (0, reified_1.decodeFromJSONField)("u64", field.size),
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
Table.fromJSON = function (typeArgs, json) {
|
|
185
|
+
if (json.$typeName !== Table.$typeName) {
|
|
186
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
187
|
+
}
|
|
188
|
+
(0, reified_1.assertReifiedTypeArgsMatch)(util_1.composeSuiType.apply(void 0, __spreadArray([Table.$typeName], __read(typeArgs.map(reified_1.extractType)), false)), json.$typeArgs, typeArgs);
|
|
189
|
+
return Table.fromJSONField(typeArgs, json);
|
|
190
|
+
};
|
|
191
|
+
Table.fromSuiParsedData = function (typeArgs, content) {
|
|
192
|
+
if (content.dataType !== "moveObject") {
|
|
193
|
+
throw new Error("not an object");
|
|
194
|
+
}
|
|
195
|
+
if (!isTable(content.type)) {
|
|
196
|
+
throw new Error("object at ".concat(content.fields.id, " is not a Table object"));
|
|
197
|
+
}
|
|
198
|
+
return Table.fromFieldsWithTypes(typeArgs, content);
|
|
199
|
+
};
|
|
200
|
+
Table.fromSuiObjectData = function (typeArgs, data) {
|
|
201
|
+
if (data.bcs) {
|
|
202
|
+
if (data.bcs.dataType !== "moveObject" || !isTable(data.bcs.type)) {
|
|
203
|
+
throw new Error("object at is not a Table object");
|
|
204
|
+
}
|
|
205
|
+
var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
206
|
+
if (gotTypeArgs.length !== 2) {
|
|
207
|
+
throw new Error("type argument mismatch: expected 2 type arguments but got ".concat(gotTypeArgs.length));
|
|
208
|
+
}
|
|
209
|
+
for (var i = 0; i < 2; i++) {
|
|
210
|
+
var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[i]);
|
|
211
|
+
var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArgs[i]));
|
|
212
|
+
if (gotTypeArg !== expectedTypeArg) {
|
|
213
|
+
throw new Error("type argument mismatch at position ".concat(i, ": expected '").concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return Table.fromBcs(typeArgs, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
217
|
+
}
|
|
218
|
+
if (data.content) {
|
|
219
|
+
return Table.fromSuiParsedData(typeArgs, data.content);
|
|
220
|
+
}
|
|
221
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
222
|
+
};
|
|
223
|
+
Table.fetch = function (client, typeArgs, id) {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
225
|
+
var res;
|
|
226
|
+
var _a, _b;
|
|
227
|
+
return __generator(this, function (_c) {
|
|
228
|
+
switch (_c.label) {
|
|
229
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
230
|
+
case 1:
|
|
231
|
+
res = _c.sent();
|
|
232
|
+
if (res.error) {
|
|
233
|
+
throw new Error("error fetching Table object at id ".concat(id, ": ").concat(res.error.code));
|
|
234
|
+
}
|
|
235
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTable(res.data.bcs.type)) {
|
|
236
|
+
throw new Error("object at id ".concat(id, " is not a Table object"));
|
|
237
|
+
}
|
|
238
|
+
return [2 /*return*/, Table.fromSuiObjectData(typeArgs, res.data)];
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
Table.$typeName = "".concat(index_1.PKG_V26, "::table::Table");
|
|
244
|
+
Table.$numTypeParams = 2;
|
|
245
|
+
Table.$isPhantom = [true, true];
|
|
246
|
+
return Table;
|
|
247
|
+
}());
|
|
248
|
+
exports.Table = Table;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr } from "../../../../_framework/reified";
|
|
3
|
+
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
|
+
import { PKG_V26 } from "../index";
|
|
5
|
+
import { Table } from "../table/structs";
|
|
6
|
+
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
|
+
export declare function isTableVec(type: string): boolean;
|
|
8
|
+
export interface TableVecFields<Element extends PhantomTypeArgument> {
|
|
9
|
+
contents: ToField<Table<"u64", Element>>;
|
|
10
|
+
}
|
|
11
|
+
export type TableVecReified<Element extends PhantomTypeArgument> = Reified<TableVec<Element>, TableVecFields<Element>>;
|
|
12
|
+
export declare class TableVec<Element extends PhantomTypeArgument> implements StructClass {
|
|
13
|
+
__StructClass: true;
|
|
14
|
+
static readonly $typeName = "0x2::table_vec::TableVec";
|
|
15
|
+
static readonly $numTypeParams = 1;
|
|
16
|
+
static readonly $isPhantom: readonly [true];
|
|
17
|
+
readonly $typeName = "0x2::table_vec::TableVec";
|
|
18
|
+
readonly $fullTypeName: `${typeof PKG_V26}::table_vec::TableVec<${PhantomToTypeStr<Element>}>`;
|
|
19
|
+
readonly $typeArgs: [PhantomToTypeStr<Element>];
|
|
20
|
+
readonly $isPhantom: readonly [true];
|
|
21
|
+
readonly contents: ToField<Table<"u64", Element>>;
|
|
22
|
+
private constructor();
|
|
23
|
+
static reified<Element extends PhantomReified<PhantomTypeArgument>>(Element: Element): TableVecReified<ToPhantomTypeArgument<Element>>;
|
|
24
|
+
static get r(): typeof TableVec.reified;
|
|
25
|
+
static phantom<Element extends PhantomReified<PhantomTypeArgument>>(Element: Element): PhantomReified<ToTypeStr<TableVec<ToPhantomTypeArgument<Element>>>>;
|
|
26
|
+
static get p(): typeof TableVec.phantom;
|
|
27
|
+
static get bcs(): import("@mysten/sui/bcs").BcsStruct<{
|
|
28
|
+
contents: import("@mysten/sui/bcs").BcsStruct<{
|
|
29
|
+
id: import("@mysten/sui/bcs").BcsStruct<{
|
|
30
|
+
id: import("@mysten/sui/bcs").BcsStruct<{
|
|
31
|
+
bytes: import("@mysten/sui/bcs").BcsType<string, string, string>;
|
|
32
|
+
}, string>;
|
|
33
|
+
}, string>;
|
|
34
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
35
|
+
}, string>;
|
|
36
|
+
}, string>;
|
|
37
|
+
static fromFields<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, fields: Record<string, any>): TableVec<ToPhantomTypeArgument<Element>>;
|
|
38
|
+
static fromFieldsWithTypes<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, item: FieldsWithTypes): TableVec<ToPhantomTypeArgument<Element>>;
|
|
39
|
+
static fromBcs<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, data: Uint8Array): TableVec<ToPhantomTypeArgument<Element>>;
|
|
40
|
+
toJSONField(): {
|
|
41
|
+
contents: {
|
|
42
|
+
id: string;
|
|
43
|
+
size: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
toJSON(): {
|
|
47
|
+
contents: {
|
|
48
|
+
id: string;
|
|
49
|
+
size: string;
|
|
50
|
+
};
|
|
51
|
+
$typeName: string;
|
|
52
|
+
$typeArgs: [reified.PhantomToTypeStr<Element>];
|
|
53
|
+
};
|
|
54
|
+
static fromJSONField<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, field: any): TableVec<ToPhantomTypeArgument<Element>>;
|
|
55
|
+
static fromJSON<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, json: Record<string, any>): TableVec<ToPhantomTypeArgument<Element>>;
|
|
56
|
+
static fromSuiParsedData<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, content: SuiParsedData): TableVec<ToPhantomTypeArgument<Element>>;
|
|
57
|
+
static fromSuiObjectData<Element extends PhantomReified<PhantomTypeArgument>>(typeArg: Element, data: SuiObjectData): TableVec<ToPhantomTypeArgument<Element>>;
|
|
58
|
+
static fetch<Element extends PhantomReified<PhantomTypeArgument>>(client: SuiClient, typeArg: Element, id: string): Promise<TableVec<ToPhantomTypeArgument<Element>>>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,274 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
47
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
48
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
49
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
50
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
51
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
52
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
56
|
+
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);
|
|
57
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
58
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
59
|
+
function step(op) {
|
|
60
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
62
|
+
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;
|
|
63
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
64
|
+
switch (op[0]) {
|
|
65
|
+
case 0: case 1: t = op; break;
|
|
66
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
67
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
68
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
69
|
+
default:
|
|
70
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
71
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
72
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
73
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
74
|
+
if (t[2]) _.ops.pop();
|
|
75
|
+
_.trys.pop(); continue;
|
|
76
|
+
}
|
|
77
|
+
op = body.call(thisArg, _);
|
|
78
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
79
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
83
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
84
|
+
if (!m) return o;
|
|
85
|
+
var i = m.call(o), r, ar = [], e;
|
|
86
|
+
try {
|
|
87
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
88
|
+
}
|
|
89
|
+
catch (error) { e = { error: error }; }
|
|
90
|
+
finally {
|
|
91
|
+
try {
|
|
92
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
93
|
+
}
|
|
94
|
+
finally { if (e) throw e.error; }
|
|
95
|
+
}
|
|
96
|
+
return ar;
|
|
97
|
+
};
|
|
98
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
99
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
100
|
+
if (ar || !(i in from)) {
|
|
101
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
102
|
+
ar[i] = from[i];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
106
|
+
};
|
|
107
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
108
|
+
exports.TableVec = void 0;
|
|
109
|
+
exports.isTableVec = isTableVec;
|
|
110
|
+
var reified = __importStar(require("../../../../_framework/reified"));
|
|
111
|
+
var reified_1 = require("../../../../_framework/reified");
|
|
112
|
+
var util_1 = require("../../../../_framework/util");
|
|
113
|
+
var index_1 = require("../index");
|
|
114
|
+
var structs_1 = require("../table/structs");
|
|
115
|
+
var bcs_1 = require("@mysten/sui/bcs");
|
|
116
|
+
var utils_1 = require("@mysten/sui/utils");
|
|
117
|
+
/* ============================== TableVec =============================== */
|
|
118
|
+
function isTableVec(type) {
|
|
119
|
+
type = (0, util_1.compressSuiType)(type);
|
|
120
|
+
return type.startsWith("".concat(index_1.PKG_V26, "::table_vec::TableVec") + "<");
|
|
121
|
+
}
|
|
122
|
+
var TableVec = /** @class */ (function () {
|
|
123
|
+
function TableVec(typeArgs, fields) {
|
|
124
|
+
this.__StructClass = true;
|
|
125
|
+
this.$typeName = TableVec.$typeName;
|
|
126
|
+
this.$isPhantom = TableVec.$isPhantom;
|
|
127
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TableVec.$typeName], __read(typeArgs), false));
|
|
128
|
+
this.$typeArgs = typeArgs;
|
|
129
|
+
this.contents = fields.contents;
|
|
130
|
+
}
|
|
131
|
+
TableVec.reified = function (Element) {
|
|
132
|
+
var _this = this;
|
|
133
|
+
return {
|
|
134
|
+
typeName: TableVec.$typeName,
|
|
135
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TableVec.$typeName], [(0, reified_1.extractType)(Element)], false)),
|
|
136
|
+
typeArgs: [(0, reified_1.extractType)(Element)],
|
|
137
|
+
isPhantom: TableVec.$isPhantom,
|
|
138
|
+
reifiedTypeArgs: [Element],
|
|
139
|
+
fromFields: function (fields) { return TableVec.fromFields(Element, fields); },
|
|
140
|
+
fromFieldsWithTypes: function (item) { return TableVec.fromFieldsWithTypes(Element, item); },
|
|
141
|
+
fromBcs: function (data) { return TableVec.fromBcs(Element, data); },
|
|
142
|
+
bcs: TableVec.bcs,
|
|
143
|
+
fromJSONField: function (field) { return TableVec.fromJSONField(Element, field); },
|
|
144
|
+
fromJSON: function (json) { return TableVec.fromJSON(Element, json); },
|
|
145
|
+
fromSuiParsedData: function (content) { return TableVec.fromSuiParsedData(Element, content); },
|
|
146
|
+
fromSuiObjectData: function (content) { return TableVec.fromSuiObjectData(Element, content); },
|
|
147
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
148
|
+
return [2 /*return*/, TableVec.fetch(client, Element, id)];
|
|
149
|
+
}); }); },
|
|
150
|
+
new: function (fields) {
|
|
151
|
+
return new TableVec([(0, reified_1.extractType)(Element)], fields);
|
|
152
|
+
},
|
|
153
|
+
kind: "StructClassReified",
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
Object.defineProperty(TableVec, "r", {
|
|
157
|
+
get: function () {
|
|
158
|
+
return TableVec.reified;
|
|
159
|
+
},
|
|
160
|
+
enumerable: false,
|
|
161
|
+
configurable: true
|
|
162
|
+
});
|
|
163
|
+
TableVec.phantom = function (Element) {
|
|
164
|
+
return (0, reified_1.phantom)(TableVec.reified(Element));
|
|
165
|
+
};
|
|
166
|
+
Object.defineProperty(TableVec, "p", {
|
|
167
|
+
get: function () {
|
|
168
|
+
return TableVec.phantom;
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(TableVec, "bcs", {
|
|
174
|
+
get: function () {
|
|
175
|
+
return bcs_1.bcs.struct("TableVec", {
|
|
176
|
+
contents: structs_1.Table.bcs,
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
enumerable: false,
|
|
180
|
+
configurable: true
|
|
181
|
+
});
|
|
182
|
+
TableVec.fromFields = function (typeArg, fields) {
|
|
183
|
+
return TableVec.reified(typeArg).new({
|
|
184
|
+
contents: (0, reified_1.decodeFromFields)(structs_1.Table.reified(reified.phantom("u64"), typeArg), fields.contents),
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
TableVec.fromFieldsWithTypes = function (typeArg, item) {
|
|
188
|
+
if (!isTableVec(item.type)) {
|
|
189
|
+
throw new Error("not a TableVec type");
|
|
190
|
+
}
|
|
191
|
+
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
192
|
+
return TableVec.reified(typeArg).new({
|
|
193
|
+
contents: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.Table.reified(reified.phantom("u64"), typeArg), item.fields.contents),
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
TableVec.fromBcs = function (typeArg, data) {
|
|
197
|
+
return TableVec.fromFields(typeArg, TableVec.bcs.parse(data));
|
|
198
|
+
};
|
|
199
|
+
TableVec.prototype.toJSONField = function () {
|
|
200
|
+
return {
|
|
201
|
+
contents: this.contents.toJSONField(),
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
TableVec.prototype.toJSON = function () {
|
|
205
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
206
|
+
};
|
|
207
|
+
TableVec.fromJSONField = function (typeArg, field) {
|
|
208
|
+
return TableVec.reified(typeArg).new({
|
|
209
|
+
contents: (0, reified_1.decodeFromJSONField)(structs_1.Table.reified(reified.phantom("u64"), typeArg), field.contents),
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
TableVec.fromJSON = function (typeArg, json) {
|
|
213
|
+
if (json.$typeName !== TableVec.$typeName) {
|
|
214
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
215
|
+
}
|
|
216
|
+
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(TableVec.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
217
|
+
return TableVec.fromJSONField(typeArg, json);
|
|
218
|
+
};
|
|
219
|
+
TableVec.fromSuiParsedData = function (typeArg, content) {
|
|
220
|
+
if (content.dataType !== "moveObject") {
|
|
221
|
+
throw new Error("not an object");
|
|
222
|
+
}
|
|
223
|
+
if (!isTableVec(content.type)) {
|
|
224
|
+
throw new Error("object at ".concat(content.fields.id, " is not a TableVec object"));
|
|
225
|
+
}
|
|
226
|
+
return TableVec.fromFieldsWithTypes(typeArg, content);
|
|
227
|
+
};
|
|
228
|
+
TableVec.fromSuiObjectData = function (typeArg, data) {
|
|
229
|
+
if (data.bcs) {
|
|
230
|
+
if (data.bcs.dataType !== "moveObject" || !isTableVec(data.bcs.type)) {
|
|
231
|
+
throw new Error("object at is not a TableVec object");
|
|
232
|
+
}
|
|
233
|
+
var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
234
|
+
if (gotTypeArgs.length !== 1) {
|
|
235
|
+
throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
|
|
236
|
+
}
|
|
237
|
+
var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
238
|
+
var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
239
|
+
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
240
|
+
throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
|
|
241
|
+
}
|
|
242
|
+
return TableVec.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
243
|
+
}
|
|
244
|
+
if (data.content) {
|
|
245
|
+
return TableVec.fromSuiParsedData(typeArg, data.content);
|
|
246
|
+
}
|
|
247
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
248
|
+
};
|
|
249
|
+
TableVec.fetch = function (client, typeArg, id) {
|
|
250
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
251
|
+
var res;
|
|
252
|
+
var _a, _b;
|
|
253
|
+
return __generator(this, function (_c) {
|
|
254
|
+
switch (_c.label) {
|
|
255
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
256
|
+
case 1:
|
|
257
|
+
res = _c.sent();
|
|
258
|
+
if (res.error) {
|
|
259
|
+
throw new Error("error fetching TableVec object at id ".concat(id, ": ").concat(res.error.code));
|
|
260
|
+
}
|
|
261
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTableVec(res.data.bcs.type)) {
|
|
262
|
+
throw new Error("object at id ".concat(id, " is not a TableVec object"));
|
|
263
|
+
}
|
|
264
|
+
return [2 /*return*/, TableVec.fromSuiObjectData(typeArg, res.data)];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
TableVec.$typeName = "".concat(index_1.PKG_V26, "::table_vec::TableVec");
|
|
270
|
+
TableVec.$numTypeParams = 1;
|
|
271
|
+
TableVec.$isPhantom = [true];
|
|
272
|
+
return TableVec;
|
|
273
|
+
}());
|
|
274
|
+
exports.TableVec = TableVec;
|