@typus/typus-perp-sdk 1.1.27 → 1.1.28-codegen-test
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 +2328 -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 +0 -4
- package/dist/src/index.js +20 -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 +13 -4
- 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,2387 +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 __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.Whitelist = exports.Tails = exports.TYPUS_NFT = exports.RoyaltyUpdateEvent = exports.Royalty = exports.Pool = exports.NewManagerCapEvent = exports.MintEvent = exports.ManagerCap = exports.LevelUpEvent = exports.FirstDepositEvent = exports.FirstBidEvent = exports.ExpUpEvent = exports.ExpDownEvent = void 0;
|
|
109
|
-
exports.isExpDownEvent = isExpDownEvent;
|
|
110
|
-
exports.isExpUpEvent = isExpUpEvent;
|
|
111
|
-
exports.isFirstBidEvent = isFirstBidEvent;
|
|
112
|
-
exports.isFirstDepositEvent = isFirstDepositEvent;
|
|
113
|
-
exports.isLevelUpEvent = isLevelUpEvent;
|
|
114
|
-
exports.isManagerCap = isManagerCap;
|
|
115
|
-
exports.isMintEvent = isMintEvent;
|
|
116
|
-
exports.isNewManagerCapEvent = isNewManagerCapEvent;
|
|
117
|
-
exports.isPool = isPool;
|
|
118
|
-
exports.isRoyalty = isRoyalty;
|
|
119
|
-
exports.isRoyaltyUpdateEvent = isRoyaltyUpdateEvent;
|
|
120
|
-
exports.isTYPUS_NFT = isTYPUS_NFT;
|
|
121
|
-
exports.isTails = isTails;
|
|
122
|
-
exports.isWhitelist = isWhitelist;
|
|
123
|
-
var reified = __importStar(require("../../../../_framework/reified"));
|
|
124
|
-
var reified_1 = require("../../../../_framework/reified");
|
|
125
|
-
var util_1 = require("../../../../_framework/util");
|
|
126
|
-
var structs_1 = require("../../0x1/string/structs");
|
|
127
|
-
var structs_2 = require("../../0x2/object/structs");
|
|
128
|
-
var structs_3 = require("../../0x2/transfer-policy/structs");
|
|
129
|
-
var structs_4 = require("../../0x2/url/structs");
|
|
130
|
-
var structs_5 = require("../../0x2/vec-map/structs");
|
|
131
|
-
var index_1 = require("../index");
|
|
132
|
-
var structs_6 = require("../table-vec/structs");
|
|
133
|
-
var bcs_1 = require("@mysten/sui/bcs");
|
|
134
|
-
var utils_1 = require("@mysten/sui/utils");
|
|
135
|
-
/* ============================== ExpDownEvent =============================== */
|
|
136
|
-
function isExpDownEvent(type) {
|
|
137
|
-
type = (0, util_1.compressSuiType)(type);
|
|
138
|
-
return type === "".concat(index_1.PKG_V17, "::typus_nft::ExpDownEvent");
|
|
139
|
-
}
|
|
140
|
-
var ExpDownEvent = /** @class */ (function () {
|
|
141
|
-
function ExpDownEvent(typeArgs, fields) {
|
|
142
|
-
this.__StructClass = true;
|
|
143
|
-
this.$typeName = ExpDownEvent.$typeName;
|
|
144
|
-
this.$isPhantom = ExpDownEvent.$isPhantom;
|
|
145
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ExpDownEvent.$typeName], __read(typeArgs), false));
|
|
146
|
-
this.$typeArgs = typeArgs;
|
|
147
|
-
this.nftId = fields.nftId;
|
|
148
|
-
this.number = fields.number;
|
|
149
|
-
this.expRemove = fields.expRemove;
|
|
150
|
-
}
|
|
151
|
-
ExpDownEvent.reified = function () {
|
|
152
|
-
var _this = this;
|
|
153
|
-
return {
|
|
154
|
-
typeName: ExpDownEvent.$typeName,
|
|
155
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ExpDownEvent.$typeName], [], false)),
|
|
156
|
-
typeArgs: [],
|
|
157
|
-
isPhantom: ExpDownEvent.$isPhantom,
|
|
158
|
-
reifiedTypeArgs: [],
|
|
159
|
-
fromFields: function (fields) { return ExpDownEvent.fromFields(fields); },
|
|
160
|
-
fromFieldsWithTypes: function (item) { return ExpDownEvent.fromFieldsWithTypes(item); },
|
|
161
|
-
fromBcs: function (data) { return ExpDownEvent.fromBcs(data); },
|
|
162
|
-
bcs: ExpDownEvent.bcs,
|
|
163
|
-
fromJSONField: function (field) { return ExpDownEvent.fromJSONField(field); },
|
|
164
|
-
fromJSON: function (json) { return ExpDownEvent.fromJSON(json); },
|
|
165
|
-
fromSuiParsedData: function (content) { return ExpDownEvent.fromSuiParsedData(content); },
|
|
166
|
-
fromSuiObjectData: function (content) { return ExpDownEvent.fromSuiObjectData(content); },
|
|
167
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
168
|
-
return [2 /*return*/, ExpDownEvent.fetch(client, id)];
|
|
169
|
-
}); }); },
|
|
170
|
-
new: function (fields) {
|
|
171
|
-
return new ExpDownEvent([], fields);
|
|
172
|
-
},
|
|
173
|
-
kind: "StructClassReified",
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
Object.defineProperty(ExpDownEvent, "r", {
|
|
177
|
-
get: function () {
|
|
178
|
-
return ExpDownEvent.reified();
|
|
179
|
-
},
|
|
180
|
-
enumerable: false,
|
|
181
|
-
configurable: true
|
|
182
|
-
});
|
|
183
|
-
ExpDownEvent.phantom = function () {
|
|
184
|
-
return (0, reified_1.phantom)(ExpDownEvent.reified());
|
|
185
|
-
};
|
|
186
|
-
Object.defineProperty(ExpDownEvent, "p", {
|
|
187
|
-
get: function () {
|
|
188
|
-
return ExpDownEvent.phantom();
|
|
189
|
-
},
|
|
190
|
-
enumerable: false,
|
|
191
|
-
configurable: true
|
|
192
|
-
});
|
|
193
|
-
Object.defineProperty(ExpDownEvent, "bcs", {
|
|
194
|
-
get: function () {
|
|
195
|
-
return bcs_1.bcs.struct("ExpDownEvent", {
|
|
196
|
-
nft_id: structs_2.ID.bcs,
|
|
197
|
-
number: bcs_1.bcs.u64(),
|
|
198
|
-
exp_remove: bcs_1.bcs.u64(),
|
|
199
|
-
});
|
|
200
|
-
},
|
|
201
|
-
enumerable: false,
|
|
202
|
-
configurable: true
|
|
203
|
-
});
|
|
204
|
-
ExpDownEvent.fromFields = function (fields) {
|
|
205
|
-
return ExpDownEvent.reified().new({
|
|
206
|
-
nftId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.nft_id),
|
|
207
|
-
number: (0, reified_1.decodeFromFields)("u64", fields.number),
|
|
208
|
-
expRemove: (0, reified_1.decodeFromFields)("u64", fields.exp_remove),
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
ExpDownEvent.fromFieldsWithTypes = function (item) {
|
|
212
|
-
if (!isExpDownEvent(item.type)) {
|
|
213
|
-
throw new Error("not a ExpDownEvent type");
|
|
214
|
-
}
|
|
215
|
-
return ExpDownEvent.reified().new({
|
|
216
|
-
nftId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.nft_id),
|
|
217
|
-
number: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.number),
|
|
218
|
-
expRemove: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.exp_remove),
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
ExpDownEvent.fromBcs = function (data) {
|
|
222
|
-
return ExpDownEvent.fromFields(ExpDownEvent.bcs.parse(data));
|
|
223
|
-
};
|
|
224
|
-
ExpDownEvent.prototype.toJSONField = function () {
|
|
225
|
-
return {
|
|
226
|
-
nftId: this.nftId,
|
|
227
|
-
number: this.number.toString(),
|
|
228
|
-
expRemove: this.expRemove.toString(),
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
ExpDownEvent.prototype.toJSON = function () {
|
|
232
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
233
|
-
};
|
|
234
|
-
ExpDownEvent.fromJSONField = function (field) {
|
|
235
|
-
return ExpDownEvent.reified().new({
|
|
236
|
-
nftId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.nftId),
|
|
237
|
-
number: (0, reified_1.decodeFromJSONField)("u64", field.number),
|
|
238
|
-
expRemove: (0, reified_1.decodeFromJSONField)("u64", field.expRemove),
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
ExpDownEvent.fromJSON = function (json) {
|
|
242
|
-
if (json.$typeName !== ExpDownEvent.$typeName) {
|
|
243
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
244
|
-
}
|
|
245
|
-
return ExpDownEvent.fromJSONField(json);
|
|
246
|
-
};
|
|
247
|
-
ExpDownEvent.fromSuiParsedData = function (content) {
|
|
248
|
-
if (content.dataType !== "moveObject") {
|
|
249
|
-
throw new Error("not an object");
|
|
250
|
-
}
|
|
251
|
-
if (!isExpDownEvent(content.type)) {
|
|
252
|
-
throw new Error("object at ".concat(content.fields.id, " is not a ExpDownEvent object"));
|
|
253
|
-
}
|
|
254
|
-
return ExpDownEvent.fromFieldsWithTypes(content);
|
|
255
|
-
};
|
|
256
|
-
ExpDownEvent.fromSuiObjectData = function (data) {
|
|
257
|
-
if (data.bcs) {
|
|
258
|
-
if (data.bcs.dataType !== "moveObject" || !isExpDownEvent(data.bcs.type)) {
|
|
259
|
-
throw new Error("object at is not a ExpDownEvent object");
|
|
260
|
-
}
|
|
261
|
-
return ExpDownEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
262
|
-
}
|
|
263
|
-
if (data.content) {
|
|
264
|
-
return ExpDownEvent.fromSuiParsedData(data.content);
|
|
265
|
-
}
|
|
266
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
267
|
-
};
|
|
268
|
-
ExpDownEvent.fetch = function (client, id) {
|
|
269
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
270
|
-
var res;
|
|
271
|
-
var _a, _b;
|
|
272
|
-
return __generator(this, function (_c) {
|
|
273
|
-
switch (_c.label) {
|
|
274
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
275
|
-
case 1:
|
|
276
|
-
res = _c.sent();
|
|
277
|
-
if (res.error) {
|
|
278
|
-
throw new Error("error fetching ExpDownEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
279
|
-
}
|
|
280
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isExpDownEvent(res.data.bcs.type)) {
|
|
281
|
-
throw new Error("object at id ".concat(id, " is not a ExpDownEvent object"));
|
|
282
|
-
}
|
|
283
|
-
return [2 /*return*/, ExpDownEvent.fromSuiObjectData(res.data)];
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
ExpDownEvent.$typeName = "".concat(index_1.PKG_V17, "::typus_nft::ExpDownEvent");
|
|
289
|
-
ExpDownEvent.$numTypeParams = 0;
|
|
290
|
-
ExpDownEvent.$isPhantom = [];
|
|
291
|
-
return ExpDownEvent;
|
|
292
|
-
}());
|
|
293
|
-
exports.ExpDownEvent = ExpDownEvent;
|
|
294
|
-
/* ============================== ExpUpEvent =============================== */
|
|
295
|
-
function isExpUpEvent(type) {
|
|
296
|
-
type = (0, util_1.compressSuiType)(type);
|
|
297
|
-
return type === "".concat(index_1.PKG_V6, "::typus_nft::ExpUpEvent");
|
|
298
|
-
}
|
|
299
|
-
var ExpUpEvent = /** @class */ (function () {
|
|
300
|
-
function ExpUpEvent(typeArgs, fields) {
|
|
301
|
-
this.__StructClass = true;
|
|
302
|
-
this.$typeName = ExpUpEvent.$typeName;
|
|
303
|
-
this.$isPhantom = ExpUpEvent.$isPhantom;
|
|
304
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ExpUpEvent.$typeName], __read(typeArgs), false));
|
|
305
|
-
this.$typeArgs = typeArgs;
|
|
306
|
-
this.nftId = fields.nftId;
|
|
307
|
-
this.number = fields.number;
|
|
308
|
-
this.expEarn = fields.expEarn;
|
|
309
|
-
}
|
|
310
|
-
ExpUpEvent.reified = function () {
|
|
311
|
-
var _this = this;
|
|
312
|
-
return {
|
|
313
|
-
typeName: ExpUpEvent.$typeName,
|
|
314
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ExpUpEvent.$typeName], [], false)),
|
|
315
|
-
typeArgs: [],
|
|
316
|
-
isPhantom: ExpUpEvent.$isPhantom,
|
|
317
|
-
reifiedTypeArgs: [],
|
|
318
|
-
fromFields: function (fields) { return ExpUpEvent.fromFields(fields); },
|
|
319
|
-
fromFieldsWithTypes: function (item) { return ExpUpEvent.fromFieldsWithTypes(item); },
|
|
320
|
-
fromBcs: function (data) { return ExpUpEvent.fromBcs(data); },
|
|
321
|
-
bcs: ExpUpEvent.bcs,
|
|
322
|
-
fromJSONField: function (field) { return ExpUpEvent.fromJSONField(field); },
|
|
323
|
-
fromJSON: function (json) { return ExpUpEvent.fromJSON(json); },
|
|
324
|
-
fromSuiParsedData: function (content) { return ExpUpEvent.fromSuiParsedData(content); },
|
|
325
|
-
fromSuiObjectData: function (content) { return ExpUpEvent.fromSuiObjectData(content); },
|
|
326
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
327
|
-
return [2 /*return*/, ExpUpEvent.fetch(client, id)];
|
|
328
|
-
}); }); },
|
|
329
|
-
new: function (fields) {
|
|
330
|
-
return new ExpUpEvent([], fields);
|
|
331
|
-
},
|
|
332
|
-
kind: "StructClassReified",
|
|
333
|
-
};
|
|
334
|
-
};
|
|
335
|
-
Object.defineProperty(ExpUpEvent, "r", {
|
|
336
|
-
get: function () {
|
|
337
|
-
return ExpUpEvent.reified();
|
|
338
|
-
},
|
|
339
|
-
enumerable: false,
|
|
340
|
-
configurable: true
|
|
341
|
-
});
|
|
342
|
-
ExpUpEvent.phantom = function () {
|
|
343
|
-
return (0, reified_1.phantom)(ExpUpEvent.reified());
|
|
344
|
-
};
|
|
345
|
-
Object.defineProperty(ExpUpEvent, "p", {
|
|
346
|
-
get: function () {
|
|
347
|
-
return ExpUpEvent.phantom();
|
|
348
|
-
},
|
|
349
|
-
enumerable: false,
|
|
350
|
-
configurable: true
|
|
351
|
-
});
|
|
352
|
-
Object.defineProperty(ExpUpEvent, "bcs", {
|
|
353
|
-
get: function () {
|
|
354
|
-
return bcs_1.bcs.struct("ExpUpEvent", {
|
|
355
|
-
nft_id: structs_2.ID.bcs,
|
|
356
|
-
number: bcs_1.bcs.u64(),
|
|
357
|
-
exp_earn: bcs_1.bcs.u64(),
|
|
358
|
-
});
|
|
359
|
-
},
|
|
360
|
-
enumerable: false,
|
|
361
|
-
configurable: true
|
|
362
|
-
});
|
|
363
|
-
ExpUpEvent.fromFields = function (fields) {
|
|
364
|
-
return ExpUpEvent.reified().new({
|
|
365
|
-
nftId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.nft_id),
|
|
366
|
-
number: (0, reified_1.decodeFromFields)("u64", fields.number),
|
|
367
|
-
expEarn: (0, reified_1.decodeFromFields)("u64", fields.exp_earn),
|
|
368
|
-
});
|
|
369
|
-
};
|
|
370
|
-
ExpUpEvent.fromFieldsWithTypes = function (item) {
|
|
371
|
-
if (!isExpUpEvent(item.type)) {
|
|
372
|
-
throw new Error("not a ExpUpEvent type");
|
|
373
|
-
}
|
|
374
|
-
return ExpUpEvent.reified().new({
|
|
375
|
-
nftId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.nft_id),
|
|
376
|
-
number: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.number),
|
|
377
|
-
expEarn: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.exp_earn),
|
|
378
|
-
});
|
|
379
|
-
};
|
|
380
|
-
ExpUpEvent.fromBcs = function (data) {
|
|
381
|
-
return ExpUpEvent.fromFields(ExpUpEvent.bcs.parse(data));
|
|
382
|
-
};
|
|
383
|
-
ExpUpEvent.prototype.toJSONField = function () {
|
|
384
|
-
return {
|
|
385
|
-
nftId: this.nftId,
|
|
386
|
-
number: this.number.toString(),
|
|
387
|
-
expEarn: this.expEarn.toString(),
|
|
388
|
-
};
|
|
389
|
-
};
|
|
390
|
-
ExpUpEvent.prototype.toJSON = function () {
|
|
391
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
392
|
-
};
|
|
393
|
-
ExpUpEvent.fromJSONField = function (field) {
|
|
394
|
-
return ExpUpEvent.reified().new({
|
|
395
|
-
nftId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.nftId),
|
|
396
|
-
number: (0, reified_1.decodeFromJSONField)("u64", field.number),
|
|
397
|
-
expEarn: (0, reified_1.decodeFromJSONField)("u64", field.expEarn),
|
|
398
|
-
});
|
|
399
|
-
};
|
|
400
|
-
ExpUpEvent.fromJSON = function (json) {
|
|
401
|
-
if (json.$typeName !== ExpUpEvent.$typeName) {
|
|
402
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
403
|
-
}
|
|
404
|
-
return ExpUpEvent.fromJSONField(json);
|
|
405
|
-
};
|
|
406
|
-
ExpUpEvent.fromSuiParsedData = function (content) {
|
|
407
|
-
if (content.dataType !== "moveObject") {
|
|
408
|
-
throw new Error("not an object");
|
|
409
|
-
}
|
|
410
|
-
if (!isExpUpEvent(content.type)) {
|
|
411
|
-
throw new Error("object at ".concat(content.fields.id, " is not a ExpUpEvent object"));
|
|
412
|
-
}
|
|
413
|
-
return ExpUpEvent.fromFieldsWithTypes(content);
|
|
414
|
-
};
|
|
415
|
-
ExpUpEvent.fromSuiObjectData = function (data) {
|
|
416
|
-
if (data.bcs) {
|
|
417
|
-
if (data.bcs.dataType !== "moveObject" || !isExpUpEvent(data.bcs.type)) {
|
|
418
|
-
throw new Error("object at is not a ExpUpEvent object");
|
|
419
|
-
}
|
|
420
|
-
return ExpUpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
421
|
-
}
|
|
422
|
-
if (data.content) {
|
|
423
|
-
return ExpUpEvent.fromSuiParsedData(data.content);
|
|
424
|
-
}
|
|
425
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
426
|
-
};
|
|
427
|
-
ExpUpEvent.fetch = function (client, id) {
|
|
428
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
429
|
-
var res;
|
|
430
|
-
var _a, _b;
|
|
431
|
-
return __generator(this, function (_c) {
|
|
432
|
-
switch (_c.label) {
|
|
433
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
434
|
-
case 1:
|
|
435
|
-
res = _c.sent();
|
|
436
|
-
if (res.error) {
|
|
437
|
-
throw new Error("error fetching ExpUpEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
438
|
-
}
|
|
439
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isExpUpEvent(res.data.bcs.type)) {
|
|
440
|
-
throw new Error("object at id ".concat(id, " is not a ExpUpEvent object"));
|
|
441
|
-
}
|
|
442
|
-
return [2 /*return*/, ExpUpEvent.fromSuiObjectData(res.data)];
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
};
|
|
447
|
-
ExpUpEvent.$typeName = "".concat(index_1.PKG_V6, "::typus_nft::ExpUpEvent");
|
|
448
|
-
ExpUpEvent.$numTypeParams = 0;
|
|
449
|
-
ExpUpEvent.$isPhantom = [];
|
|
450
|
-
return ExpUpEvent;
|
|
451
|
-
}());
|
|
452
|
-
exports.ExpUpEvent = ExpUpEvent;
|
|
453
|
-
/* ============================== FirstBidEvent =============================== */
|
|
454
|
-
function isFirstBidEvent(type) {
|
|
455
|
-
type = (0, util_1.compressSuiType)(type);
|
|
456
|
-
return type === "".concat(index_1.PKG_V6, "::typus_nft::FirstBidEvent");
|
|
457
|
-
}
|
|
458
|
-
var FirstBidEvent = /** @class */ (function () {
|
|
459
|
-
function FirstBidEvent(typeArgs, fields) {
|
|
460
|
-
this.__StructClass = true;
|
|
461
|
-
this.$typeName = FirstBidEvent.$typeName;
|
|
462
|
-
this.$isPhantom = FirstBidEvent.$isPhantom;
|
|
463
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([FirstBidEvent.$typeName], __read(typeArgs), false));
|
|
464
|
-
this.$typeArgs = typeArgs;
|
|
465
|
-
this.nftId = fields.nftId;
|
|
466
|
-
this.number = fields.number;
|
|
467
|
-
this.expEarn = fields.expEarn;
|
|
468
|
-
}
|
|
469
|
-
FirstBidEvent.reified = function () {
|
|
470
|
-
var _this = this;
|
|
471
|
-
return {
|
|
472
|
-
typeName: FirstBidEvent.$typeName,
|
|
473
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([FirstBidEvent.$typeName], [], false)),
|
|
474
|
-
typeArgs: [],
|
|
475
|
-
isPhantom: FirstBidEvent.$isPhantom,
|
|
476
|
-
reifiedTypeArgs: [],
|
|
477
|
-
fromFields: function (fields) { return FirstBidEvent.fromFields(fields); },
|
|
478
|
-
fromFieldsWithTypes: function (item) { return FirstBidEvent.fromFieldsWithTypes(item); },
|
|
479
|
-
fromBcs: function (data) { return FirstBidEvent.fromBcs(data); },
|
|
480
|
-
bcs: FirstBidEvent.bcs,
|
|
481
|
-
fromJSONField: function (field) { return FirstBidEvent.fromJSONField(field); },
|
|
482
|
-
fromJSON: function (json) { return FirstBidEvent.fromJSON(json); },
|
|
483
|
-
fromSuiParsedData: function (content) { return FirstBidEvent.fromSuiParsedData(content); },
|
|
484
|
-
fromSuiObjectData: function (content) { return FirstBidEvent.fromSuiObjectData(content); },
|
|
485
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
486
|
-
return [2 /*return*/, FirstBidEvent.fetch(client, id)];
|
|
487
|
-
}); }); },
|
|
488
|
-
new: function (fields) {
|
|
489
|
-
return new FirstBidEvent([], fields);
|
|
490
|
-
},
|
|
491
|
-
kind: "StructClassReified",
|
|
492
|
-
};
|
|
493
|
-
};
|
|
494
|
-
Object.defineProperty(FirstBidEvent, "r", {
|
|
495
|
-
get: function () {
|
|
496
|
-
return FirstBidEvent.reified();
|
|
497
|
-
},
|
|
498
|
-
enumerable: false,
|
|
499
|
-
configurable: true
|
|
500
|
-
});
|
|
501
|
-
FirstBidEvent.phantom = function () {
|
|
502
|
-
return (0, reified_1.phantom)(FirstBidEvent.reified());
|
|
503
|
-
};
|
|
504
|
-
Object.defineProperty(FirstBidEvent, "p", {
|
|
505
|
-
get: function () {
|
|
506
|
-
return FirstBidEvent.phantom();
|
|
507
|
-
},
|
|
508
|
-
enumerable: false,
|
|
509
|
-
configurable: true
|
|
510
|
-
});
|
|
511
|
-
Object.defineProperty(FirstBidEvent, "bcs", {
|
|
512
|
-
get: function () {
|
|
513
|
-
return bcs_1.bcs.struct("FirstBidEvent", {
|
|
514
|
-
nft_id: structs_2.ID.bcs,
|
|
515
|
-
number: bcs_1.bcs.u64(),
|
|
516
|
-
exp_earn: bcs_1.bcs.u64(),
|
|
517
|
-
});
|
|
518
|
-
},
|
|
519
|
-
enumerable: false,
|
|
520
|
-
configurable: true
|
|
521
|
-
});
|
|
522
|
-
FirstBidEvent.fromFields = function (fields) {
|
|
523
|
-
return FirstBidEvent.reified().new({
|
|
524
|
-
nftId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.nft_id),
|
|
525
|
-
number: (0, reified_1.decodeFromFields)("u64", fields.number),
|
|
526
|
-
expEarn: (0, reified_1.decodeFromFields)("u64", fields.exp_earn),
|
|
527
|
-
});
|
|
528
|
-
};
|
|
529
|
-
FirstBidEvent.fromFieldsWithTypes = function (item) {
|
|
530
|
-
if (!isFirstBidEvent(item.type)) {
|
|
531
|
-
throw new Error("not a FirstBidEvent type");
|
|
532
|
-
}
|
|
533
|
-
return FirstBidEvent.reified().new({
|
|
534
|
-
nftId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.nft_id),
|
|
535
|
-
number: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.number),
|
|
536
|
-
expEarn: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.exp_earn),
|
|
537
|
-
});
|
|
538
|
-
};
|
|
539
|
-
FirstBidEvent.fromBcs = function (data) {
|
|
540
|
-
return FirstBidEvent.fromFields(FirstBidEvent.bcs.parse(data));
|
|
541
|
-
};
|
|
542
|
-
FirstBidEvent.prototype.toJSONField = function () {
|
|
543
|
-
return {
|
|
544
|
-
nftId: this.nftId,
|
|
545
|
-
number: this.number.toString(),
|
|
546
|
-
expEarn: this.expEarn.toString(),
|
|
547
|
-
};
|
|
548
|
-
};
|
|
549
|
-
FirstBidEvent.prototype.toJSON = function () {
|
|
550
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
551
|
-
};
|
|
552
|
-
FirstBidEvent.fromJSONField = function (field) {
|
|
553
|
-
return FirstBidEvent.reified().new({
|
|
554
|
-
nftId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.nftId),
|
|
555
|
-
number: (0, reified_1.decodeFromJSONField)("u64", field.number),
|
|
556
|
-
expEarn: (0, reified_1.decodeFromJSONField)("u64", field.expEarn),
|
|
557
|
-
});
|
|
558
|
-
};
|
|
559
|
-
FirstBidEvent.fromJSON = function (json) {
|
|
560
|
-
if (json.$typeName !== FirstBidEvent.$typeName) {
|
|
561
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
562
|
-
}
|
|
563
|
-
return FirstBidEvent.fromJSONField(json);
|
|
564
|
-
};
|
|
565
|
-
FirstBidEvent.fromSuiParsedData = function (content) {
|
|
566
|
-
if (content.dataType !== "moveObject") {
|
|
567
|
-
throw new Error("not an object");
|
|
568
|
-
}
|
|
569
|
-
if (!isFirstBidEvent(content.type)) {
|
|
570
|
-
throw new Error("object at ".concat(content.fields.id, " is not a FirstBidEvent object"));
|
|
571
|
-
}
|
|
572
|
-
return FirstBidEvent.fromFieldsWithTypes(content);
|
|
573
|
-
};
|
|
574
|
-
FirstBidEvent.fromSuiObjectData = function (data) {
|
|
575
|
-
if (data.bcs) {
|
|
576
|
-
if (data.bcs.dataType !== "moveObject" || !isFirstBidEvent(data.bcs.type)) {
|
|
577
|
-
throw new Error("object at is not a FirstBidEvent object");
|
|
578
|
-
}
|
|
579
|
-
return FirstBidEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
580
|
-
}
|
|
581
|
-
if (data.content) {
|
|
582
|
-
return FirstBidEvent.fromSuiParsedData(data.content);
|
|
583
|
-
}
|
|
584
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
585
|
-
};
|
|
586
|
-
FirstBidEvent.fetch = function (client, id) {
|
|
587
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
588
|
-
var res;
|
|
589
|
-
var _a, _b;
|
|
590
|
-
return __generator(this, function (_c) {
|
|
591
|
-
switch (_c.label) {
|
|
592
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
593
|
-
case 1:
|
|
594
|
-
res = _c.sent();
|
|
595
|
-
if (res.error) {
|
|
596
|
-
throw new Error("error fetching FirstBidEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
597
|
-
}
|
|
598
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isFirstBidEvent(res.data.bcs.type)) {
|
|
599
|
-
throw new Error("object at id ".concat(id, " is not a FirstBidEvent object"));
|
|
600
|
-
}
|
|
601
|
-
return [2 /*return*/, FirstBidEvent.fromSuiObjectData(res.data)];
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
});
|
|
605
|
-
};
|
|
606
|
-
FirstBidEvent.$typeName = "".concat(index_1.PKG_V6, "::typus_nft::FirstBidEvent");
|
|
607
|
-
FirstBidEvent.$numTypeParams = 0;
|
|
608
|
-
FirstBidEvent.$isPhantom = [];
|
|
609
|
-
return FirstBidEvent;
|
|
610
|
-
}());
|
|
611
|
-
exports.FirstBidEvent = FirstBidEvent;
|
|
612
|
-
/* ============================== FirstDepositEvent =============================== */
|
|
613
|
-
function isFirstDepositEvent(type) {
|
|
614
|
-
type = (0, util_1.compressSuiType)(type);
|
|
615
|
-
return type === "".concat(index_1.PKG_V6, "::typus_nft::FirstDepositEvent");
|
|
616
|
-
}
|
|
617
|
-
var FirstDepositEvent = /** @class */ (function () {
|
|
618
|
-
function FirstDepositEvent(typeArgs, fields) {
|
|
619
|
-
this.__StructClass = true;
|
|
620
|
-
this.$typeName = FirstDepositEvent.$typeName;
|
|
621
|
-
this.$isPhantom = FirstDepositEvent.$isPhantom;
|
|
622
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([FirstDepositEvent.$typeName], __read(typeArgs), false));
|
|
623
|
-
this.$typeArgs = typeArgs;
|
|
624
|
-
this.nftId = fields.nftId;
|
|
625
|
-
this.number = fields.number;
|
|
626
|
-
this.expEarn = fields.expEarn;
|
|
627
|
-
}
|
|
628
|
-
FirstDepositEvent.reified = function () {
|
|
629
|
-
var _this = this;
|
|
630
|
-
return {
|
|
631
|
-
typeName: FirstDepositEvent.$typeName,
|
|
632
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([FirstDepositEvent.$typeName], [], false)),
|
|
633
|
-
typeArgs: [],
|
|
634
|
-
isPhantom: FirstDepositEvent.$isPhantom,
|
|
635
|
-
reifiedTypeArgs: [],
|
|
636
|
-
fromFields: function (fields) { return FirstDepositEvent.fromFields(fields); },
|
|
637
|
-
fromFieldsWithTypes: function (item) { return FirstDepositEvent.fromFieldsWithTypes(item); },
|
|
638
|
-
fromBcs: function (data) { return FirstDepositEvent.fromBcs(data); },
|
|
639
|
-
bcs: FirstDepositEvent.bcs,
|
|
640
|
-
fromJSONField: function (field) { return FirstDepositEvent.fromJSONField(field); },
|
|
641
|
-
fromJSON: function (json) { return FirstDepositEvent.fromJSON(json); },
|
|
642
|
-
fromSuiParsedData: function (content) { return FirstDepositEvent.fromSuiParsedData(content); },
|
|
643
|
-
fromSuiObjectData: function (content) { return FirstDepositEvent.fromSuiObjectData(content); },
|
|
644
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
645
|
-
return [2 /*return*/, FirstDepositEvent.fetch(client, id)];
|
|
646
|
-
}); }); },
|
|
647
|
-
new: function (fields) {
|
|
648
|
-
return new FirstDepositEvent([], fields);
|
|
649
|
-
},
|
|
650
|
-
kind: "StructClassReified",
|
|
651
|
-
};
|
|
652
|
-
};
|
|
653
|
-
Object.defineProperty(FirstDepositEvent, "r", {
|
|
654
|
-
get: function () {
|
|
655
|
-
return FirstDepositEvent.reified();
|
|
656
|
-
},
|
|
657
|
-
enumerable: false,
|
|
658
|
-
configurable: true
|
|
659
|
-
});
|
|
660
|
-
FirstDepositEvent.phantom = function () {
|
|
661
|
-
return (0, reified_1.phantom)(FirstDepositEvent.reified());
|
|
662
|
-
};
|
|
663
|
-
Object.defineProperty(FirstDepositEvent, "p", {
|
|
664
|
-
get: function () {
|
|
665
|
-
return FirstDepositEvent.phantom();
|
|
666
|
-
},
|
|
667
|
-
enumerable: false,
|
|
668
|
-
configurable: true
|
|
669
|
-
});
|
|
670
|
-
Object.defineProperty(FirstDepositEvent, "bcs", {
|
|
671
|
-
get: function () {
|
|
672
|
-
return bcs_1.bcs.struct("FirstDepositEvent", {
|
|
673
|
-
nft_id: structs_2.ID.bcs,
|
|
674
|
-
number: bcs_1.bcs.u64(),
|
|
675
|
-
exp_earn: bcs_1.bcs.u64(),
|
|
676
|
-
});
|
|
677
|
-
},
|
|
678
|
-
enumerable: false,
|
|
679
|
-
configurable: true
|
|
680
|
-
});
|
|
681
|
-
FirstDepositEvent.fromFields = function (fields) {
|
|
682
|
-
return FirstDepositEvent.reified().new({
|
|
683
|
-
nftId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.nft_id),
|
|
684
|
-
number: (0, reified_1.decodeFromFields)("u64", fields.number),
|
|
685
|
-
expEarn: (0, reified_1.decodeFromFields)("u64", fields.exp_earn),
|
|
686
|
-
});
|
|
687
|
-
};
|
|
688
|
-
FirstDepositEvent.fromFieldsWithTypes = function (item) {
|
|
689
|
-
if (!isFirstDepositEvent(item.type)) {
|
|
690
|
-
throw new Error("not a FirstDepositEvent type");
|
|
691
|
-
}
|
|
692
|
-
return FirstDepositEvent.reified().new({
|
|
693
|
-
nftId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.nft_id),
|
|
694
|
-
number: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.number),
|
|
695
|
-
expEarn: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.exp_earn),
|
|
696
|
-
});
|
|
697
|
-
};
|
|
698
|
-
FirstDepositEvent.fromBcs = function (data) {
|
|
699
|
-
return FirstDepositEvent.fromFields(FirstDepositEvent.bcs.parse(data));
|
|
700
|
-
};
|
|
701
|
-
FirstDepositEvent.prototype.toJSONField = function () {
|
|
702
|
-
return {
|
|
703
|
-
nftId: this.nftId,
|
|
704
|
-
number: this.number.toString(),
|
|
705
|
-
expEarn: this.expEarn.toString(),
|
|
706
|
-
};
|
|
707
|
-
};
|
|
708
|
-
FirstDepositEvent.prototype.toJSON = function () {
|
|
709
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
710
|
-
};
|
|
711
|
-
FirstDepositEvent.fromJSONField = function (field) {
|
|
712
|
-
return FirstDepositEvent.reified().new({
|
|
713
|
-
nftId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.nftId),
|
|
714
|
-
number: (0, reified_1.decodeFromJSONField)("u64", field.number),
|
|
715
|
-
expEarn: (0, reified_1.decodeFromJSONField)("u64", field.expEarn),
|
|
716
|
-
});
|
|
717
|
-
};
|
|
718
|
-
FirstDepositEvent.fromJSON = function (json) {
|
|
719
|
-
if (json.$typeName !== FirstDepositEvent.$typeName) {
|
|
720
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
721
|
-
}
|
|
722
|
-
return FirstDepositEvent.fromJSONField(json);
|
|
723
|
-
};
|
|
724
|
-
FirstDepositEvent.fromSuiParsedData = function (content) {
|
|
725
|
-
if (content.dataType !== "moveObject") {
|
|
726
|
-
throw new Error("not an object");
|
|
727
|
-
}
|
|
728
|
-
if (!isFirstDepositEvent(content.type)) {
|
|
729
|
-
throw new Error("object at ".concat(content.fields.id, " is not a FirstDepositEvent object"));
|
|
730
|
-
}
|
|
731
|
-
return FirstDepositEvent.fromFieldsWithTypes(content);
|
|
732
|
-
};
|
|
733
|
-
FirstDepositEvent.fromSuiObjectData = function (data) {
|
|
734
|
-
if (data.bcs) {
|
|
735
|
-
if (data.bcs.dataType !== "moveObject" || !isFirstDepositEvent(data.bcs.type)) {
|
|
736
|
-
throw new Error("object at is not a FirstDepositEvent object");
|
|
737
|
-
}
|
|
738
|
-
return FirstDepositEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
739
|
-
}
|
|
740
|
-
if (data.content) {
|
|
741
|
-
return FirstDepositEvent.fromSuiParsedData(data.content);
|
|
742
|
-
}
|
|
743
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
744
|
-
};
|
|
745
|
-
FirstDepositEvent.fetch = function (client, id) {
|
|
746
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
747
|
-
var res;
|
|
748
|
-
var _a, _b;
|
|
749
|
-
return __generator(this, function (_c) {
|
|
750
|
-
switch (_c.label) {
|
|
751
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
752
|
-
case 1:
|
|
753
|
-
res = _c.sent();
|
|
754
|
-
if (res.error) {
|
|
755
|
-
throw new Error("error fetching FirstDepositEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
756
|
-
}
|
|
757
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isFirstDepositEvent(res.data.bcs.type)) {
|
|
758
|
-
throw new Error("object at id ".concat(id, " is not a FirstDepositEvent object"));
|
|
759
|
-
}
|
|
760
|
-
return [2 /*return*/, FirstDepositEvent.fromSuiObjectData(res.data)];
|
|
761
|
-
}
|
|
762
|
-
});
|
|
763
|
-
});
|
|
764
|
-
};
|
|
765
|
-
FirstDepositEvent.$typeName = "".concat(index_1.PKG_V6, "::typus_nft::FirstDepositEvent");
|
|
766
|
-
FirstDepositEvent.$numTypeParams = 0;
|
|
767
|
-
FirstDepositEvent.$isPhantom = [];
|
|
768
|
-
return FirstDepositEvent;
|
|
769
|
-
}());
|
|
770
|
-
exports.FirstDepositEvent = FirstDepositEvent;
|
|
771
|
-
/* ============================== LevelUpEvent =============================== */
|
|
772
|
-
function isLevelUpEvent(type) {
|
|
773
|
-
type = (0, util_1.compressSuiType)(type);
|
|
774
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::LevelUpEvent");
|
|
775
|
-
}
|
|
776
|
-
var LevelUpEvent = /** @class */ (function () {
|
|
777
|
-
function LevelUpEvent(typeArgs, fields) {
|
|
778
|
-
this.__StructClass = true;
|
|
779
|
-
this.$typeName = LevelUpEvent.$typeName;
|
|
780
|
-
this.$isPhantom = LevelUpEvent.$isPhantom;
|
|
781
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([LevelUpEvent.$typeName], __read(typeArgs), false));
|
|
782
|
-
this.$typeArgs = typeArgs;
|
|
783
|
-
this.nftId = fields.nftId;
|
|
784
|
-
this.level = fields.level;
|
|
785
|
-
}
|
|
786
|
-
LevelUpEvent.reified = function () {
|
|
787
|
-
var _this = this;
|
|
788
|
-
return {
|
|
789
|
-
typeName: LevelUpEvent.$typeName,
|
|
790
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([LevelUpEvent.$typeName], [], false)),
|
|
791
|
-
typeArgs: [],
|
|
792
|
-
isPhantom: LevelUpEvent.$isPhantom,
|
|
793
|
-
reifiedTypeArgs: [],
|
|
794
|
-
fromFields: function (fields) { return LevelUpEvent.fromFields(fields); },
|
|
795
|
-
fromFieldsWithTypes: function (item) { return LevelUpEvent.fromFieldsWithTypes(item); },
|
|
796
|
-
fromBcs: function (data) { return LevelUpEvent.fromBcs(data); },
|
|
797
|
-
bcs: LevelUpEvent.bcs,
|
|
798
|
-
fromJSONField: function (field) { return LevelUpEvent.fromJSONField(field); },
|
|
799
|
-
fromJSON: function (json) { return LevelUpEvent.fromJSON(json); },
|
|
800
|
-
fromSuiParsedData: function (content) { return LevelUpEvent.fromSuiParsedData(content); },
|
|
801
|
-
fromSuiObjectData: function (content) { return LevelUpEvent.fromSuiObjectData(content); },
|
|
802
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
803
|
-
return [2 /*return*/, LevelUpEvent.fetch(client, id)];
|
|
804
|
-
}); }); },
|
|
805
|
-
new: function (fields) {
|
|
806
|
-
return new LevelUpEvent([], fields);
|
|
807
|
-
},
|
|
808
|
-
kind: "StructClassReified",
|
|
809
|
-
};
|
|
810
|
-
};
|
|
811
|
-
Object.defineProperty(LevelUpEvent, "r", {
|
|
812
|
-
get: function () {
|
|
813
|
-
return LevelUpEvent.reified();
|
|
814
|
-
},
|
|
815
|
-
enumerable: false,
|
|
816
|
-
configurable: true
|
|
817
|
-
});
|
|
818
|
-
LevelUpEvent.phantom = function () {
|
|
819
|
-
return (0, reified_1.phantom)(LevelUpEvent.reified());
|
|
820
|
-
};
|
|
821
|
-
Object.defineProperty(LevelUpEvent, "p", {
|
|
822
|
-
get: function () {
|
|
823
|
-
return LevelUpEvent.phantom();
|
|
824
|
-
},
|
|
825
|
-
enumerable: false,
|
|
826
|
-
configurable: true
|
|
827
|
-
});
|
|
828
|
-
Object.defineProperty(LevelUpEvent, "bcs", {
|
|
829
|
-
get: function () {
|
|
830
|
-
return bcs_1.bcs.struct("LevelUpEvent", {
|
|
831
|
-
nft_id: structs_2.ID.bcs,
|
|
832
|
-
level: bcs_1.bcs.u64(),
|
|
833
|
-
});
|
|
834
|
-
},
|
|
835
|
-
enumerable: false,
|
|
836
|
-
configurable: true
|
|
837
|
-
});
|
|
838
|
-
LevelUpEvent.fromFields = function (fields) {
|
|
839
|
-
return LevelUpEvent.reified().new({
|
|
840
|
-
nftId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.nft_id),
|
|
841
|
-
level: (0, reified_1.decodeFromFields)("u64", fields.level),
|
|
842
|
-
});
|
|
843
|
-
};
|
|
844
|
-
LevelUpEvent.fromFieldsWithTypes = function (item) {
|
|
845
|
-
if (!isLevelUpEvent(item.type)) {
|
|
846
|
-
throw new Error("not a LevelUpEvent type");
|
|
847
|
-
}
|
|
848
|
-
return LevelUpEvent.reified().new({
|
|
849
|
-
nftId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.nft_id),
|
|
850
|
-
level: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.level),
|
|
851
|
-
});
|
|
852
|
-
};
|
|
853
|
-
LevelUpEvent.fromBcs = function (data) {
|
|
854
|
-
return LevelUpEvent.fromFields(LevelUpEvent.bcs.parse(data));
|
|
855
|
-
};
|
|
856
|
-
LevelUpEvent.prototype.toJSONField = function () {
|
|
857
|
-
return {
|
|
858
|
-
nftId: this.nftId,
|
|
859
|
-
level: this.level.toString(),
|
|
860
|
-
};
|
|
861
|
-
};
|
|
862
|
-
LevelUpEvent.prototype.toJSON = function () {
|
|
863
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
864
|
-
};
|
|
865
|
-
LevelUpEvent.fromJSONField = function (field) {
|
|
866
|
-
return LevelUpEvent.reified().new({
|
|
867
|
-
nftId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.nftId),
|
|
868
|
-
level: (0, reified_1.decodeFromJSONField)("u64", field.level),
|
|
869
|
-
});
|
|
870
|
-
};
|
|
871
|
-
LevelUpEvent.fromJSON = function (json) {
|
|
872
|
-
if (json.$typeName !== LevelUpEvent.$typeName) {
|
|
873
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
874
|
-
}
|
|
875
|
-
return LevelUpEvent.fromJSONField(json);
|
|
876
|
-
};
|
|
877
|
-
LevelUpEvent.fromSuiParsedData = function (content) {
|
|
878
|
-
if (content.dataType !== "moveObject") {
|
|
879
|
-
throw new Error("not an object");
|
|
880
|
-
}
|
|
881
|
-
if (!isLevelUpEvent(content.type)) {
|
|
882
|
-
throw new Error("object at ".concat(content.fields.id, " is not a LevelUpEvent object"));
|
|
883
|
-
}
|
|
884
|
-
return LevelUpEvent.fromFieldsWithTypes(content);
|
|
885
|
-
};
|
|
886
|
-
LevelUpEvent.fromSuiObjectData = function (data) {
|
|
887
|
-
if (data.bcs) {
|
|
888
|
-
if (data.bcs.dataType !== "moveObject" || !isLevelUpEvent(data.bcs.type)) {
|
|
889
|
-
throw new Error("object at is not a LevelUpEvent object");
|
|
890
|
-
}
|
|
891
|
-
return LevelUpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
892
|
-
}
|
|
893
|
-
if (data.content) {
|
|
894
|
-
return LevelUpEvent.fromSuiParsedData(data.content);
|
|
895
|
-
}
|
|
896
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
897
|
-
};
|
|
898
|
-
LevelUpEvent.fetch = function (client, id) {
|
|
899
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
900
|
-
var res;
|
|
901
|
-
var _a, _b;
|
|
902
|
-
return __generator(this, function (_c) {
|
|
903
|
-
switch (_c.label) {
|
|
904
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
905
|
-
case 1:
|
|
906
|
-
res = _c.sent();
|
|
907
|
-
if (res.error) {
|
|
908
|
-
throw new Error("error fetching LevelUpEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
909
|
-
}
|
|
910
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isLevelUpEvent(res.data.bcs.type)) {
|
|
911
|
-
throw new Error("object at id ".concat(id, " is not a LevelUpEvent object"));
|
|
912
|
-
}
|
|
913
|
-
return [2 /*return*/, LevelUpEvent.fromSuiObjectData(res.data)];
|
|
914
|
-
}
|
|
915
|
-
});
|
|
916
|
-
});
|
|
917
|
-
};
|
|
918
|
-
LevelUpEvent.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::LevelUpEvent");
|
|
919
|
-
LevelUpEvent.$numTypeParams = 0;
|
|
920
|
-
LevelUpEvent.$isPhantom = [];
|
|
921
|
-
return LevelUpEvent;
|
|
922
|
-
}());
|
|
923
|
-
exports.LevelUpEvent = LevelUpEvent;
|
|
924
|
-
/* ============================== ManagerCap =============================== */
|
|
925
|
-
function isManagerCap(type) {
|
|
926
|
-
type = (0, util_1.compressSuiType)(type);
|
|
927
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::ManagerCap");
|
|
928
|
-
}
|
|
929
|
-
var ManagerCap = /** @class */ (function () {
|
|
930
|
-
function ManagerCap(typeArgs, fields) {
|
|
931
|
-
this.__StructClass = true;
|
|
932
|
-
this.$typeName = ManagerCap.$typeName;
|
|
933
|
-
this.$isPhantom = ManagerCap.$isPhantom;
|
|
934
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerCap.$typeName], __read(typeArgs), false));
|
|
935
|
-
this.$typeArgs = typeArgs;
|
|
936
|
-
this.id = fields.id;
|
|
937
|
-
}
|
|
938
|
-
ManagerCap.reified = function () {
|
|
939
|
-
var _this = this;
|
|
940
|
-
return {
|
|
941
|
-
typeName: ManagerCap.$typeName,
|
|
942
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerCap.$typeName], [], false)),
|
|
943
|
-
typeArgs: [],
|
|
944
|
-
isPhantom: ManagerCap.$isPhantom,
|
|
945
|
-
reifiedTypeArgs: [],
|
|
946
|
-
fromFields: function (fields) { return ManagerCap.fromFields(fields); },
|
|
947
|
-
fromFieldsWithTypes: function (item) { return ManagerCap.fromFieldsWithTypes(item); },
|
|
948
|
-
fromBcs: function (data) { return ManagerCap.fromBcs(data); },
|
|
949
|
-
bcs: ManagerCap.bcs,
|
|
950
|
-
fromJSONField: function (field) { return ManagerCap.fromJSONField(field); },
|
|
951
|
-
fromJSON: function (json) { return ManagerCap.fromJSON(json); },
|
|
952
|
-
fromSuiParsedData: function (content) { return ManagerCap.fromSuiParsedData(content); },
|
|
953
|
-
fromSuiObjectData: function (content) { return ManagerCap.fromSuiObjectData(content); },
|
|
954
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
955
|
-
return [2 /*return*/, ManagerCap.fetch(client, id)];
|
|
956
|
-
}); }); },
|
|
957
|
-
new: function (fields) {
|
|
958
|
-
return new ManagerCap([], fields);
|
|
959
|
-
},
|
|
960
|
-
kind: "StructClassReified",
|
|
961
|
-
};
|
|
962
|
-
};
|
|
963
|
-
Object.defineProperty(ManagerCap, "r", {
|
|
964
|
-
get: function () {
|
|
965
|
-
return ManagerCap.reified();
|
|
966
|
-
},
|
|
967
|
-
enumerable: false,
|
|
968
|
-
configurable: true
|
|
969
|
-
});
|
|
970
|
-
ManagerCap.phantom = function () {
|
|
971
|
-
return (0, reified_1.phantom)(ManagerCap.reified());
|
|
972
|
-
};
|
|
973
|
-
Object.defineProperty(ManagerCap, "p", {
|
|
974
|
-
get: function () {
|
|
975
|
-
return ManagerCap.phantom();
|
|
976
|
-
},
|
|
977
|
-
enumerable: false,
|
|
978
|
-
configurable: true
|
|
979
|
-
});
|
|
980
|
-
Object.defineProperty(ManagerCap, "bcs", {
|
|
981
|
-
get: function () {
|
|
982
|
-
return bcs_1.bcs.struct("ManagerCap", {
|
|
983
|
-
id: structs_2.UID.bcs,
|
|
984
|
-
});
|
|
985
|
-
},
|
|
986
|
-
enumerable: false,
|
|
987
|
-
configurable: true
|
|
988
|
-
});
|
|
989
|
-
ManagerCap.fromFields = function (fields) {
|
|
990
|
-
return ManagerCap.reified().new({ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id) });
|
|
991
|
-
};
|
|
992
|
-
ManagerCap.fromFieldsWithTypes = function (item) {
|
|
993
|
-
if (!isManagerCap(item.type)) {
|
|
994
|
-
throw new Error("not a ManagerCap type");
|
|
995
|
-
}
|
|
996
|
-
return ManagerCap.reified().new({ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id) });
|
|
997
|
-
};
|
|
998
|
-
ManagerCap.fromBcs = function (data) {
|
|
999
|
-
return ManagerCap.fromFields(ManagerCap.bcs.parse(data));
|
|
1000
|
-
};
|
|
1001
|
-
ManagerCap.prototype.toJSONField = function () {
|
|
1002
|
-
return {
|
|
1003
|
-
id: this.id,
|
|
1004
|
-
};
|
|
1005
|
-
};
|
|
1006
|
-
ManagerCap.prototype.toJSON = function () {
|
|
1007
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1008
|
-
};
|
|
1009
|
-
ManagerCap.fromJSONField = function (field) {
|
|
1010
|
-
return ManagerCap.reified().new({ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id) });
|
|
1011
|
-
};
|
|
1012
|
-
ManagerCap.fromJSON = function (json) {
|
|
1013
|
-
if (json.$typeName !== ManagerCap.$typeName) {
|
|
1014
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1015
|
-
}
|
|
1016
|
-
return ManagerCap.fromJSONField(json);
|
|
1017
|
-
};
|
|
1018
|
-
ManagerCap.fromSuiParsedData = function (content) {
|
|
1019
|
-
if (content.dataType !== "moveObject") {
|
|
1020
|
-
throw new Error("not an object");
|
|
1021
|
-
}
|
|
1022
|
-
if (!isManagerCap(content.type)) {
|
|
1023
|
-
throw new Error("object at ".concat(content.fields.id, " is not a ManagerCap object"));
|
|
1024
|
-
}
|
|
1025
|
-
return ManagerCap.fromFieldsWithTypes(content);
|
|
1026
|
-
};
|
|
1027
|
-
ManagerCap.fromSuiObjectData = function (data) {
|
|
1028
|
-
if (data.bcs) {
|
|
1029
|
-
if (data.bcs.dataType !== "moveObject" || !isManagerCap(data.bcs.type)) {
|
|
1030
|
-
throw new Error("object at is not a ManagerCap object");
|
|
1031
|
-
}
|
|
1032
|
-
return ManagerCap.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1033
|
-
}
|
|
1034
|
-
if (data.content) {
|
|
1035
|
-
return ManagerCap.fromSuiParsedData(data.content);
|
|
1036
|
-
}
|
|
1037
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1038
|
-
};
|
|
1039
|
-
ManagerCap.fetch = function (client, id) {
|
|
1040
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1041
|
-
var res;
|
|
1042
|
-
var _a, _b;
|
|
1043
|
-
return __generator(this, function (_c) {
|
|
1044
|
-
switch (_c.label) {
|
|
1045
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1046
|
-
case 1:
|
|
1047
|
-
res = _c.sent();
|
|
1048
|
-
if (res.error) {
|
|
1049
|
-
throw new Error("error fetching ManagerCap object at id ".concat(id, ": ").concat(res.error.code));
|
|
1050
|
-
}
|
|
1051
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerCap(res.data.bcs.type)) {
|
|
1052
|
-
throw new Error("object at id ".concat(id, " is not a ManagerCap object"));
|
|
1053
|
-
}
|
|
1054
|
-
return [2 /*return*/, ManagerCap.fromSuiObjectData(res.data)];
|
|
1055
|
-
}
|
|
1056
|
-
});
|
|
1057
|
-
});
|
|
1058
|
-
};
|
|
1059
|
-
ManagerCap.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::ManagerCap");
|
|
1060
|
-
ManagerCap.$numTypeParams = 0;
|
|
1061
|
-
ManagerCap.$isPhantom = [];
|
|
1062
|
-
return ManagerCap;
|
|
1063
|
-
}());
|
|
1064
|
-
exports.ManagerCap = ManagerCap;
|
|
1065
|
-
/* ============================== MintEvent =============================== */
|
|
1066
|
-
function isMintEvent(type) {
|
|
1067
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1068
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::MintEvent");
|
|
1069
|
-
}
|
|
1070
|
-
var MintEvent = /** @class */ (function () {
|
|
1071
|
-
function MintEvent(typeArgs, fields) {
|
|
1072
|
-
this.__StructClass = true;
|
|
1073
|
-
this.$typeName = MintEvent.$typeName;
|
|
1074
|
-
this.$isPhantom = MintEvent.$isPhantom;
|
|
1075
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MintEvent.$typeName], __read(typeArgs), false));
|
|
1076
|
-
this.$typeArgs = typeArgs;
|
|
1077
|
-
this.id = fields.id;
|
|
1078
|
-
this.name = fields.name;
|
|
1079
|
-
this.description = fields.description;
|
|
1080
|
-
this.number = fields.number;
|
|
1081
|
-
this.url = fields.url;
|
|
1082
|
-
this.attributes = fields.attributes;
|
|
1083
|
-
this.sender = fields.sender;
|
|
1084
|
-
}
|
|
1085
|
-
MintEvent.reified = function () {
|
|
1086
|
-
var _this = this;
|
|
1087
|
-
return {
|
|
1088
|
-
typeName: MintEvent.$typeName,
|
|
1089
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MintEvent.$typeName], [], false)),
|
|
1090
|
-
typeArgs: [],
|
|
1091
|
-
isPhantom: MintEvent.$isPhantom,
|
|
1092
|
-
reifiedTypeArgs: [],
|
|
1093
|
-
fromFields: function (fields) { return MintEvent.fromFields(fields); },
|
|
1094
|
-
fromFieldsWithTypes: function (item) { return MintEvent.fromFieldsWithTypes(item); },
|
|
1095
|
-
fromBcs: function (data) { return MintEvent.fromBcs(data); },
|
|
1096
|
-
bcs: MintEvent.bcs,
|
|
1097
|
-
fromJSONField: function (field) { return MintEvent.fromJSONField(field); },
|
|
1098
|
-
fromJSON: function (json) { return MintEvent.fromJSON(json); },
|
|
1099
|
-
fromSuiParsedData: function (content) { return MintEvent.fromSuiParsedData(content); },
|
|
1100
|
-
fromSuiObjectData: function (content) { return MintEvent.fromSuiObjectData(content); },
|
|
1101
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1102
|
-
return [2 /*return*/, MintEvent.fetch(client, id)];
|
|
1103
|
-
}); }); },
|
|
1104
|
-
new: function (fields) {
|
|
1105
|
-
return new MintEvent([], fields);
|
|
1106
|
-
},
|
|
1107
|
-
kind: "StructClassReified",
|
|
1108
|
-
};
|
|
1109
|
-
};
|
|
1110
|
-
Object.defineProperty(MintEvent, "r", {
|
|
1111
|
-
get: function () {
|
|
1112
|
-
return MintEvent.reified();
|
|
1113
|
-
},
|
|
1114
|
-
enumerable: false,
|
|
1115
|
-
configurable: true
|
|
1116
|
-
});
|
|
1117
|
-
MintEvent.phantom = function () {
|
|
1118
|
-
return (0, reified_1.phantom)(MintEvent.reified());
|
|
1119
|
-
};
|
|
1120
|
-
Object.defineProperty(MintEvent, "p", {
|
|
1121
|
-
get: function () {
|
|
1122
|
-
return MintEvent.phantom();
|
|
1123
|
-
},
|
|
1124
|
-
enumerable: false,
|
|
1125
|
-
configurable: true
|
|
1126
|
-
});
|
|
1127
|
-
Object.defineProperty(MintEvent, "bcs", {
|
|
1128
|
-
get: function () {
|
|
1129
|
-
return bcs_1.bcs.struct("MintEvent", {
|
|
1130
|
-
id: structs_2.ID.bcs,
|
|
1131
|
-
name: structs_1.String.bcs,
|
|
1132
|
-
description: structs_1.String.bcs,
|
|
1133
|
-
number: bcs_1.bcs.u64(),
|
|
1134
|
-
url: structs_4.Url.bcs,
|
|
1135
|
-
attributes: structs_5.VecMap.bcs(structs_1.String.bcs, structs_1.String.bcs),
|
|
1136
|
-
sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
|
|
1137
|
-
});
|
|
1138
|
-
},
|
|
1139
|
-
enumerable: false,
|
|
1140
|
-
configurable: true
|
|
1141
|
-
});
|
|
1142
|
-
MintEvent.fromFields = function (fields) {
|
|
1143
|
-
return MintEvent.reified().new({
|
|
1144
|
-
id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id),
|
|
1145
|
-
name: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.name),
|
|
1146
|
-
description: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.description),
|
|
1147
|
-
number: (0, reified_1.decodeFromFields)("u64", fields.number),
|
|
1148
|
-
url: (0, reified_1.decodeFromFields)(structs_4.Url.reified(), fields.url),
|
|
1149
|
-
attributes: (0, reified_1.decodeFromFields)(structs_5.VecMap.reified(structs_1.String.reified(), structs_1.String.reified()), fields.attributes),
|
|
1150
|
-
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
1151
|
-
});
|
|
1152
|
-
};
|
|
1153
|
-
MintEvent.fromFieldsWithTypes = function (item) {
|
|
1154
|
-
if (!isMintEvent(item.type)) {
|
|
1155
|
-
throw new Error("not a MintEvent type");
|
|
1156
|
-
}
|
|
1157
|
-
return MintEvent.reified().new({
|
|
1158
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id),
|
|
1159
|
-
name: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.name),
|
|
1160
|
-
description: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.description),
|
|
1161
|
-
number: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.number),
|
|
1162
|
-
url: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.Url.reified(), item.fields.url),
|
|
1163
|
-
attributes: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.VecMap.reified(structs_1.String.reified(), structs_1.String.reified()), item.fields.attributes),
|
|
1164
|
-
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
1165
|
-
});
|
|
1166
|
-
};
|
|
1167
|
-
MintEvent.fromBcs = function (data) {
|
|
1168
|
-
return MintEvent.fromFields(MintEvent.bcs.parse(data));
|
|
1169
|
-
};
|
|
1170
|
-
MintEvent.prototype.toJSONField = function () {
|
|
1171
|
-
return {
|
|
1172
|
-
id: this.id,
|
|
1173
|
-
name: this.name,
|
|
1174
|
-
description: this.description,
|
|
1175
|
-
number: this.number.toString(),
|
|
1176
|
-
url: this.url,
|
|
1177
|
-
attributes: this.attributes.toJSONField(),
|
|
1178
|
-
sender: this.sender,
|
|
1179
|
-
};
|
|
1180
|
-
};
|
|
1181
|
-
MintEvent.prototype.toJSON = function () {
|
|
1182
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1183
|
-
};
|
|
1184
|
-
MintEvent.fromJSONField = function (field) {
|
|
1185
|
-
return MintEvent.reified().new({
|
|
1186
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id),
|
|
1187
|
-
name: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.name),
|
|
1188
|
-
description: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.description),
|
|
1189
|
-
number: (0, reified_1.decodeFromJSONField)("u64", field.number),
|
|
1190
|
-
url: (0, reified_1.decodeFromJSONField)(structs_4.Url.reified(), field.url),
|
|
1191
|
-
attributes: (0, reified_1.decodeFromJSONField)(structs_5.VecMap.reified(structs_1.String.reified(), structs_1.String.reified()), field.attributes),
|
|
1192
|
-
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
1193
|
-
});
|
|
1194
|
-
};
|
|
1195
|
-
MintEvent.fromJSON = function (json) {
|
|
1196
|
-
if (json.$typeName !== MintEvent.$typeName) {
|
|
1197
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1198
|
-
}
|
|
1199
|
-
return MintEvent.fromJSONField(json);
|
|
1200
|
-
};
|
|
1201
|
-
MintEvent.fromSuiParsedData = function (content) {
|
|
1202
|
-
if (content.dataType !== "moveObject") {
|
|
1203
|
-
throw new Error("not an object");
|
|
1204
|
-
}
|
|
1205
|
-
if (!isMintEvent(content.type)) {
|
|
1206
|
-
throw new Error("object at ".concat(content.fields.id, " is not a MintEvent object"));
|
|
1207
|
-
}
|
|
1208
|
-
return MintEvent.fromFieldsWithTypes(content);
|
|
1209
|
-
};
|
|
1210
|
-
MintEvent.fromSuiObjectData = function (data) {
|
|
1211
|
-
if (data.bcs) {
|
|
1212
|
-
if (data.bcs.dataType !== "moveObject" || !isMintEvent(data.bcs.type)) {
|
|
1213
|
-
throw new Error("object at is not a MintEvent object");
|
|
1214
|
-
}
|
|
1215
|
-
return MintEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1216
|
-
}
|
|
1217
|
-
if (data.content) {
|
|
1218
|
-
return MintEvent.fromSuiParsedData(data.content);
|
|
1219
|
-
}
|
|
1220
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1221
|
-
};
|
|
1222
|
-
MintEvent.fetch = function (client, id) {
|
|
1223
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1224
|
-
var res;
|
|
1225
|
-
var _a, _b;
|
|
1226
|
-
return __generator(this, function (_c) {
|
|
1227
|
-
switch (_c.label) {
|
|
1228
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1229
|
-
case 1:
|
|
1230
|
-
res = _c.sent();
|
|
1231
|
-
if (res.error) {
|
|
1232
|
-
throw new Error("error fetching MintEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
1233
|
-
}
|
|
1234
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMintEvent(res.data.bcs.type)) {
|
|
1235
|
-
throw new Error("object at id ".concat(id, " is not a MintEvent object"));
|
|
1236
|
-
}
|
|
1237
|
-
return [2 /*return*/, MintEvent.fromSuiObjectData(res.data)];
|
|
1238
|
-
}
|
|
1239
|
-
});
|
|
1240
|
-
});
|
|
1241
|
-
};
|
|
1242
|
-
MintEvent.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::MintEvent");
|
|
1243
|
-
MintEvent.$numTypeParams = 0;
|
|
1244
|
-
MintEvent.$isPhantom = [];
|
|
1245
|
-
return MintEvent;
|
|
1246
|
-
}());
|
|
1247
|
-
exports.MintEvent = MintEvent;
|
|
1248
|
-
/* ============================== NewManagerCapEvent =============================== */
|
|
1249
|
-
function isNewManagerCapEvent(type) {
|
|
1250
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1251
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::NewManagerCapEvent");
|
|
1252
|
-
}
|
|
1253
|
-
var NewManagerCapEvent = /** @class */ (function () {
|
|
1254
|
-
function NewManagerCapEvent(typeArgs, fields) {
|
|
1255
|
-
this.__StructClass = true;
|
|
1256
|
-
this.$typeName = NewManagerCapEvent.$typeName;
|
|
1257
|
-
this.$isPhantom = NewManagerCapEvent.$isPhantom;
|
|
1258
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewManagerCapEvent.$typeName], __read(typeArgs), false));
|
|
1259
|
-
this.$typeArgs = typeArgs;
|
|
1260
|
-
this.id = fields.id;
|
|
1261
|
-
this.sender = fields.sender;
|
|
1262
|
-
}
|
|
1263
|
-
NewManagerCapEvent.reified = function () {
|
|
1264
|
-
var _this = this;
|
|
1265
|
-
return {
|
|
1266
|
-
typeName: NewManagerCapEvent.$typeName,
|
|
1267
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewManagerCapEvent.$typeName], [], false)),
|
|
1268
|
-
typeArgs: [],
|
|
1269
|
-
isPhantom: NewManagerCapEvent.$isPhantom,
|
|
1270
|
-
reifiedTypeArgs: [],
|
|
1271
|
-
fromFields: function (fields) { return NewManagerCapEvent.fromFields(fields); },
|
|
1272
|
-
fromFieldsWithTypes: function (item) { return NewManagerCapEvent.fromFieldsWithTypes(item); },
|
|
1273
|
-
fromBcs: function (data) { return NewManagerCapEvent.fromBcs(data); },
|
|
1274
|
-
bcs: NewManagerCapEvent.bcs,
|
|
1275
|
-
fromJSONField: function (field) { return NewManagerCapEvent.fromJSONField(field); },
|
|
1276
|
-
fromJSON: function (json) { return NewManagerCapEvent.fromJSON(json); },
|
|
1277
|
-
fromSuiParsedData: function (content) { return NewManagerCapEvent.fromSuiParsedData(content); },
|
|
1278
|
-
fromSuiObjectData: function (content) { return NewManagerCapEvent.fromSuiObjectData(content); },
|
|
1279
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1280
|
-
return [2 /*return*/, NewManagerCapEvent.fetch(client, id)];
|
|
1281
|
-
}); }); },
|
|
1282
|
-
new: function (fields) {
|
|
1283
|
-
return new NewManagerCapEvent([], fields);
|
|
1284
|
-
},
|
|
1285
|
-
kind: "StructClassReified",
|
|
1286
|
-
};
|
|
1287
|
-
};
|
|
1288
|
-
Object.defineProperty(NewManagerCapEvent, "r", {
|
|
1289
|
-
get: function () {
|
|
1290
|
-
return NewManagerCapEvent.reified();
|
|
1291
|
-
},
|
|
1292
|
-
enumerable: false,
|
|
1293
|
-
configurable: true
|
|
1294
|
-
});
|
|
1295
|
-
NewManagerCapEvent.phantom = function () {
|
|
1296
|
-
return (0, reified_1.phantom)(NewManagerCapEvent.reified());
|
|
1297
|
-
};
|
|
1298
|
-
Object.defineProperty(NewManagerCapEvent, "p", {
|
|
1299
|
-
get: function () {
|
|
1300
|
-
return NewManagerCapEvent.phantom();
|
|
1301
|
-
},
|
|
1302
|
-
enumerable: false,
|
|
1303
|
-
configurable: true
|
|
1304
|
-
});
|
|
1305
|
-
Object.defineProperty(NewManagerCapEvent, "bcs", {
|
|
1306
|
-
get: function () {
|
|
1307
|
-
return bcs_1.bcs.struct("NewManagerCapEvent", {
|
|
1308
|
-
id: structs_2.ID.bcs,
|
|
1309
|
-
sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
|
|
1310
|
-
});
|
|
1311
|
-
},
|
|
1312
|
-
enumerable: false,
|
|
1313
|
-
configurable: true
|
|
1314
|
-
});
|
|
1315
|
-
NewManagerCapEvent.fromFields = function (fields) {
|
|
1316
|
-
return NewManagerCapEvent.reified().new({
|
|
1317
|
-
id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id),
|
|
1318
|
-
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
1319
|
-
});
|
|
1320
|
-
};
|
|
1321
|
-
NewManagerCapEvent.fromFieldsWithTypes = function (item) {
|
|
1322
|
-
if (!isNewManagerCapEvent(item.type)) {
|
|
1323
|
-
throw new Error("not a NewManagerCapEvent type");
|
|
1324
|
-
}
|
|
1325
|
-
return NewManagerCapEvent.reified().new({
|
|
1326
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id),
|
|
1327
|
-
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
1328
|
-
});
|
|
1329
|
-
};
|
|
1330
|
-
NewManagerCapEvent.fromBcs = function (data) {
|
|
1331
|
-
return NewManagerCapEvent.fromFields(NewManagerCapEvent.bcs.parse(data));
|
|
1332
|
-
};
|
|
1333
|
-
NewManagerCapEvent.prototype.toJSONField = function () {
|
|
1334
|
-
return {
|
|
1335
|
-
id: this.id,
|
|
1336
|
-
sender: this.sender,
|
|
1337
|
-
};
|
|
1338
|
-
};
|
|
1339
|
-
NewManagerCapEvent.prototype.toJSON = function () {
|
|
1340
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1341
|
-
};
|
|
1342
|
-
NewManagerCapEvent.fromJSONField = function (field) {
|
|
1343
|
-
return NewManagerCapEvent.reified().new({
|
|
1344
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id),
|
|
1345
|
-
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
1346
|
-
});
|
|
1347
|
-
};
|
|
1348
|
-
NewManagerCapEvent.fromJSON = function (json) {
|
|
1349
|
-
if (json.$typeName !== NewManagerCapEvent.$typeName) {
|
|
1350
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1351
|
-
}
|
|
1352
|
-
return NewManagerCapEvent.fromJSONField(json);
|
|
1353
|
-
};
|
|
1354
|
-
NewManagerCapEvent.fromSuiParsedData = function (content) {
|
|
1355
|
-
if (content.dataType !== "moveObject") {
|
|
1356
|
-
throw new Error("not an object");
|
|
1357
|
-
}
|
|
1358
|
-
if (!isNewManagerCapEvent(content.type)) {
|
|
1359
|
-
throw new Error("object at ".concat(content.fields.id, " is not a NewManagerCapEvent object"));
|
|
1360
|
-
}
|
|
1361
|
-
return NewManagerCapEvent.fromFieldsWithTypes(content);
|
|
1362
|
-
};
|
|
1363
|
-
NewManagerCapEvent.fromSuiObjectData = function (data) {
|
|
1364
|
-
if (data.bcs) {
|
|
1365
|
-
if (data.bcs.dataType !== "moveObject" || !isNewManagerCapEvent(data.bcs.type)) {
|
|
1366
|
-
throw new Error("object at is not a NewManagerCapEvent object");
|
|
1367
|
-
}
|
|
1368
|
-
return NewManagerCapEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1369
|
-
}
|
|
1370
|
-
if (data.content) {
|
|
1371
|
-
return NewManagerCapEvent.fromSuiParsedData(data.content);
|
|
1372
|
-
}
|
|
1373
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1374
|
-
};
|
|
1375
|
-
NewManagerCapEvent.fetch = function (client, id) {
|
|
1376
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1377
|
-
var res;
|
|
1378
|
-
var _a, _b;
|
|
1379
|
-
return __generator(this, function (_c) {
|
|
1380
|
-
switch (_c.label) {
|
|
1381
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1382
|
-
case 1:
|
|
1383
|
-
res = _c.sent();
|
|
1384
|
-
if (res.error) {
|
|
1385
|
-
throw new Error("error fetching NewManagerCapEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
1386
|
-
}
|
|
1387
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewManagerCapEvent(res.data.bcs.type)) {
|
|
1388
|
-
throw new Error("object at id ".concat(id, " is not a NewManagerCapEvent object"));
|
|
1389
|
-
}
|
|
1390
|
-
return [2 /*return*/, NewManagerCapEvent.fromSuiObjectData(res.data)];
|
|
1391
|
-
}
|
|
1392
|
-
});
|
|
1393
|
-
});
|
|
1394
|
-
};
|
|
1395
|
-
NewManagerCapEvent.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::NewManagerCapEvent");
|
|
1396
|
-
NewManagerCapEvent.$numTypeParams = 0;
|
|
1397
|
-
NewManagerCapEvent.$isPhantom = [];
|
|
1398
|
-
return NewManagerCapEvent;
|
|
1399
|
-
}());
|
|
1400
|
-
exports.NewManagerCapEvent = NewManagerCapEvent;
|
|
1401
|
-
/* ============================== Pool =============================== */
|
|
1402
|
-
function isPool(type) {
|
|
1403
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1404
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::Pool");
|
|
1405
|
-
}
|
|
1406
|
-
var Pool = /** @class */ (function () {
|
|
1407
|
-
function Pool(typeArgs, fields) {
|
|
1408
|
-
this.__StructClass = true;
|
|
1409
|
-
this.$typeName = Pool.$typeName;
|
|
1410
|
-
this.$isPhantom = Pool.$isPhantom;
|
|
1411
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Pool.$typeName], __read(typeArgs), false));
|
|
1412
|
-
this.$typeArgs = typeArgs;
|
|
1413
|
-
this.id = fields.id;
|
|
1414
|
-
this.tails = fields.tails;
|
|
1415
|
-
this.num = fields.num;
|
|
1416
|
-
this.isLive = fields.isLive;
|
|
1417
|
-
this.startMs = fields.startMs;
|
|
1418
|
-
}
|
|
1419
|
-
Pool.reified = function () {
|
|
1420
|
-
var _this = this;
|
|
1421
|
-
return {
|
|
1422
|
-
typeName: Pool.$typeName,
|
|
1423
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Pool.$typeName], [], false)),
|
|
1424
|
-
typeArgs: [],
|
|
1425
|
-
isPhantom: Pool.$isPhantom,
|
|
1426
|
-
reifiedTypeArgs: [],
|
|
1427
|
-
fromFields: function (fields) { return Pool.fromFields(fields); },
|
|
1428
|
-
fromFieldsWithTypes: function (item) { return Pool.fromFieldsWithTypes(item); },
|
|
1429
|
-
fromBcs: function (data) { return Pool.fromBcs(data); },
|
|
1430
|
-
bcs: Pool.bcs,
|
|
1431
|
-
fromJSONField: function (field) { return Pool.fromJSONField(field); },
|
|
1432
|
-
fromJSON: function (json) { return Pool.fromJSON(json); },
|
|
1433
|
-
fromSuiParsedData: function (content) { return Pool.fromSuiParsedData(content); },
|
|
1434
|
-
fromSuiObjectData: function (content) { return Pool.fromSuiObjectData(content); },
|
|
1435
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1436
|
-
return [2 /*return*/, Pool.fetch(client, id)];
|
|
1437
|
-
}); }); },
|
|
1438
|
-
new: function (fields) {
|
|
1439
|
-
return new Pool([], fields);
|
|
1440
|
-
},
|
|
1441
|
-
kind: "StructClassReified",
|
|
1442
|
-
};
|
|
1443
|
-
};
|
|
1444
|
-
Object.defineProperty(Pool, "r", {
|
|
1445
|
-
get: function () {
|
|
1446
|
-
return Pool.reified();
|
|
1447
|
-
},
|
|
1448
|
-
enumerable: false,
|
|
1449
|
-
configurable: true
|
|
1450
|
-
});
|
|
1451
|
-
Pool.phantom = function () {
|
|
1452
|
-
return (0, reified_1.phantom)(Pool.reified());
|
|
1453
|
-
};
|
|
1454
|
-
Object.defineProperty(Pool, "p", {
|
|
1455
|
-
get: function () {
|
|
1456
|
-
return Pool.phantom();
|
|
1457
|
-
},
|
|
1458
|
-
enumerable: false,
|
|
1459
|
-
configurable: true
|
|
1460
|
-
});
|
|
1461
|
-
Object.defineProperty(Pool, "bcs", {
|
|
1462
|
-
get: function () {
|
|
1463
|
-
return bcs_1.bcs.struct("Pool", {
|
|
1464
|
-
id: structs_2.UID.bcs,
|
|
1465
|
-
tails: structs_6.TableVec.bcs,
|
|
1466
|
-
num: bcs_1.bcs.u64(),
|
|
1467
|
-
is_live: bcs_1.bcs.bool(),
|
|
1468
|
-
start_ms: bcs_1.bcs.u64(),
|
|
1469
|
-
});
|
|
1470
|
-
},
|
|
1471
|
-
enumerable: false,
|
|
1472
|
-
configurable: true
|
|
1473
|
-
});
|
|
1474
|
-
Pool.fromFields = function (fields) {
|
|
1475
|
-
return Pool.reified().new({
|
|
1476
|
-
id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
|
|
1477
|
-
tails: (0, reified_1.decodeFromFields)(structs_6.TableVec.reified(reified.phantom(Tails.reified())), fields.tails),
|
|
1478
|
-
num: (0, reified_1.decodeFromFields)("u64", fields.num),
|
|
1479
|
-
isLive: (0, reified_1.decodeFromFields)("bool", fields.is_live),
|
|
1480
|
-
startMs: (0, reified_1.decodeFromFields)("u64", fields.start_ms),
|
|
1481
|
-
});
|
|
1482
|
-
};
|
|
1483
|
-
Pool.fromFieldsWithTypes = function (item) {
|
|
1484
|
-
if (!isPool(item.type)) {
|
|
1485
|
-
throw new Error("not a Pool type");
|
|
1486
|
-
}
|
|
1487
|
-
return Pool.reified().new({
|
|
1488
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
1489
|
-
tails: (0, reified_1.decodeFromFieldsWithTypes)(structs_6.TableVec.reified(reified.phantom(Tails.reified())), item.fields.tails),
|
|
1490
|
-
num: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.num),
|
|
1491
|
-
isLive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_live),
|
|
1492
|
-
startMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.start_ms),
|
|
1493
|
-
});
|
|
1494
|
-
};
|
|
1495
|
-
Pool.fromBcs = function (data) {
|
|
1496
|
-
return Pool.fromFields(Pool.bcs.parse(data));
|
|
1497
|
-
};
|
|
1498
|
-
Pool.prototype.toJSONField = function () {
|
|
1499
|
-
return {
|
|
1500
|
-
id: this.id,
|
|
1501
|
-
tails: this.tails.toJSONField(),
|
|
1502
|
-
num: this.num.toString(),
|
|
1503
|
-
isLive: this.isLive,
|
|
1504
|
-
startMs: this.startMs.toString(),
|
|
1505
|
-
};
|
|
1506
|
-
};
|
|
1507
|
-
Pool.prototype.toJSON = function () {
|
|
1508
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1509
|
-
};
|
|
1510
|
-
Pool.fromJSONField = function (field) {
|
|
1511
|
-
return Pool.reified().new({
|
|
1512
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
1513
|
-
tails: (0, reified_1.decodeFromJSONField)(structs_6.TableVec.reified(reified.phantom(Tails.reified())), field.tails),
|
|
1514
|
-
num: (0, reified_1.decodeFromJSONField)("u64", field.num),
|
|
1515
|
-
isLive: (0, reified_1.decodeFromJSONField)("bool", field.isLive),
|
|
1516
|
-
startMs: (0, reified_1.decodeFromJSONField)("u64", field.startMs),
|
|
1517
|
-
});
|
|
1518
|
-
};
|
|
1519
|
-
Pool.fromJSON = function (json) {
|
|
1520
|
-
if (json.$typeName !== Pool.$typeName) {
|
|
1521
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1522
|
-
}
|
|
1523
|
-
return Pool.fromJSONField(json);
|
|
1524
|
-
};
|
|
1525
|
-
Pool.fromSuiParsedData = function (content) {
|
|
1526
|
-
if (content.dataType !== "moveObject") {
|
|
1527
|
-
throw new Error("not an object");
|
|
1528
|
-
}
|
|
1529
|
-
if (!isPool(content.type)) {
|
|
1530
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Pool object"));
|
|
1531
|
-
}
|
|
1532
|
-
return Pool.fromFieldsWithTypes(content);
|
|
1533
|
-
};
|
|
1534
|
-
Pool.fromSuiObjectData = function (data) {
|
|
1535
|
-
if (data.bcs) {
|
|
1536
|
-
if (data.bcs.dataType !== "moveObject" || !isPool(data.bcs.type)) {
|
|
1537
|
-
throw new Error("object at is not a Pool object");
|
|
1538
|
-
}
|
|
1539
|
-
return Pool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1540
|
-
}
|
|
1541
|
-
if (data.content) {
|
|
1542
|
-
return Pool.fromSuiParsedData(data.content);
|
|
1543
|
-
}
|
|
1544
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1545
|
-
};
|
|
1546
|
-
Pool.fetch = function (client, id) {
|
|
1547
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1548
|
-
var res;
|
|
1549
|
-
var _a, _b;
|
|
1550
|
-
return __generator(this, function (_c) {
|
|
1551
|
-
switch (_c.label) {
|
|
1552
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1553
|
-
case 1:
|
|
1554
|
-
res = _c.sent();
|
|
1555
|
-
if (res.error) {
|
|
1556
|
-
throw new Error("error fetching Pool object at id ".concat(id, ": ").concat(res.error.code));
|
|
1557
|
-
}
|
|
1558
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isPool(res.data.bcs.type)) {
|
|
1559
|
-
throw new Error("object at id ".concat(id, " is not a Pool object"));
|
|
1560
|
-
}
|
|
1561
|
-
return [2 /*return*/, Pool.fromSuiObjectData(res.data)];
|
|
1562
|
-
}
|
|
1563
|
-
});
|
|
1564
|
-
});
|
|
1565
|
-
};
|
|
1566
|
-
Pool.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::Pool");
|
|
1567
|
-
Pool.$numTypeParams = 0;
|
|
1568
|
-
Pool.$isPhantom = [];
|
|
1569
|
-
return Pool;
|
|
1570
|
-
}());
|
|
1571
|
-
exports.Pool = Pool;
|
|
1572
|
-
/* ============================== Royalty =============================== */
|
|
1573
|
-
function isRoyalty(type) {
|
|
1574
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1575
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::Royalty");
|
|
1576
|
-
}
|
|
1577
|
-
var Royalty = /** @class */ (function () {
|
|
1578
|
-
function Royalty(typeArgs, fields) {
|
|
1579
|
-
this.__StructClass = true;
|
|
1580
|
-
this.$typeName = Royalty.$typeName;
|
|
1581
|
-
this.$isPhantom = Royalty.$isPhantom;
|
|
1582
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Royalty.$typeName], __read(typeArgs), false));
|
|
1583
|
-
this.$typeArgs = typeArgs;
|
|
1584
|
-
this.id = fields.id;
|
|
1585
|
-
this.recipients = fields.recipients;
|
|
1586
|
-
this.policyCap = fields.policyCap;
|
|
1587
|
-
}
|
|
1588
|
-
Royalty.reified = function () {
|
|
1589
|
-
var _this = this;
|
|
1590
|
-
return {
|
|
1591
|
-
typeName: Royalty.$typeName,
|
|
1592
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Royalty.$typeName], [], false)),
|
|
1593
|
-
typeArgs: [],
|
|
1594
|
-
isPhantom: Royalty.$isPhantom,
|
|
1595
|
-
reifiedTypeArgs: [],
|
|
1596
|
-
fromFields: function (fields) { return Royalty.fromFields(fields); },
|
|
1597
|
-
fromFieldsWithTypes: function (item) { return Royalty.fromFieldsWithTypes(item); },
|
|
1598
|
-
fromBcs: function (data) { return Royalty.fromBcs(data); },
|
|
1599
|
-
bcs: Royalty.bcs,
|
|
1600
|
-
fromJSONField: function (field) { return Royalty.fromJSONField(field); },
|
|
1601
|
-
fromJSON: function (json) { return Royalty.fromJSON(json); },
|
|
1602
|
-
fromSuiParsedData: function (content) { return Royalty.fromSuiParsedData(content); },
|
|
1603
|
-
fromSuiObjectData: function (content) { return Royalty.fromSuiObjectData(content); },
|
|
1604
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1605
|
-
return [2 /*return*/, Royalty.fetch(client, id)];
|
|
1606
|
-
}); }); },
|
|
1607
|
-
new: function (fields) {
|
|
1608
|
-
return new Royalty([], fields);
|
|
1609
|
-
},
|
|
1610
|
-
kind: "StructClassReified",
|
|
1611
|
-
};
|
|
1612
|
-
};
|
|
1613
|
-
Object.defineProperty(Royalty, "r", {
|
|
1614
|
-
get: function () {
|
|
1615
|
-
return Royalty.reified();
|
|
1616
|
-
},
|
|
1617
|
-
enumerable: false,
|
|
1618
|
-
configurable: true
|
|
1619
|
-
});
|
|
1620
|
-
Royalty.phantom = function () {
|
|
1621
|
-
return (0, reified_1.phantom)(Royalty.reified());
|
|
1622
|
-
};
|
|
1623
|
-
Object.defineProperty(Royalty, "p", {
|
|
1624
|
-
get: function () {
|
|
1625
|
-
return Royalty.phantom();
|
|
1626
|
-
},
|
|
1627
|
-
enumerable: false,
|
|
1628
|
-
configurable: true
|
|
1629
|
-
});
|
|
1630
|
-
Object.defineProperty(Royalty, "bcs", {
|
|
1631
|
-
get: function () {
|
|
1632
|
-
return bcs_1.bcs.struct("Royalty", {
|
|
1633
|
-
id: structs_2.UID.bcs,
|
|
1634
|
-
recipients: structs_5.VecMap.bcs(bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }), bcs_1.bcs.u64()),
|
|
1635
|
-
policy_cap: structs_3.TransferPolicyCap.bcs,
|
|
1636
|
-
});
|
|
1637
|
-
},
|
|
1638
|
-
enumerable: false,
|
|
1639
|
-
configurable: true
|
|
1640
|
-
});
|
|
1641
|
-
Royalty.fromFields = function (fields) {
|
|
1642
|
-
return Royalty.reified().new({
|
|
1643
|
-
id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
|
|
1644
|
-
recipients: (0, reified_1.decodeFromFields)(structs_5.VecMap.reified("address", "u64"), fields.recipients),
|
|
1645
|
-
policyCap: (0, reified_1.decodeFromFields)(structs_3.TransferPolicyCap.reified(reified.phantom(Tails.reified())), fields.policy_cap),
|
|
1646
|
-
});
|
|
1647
|
-
};
|
|
1648
|
-
Royalty.fromFieldsWithTypes = function (item) {
|
|
1649
|
-
if (!isRoyalty(item.type)) {
|
|
1650
|
-
throw new Error("not a Royalty type");
|
|
1651
|
-
}
|
|
1652
|
-
return Royalty.reified().new({
|
|
1653
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
1654
|
-
recipients: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.VecMap.reified("address", "u64"), item.fields.recipients),
|
|
1655
|
-
policyCap: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.TransferPolicyCap.reified(reified.phantom(Tails.reified())), item.fields.policy_cap),
|
|
1656
|
-
});
|
|
1657
|
-
};
|
|
1658
|
-
Royalty.fromBcs = function (data) {
|
|
1659
|
-
return Royalty.fromFields(Royalty.bcs.parse(data));
|
|
1660
|
-
};
|
|
1661
|
-
Royalty.prototype.toJSONField = function () {
|
|
1662
|
-
return {
|
|
1663
|
-
id: this.id,
|
|
1664
|
-
recipients: this.recipients.toJSONField(),
|
|
1665
|
-
policyCap: this.policyCap.toJSONField(),
|
|
1666
|
-
};
|
|
1667
|
-
};
|
|
1668
|
-
Royalty.prototype.toJSON = function () {
|
|
1669
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1670
|
-
};
|
|
1671
|
-
Royalty.fromJSONField = function (field) {
|
|
1672
|
-
return Royalty.reified().new({
|
|
1673
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
1674
|
-
recipients: (0, reified_1.decodeFromJSONField)(structs_5.VecMap.reified("address", "u64"), field.recipients),
|
|
1675
|
-
policyCap: (0, reified_1.decodeFromJSONField)(structs_3.TransferPolicyCap.reified(reified.phantom(Tails.reified())), field.policyCap),
|
|
1676
|
-
});
|
|
1677
|
-
};
|
|
1678
|
-
Royalty.fromJSON = function (json) {
|
|
1679
|
-
if (json.$typeName !== Royalty.$typeName) {
|
|
1680
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1681
|
-
}
|
|
1682
|
-
return Royalty.fromJSONField(json);
|
|
1683
|
-
};
|
|
1684
|
-
Royalty.fromSuiParsedData = function (content) {
|
|
1685
|
-
if (content.dataType !== "moveObject") {
|
|
1686
|
-
throw new Error("not an object");
|
|
1687
|
-
}
|
|
1688
|
-
if (!isRoyalty(content.type)) {
|
|
1689
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Royalty object"));
|
|
1690
|
-
}
|
|
1691
|
-
return Royalty.fromFieldsWithTypes(content);
|
|
1692
|
-
};
|
|
1693
|
-
Royalty.fromSuiObjectData = function (data) {
|
|
1694
|
-
if (data.bcs) {
|
|
1695
|
-
if (data.bcs.dataType !== "moveObject" || !isRoyalty(data.bcs.type)) {
|
|
1696
|
-
throw new Error("object at is not a Royalty object");
|
|
1697
|
-
}
|
|
1698
|
-
return Royalty.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1699
|
-
}
|
|
1700
|
-
if (data.content) {
|
|
1701
|
-
return Royalty.fromSuiParsedData(data.content);
|
|
1702
|
-
}
|
|
1703
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1704
|
-
};
|
|
1705
|
-
Royalty.fetch = function (client, id) {
|
|
1706
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1707
|
-
var res;
|
|
1708
|
-
var _a, _b;
|
|
1709
|
-
return __generator(this, function (_c) {
|
|
1710
|
-
switch (_c.label) {
|
|
1711
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1712
|
-
case 1:
|
|
1713
|
-
res = _c.sent();
|
|
1714
|
-
if (res.error) {
|
|
1715
|
-
throw new Error("error fetching Royalty object at id ".concat(id, ": ").concat(res.error.code));
|
|
1716
|
-
}
|
|
1717
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRoyalty(res.data.bcs.type)) {
|
|
1718
|
-
throw new Error("object at id ".concat(id, " is not a Royalty object"));
|
|
1719
|
-
}
|
|
1720
|
-
return [2 /*return*/, Royalty.fromSuiObjectData(res.data)];
|
|
1721
|
-
}
|
|
1722
|
-
});
|
|
1723
|
-
});
|
|
1724
|
-
};
|
|
1725
|
-
Royalty.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::Royalty");
|
|
1726
|
-
Royalty.$numTypeParams = 0;
|
|
1727
|
-
Royalty.$isPhantom = [];
|
|
1728
|
-
return Royalty;
|
|
1729
|
-
}());
|
|
1730
|
-
exports.Royalty = Royalty;
|
|
1731
|
-
/* ============================== RoyaltyUpdateEvent =============================== */
|
|
1732
|
-
function isRoyaltyUpdateEvent(type) {
|
|
1733
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1734
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::RoyaltyUpdateEvent");
|
|
1735
|
-
}
|
|
1736
|
-
var RoyaltyUpdateEvent = /** @class */ (function () {
|
|
1737
|
-
function RoyaltyUpdateEvent(typeArgs, fields) {
|
|
1738
|
-
this.__StructClass = true;
|
|
1739
|
-
this.$typeName = RoyaltyUpdateEvent.$typeName;
|
|
1740
|
-
this.$isPhantom = RoyaltyUpdateEvent.$isPhantom;
|
|
1741
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RoyaltyUpdateEvent.$typeName], __read(typeArgs), false));
|
|
1742
|
-
this.$typeArgs = typeArgs;
|
|
1743
|
-
this.sender = fields.sender;
|
|
1744
|
-
this.recipients = fields.recipients;
|
|
1745
|
-
}
|
|
1746
|
-
RoyaltyUpdateEvent.reified = function () {
|
|
1747
|
-
var _this = this;
|
|
1748
|
-
return {
|
|
1749
|
-
typeName: RoyaltyUpdateEvent.$typeName,
|
|
1750
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RoyaltyUpdateEvent.$typeName], [], false)),
|
|
1751
|
-
typeArgs: [],
|
|
1752
|
-
isPhantom: RoyaltyUpdateEvent.$isPhantom,
|
|
1753
|
-
reifiedTypeArgs: [],
|
|
1754
|
-
fromFields: function (fields) { return RoyaltyUpdateEvent.fromFields(fields); },
|
|
1755
|
-
fromFieldsWithTypes: function (item) { return RoyaltyUpdateEvent.fromFieldsWithTypes(item); },
|
|
1756
|
-
fromBcs: function (data) { return RoyaltyUpdateEvent.fromBcs(data); },
|
|
1757
|
-
bcs: RoyaltyUpdateEvent.bcs,
|
|
1758
|
-
fromJSONField: function (field) { return RoyaltyUpdateEvent.fromJSONField(field); },
|
|
1759
|
-
fromJSON: function (json) { return RoyaltyUpdateEvent.fromJSON(json); },
|
|
1760
|
-
fromSuiParsedData: function (content) { return RoyaltyUpdateEvent.fromSuiParsedData(content); },
|
|
1761
|
-
fromSuiObjectData: function (content) { return RoyaltyUpdateEvent.fromSuiObjectData(content); },
|
|
1762
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1763
|
-
return [2 /*return*/, RoyaltyUpdateEvent.fetch(client, id)];
|
|
1764
|
-
}); }); },
|
|
1765
|
-
new: function (fields) {
|
|
1766
|
-
return new RoyaltyUpdateEvent([], fields);
|
|
1767
|
-
},
|
|
1768
|
-
kind: "StructClassReified",
|
|
1769
|
-
};
|
|
1770
|
-
};
|
|
1771
|
-
Object.defineProperty(RoyaltyUpdateEvent, "r", {
|
|
1772
|
-
get: function () {
|
|
1773
|
-
return RoyaltyUpdateEvent.reified();
|
|
1774
|
-
},
|
|
1775
|
-
enumerable: false,
|
|
1776
|
-
configurable: true
|
|
1777
|
-
});
|
|
1778
|
-
RoyaltyUpdateEvent.phantom = function () {
|
|
1779
|
-
return (0, reified_1.phantom)(RoyaltyUpdateEvent.reified());
|
|
1780
|
-
};
|
|
1781
|
-
Object.defineProperty(RoyaltyUpdateEvent, "p", {
|
|
1782
|
-
get: function () {
|
|
1783
|
-
return RoyaltyUpdateEvent.phantom();
|
|
1784
|
-
},
|
|
1785
|
-
enumerable: false,
|
|
1786
|
-
configurable: true
|
|
1787
|
-
});
|
|
1788
|
-
Object.defineProperty(RoyaltyUpdateEvent, "bcs", {
|
|
1789
|
-
get: function () {
|
|
1790
|
-
return bcs_1.bcs.struct("RoyaltyUpdateEvent", {
|
|
1791
|
-
sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
|
|
1792
|
-
recipients: structs_5.VecMap.bcs(bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }), bcs_1.bcs.u64()),
|
|
1793
|
-
});
|
|
1794
|
-
},
|
|
1795
|
-
enumerable: false,
|
|
1796
|
-
configurable: true
|
|
1797
|
-
});
|
|
1798
|
-
RoyaltyUpdateEvent.fromFields = function (fields) {
|
|
1799
|
-
return RoyaltyUpdateEvent.reified().new({
|
|
1800
|
-
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
1801
|
-
recipients: (0, reified_1.decodeFromFields)(structs_5.VecMap.reified("address", "u64"), fields.recipients),
|
|
1802
|
-
});
|
|
1803
|
-
};
|
|
1804
|
-
RoyaltyUpdateEvent.fromFieldsWithTypes = function (item) {
|
|
1805
|
-
if (!isRoyaltyUpdateEvent(item.type)) {
|
|
1806
|
-
throw new Error("not a RoyaltyUpdateEvent type");
|
|
1807
|
-
}
|
|
1808
|
-
return RoyaltyUpdateEvent.reified().new({
|
|
1809
|
-
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
1810
|
-
recipients: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.VecMap.reified("address", "u64"), item.fields.recipients),
|
|
1811
|
-
});
|
|
1812
|
-
};
|
|
1813
|
-
RoyaltyUpdateEvent.fromBcs = function (data) {
|
|
1814
|
-
return RoyaltyUpdateEvent.fromFields(RoyaltyUpdateEvent.bcs.parse(data));
|
|
1815
|
-
};
|
|
1816
|
-
RoyaltyUpdateEvent.prototype.toJSONField = function () {
|
|
1817
|
-
return {
|
|
1818
|
-
sender: this.sender,
|
|
1819
|
-
recipients: this.recipients.toJSONField(),
|
|
1820
|
-
};
|
|
1821
|
-
};
|
|
1822
|
-
RoyaltyUpdateEvent.prototype.toJSON = function () {
|
|
1823
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1824
|
-
};
|
|
1825
|
-
RoyaltyUpdateEvent.fromJSONField = function (field) {
|
|
1826
|
-
return RoyaltyUpdateEvent.reified().new({
|
|
1827
|
-
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
1828
|
-
recipients: (0, reified_1.decodeFromJSONField)(structs_5.VecMap.reified("address", "u64"), field.recipients),
|
|
1829
|
-
});
|
|
1830
|
-
};
|
|
1831
|
-
RoyaltyUpdateEvent.fromJSON = function (json) {
|
|
1832
|
-
if (json.$typeName !== RoyaltyUpdateEvent.$typeName) {
|
|
1833
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1834
|
-
}
|
|
1835
|
-
return RoyaltyUpdateEvent.fromJSONField(json);
|
|
1836
|
-
};
|
|
1837
|
-
RoyaltyUpdateEvent.fromSuiParsedData = function (content) {
|
|
1838
|
-
if (content.dataType !== "moveObject") {
|
|
1839
|
-
throw new Error("not an object");
|
|
1840
|
-
}
|
|
1841
|
-
if (!isRoyaltyUpdateEvent(content.type)) {
|
|
1842
|
-
throw new Error("object at ".concat(content.fields.id, " is not a RoyaltyUpdateEvent object"));
|
|
1843
|
-
}
|
|
1844
|
-
return RoyaltyUpdateEvent.fromFieldsWithTypes(content);
|
|
1845
|
-
};
|
|
1846
|
-
RoyaltyUpdateEvent.fromSuiObjectData = function (data) {
|
|
1847
|
-
if (data.bcs) {
|
|
1848
|
-
if (data.bcs.dataType !== "moveObject" || !isRoyaltyUpdateEvent(data.bcs.type)) {
|
|
1849
|
-
throw new Error("object at is not a RoyaltyUpdateEvent object");
|
|
1850
|
-
}
|
|
1851
|
-
return RoyaltyUpdateEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1852
|
-
}
|
|
1853
|
-
if (data.content) {
|
|
1854
|
-
return RoyaltyUpdateEvent.fromSuiParsedData(data.content);
|
|
1855
|
-
}
|
|
1856
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1857
|
-
};
|
|
1858
|
-
RoyaltyUpdateEvent.fetch = function (client, id) {
|
|
1859
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1860
|
-
var res;
|
|
1861
|
-
var _a, _b;
|
|
1862
|
-
return __generator(this, function (_c) {
|
|
1863
|
-
switch (_c.label) {
|
|
1864
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1865
|
-
case 1:
|
|
1866
|
-
res = _c.sent();
|
|
1867
|
-
if (res.error) {
|
|
1868
|
-
throw new Error("error fetching RoyaltyUpdateEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
1869
|
-
}
|
|
1870
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRoyaltyUpdateEvent(res.data.bcs.type)) {
|
|
1871
|
-
throw new Error("object at id ".concat(id, " is not a RoyaltyUpdateEvent object"));
|
|
1872
|
-
}
|
|
1873
|
-
return [2 /*return*/, RoyaltyUpdateEvent.fromSuiObjectData(res.data)];
|
|
1874
|
-
}
|
|
1875
|
-
});
|
|
1876
|
-
});
|
|
1877
|
-
};
|
|
1878
|
-
RoyaltyUpdateEvent.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::RoyaltyUpdateEvent");
|
|
1879
|
-
RoyaltyUpdateEvent.$numTypeParams = 0;
|
|
1880
|
-
RoyaltyUpdateEvent.$isPhantom = [];
|
|
1881
|
-
return RoyaltyUpdateEvent;
|
|
1882
|
-
}());
|
|
1883
|
-
exports.RoyaltyUpdateEvent = RoyaltyUpdateEvent;
|
|
1884
|
-
/* ============================== TYPUS_NFT =============================== */
|
|
1885
|
-
function isTYPUS_NFT(type) {
|
|
1886
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1887
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::TYPUS_NFT");
|
|
1888
|
-
}
|
|
1889
|
-
var TYPUS_NFT = /** @class */ (function () {
|
|
1890
|
-
function TYPUS_NFT(typeArgs, fields) {
|
|
1891
|
-
this.__StructClass = true;
|
|
1892
|
-
this.$typeName = TYPUS_NFT.$typeName;
|
|
1893
|
-
this.$isPhantom = TYPUS_NFT.$isPhantom;
|
|
1894
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TYPUS_NFT.$typeName], __read(typeArgs), false));
|
|
1895
|
-
this.$typeArgs = typeArgs;
|
|
1896
|
-
this.dummyField = fields.dummyField;
|
|
1897
|
-
}
|
|
1898
|
-
TYPUS_NFT.reified = function () {
|
|
1899
|
-
var _this = this;
|
|
1900
|
-
return {
|
|
1901
|
-
typeName: TYPUS_NFT.$typeName,
|
|
1902
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TYPUS_NFT.$typeName], [], false)),
|
|
1903
|
-
typeArgs: [],
|
|
1904
|
-
isPhantom: TYPUS_NFT.$isPhantom,
|
|
1905
|
-
reifiedTypeArgs: [],
|
|
1906
|
-
fromFields: function (fields) { return TYPUS_NFT.fromFields(fields); },
|
|
1907
|
-
fromFieldsWithTypes: function (item) { return TYPUS_NFT.fromFieldsWithTypes(item); },
|
|
1908
|
-
fromBcs: function (data) { return TYPUS_NFT.fromBcs(data); },
|
|
1909
|
-
bcs: TYPUS_NFT.bcs,
|
|
1910
|
-
fromJSONField: function (field) { return TYPUS_NFT.fromJSONField(field); },
|
|
1911
|
-
fromJSON: function (json) { return TYPUS_NFT.fromJSON(json); },
|
|
1912
|
-
fromSuiParsedData: function (content) { return TYPUS_NFT.fromSuiParsedData(content); },
|
|
1913
|
-
fromSuiObjectData: function (content) { return TYPUS_NFT.fromSuiObjectData(content); },
|
|
1914
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1915
|
-
return [2 /*return*/, TYPUS_NFT.fetch(client, id)];
|
|
1916
|
-
}); }); },
|
|
1917
|
-
new: function (fields) {
|
|
1918
|
-
return new TYPUS_NFT([], fields);
|
|
1919
|
-
},
|
|
1920
|
-
kind: "StructClassReified",
|
|
1921
|
-
};
|
|
1922
|
-
};
|
|
1923
|
-
Object.defineProperty(TYPUS_NFT, "r", {
|
|
1924
|
-
get: function () {
|
|
1925
|
-
return TYPUS_NFT.reified();
|
|
1926
|
-
},
|
|
1927
|
-
enumerable: false,
|
|
1928
|
-
configurable: true
|
|
1929
|
-
});
|
|
1930
|
-
TYPUS_NFT.phantom = function () {
|
|
1931
|
-
return (0, reified_1.phantom)(TYPUS_NFT.reified());
|
|
1932
|
-
};
|
|
1933
|
-
Object.defineProperty(TYPUS_NFT, "p", {
|
|
1934
|
-
get: function () {
|
|
1935
|
-
return TYPUS_NFT.phantom();
|
|
1936
|
-
},
|
|
1937
|
-
enumerable: false,
|
|
1938
|
-
configurable: true
|
|
1939
|
-
});
|
|
1940
|
-
Object.defineProperty(TYPUS_NFT, "bcs", {
|
|
1941
|
-
get: function () {
|
|
1942
|
-
return bcs_1.bcs.struct("TYPUS_NFT", {
|
|
1943
|
-
dummy_field: bcs_1.bcs.bool(),
|
|
1944
|
-
});
|
|
1945
|
-
},
|
|
1946
|
-
enumerable: false,
|
|
1947
|
-
configurable: true
|
|
1948
|
-
});
|
|
1949
|
-
TYPUS_NFT.fromFields = function (fields) {
|
|
1950
|
-
return TYPUS_NFT.reified().new({ dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field) });
|
|
1951
|
-
};
|
|
1952
|
-
TYPUS_NFT.fromFieldsWithTypes = function (item) {
|
|
1953
|
-
if (!isTYPUS_NFT(item.type)) {
|
|
1954
|
-
throw new Error("not a TYPUS_NFT type");
|
|
1955
|
-
}
|
|
1956
|
-
return TYPUS_NFT.reified().new({ dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field) });
|
|
1957
|
-
};
|
|
1958
|
-
TYPUS_NFT.fromBcs = function (data) {
|
|
1959
|
-
return TYPUS_NFT.fromFields(TYPUS_NFT.bcs.parse(data));
|
|
1960
|
-
};
|
|
1961
|
-
TYPUS_NFT.prototype.toJSONField = function () {
|
|
1962
|
-
return {
|
|
1963
|
-
dummyField: this.dummyField,
|
|
1964
|
-
};
|
|
1965
|
-
};
|
|
1966
|
-
TYPUS_NFT.prototype.toJSON = function () {
|
|
1967
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1968
|
-
};
|
|
1969
|
-
TYPUS_NFT.fromJSONField = function (field) {
|
|
1970
|
-
return TYPUS_NFT.reified().new({ dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField) });
|
|
1971
|
-
};
|
|
1972
|
-
TYPUS_NFT.fromJSON = function (json) {
|
|
1973
|
-
if (json.$typeName !== TYPUS_NFT.$typeName) {
|
|
1974
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1975
|
-
}
|
|
1976
|
-
return TYPUS_NFT.fromJSONField(json);
|
|
1977
|
-
};
|
|
1978
|
-
TYPUS_NFT.fromSuiParsedData = function (content) {
|
|
1979
|
-
if (content.dataType !== "moveObject") {
|
|
1980
|
-
throw new Error("not an object");
|
|
1981
|
-
}
|
|
1982
|
-
if (!isTYPUS_NFT(content.type)) {
|
|
1983
|
-
throw new Error("object at ".concat(content.fields.id, " is not a TYPUS_NFT object"));
|
|
1984
|
-
}
|
|
1985
|
-
return TYPUS_NFT.fromFieldsWithTypes(content);
|
|
1986
|
-
};
|
|
1987
|
-
TYPUS_NFT.fromSuiObjectData = function (data) {
|
|
1988
|
-
if (data.bcs) {
|
|
1989
|
-
if (data.bcs.dataType !== "moveObject" || !isTYPUS_NFT(data.bcs.type)) {
|
|
1990
|
-
throw new Error("object at is not a TYPUS_NFT object");
|
|
1991
|
-
}
|
|
1992
|
-
return TYPUS_NFT.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1993
|
-
}
|
|
1994
|
-
if (data.content) {
|
|
1995
|
-
return TYPUS_NFT.fromSuiParsedData(data.content);
|
|
1996
|
-
}
|
|
1997
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1998
|
-
};
|
|
1999
|
-
TYPUS_NFT.fetch = function (client, id) {
|
|
2000
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2001
|
-
var res;
|
|
2002
|
-
var _a, _b;
|
|
2003
|
-
return __generator(this, function (_c) {
|
|
2004
|
-
switch (_c.label) {
|
|
2005
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2006
|
-
case 1:
|
|
2007
|
-
res = _c.sent();
|
|
2008
|
-
if (res.error) {
|
|
2009
|
-
throw new Error("error fetching TYPUS_NFT object at id ".concat(id, ": ").concat(res.error.code));
|
|
2010
|
-
}
|
|
2011
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTYPUS_NFT(res.data.bcs.type)) {
|
|
2012
|
-
throw new Error("object at id ".concat(id, " is not a TYPUS_NFT object"));
|
|
2013
|
-
}
|
|
2014
|
-
return [2 /*return*/, TYPUS_NFT.fromSuiObjectData(res.data)];
|
|
2015
|
-
}
|
|
2016
|
-
});
|
|
2017
|
-
});
|
|
2018
|
-
};
|
|
2019
|
-
TYPUS_NFT.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::TYPUS_NFT");
|
|
2020
|
-
TYPUS_NFT.$numTypeParams = 0;
|
|
2021
|
-
TYPUS_NFT.$isPhantom = [];
|
|
2022
|
-
return TYPUS_NFT;
|
|
2023
|
-
}());
|
|
2024
|
-
exports.TYPUS_NFT = TYPUS_NFT;
|
|
2025
|
-
/* ============================== Tails =============================== */
|
|
2026
|
-
function isTails(type) {
|
|
2027
|
-
type = (0, util_1.compressSuiType)(type);
|
|
2028
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::Tails");
|
|
2029
|
-
}
|
|
2030
|
-
var Tails = /** @class */ (function () {
|
|
2031
|
-
function Tails(typeArgs, fields) {
|
|
2032
|
-
this.__StructClass = true;
|
|
2033
|
-
this.$typeName = Tails.$typeName;
|
|
2034
|
-
this.$isPhantom = Tails.$isPhantom;
|
|
2035
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Tails.$typeName], __read(typeArgs), false));
|
|
2036
|
-
this.$typeArgs = typeArgs;
|
|
2037
|
-
this.id = fields.id;
|
|
2038
|
-
this.name = fields.name;
|
|
2039
|
-
this.description = fields.description;
|
|
2040
|
-
this.number = fields.number;
|
|
2041
|
-
this.url = fields.url;
|
|
2042
|
-
this.attributes = fields.attributes;
|
|
2043
|
-
this.level = fields.level;
|
|
2044
|
-
this.exp = fields.exp;
|
|
2045
|
-
this.firstBid = fields.firstBid;
|
|
2046
|
-
this.firstDeposit = fields.firstDeposit;
|
|
2047
|
-
this.firstDepositNft = fields.firstDepositNft;
|
|
2048
|
-
this.u64Padding = fields.u64Padding;
|
|
2049
|
-
}
|
|
2050
|
-
Tails.reified = function () {
|
|
2051
|
-
var _this = this;
|
|
2052
|
-
return {
|
|
2053
|
-
typeName: Tails.$typeName,
|
|
2054
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Tails.$typeName], [], false)),
|
|
2055
|
-
typeArgs: [],
|
|
2056
|
-
isPhantom: Tails.$isPhantom,
|
|
2057
|
-
reifiedTypeArgs: [],
|
|
2058
|
-
fromFields: function (fields) { return Tails.fromFields(fields); },
|
|
2059
|
-
fromFieldsWithTypes: function (item) { return Tails.fromFieldsWithTypes(item); },
|
|
2060
|
-
fromBcs: function (data) { return Tails.fromBcs(data); },
|
|
2061
|
-
bcs: Tails.bcs,
|
|
2062
|
-
fromJSONField: function (field) { return Tails.fromJSONField(field); },
|
|
2063
|
-
fromJSON: function (json) { return Tails.fromJSON(json); },
|
|
2064
|
-
fromSuiParsedData: function (content) { return Tails.fromSuiParsedData(content); },
|
|
2065
|
-
fromSuiObjectData: function (content) { return Tails.fromSuiObjectData(content); },
|
|
2066
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2067
|
-
return [2 /*return*/, Tails.fetch(client, id)];
|
|
2068
|
-
}); }); },
|
|
2069
|
-
new: function (fields) {
|
|
2070
|
-
return new Tails([], fields);
|
|
2071
|
-
},
|
|
2072
|
-
kind: "StructClassReified",
|
|
2073
|
-
};
|
|
2074
|
-
};
|
|
2075
|
-
Object.defineProperty(Tails, "r", {
|
|
2076
|
-
get: function () {
|
|
2077
|
-
return Tails.reified();
|
|
2078
|
-
},
|
|
2079
|
-
enumerable: false,
|
|
2080
|
-
configurable: true
|
|
2081
|
-
});
|
|
2082
|
-
Tails.phantom = function () {
|
|
2083
|
-
return (0, reified_1.phantom)(Tails.reified());
|
|
2084
|
-
};
|
|
2085
|
-
Object.defineProperty(Tails, "p", {
|
|
2086
|
-
get: function () {
|
|
2087
|
-
return Tails.phantom();
|
|
2088
|
-
},
|
|
2089
|
-
enumerable: false,
|
|
2090
|
-
configurable: true
|
|
2091
|
-
});
|
|
2092
|
-
Object.defineProperty(Tails, "bcs", {
|
|
2093
|
-
get: function () {
|
|
2094
|
-
return bcs_1.bcs.struct("Tails", {
|
|
2095
|
-
id: structs_2.UID.bcs,
|
|
2096
|
-
name: structs_1.String.bcs,
|
|
2097
|
-
description: structs_1.String.bcs,
|
|
2098
|
-
number: bcs_1.bcs.u64(),
|
|
2099
|
-
url: structs_4.Url.bcs,
|
|
2100
|
-
attributes: structs_5.VecMap.bcs(structs_1.String.bcs, structs_1.String.bcs),
|
|
2101
|
-
level: bcs_1.bcs.u64(),
|
|
2102
|
-
exp: bcs_1.bcs.u64(),
|
|
2103
|
-
first_bid: bcs_1.bcs.bool(),
|
|
2104
|
-
first_deposit: bcs_1.bcs.bool(),
|
|
2105
|
-
first_deposit_nft: bcs_1.bcs.bool(),
|
|
2106
|
-
u64_padding: structs_5.VecMap.bcs(structs_1.String.bcs, bcs_1.bcs.u64()),
|
|
2107
|
-
});
|
|
2108
|
-
},
|
|
2109
|
-
enumerable: false,
|
|
2110
|
-
configurable: true
|
|
2111
|
-
});
|
|
2112
|
-
Tails.fromFields = function (fields) {
|
|
2113
|
-
return Tails.reified().new({
|
|
2114
|
-
id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
|
|
2115
|
-
name: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.name),
|
|
2116
|
-
description: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.description),
|
|
2117
|
-
number: (0, reified_1.decodeFromFields)("u64", fields.number),
|
|
2118
|
-
url: (0, reified_1.decodeFromFields)(structs_4.Url.reified(), fields.url),
|
|
2119
|
-
attributes: (0, reified_1.decodeFromFields)(structs_5.VecMap.reified(structs_1.String.reified(), structs_1.String.reified()), fields.attributes),
|
|
2120
|
-
level: (0, reified_1.decodeFromFields)("u64", fields.level),
|
|
2121
|
-
exp: (0, reified_1.decodeFromFields)("u64", fields.exp),
|
|
2122
|
-
firstBid: (0, reified_1.decodeFromFields)("bool", fields.first_bid),
|
|
2123
|
-
firstDeposit: (0, reified_1.decodeFromFields)("bool", fields.first_deposit),
|
|
2124
|
-
firstDepositNft: (0, reified_1.decodeFromFields)("bool", fields.first_deposit_nft),
|
|
2125
|
-
u64Padding: (0, reified_1.decodeFromFields)(structs_5.VecMap.reified(structs_1.String.reified(), "u64"), fields.u64_padding),
|
|
2126
|
-
});
|
|
2127
|
-
};
|
|
2128
|
-
Tails.fromFieldsWithTypes = function (item) {
|
|
2129
|
-
if (!isTails(item.type)) {
|
|
2130
|
-
throw new Error("not a Tails type");
|
|
2131
|
-
}
|
|
2132
|
-
return Tails.reified().new({
|
|
2133
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
2134
|
-
name: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.name),
|
|
2135
|
-
description: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.description),
|
|
2136
|
-
number: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.number),
|
|
2137
|
-
url: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.Url.reified(), item.fields.url),
|
|
2138
|
-
attributes: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.VecMap.reified(structs_1.String.reified(), structs_1.String.reified()), item.fields.attributes),
|
|
2139
|
-
level: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.level),
|
|
2140
|
-
exp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.exp),
|
|
2141
|
-
firstBid: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.first_bid),
|
|
2142
|
-
firstDeposit: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.first_deposit),
|
|
2143
|
-
firstDepositNft: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.first_deposit_nft),
|
|
2144
|
-
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.VecMap.reified(structs_1.String.reified(), "u64"), item.fields.u64_padding),
|
|
2145
|
-
});
|
|
2146
|
-
};
|
|
2147
|
-
Tails.fromBcs = function (data) {
|
|
2148
|
-
return Tails.fromFields(Tails.bcs.parse(data));
|
|
2149
|
-
};
|
|
2150
|
-
Tails.prototype.toJSONField = function () {
|
|
2151
|
-
return {
|
|
2152
|
-
id: this.id,
|
|
2153
|
-
name: this.name,
|
|
2154
|
-
description: this.description,
|
|
2155
|
-
number: this.number.toString(),
|
|
2156
|
-
url: this.url,
|
|
2157
|
-
attributes: this.attributes.toJSONField(),
|
|
2158
|
-
level: this.level.toString(),
|
|
2159
|
-
exp: this.exp.toString(),
|
|
2160
|
-
firstBid: this.firstBid,
|
|
2161
|
-
firstDeposit: this.firstDeposit,
|
|
2162
|
-
firstDepositNft: this.firstDepositNft,
|
|
2163
|
-
u64Padding: this.u64Padding.toJSONField(),
|
|
2164
|
-
};
|
|
2165
|
-
};
|
|
2166
|
-
Tails.prototype.toJSON = function () {
|
|
2167
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2168
|
-
};
|
|
2169
|
-
Tails.fromJSONField = function (field) {
|
|
2170
|
-
return Tails.reified().new({
|
|
2171
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
2172
|
-
name: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.name),
|
|
2173
|
-
description: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.description),
|
|
2174
|
-
number: (0, reified_1.decodeFromJSONField)("u64", field.number),
|
|
2175
|
-
url: (0, reified_1.decodeFromJSONField)(structs_4.Url.reified(), field.url),
|
|
2176
|
-
attributes: (0, reified_1.decodeFromJSONField)(structs_5.VecMap.reified(structs_1.String.reified(), structs_1.String.reified()), field.attributes),
|
|
2177
|
-
level: (0, reified_1.decodeFromJSONField)("u64", field.level),
|
|
2178
|
-
exp: (0, reified_1.decodeFromJSONField)("u64", field.exp),
|
|
2179
|
-
firstBid: (0, reified_1.decodeFromJSONField)("bool", field.firstBid),
|
|
2180
|
-
firstDeposit: (0, reified_1.decodeFromJSONField)("bool", field.firstDeposit),
|
|
2181
|
-
firstDepositNft: (0, reified_1.decodeFromJSONField)("bool", field.firstDepositNft),
|
|
2182
|
-
u64Padding: (0, reified_1.decodeFromJSONField)(structs_5.VecMap.reified(structs_1.String.reified(), "u64"), field.u64Padding),
|
|
2183
|
-
});
|
|
2184
|
-
};
|
|
2185
|
-
Tails.fromJSON = function (json) {
|
|
2186
|
-
if (json.$typeName !== Tails.$typeName) {
|
|
2187
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
2188
|
-
}
|
|
2189
|
-
return Tails.fromJSONField(json);
|
|
2190
|
-
};
|
|
2191
|
-
Tails.fromSuiParsedData = function (content) {
|
|
2192
|
-
if (content.dataType !== "moveObject") {
|
|
2193
|
-
throw new Error("not an object");
|
|
2194
|
-
}
|
|
2195
|
-
if (!isTails(content.type)) {
|
|
2196
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Tails object"));
|
|
2197
|
-
}
|
|
2198
|
-
return Tails.fromFieldsWithTypes(content);
|
|
2199
|
-
};
|
|
2200
|
-
Tails.fromSuiObjectData = function (data) {
|
|
2201
|
-
if (data.bcs) {
|
|
2202
|
-
if (data.bcs.dataType !== "moveObject" || !isTails(data.bcs.type)) {
|
|
2203
|
-
throw new Error("object at is not a Tails object");
|
|
2204
|
-
}
|
|
2205
|
-
return Tails.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2206
|
-
}
|
|
2207
|
-
if (data.content) {
|
|
2208
|
-
return Tails.fromSuiParsedData(data.content);
|
|
2209
|
-
}
|
|
2210
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2211
|
-
};
|
|
2212
|
-
Tails.fetch = function (client, id) {
|
|
2213
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2214
|
-
var res;
|
|
2215
|
-
var _a, _b;
|
|
2216
|
-
return __generator(this, function (_c) {
|
|
2217
|
-
switch (_c.label) {
|
|
2218
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2219
|
-
case 1:
|
|
2220
|
-
res = _c.sent();
|
|
2221
|
-
if (res.error) {
|
|
2222
|
-
throw new Error("error fetching Tails object at id ".concat(id, ": ").concat(res.error.code));
|
|
2223
|
-
}
|
|
2224
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTails(res.data.bcs.type)) {
|
|
2225
|
-
throw new Error("object at id ".concat(id, " is not a Tails object"));
|
|
2226
|
-
}
|
|
2227
|
-
return [2 /*return*/, Tails.fromSuiObjectData(res.data)];
|
|
2228
|
-
}
|
|
2229
|
-
});
|
|
2230
|
-
});
|
|
2231
|
-
};
|
|
2232
|
-
Tails.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::Tails");
|
|
2233
|
-
Tails.$numTypeParams = 0;
|
|
2234
|
-
Tails.$isPhantom = [];
|
|
2235
|
-
return Tails;
|
|
2236
|
-
}());
|
|
2237
|
-
exports.Tails = Tails;
|
|
2238
|
-
/* ============================== Whitelist =============================== */
|
|
2239
|
-
function isWhitelist(type) {
|
|
2240
|
-
type = (0, util_1.compressSuiType)(type);
|
|
2241
|
-
return type === "".concat(index_1.PKG_V1, "::typus_nft::Whitelist");
|
|
2242
|
-
}
|
|
2243
|
-
var Whitelist = /** @class */ (function () {
|
|
2244
|
-
function Whitelist(typeArgs, fields) {
|
|
2245
|
-
this.__StructClass = true;
|
|
2246
|
-
this.$typeName = Whitelist.$typeName;
|
|
2247
|
-
this.$isPhantom = Whitelist.$isPhantom;
|
|
2248
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Whitelist.$typeName], __read(typeArgs), false));
|
|
2249
|
-
this.$typeArgs = typeArgs;
|
|
2250
|
-
this.id = fields.id;
|
|
2251
|
-
this.for = fields.for;
|
|
2252
|
-
}
|
|
2253
|
-
Whitelist.reified = function () {
|
|
2254
|
-
var _this = this;
|
|
2255
|
-
return {
|
|
2256
|
-
typeName: Whitelist.$typeName,
|
|
2257
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Whitelist.$typeName], [], false)),
|
|
2258
|
-
typeArgs: [],
|
|
2259
|
-
isPhantom: Whitelist.$isPhantom,
|
|
2260
|
-
reifiedTypeArgs: [],
|
|
2261
|
-
fromFields: function (fields) { return Whitelist.fromFields(fields); },
|
|
2262
|
-
fromFieldsWithTypes: function (item) { return Whitelist.fromFieldsWithTypes(item); },
|
|
2263
|
-
fromBcs: function (data) { return Whitelist.fromBcs(data); },
|
|
2264
|
-
bcs: Whitelist.bcs,
|
|
2265
|
-
fromJSONField: function (field) { return Whitelist.fromJSONField(field); },
|
|
2266
|
-
fromJSON: function (json) { return Whitelist.fromJSON(json); },
|
|
2267
|
-
fromSuiParsedData: function (content) { return Whitelist.fromSuiParsedData(content); },
|
|
2268
|
-
fromSuiObjectData: function (content) { return Whitelist.fromSuiObjectData(content); },
|
|
2269
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2270
|
-
return [2 /*return*/, Whitelist.fetch(client, id)];
|
|
2271
|
-
}); }); },
|
|
2272
|
-
new: function (fields) {
|
|
2273
|
-
return new Whitelist([], fields);
|
|
2274
|
-
},
|
|
2275
|
-
kind: "StructClassReified",
|
|
2276
|
-
};
|
|
2277
|
-
};
|
|
2278
|
-
Object.defineProperty(Whitelist, "r", {
|
|
2279
|
-
get: function () {
|
|
2280
|
-
return Whitelist.reified();
|
|
2281
|
-
},
|
|
2282
|
-
enumerable: false,
|
|
2283
|
-
configurable: true
|
|
2284
|
-
});
|
|
2285
|
-
Whitelist.phantom = function () {
|
|
2286
|
-
return (0, reified_1.phantom)(Whitelist.reified());
|
|
2287
|
-
};
|
|
2288
|
-
Object.defineProperty(Whitelist, "p", {
|
|
2289
|
-
get: function () {
|
|
2290
|
-
return Whitelist.phantom();
|
|
2291
|
-
},
|
|
2292
|
-
enumerable: false,
|
|
2293
|
-
configurable: true
|
|
2294
|
-
});
|
|
2295
|
-
Object.defineProperty(Whitelist, "bcs", {
|
|
2296
|
-
get: function () {
|
|
2297
|
-
return bcs_1.bcs.struct("Whitelist", {
|
|
2298
|
-
id: structs_2.UID.bcs,
|
|
2299
|
-
for: structs_2.ID.bcs,
|
|
2300
|
-
});
|
|
2301
|
-
},
|
|
2302
|
-
enumerable: false,
|
|
2303
|
-
configurable: true
|
|
2304
|
-
});
|
|
2305
|
-
Whitelist.fromFields = function (fields) {
|
|
2306
|
-
return Whitelist.reified().new({ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id), for: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.for) });
|
|
2307
|
-
};
|
|
2308
|
-
Whitelist.fromFieldsWithTypes = function (item) {
|
|
2309
|
-
if (!isWhitelist(item.type)) {
|
|
2310
|
-
throw new Error("not a Whitelist type");
|
|
2311
|
-
}
|
|
2312
|
-
return Whitelist.reified().new({
|
|
2313
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
2314
|
-
for: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.for),
|
|
2315
|
-
});
|
|
2316
|
-
};
|
|
2317
|
-
Whitelist.fromBcs = function (data) {
|
|
2318
|
-
return Whitelist.fromFields(Whitelist.bcs.parse(data));
|
|
2319
|
-
};
|
|
2320
|
-
Whitelist.prototype.toJSONField = function () {
|
|
2321
|
-
return {
|
|
2322
|
-
id: this.id,
|
|
2323
|
-
for: this.for,
|
|
2324
|
-
};
|
|
2325
|
-
};
|
|
2326
|
-
Whitelist.prototype.toJSON = function () {
|
|
2327
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2328
|
-
};
|
|
2329
|
-
Whitelist.fromJSONField = function (field) {
|
|
2330
|
-
return Whitelist.reified().new({
|
|
2331
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
2332
|
-
for: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.for),
|
|
2333
|
-
});
|
|
2334
|
-
};
|
|
2335
|
-
Whitelist.fromJSON = function (json) {
|
|
2336
|
-
if (json.$typeName !== Whitelist.$typeName) {
|
|
2337
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
2338
|
-
}
|
|
2339
|
-
return Whitelist.fromJSONField(json);
|
|
2340
|
-
};
|
|
2341
|
-
Whitelist.fromSuiParsedData = function (content) {
|
|
2342
|
-
if (content.dataType !== "moveObject") {
|
|
2343
|
-
throw new Error("not an object");
|
|
2344
|
-
}
|
|
2345
|
-
if (!isWhitelist(content.type)) {
|
|
2346
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Whitelist object"));
|
|
2347
|
-
}
|
|
2348
|
-
return Whitelist.fromFieldsWithTypes(content);
|
|
2349
|
-
};
|
|
2350
|
-
Whitelist.fromSuiObjectData = function (data) {
|
|
2351
|
-
if (data.bcs) {
|
|
2352
|
-
if (data.bcs.dataType !== "moveObject" || !isWhitelist(data.bcs.type)) {
|
|
2353
|
-
throw new Error("object at is not a Whitelist object");
|
|
2354
|
-
}
|
|
2355
|
-
return Whitelist.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2356
|
-
}
|
|
2357
|
-
if (data.content) {
|
|
2358
|
-
return Whitelist.fromSuiParsedData(data.content);
|
|
2359
|
-
}
|
|
2360
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2361
|
-
};
|
|
2362
|
-
Whitelist.fetch = function (client, id) {
|
|
2363
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2364
|
-
var res;
|
|
2365
|
-
var _a, _b;
|
|
2366
|
-
return __generator(this, function (_c) {
|
|
2367
|
-
switch (_c.label) {
|
|
2368
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2369
|
-
case 1:
|
|
2370
|
-
res = _c.sent();
|
|
2371
|
-
if (res.error) {
|
|
2372
|
-
throw new Error("error fetching Whitelist object at id ".concat(id, ": ").concat(res.error.code));
|
|
2373
|
-
}
|
|
2374
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isWhitelist(res.data.bcs.type)) {
|
|
2375
|
-
throw new Error("object at id ".concat(id, " is not a Whitelist object"));
|
|
2376
|
-
}
|
|
2377
|
-
return [2 /*return*/, Whitelist.fromSuiObjectData(res.data)];
|
|
2378
|
-
}
|
|
2379
|
-
});
|
|
2380
|
-
});
|
|
2381
|
-
};
|
|
2382
|
-
Whitelist.$typeName = "".concat(index_1.PKG_V1, "::typus_nft::Whitelist");
|
|
2383
|
-
Whitelist.$numTypeParams = 0;
|
|
2384
|
-
Whitelist.$isPhantom = [];
|
|
2385
|
-
return Whitelist;
|
|
2386
|
-
}());
|
|
2387
|
-
exports.Whitelist = Whitelist;
|