@typus/typus-perp-sdk 1.0.0 → 1.0.3
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/_framework/init-loader.js +4 -32
- package/dist/src/fetch.d.ts +10 -4
- package/dist/src/fetch.js +122 -110
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -2
- package/dist/src/typus_perp/admin/structs.d.ts +66 -4
- package/dist/src/typus_perp/admin/structs.js +155 -1
- package/dist/src/typus_perp/error/functions.d.ts +4 -0
- package/dist/src/typus_perp/error/functions.js +16 -0
- package/dist/src/typus_perp/escrow/structs.d.ts +1 -1
- package/dist/src/typus_perp/index.js +4 -4
- package/dist/src/typus_perp/init.js +2 -2
- package/dist/src/typus_perp/lp-pool/structs.d.ts +26 -26
- package/dist/src/typus_perp/oracle/structs.d.ts +2 -2
- package/dist/src/typus_perp/position/functions.d.ts +3 -0
- package/dist/src/typus_perp/position/functions.js +7 -1
- package/dist/src/typus_perp/position/structs.d.ts +42 -164
- package/dist/src/typus_perp/position/structs.js +31 -209
- package/dist/src/typus_perp/symbol/structs.d.ts +1 -1
- package/dist/src/typus_perp/tlp/structs.d.ts +2 -2
- package/dist/src/typus_perp/trading/structs.d.ts +179 -139
- package/dist/src/typus_perp/trading/structs.js +227 -173
- package/dist/src/typus_perp/treasury-caps/structs.d.ts +1 -1
- package/dist/src/typus_stake_pool/admin/structs.d.ts +4 -4
- package/dist/src/typus_stake_pool/index.js +4 -4
- package/dist/src/typus_stake_pool/init.js +2 -2
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +16 -16
- package/dist/src/typus_stake_pool/stake-pool/functions.js +28 -28
- package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +202 -202
- package/dist/src/typus_stake_pool/stake-pool/structs.js +404 -404
- package/dist/src/user/history.js +98 -18
- package/dist/src/user/order.js +6 -0
- package/dist/src/user/orderWithBidReceipt.d.ts +2 -4
- package/dist/src/user/orderWithBidReceipt.js +3 -14
- package/package.json +2 -1
- package/dist/src/_dependencies/source/0x1/bit-vector/structs.d.ts +0 -56
- package/dist/src/_dependencies/source/0x1/bit-vector/structs.js +0 -268
- package/dist/src/_dependencies/source/0x1/fixed-point32/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0x1/fixed-point32/structs.js +0 -222
- package/dist/src/_dependencies/source/0x1/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x1/init.js +0 -55
- package/dist/src/_dependencies/source/0x1/uq32-32/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0x1/uq32-32/structs.js +0 -222
- package/dist/src/_dependencies/source/0x1/uq64-64/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0x1/uq64-64/structs.js +0 -222
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.d.ts +0 -5
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.js +0 -8
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.js +0 -50
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.d.ts +0 -350
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.js +0 -794
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.d.ts +0 -111
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.js +0 -389
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.d.ts +0 -70
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.js +0 -252
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.d.ts +0 -70
- package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.js +0 -252
- package/dist/src/_dependencies/source/0x2/authenticator-state/structs.d.ts +0 -464
- package/dist/src/_dependencies/source/0x2/authenticator-state/structs.js +0 -904
- 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/bcs/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0x2/bcs/structs.js +0 -256
- package/dist/src/_dependencies/source/0x2/bls12381/structs.d.ts +0 -214
- package/dist/src/_dependencies/source/0x2/bls12381/structs.js +0 -790
- package/dist/src/_dependencies/source/0x2/borrow/structs.d.ts +0 -113
- package/dist/src/_dependencies/source/0x2/borrow/structs.js +0 -398
- package/dist/src/_dependencies/source/0x2/clock/structs.d.ts +0 -61
- package/dist/src/_dependencies/source/0x2/clock/structs.js +0 -235
- 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/config/structs.d.ts +0 -179
- package/dist/src/_dependencies/source/0x2/config/structs.js +0 -567
- package/dist/src/_dependencies/source/0x2/deny-list/structs.d.ts +0 -430
- package/dist/src/_dependencies/source/0x2/deny-list/structs.js +0 -1166
- package/dist/src/_dependencies/source/0x2/display/structs.d.ts +0 -241
- package/dist/src/_dependencies/source/0x2/display/structs.js +0 -578
- package/dist/src/_dependencies/source/0x2/dynamic-field/structs.d.ts +0 -68
- package/dist/src/_dependencies/source/0x2/dynamic-field/structs.js +0 -256
- package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.d.ts +0 -47
- package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.js +0 -236
- package/dist/src/_dependencies/source/0x2/groth16/structs.d.ts +0 -204
- package/dist/src/_dependencies/source/0x2/groth16/structs.js +0 -706
- package/dist/src/_dependencies/source/0x2/group-ops/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0x2/group-ops/structs.js +0 -267
- package/dist/src/_dependencies/source/0x2/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x2/init.js +0 -171
- package/dist/src/_dependencies/source/0x2/kiosk/structs.d.ts +0 -606
- package/dist/src/_dependencies/source/0x2/kiosk/structs.js +0 -1719
- package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.d.ts +0 -121
- package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.js +0 -394
- 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-bag/structs.d.ts +0 -61
- package/dist/src/_dependencies/source/0x2/object-bag/structs.js +0 -229
- package/dist/src/_dependencies/source/0x2/package/structs.d.ts +0 -280
- package/dist/src/_dependencies/source/0x2/package/structs.js +0 -762
- package/dist/src/_dependencies/source/0x2/priority-queue/structs.d.ts +0 -111
- package/dist/src/_dependencies/source/0x2/priority-queue/structs.js +0 -440
- package/dist/src/_dependencies/source/0x2/random/structs.d.ts +0 -204
- package/dist/src/_dependencies/source/0x2/random/structs.js +0 -596
- 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/structs.d.ts +0 -57
- package/dist/src/_dependencies/source/0x2/transfer/structs.js +0 -246
- 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/tx-context/structs.d.ts +0 -74
- package/dist/src/_dependencies/source/0x2/tx-context/structs.js +0 -286
- 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/versioned/structs.d.ts +0 -113
- package/dist/src/_dependencies/source/0x2/versioned/structs.js +0 -389
- package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.d.ts +0 -110
- package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.js +0 -260
- package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.d.ts +0 -74
- package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.js +0 -242
- package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.js +0 -6
- package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.js +0 -40
- package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.d.ts +0 -55
- package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.js +0 -223
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.d.ts +0 -4
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.js +0 -7
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.js +0 -43
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.js +0 -222
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.d.ts +0 -121
- package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.js +0 -395
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.d.ts +0 -489
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.js +0 -1084
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.d.ts +0 -147
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.js +0 -456
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.d.ts +0 -239
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.js +0 -653
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.d.ts +0 -405
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.js +0 -899
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.js +0 -102
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.d.ts +0 -699
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.js +0 -1459
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.d.ts +0 -147
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.js +0 -430
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tails-staking/structs.d.ts +0 -1071
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tails-staking/structs.js +0 -2261
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.d.ts +0 -279
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.js +0 -733
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.d.ts +0 -328
- package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.js +0 -892
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.d.ts +0 -628
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.js +0 -1324
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.d.ts +0 -9
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.js +0 -12
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.js +0 -72
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.d.ts +0 -94
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.js +0 -376
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.d.ts +0 -454
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.js +0 -881
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.d.ts +0 -68
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.js +0 -274
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.d.ts +0 -1117
- package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.js +0 -2387
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.d.ts +0 -1524
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.js +0 -3008
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.d.ts +0 -10
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.js +0 -13
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.js +0 -145
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.d.ts +0 -1267
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.js +0 -2820
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.d.ts +0 -1412
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.js +0 -1646
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.d.ts +0 -425
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.js +0 -1223
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.d.ts +0 -1156
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.js +0 -1828
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.d.ts +0 -82
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.js +0 -264
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.d.ts +0 -5022
- package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.js +0 -7585
- package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.js +0 -6
- package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.js +0 -4
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.js +0 -263
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.d.ts +0 -347
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.js +0 -591
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.d.ts +0 -73
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.js +0 -258
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.d.ts +0 -876
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.js +0 -1721
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.js +0 -222
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.js +0 -89
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.d.ts +0 -155
- package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.js +0 -444
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.d.ts +0 -745
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.js +0 -1221
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.js +0 -53
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.d.ts +0 -87
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.js +0 -287
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.d.ts +0 -58
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.js +0 -240
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.d.ts +0 -121
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.js +0 -323
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.d.ts +0 -55
- package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.js +0 -223
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/batch-price-attestation/structs.d.ts +0 -289
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/batch-price-attestation/structs.js +0 -453
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/contract-upgrade/structs.d.ts +0 -114
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/contract-upgrade/structs.js +0 -378
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/data-source/structs.d.ts +0 -71
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/data-source/structs.js +0 -235
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/event/structs.d.ts +0 -209
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/event/structs.js +0 -377
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance/structs.d.ts +0 -73
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance/structs.js +0 -275
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-action/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-action/structs.js +0 -222
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-instruction/structs.d.ts +0 -77
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-instruction/structs.js +0 -281
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/hot-potato-vector/structs.d.ts +0 -51
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/hot-potato-vector/structs.js +0 -270
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/i64/structs.d.ts +0 -52
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/i64/structs.js +0 -234
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/index.js +0 -6
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/init.js +0 -95
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/migrate/structs.d.ts +0 -51
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/migrate/structs.js +0 -223
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price/structs.d.ts +0 -89
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price/structs.js +0 -247
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-feed/structs.d.ts +0 -158
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-feed/structs.js +0 -242
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-identifier/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-identifier/structs.js +0 -256
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-info/structs.d.ts +0 -360
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-info/structs.js +0 -396
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-status/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-status/structs.js +0 -222
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set/structs.d.ts +0 -120
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set/structs.js +0 -425
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-data-sources/structs.d.ts +0 -81
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-data-sources/structs.js +0 -257
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-fee-recipient/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-fee-recipient/structs.js +0 -222
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-governance-data-source/structs.d.ts +0 -77
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-governance-data-source/structs.js +0 -241
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-stale-price-threshold/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-stale-price-threshold/structs.js +0 -222
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-update-fee/structs.d.ts +0 -52
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-update-fee/structs.js +0 -234
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/setup/structs.d.ts +0 -55
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/setup/structs.js +0 -223
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/state/structs.d.ts +0 -282
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/state/structs.js +0 -560
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/version-control/structs.d.ts +0 -130
- package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/version-control/structs.js +0 -506
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.js +0 -6
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.js +0 -46
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.js +0 -364
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.d.ts +0 -94
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.js +0 -376
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.d.ts +0 -46
- package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.js +0 -233
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes20/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes20/structs.js +0 -256
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32/structs.js +0 -256
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed-vaas/structs.d.ts +0 -77
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed-vaas/structs.js +0 -260
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/cursor/structs.d.ts +0 -51
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/cursor/structs.js +0 -270
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/emitter/structs.d.ts +0 -153
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/emitter/structs.js +0 -519
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external-address/structs.d.ts +0 -57
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external-address/structs.js +0 -223
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/fee-collector/structs.d.ts +0 -63
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/fee-collector/structs.js +0 -270
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/governance-message/structs.d.ts +0 -168
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/governance-message/structs.js +0 -470
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian/structs.d.ts +0 -57
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian/structs.js +0 -223
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-set/structs.d.ts +0 -81
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-set/structs.js +0 -275
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-signature/structs.d.ts +0 -85
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-signature/structs.js +0 -247
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/index.js +0 -6
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/init.js +0 -100
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/migrate/structs.d.ts +0 -51
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/migrate/structs.js +0 -223
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/package-utils/structs.d.ts +0 -194
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/package-utils/structs.js +0 -662
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/publish-message/structs.d.ts +0 -151
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/publish-message/structs.js +0 -459
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set/structs.d.ts +0 -110
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set/structs.js +0 -416
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set-fee/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set-fee/structs.js +0 -364
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/setup/structs.d.ts +0 -55
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/setup/structs.js +0 -223
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/state/structs.d.ts +0 -278
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/state/structs.js +0 -459
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/transfer-fee/structs.d.ts +0 -94
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/transfer-fee/structs.js +0 -376
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/update-guardian-set/structs.d.ts +0 -159
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/update-guardian-set/structs.js +0 -553
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/upgrade-contract/structs.d.ts +0 -156
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/upgrade-contract/structs.js +0 -520
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/vaa/structs.d.ts +0 -128
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/vaa/structs.js +0 -312
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/version-control/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/version-control/structs.js +0 -364
- package/dist/src/readVec.d.ts +0 -3
- package/dist/src/readVec.js +0 -118
|
@@ -1,1719 +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.PurchaseCap = exports.Lock = exports.Listing = exports.KioskOwnerCap = exports.Kiosk = exports.ItemPurchased = exports.ItemListed = exports.ItemDelisted = exports.Item = exports.Borrow = void 0;
|
|
109
|
-
exports.isBorrow = isBorrow;
|
|
110
|
-
exports.isItem = isItem;
|
|
111
|
-
exports.isItemDelisted = isItemDelisted;
|
|
112
|
-
exports.isItemListed = isItemListed;
|
|
113
|
-
exports.isItemPurchased = isItemPurchased;
|
|
114
|
-
exports.isKiosk = isKiosk;
|
|
115
|
-
exports.isKioskOwnerCap = isKioskOwnerCap;
|
|
116
|
-
exports.isListing = isListing;
|
|
117
|
-
exports.isLock = isLock;
|
|
118
|
-
exports.isPurchaseCap = isPurchaseCap;
|
|
119
|
-
var reified = __importStar(require("../../../../_framework/reified"));
|
|
120
|
-
var reified_1 = require("../../../../_framework/reified");
|
|
121
|
-
var util_1 = require("../../../../_framework/util");
|
|
122
|
-
var structs_1 = require("../balance/structs");
|
|
123
|
-
var index_1 = require("../index");
|
|
124
|
-
var structs_2 = require("../object/structs");
|
|
125
|
-
var structs_3 = require("../sui/structs");
|
|
126
|
-
var bcs_1 = require("@mysten/sui/bcs");
|
|
127
|
-
var utils_1 = require("@mysten/sui/utils");
|
|
128
|
-
/* ============================== Borrow =============================== */
|
|
129
|
-
function isBorrow(type) {
|
|
130
|
-
type = (0, util_1.compressSuiType)(type);
|
|
131
|
-
return type === "".concat(index_1.PKG_V26, "::kiosk::Borrow");
|
|
132
|
-
}
|
|
133
|
-
var Borrow = /** @class */ (function () {
|
|
134
|
-
function Borrow(typeArgs, fields) {
|
|
135
|
-
this.__StructClass = true;
|
|
136
|
-
this.$typeName = Borrow.$typeName;
|
|
137
|
-
this.$isPhantom = Borrow.$isPhantom;
|
|
138
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Borrow.$typeName], __read(typeArgs), false));
|
|
139
|
-
this.$typeArgs = typeArgs;
|
|
140
|
-
this.kioskId = fields.kioskId;
|
|
141
|
-
this.itemId = fields.itemId;
|
|
142
|
-
}
|
|
143
|
-
Borrow.reified = function () {
|
|
144
|
-
var _this = this;
|
|
145
|
-
return {
|
|
146
|
-
typeName: Borrow.$typeName,
|
|
147
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Borrow.$typeName], [], false)),
|
|
148
|
-
typeArgs: [],
|
|
149
|
-
isPhantom: Borrow.$isPhantom,
|
|
150
|
-
reifiedTypeArgs: [],
|
|
151
|
-
fromFields: function (fields) { return Borrow.fromFields(fields); },
|
|
152
|
-
fromFieldsWithTypes: function (item) { return Borrow.fromFieldsWithTypes(item); },
|
|
153
|
-
fromBcs: function (data) { return Borrow.fromBcs(data); },
|
|
154
|
-
bcs: Borrow.bcs,
|
|
155
|
-
fromJSONField: function (field) { return Borrow.fromJSONField(field); },
|
|
156
|
-
fromJSON: function (json) { return Borrow.fromJSON(json); },
|
|
157
|
-
fromSuiParsedData: function (content) { return Borrow.fromSuiParsedData(content); },
|
|
158
|
-
fromSuiObjectData: function (content) { return Borrow.fromSuiObjectData(content); },
|
|
159
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
160
|
-
return [2 /*return*/, Borrow.fetch(client, id)];
|
|
161
|
-
}); }); },
|
|
162
|
-
new: function (fields) {
|
|
163
|
-
return new Borrow([], fields);
|
|
164
|
-
},
|
|
165
|
-
kind: "StructClassReified",
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
Object.defineProperty(Borrow, "r", {
|
|
169
|
-
get: function () {
|
|
170
|
-
return Borrow.reified();
|
|
171
|
-
},
|
|
172
|
-
enumerable: false,
|
|
173
|
-
configurable: true
|
|
174
|
-
});
|
|
175
|
-
Borrow.phantom = function () {
|
|
176
|
-
return (0, reified_1.phantom)(Borrow.reified());
|
|
177
|
-
};
|
|
178
|
-
Object.defineProperty(Borrow, "p", {
|
|
179
|
-
get: function () {
|
|
180
|
-
return Borrow.phantom();
|
|
181
|
-
},
|
|
182
|
-
enumerable: false,
|
|
183
|
-
configurable: true
|
|
184
|
-
});
|
|
185
|
-
Object.defineProperty(Borrow, "bcs", {
|
|
186
|
-
get: function () {
|
|
187
|
-
return bcs_1.bcs.struct("Borrow", {
|
|
188
|
-
kiosk_id: structs_2.ID.bcs,
|
|
189
|
-
item_id: structs_2.ID.bcs,
|
|
190
|
-
});
|
|
191
|
-
},
|
|
192
|
-
enumerable: false,
|
|
193
|
-
configurable: true
|
|
194
|
-
});
|
|
195
|
-
Borrow.fromFields = function (fields) {
|
|
196
|
-
return Borrow.reified().new({
|
|
197
|
-
kioskId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.kiosk_id),
|
|
198
|
-
itemId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.item_id),
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
Borrow.fromFieldsWithTypes = function (item) {
|
|
202
|
-
if (!isBorrow(item.type)) {
|
|
203
|
-
throw new Error("not a Borrow type");
|
|
204
|
-
}
|
|
205
|
-
return Borrow.reified().new({
|
|
206
|
-
kioskId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.kiosk_id),
|
|
207
|
-
itemId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.item_id),
|
|
208
|
-
});
|
|
209
|
-
};
|
|
210
|
-
Borrow.fromBcs = function (data) {
|
|
211
|
-
return Borrow.fromFields(Borrow.bcs.parse(data));
|
|
212
|
-
};
|
|
213
|
-
Borrow.prototype.toJSONField = function () {
|
|
214
|
-
return {
|
|
215
|
-
kioskId: this.kioskId,
|
|
216
|
-
itemId: this.itemId,
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
Borrow.prototype.toJSON = function () {
|
|
220
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
221
|
-
};
|
|
222
|
-
Borrow.fromJSONField = function (field) {
|
|
223
|
-
return Borrow.reified().new({
|
|
224
|
-
kioskId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.kioskId),
|
|
225
|
-
itemId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.itemId),
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
Borrow.fromJSON = function (json) {
|
|
229
|
-
if (json.$typeName !== Borrow.$typeName) {
|
|
230
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
231
|
-
}
|
|
232
|
-
return Borrow.fromJSONField(json);
|
|
233
|
-
};
|
|
234
|
-
Borrow.fromSuiParsedData = function (content) {
|
|
235
|
-
if (content.dataType !== "moveObject") {
|
|
236
|
-
throw new Error("not an object");
|
|
237
|
-
}
|
|
238
|
-
if (!isBorrow(content.type)) {
|
|
239
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Borrow object"));
|
|
240
|
-
}
|
|
241
|
-
return Borrow.fromFieldsWithTypes(content);
|
|
242
|
-
};
|
|
243
|
-
Borrow.fromSuiObjectData = function (data) {
|
|
244
|
-
if (data.bcs) {
|
|
245
|
-
if (data.bcs.dataType !== "moveObject" || !isBorrow(data.bcs.type)) {
|
|
246
|
-
throw new Error("object at is not a Borrow object");
|
|
247
|
-
}
|
|
248
|
-
return Borrow.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
249
|
-
}
|
|
250
|
-
if (data.content) {
|
|
251
|
-
return Borrow.fromSuiParsedData(data.content);
|
|
252
|
-
}
|
|
253
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
254
|
-
};
|
|
255
|
-
Borrow.fetch = function (client, id) {
|
|
256
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
var res;
|
|
258
|
-
var _a, _b;
|
|
259
|
-
return __generator(this, function (_c) {
|
|
260
|
-
switch (_c.label) {
|
|
261
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
262
|
-
case 1:
|
|
263
|
-
res = _c.sent();
|
|
264
|
-
if (res.error) {
|
|
265
|
-
throw new Error("error fetching Borrow object at id ".concat(id, ": ").concat(res.error.code));
|
|
266
|
-
}
|
|
267
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isBorrow(res.data.bcs.type)) {
|
|
268
|
-
throw new Error("object at id ".concat(id, " is not a Borrow object"));
|
|
269
|
-
}
|
|
270
|
-
return [2 /*return*/, Borrow.fromSuiObjectData(res.data)];
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
Borrow.$typeName = "".concat(index_1.PKG_V26, "::kiosk::Borrow");
|
|
276
|
-
Borrow.$numTypeParams = 0;
|
|
277
|
-
Borrow.$isPhantom = [];
|
|
278
|
-
return Borrow;
|
|
279
|
-
}());
|
|
280
|
-
exports.Borrow = Borrow;
|
|
281
|
-
/* ============================== Item =============================== */
|
|
282
|
-
function isItem(type) {
|
|
283
|
-
type = (0, util_1.compressSuiType)(type);
|
|
284
|
-
return type === "".concat(index_1.PKG_V26, "::kiosk::Item");
|
|
285
|
-
}
|
|
286
|
-
var Item = /** @class */ (function () {
|
|
287
|
-
function Item(typeArgs, fields) {
|
|
288
|
-
this.__StructClass = true;
|
|
289
|
-
this.$typeName = Item.$typeName;
|
|
290
|
-
this.$isPhantom = Item.$isPhantom;
|
|
291
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Item.$typeName], __read(typeArgs), false));
|
|
292
|
-
this.$typeArgs = typeArgs;
|
|
293
|
-
this.id = fields.id;
|
|
294
|
-
}
|
|
295
|
-
Item.reified = function () {
|
|
296
|
-
var _this = this;
|
|
297
|
-
return {
|
|
298
|
-
typeName: Item.$typeName,
|
|
299
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Item.$typeName], [], false)),
|
|
300
|
-
typeArgs: [],
|
|
301
|
-
isPhantom: Item.$isPhantom,
|
|
302
|
-
reifiedTypeArgs: [],
|
|
303
|
-
fromFields: function (fields) { return Item.fromFields(fields); },
|
|
304
|
-
fromFieldsWithTypes: function (item) { return Item.fromFieldsWithTypes(item); },
|
|
305
|
-
fromBcs: function (data) { return Item.fromBcs(data); },
|
|
306
|
-
bcs: Item.bcs,
|
|
307
|
-
fromJSONField: function (field) { return Item.fromJSONField(field); },
|
|
308
|
-
fromJSON: function (json) { return Item.fromJSON(json); },
|
|
309
|
-
fromSuiParsedData: function (content) { return Item.fromSuiParsedData(content); },
|
|
310
|
-
fromSuiObjectData: function (content) { return Item.fromSuiObjectData(content); },
|
|
311
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
312
|
-
return [2 /*return*/, Item.fetch(client, id)];
|
|
313
|
-
}); }); },
|
|
314
|
-
new: function (fields) {
|
|
315
|
-
return new Item([], fields);
|
|
316
|
-
},
|
|
317
|
-
kind: "StructClassReified",
|
|
318
|
-
};
|
|
319
|
-
};
|
|
320
|
-
Object.defineProperty(Item, "r", {
|
|
321
|
-
get: function () {
|
|
322
|
-
return Item.reified();
|
|
323
|
-
},
|
|
324
|
-
enumerable: false,
|
|
325
|
-
configurable: true
|
|
326
|
-
});
|
|
327
|
-
Item.phantom = function () {
|
|
328
|
-
return (0, reified_1.phantom)(Item.reified());
|
|
329
|
-
};
|
|
330
|
-
Object.defineProperty(Item, "p", {
|
|
331
|
-
get: function () {
|
|
332
|
-
return Item.phantom();
|
|
333
|
-
},
|
|
334
|
-
enumerable: false,
|
|
335
|
-
configurable: true
|
|
336
|
-
});
|
|
337
|
-
Object.defineProperty(Item, "bcs", {
|
|
338
|
-
get: function () {
|
|
339
|
-
return bcs_1.bcs.struct("Item", {
|
|
340
|
-
id: structs_2.ID.bcs,
|
|
341
|
-
});
|
|
342
|
-
},
|
|
343
|
-
enumerable: false,
|
|
344
|
-
configurable: true
|
|
345
|
-
});
|
|
346
|
-
Item.fromFields = function (fields) {
|
|
347
|
-
return Item.reified().new({ id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id) });
|
|
348
|
-
};
|
|
349
|
-
Item.fromFieldsWithTypes = function (item) {
|
|
350
|
-
if (!isItem(item.type)) {
|
|
351
|
-
throw new Error("not a Item type");
|
|
352
|
-
}
|
|
353
|
-
return Item.reified().new({ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id) });
|
|
354
|
-
};
|
|
355
|
-
Item.fromBcs = function (data) {
|
|
356
|
-
return Item.fromFields(Item.bcs.parse(data));
|
|
357
|
-
};
|
|
358
|
-
Item.prototype.toJSONField = function () {
|
|
359
|
-
return {
|
|
360
|
-
id: this.id,
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
Item.prototype.toJSON = function () {
|
|
364
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
365
|
-
};
|
|
366
|
-
Item.fromJSONField = function (field) {
|
|
367
|
-
return Item.reified().new({ id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id) });
|
|
368
|
-
};
|
|
369
|
-
Item.fromJSON = function (json) {
|
|
370
|
-
if (json.$typeName !== Item.$typeName) {
|
|
371
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
372
|
-
}
|
|
373
|
-
return Item.fromJSONField(json);
|
|
374
|
-
};
|
|
375
|
-
Item.fromSuiParsedData = function (content) {
|
|
376
|
-
if (content.dataType !== "moveObject") {
|
|
377
|
-
throw new Error("not an object");
|
|
378
|
-
}
|
|
379
|
-
if (!isItem(content.type)) {
|
|
380
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Item object"));
|
|
381
|
-
}
|
|
382
|
-
return Item.fromFieldsWithTypes(content);
|
|
383
|
-
};
|
|
384
|
-
Item.fromSuiObjectData = function (data) {
|
|
385
|
-
if (data.bcs) {
|
|
386
|
-
if (data.bcs.dataType !== "moveObject" || !isItem(data.bcs.type)) {
|
|
387
|
-
throw new Error("object at is not a Item object");
|
|
388
|
-
}
|
|
389
|
-
return Item.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
390
|
-
}
|
|
391
|
-
if (data.content) {
|
|
392
|
-
return Item.fromSuiParsedData(data.content);
|
|
393
|
-
}
|
|
394
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
395
|
-
};
|
|
396
|
-
Item.fetch = function (client, id) {
|
|
397
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
398
|
-
var res;
|
|
399
|
-
var _a, _b;
|
|
400
|
-
return __generator(this, function (_c) {
|
|
401
|
-
switch (_c.label) {
|
|
402
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
403
|
-
case 1:
|
|
404
|
-
res = _c.sent();
|
|
405
|
-
if (res.error) {
|
|
406
|
-
throw new Error("error fetching Item object at id ".concat(id, ": ").concat(res.error.code));
|
|
407
|
-
}
|
|
408
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isItem(res.data.bcs.type)) {
|
|
409
|
-
throw new Error("object at id ".concat(id, " is not a Item object"));
|
|
410
|
-
}
|
|
411
|
-
return [2 /*return*/, Item.fromSuiObjectData(res.data)];
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
});
|
|
415
|
-
};
|
|
416
|
-
Item.$typeName = "".concat(index_1.PKG_V26, "::kiosk::Item");
|
|
417
|
-
Item.$numTypeParams = 0;
|
|
418
|
-
Item.$isPhantom = [];
|
|
419
|
-
return Item;
|
|
420
|
-
}());
|
|
421
|
-
exports.Item = Item;
|
|
422
|
-
/* ============================== ItemDelisted =============================== */
|
|
423
|
-
function isItemDelisted(type) {
|
|
424
|
-
type = (0, util_1.compressSuiType)(type);
|
|
425
|
-
return type.startsWith("".concat(index_1.PKG_V26, "::kiosk::ItemDelisted") + "<");
|
|
426
|
-
}
|
|
427
|
-
var ItemDelisted = /** @class */ (function () {
|
|
428
|
-
function ItemDelisted(typeArgs, fields) {
|
|
429
|
-
this.__StructClass = true;
|
|
430
|
-
this.$typeName = ItemDelisted.$typeName;
|
|
431
|
-
this.$isPhantom = ItemDelisted.$isPhantom;
|
|
432
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ItemDelisted.$typeName], __read(typeArgs), false));
|
|
433
|
-
this.$typeArgs = typeArgs;
|
|
434
|
-
this.kiosk = fields.kiosk;
|
|
435
|
-
this.id = fields.id;
|
|
436
|
-
}
|
|
437
|
-
ItemDelisted.reified = function (T) {
|
|
438
|
-
var _this = this;
|
|
439
|
-
return {
|
|
440
|
-
typeName: ItemDelisted.$typeName,
|
|
441
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ItemDelisted.$typeName], [(0, reified_1.extractType)(T)], false)),
|
|
442
|
-
typeArgs: [(0, reified_1.extractType)(T)],
|
|
443
|
-
isPhantom: ItemDelisted.$isPhantom,
|
|
444
|
-
reifiedTypeArgs: [T],
|
|
445
|
-
fromFields: function (fields) { return ItemDelisted.fromFields(T, fields); },
|
|
446
|
-
fromFieldsWithTypes: function (item) { return ItemDelisted.fromFieldsWithTypes(T, item); },
|
|
447
|
-
fromBcs: function (data) { return ItemDelisted.fromBcs(T, data); },
|
|
448
|
-
bcs: ItemDelisted.bcs,
|
|
449
|
-
fromJSONField: function (field) { return ItemDelisted.fromJSONField(T, field); },
|
|
450
|
-
fromJSON: function (json) { return ItemDelisted.fromJSON(T, json); },
|
|
451
|
-
fromSuiParsedData: function (content) { return ItemDelisted.fromSuiParsedData(T, content); },
|
|
452
|
-
fromSuiObjectData: function (content) { return ItemDelisted.fromSuiObjectData(T, content); },
|
|
453
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
454
|
-
return [2 /*return*/, ItemDelisted.fetch(client, T, id)];
|
|
455
|
-
}); }); },
|
|
456
|
-
new: function (fields) {
|
|
457
|
-
return new ItemDelisted([(0, reified_1.extractType)(T)], fields);
|
|
458
|
-
},
|
|
459
|
-
kind: "StructClassReified",
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
Object.defineProperty(ItemDelisted, "r", {
|
|
463
|
-
get: function () {
|
|
464
|
-
return ItemDelisted.reified;
|
|
465
|
-
},
|
|
466
|
-
enumerable: false,
|
|
467
|
-
configurable: true
|
|
468
|
-
});
|
|
469
|
-
ItemDelisted.phantom = function (T) {
|
|
470
|
-
return (0, reified_1.phantom)(ItemDelisted.reified(T));
|
|
471
|
-
};
|
|
472
|
-
Object.defineProperty(ItemDelisted, "p", {
|
|
473
|
-
get: function () {
|
|
474
|
-
return ItemDelisted.phantom;
|
|
475
|
-
},
|
|
476
|
-
enumerable: false,
|
|
477
|
-
configurable: true
|
|
478
|
-
});
|
|
479
|
-
Object.defineProperty(ItemDelisted, "bcs", {
|
|
480
|
-
get: function () {
|
|
481
|
-
return bcs_1.bcs.struct("ItemDelisted", {
|
|
482
|
-
kiosk: structs_2.ID.bcs,
|
|
483
|
-
id: structs_2.ID.bcs,
|
|
484
|
-
});
|
|
485
|
-
},
|
|
486
|
-
enumerable: false,
|
|
487
|
-
configurable: true
|
|
488
|
-
});
|
|
489
|
-
ItemDelisted.fromFields = function (typeArg, fields) {
|
|
490
|
-
return ItemDelisted.reified(typeArg).new({
|
|
491
|
-
kiosk: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.kiosk),
|
|
492
|
-
id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id),
|
|
493
|
-
});
|
|
494
|
-
};
|
|
495
|
-
ItemDelisted.fromFieldsWithTypes = function (typeArg, item) {
|
|
496
|
-
if (!isItemDelisted(item.type)) {
|
|
497
|
-
throw new Error("not a ItemDelisted type");
|
|
498
|
-
}
|
|
499
|
-
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
500
|
-
return ItemDelisted.reified(typeArg).new({
|
|
501
|
-
kiosk: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.kiosk),
|
|
502
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id),
|
|
503
|
-
});
|
|
504
|
-
};
|
|
505
|
-
ItemDelisted.fromBcs = function (typeArg, data) {
|
|
506
|
-
return ItemDelisted.fromFields(typeArg, ItemDelisted.bcs.parse(data));
|
|
507
|
-
};
|
|
508
|
-
ItemDelisted.prototype.toJSONField = function () {
|
|
509
|
-
return {
|
|
510
|
-
kiosk: this.kiosk,
|
|
511
|
-
id: this.id,
|
|
512
|
-
};
|
|
513
|
-
};
|
|
514
|
-
ItemDelisted.prototype.toJSON = function () {
|
|
515
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
516
|
-
};
|
|
517
|
-
ItemDelisted.fromJSONField = function (typeArg, field) {
|
|
518
|
-
return ItemDelisted.reified(typeArg).new({
|
|
519
|
-
kiosk: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.kiosk),
|
|
520
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id),
|
|
521
|
-
});
|
|
522
|
-
};
|
|
523
|
-
ItemDelisted.fromJSON = function (typeArg, json) {
|
|
524
|
-
if (json.$typeName !== ItemDelisted.$typeName) {
|
|
525
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
526
|
-
}
|
|
527
|
-
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(ItemDelisted.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
528
|
-
return ItemDelisted.fromJSONField(typeArg, json);
|
|
529
|
-
};
|
|
530
|
-
ItemDelisted.fromSuiParsedData = function (typeArg, content) {
|
|
531
|
-
if (content.dataType !== "moveObject") {
|
|
532
|
-
throw new Error("not an object");
|
|
533
|
-
}
|
|
534
|
-
if (!isItemDelisted(content.type)) {
|
|
535
|
-
throw new Error("object at ".concat(content.fields.id, " is not a ItemDelisted object"));
|
|
536
|
-
}
|
|
537
|
-
return ItemDelisted.fromFieldsWithTypes(typeArg, content);
|
|
538
|
-
};
|
|
539
|
-
ItemDelisted.fromSuiObjectData = function (typeArg, data) {
|
|
540
|
-
if (data.bcs) {
|
|
541
|
-
if (data.bcs.dataType !== "moveObject" || !isItemDelisted(data.bcs.type)) {
|
|
542
|
-
throw new Error("object at is not a ItemDelisted object");
|
|
543
|
-
}
|
|
544
|
-
var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
545
|
-
if (gotTypeArgs.length !== 1) {
|
|
546
|
-
throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
|
|
547
|
-
}
|
|
548
|
-
var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
549
|
-
var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
550
|
-
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
551
|
-
throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
|
|
552
|
-
}
|
|
553
|
-
return ItemDelisted.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
554
|
-
}
|
|
555
|
-
if (data.content) {
|
|
556
|
-
return ItemDelisted.fromSuiParsedData(typeArg, data.content);
|
|
557
|
-
}
|
|
558
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
559
|
-
};
|
|
560
|
-
ItemDelisted.fetch = function (client, typeArg, id) {
|
|
561
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
562
|
-
var res;
|
|
563
|
-
var _a, _b;
|
|
564
|
-
return __generator(this, function (_c) {
|
|
565
|
-
switch (_c.label) {
|
|
566
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
567
|
-
case 1:
|
|
568
|
-
res = _c.sent();
|
|
569
|
-
if (res.error) {
|
|
570
|
-
throw new Error("error fetching ItemDelisted object at id ".concat(id, ": ").concat(res.error.code));
|
|
571
|
-
}
|
|
572
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isItemDelisted(res.data.bcs.type)) {
|
|
573
|
-
throw new Error("object at id ".concat(id, " is not a ItemDelisted object"));
|
|
574
|
-
}
|
|
575
|
-
return [2 /*return*/, ItemDelisted.fromSuiObjectData(typeArg, res.data)];
|
|
576
|
-
}
|
|
577
|
-
});
|
|
578
|
-
});
|
|
579
|
-
};
|
|
580
|
-
ItemDelisted.$typeName = "".concat(index_1.PKG_V26, "::kiosk::ItemDelisted");
|
|
581
|
-
ItemDelisted.$numTypeParams = 1;
|
|
582
|
-
ItemDelisted.$isPhantom = [true];
|
|
583
|
-
return ItemDelisted;
|
|
584
|
-
}());
|
|
585
|
-
exports.ItemDelisted = ItemDelisted;
|
|
586
|
-
/* ============================== ItemListed =============================== */
|
|
587
|
-
function isItemListed(type) {
|
|
588
|
-
type = (0, util_1.compressSuiType)(type);
|
|
589
|
-
return type.startsWith("".concat(index_1.PKG_V26, "::kiosk::ItemListed") + "<");
|
|
590
|
-
}
|
|
591
|
-
var ItemListed = /** @class */ (function () {
|
|
592
|
-
function ItemListed(typeArgs, fields) {
|
|
593
|
-
this.__StructClass = true;
|
|
594
|
-
this.$typeName = ItemListed.$typeName;
|
|
595
|
-
this.$isPhantom = ItemListed.$isPhantom;
|
|
596
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ItemListed.$typeName], __read(typeArgs), false));
|
|
597
|
-
this.$typeArgs = typeArgs;
|
|
598
|
-
this.kiosk = fields.kiosk;
|
|
599
|
-
this.id = fields.id;
|
|
600
|
-
this.price = fields.price;
|
|
601
|
-
}
|
|
602
|
-
ItemListed.reified = function (T) {
|
|
603
|
-
var _this = this;
|
|
604
|
-
return {
|
|
605
|
-
typeName: ItemListed.$typeName,
|
|
606
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ItemListed.$typeName], [(0, reified_1.extractType)(T)], false)),
|
|
607
|
-
typeArgs: [(0, reified_1.extractType)(T)],
|
|
608
|
-
isPhantom: ItemListed.$isPhantom,
|
|
609
|
-
reifiedTypeArgs: [T],
|
|
610
|
-
fromFields: function (fields) { return ItemListed.fromFields(T, fields); },
|
|
611
|
-
fromFieldsWithTypes: function (item) { return ItemListed.fromFieldsWithTypes(T, item); },
|
|
612
|
-
fromBcs: function (data) { return ItemListed.fromBcs(T, data); },
|
|
613
|
-
bcs: ItemListed.bcs,
|
|
614
|
-
fromJSONField: function (field) { return ItemListed.fromJSONField(T, field); },
|
|
615
|
-
fromJSON: function (json) { return ItemListed.fromJSON(T, json); },
|
|
616
|
-
fromSuiParsedData: function (content) { return ItemListed.fromSuiParsedData(T, content); },
|
|
617
|
-
fromSuiObjectData: function (content) { return ItemListed.fromSuiObjectData(T, content); },
|
|
618
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
619
|
-
return [2 /*return*/, ItemListed.fetch(client, T, id)];
|
|
620
|
-
}); }); },
|
|
621
|
-
new: function (fields) {
|
|
622
|
-
return new ItemListed([(0, reified_1.extractType)(T)], fields);
|
|
623
|
-
},
|
|
624
|
-
kind: "StructClassReified",
|
|
625
|
-
};
|
|
626
|
-
};
|
|
627
|
-
Object.defineProperty(ItemListed, "r", {
|
|
628
|
-
get: function () {
|
|
629
|
-
return ItemListed.reified;
|
|
630
|
-
},
|
|
631
|
-
enumerable: false,
|
|
632
|
-
configurable: true
|
|
633
|
-
});
|
|
634
|
-
ItemListed.phantom = function (T) {
|
|
635
|
-
return (0, reified_1.phantom)(ItemListed.reified(T));
|
|
636
|
-
};
|
|
637
|
-
Object.defineProperty(ItemListed, "p", {
|
|
638
|
-
get: function () {
|
|
639
|
-
return ItemListed.phantom;
|
|
640
|
-
},
|
|
641
|
-
enumerable: false,
|
|
642
|
-
configurable: true
|
|
643
|
-
});
|
|
644
|
-
Object.defineProperty(ItemListed, "bcs", {
|
|
645
|
-
get: function () {
|
|
646
|
-
return bcs_1.bcs.struct("ItemListed", {
|
|
647
|
-
kiosk: structs_2.ID.bcs,
|
|
648
|
-
id: structs_2.ID.bcs,
|
|
649
|
-
price: bcs_1.bcs.u64(),
|
|
650
|
-
});
|
|
651
|
-
},
|
|
652
|
-
enumerable: false,
|
|
653
|
-
configurable: true
|
|
654
|
-
});
|
|
655
|
-
ItemListed.fromFields = function (typeArg, fields) {
|
|
656
|
-
return ItemListed.reified(typeArg).new({
|
|
657
|
-
kiosk: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.kiosk),
|
|
658
|
-
id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id),
|
|
659
|
-
price: (0, reified_1.decodeFromFields)("u64", fields.price),
|
|
660
|
-
});
|
|
661
|
-
};
|
|
662
|
-
ItemListed.fromFieldsWithTypes = function (typeArg, item) {
|
|
663
|
-
if (!isItemListed(item.type)) {
|
|
664
|
-
throw new Error("not a ItemListed type");
|
|
665
|
-
}
|
|
666
|
-
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
667
|
-
return ItemListed.reified(typeArg).new({
|
|
668
|
-
kiosk: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.kiosk),
|
|
669
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id),
|
|
670
|
-
price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
|
|
671
|
-
});
|
|
672
|
-
};
|
|
673
|
-
ItemListed.fromBcs = function (typeArg, data) {
|
|
674
|
-
return ItemListed.fromFields(typeArg, ItemListed.bcs.parse(data));
|
|
675
|
-
};
|
|
676
|
-
ItemListed.prototype.toJSONField = function () {
|
|
677
|
-
return {
|
|
678
|
-
kiosk: this.kiosk,
|
|
679
|
-
id: this.id,
|
|
680
|
-
price: this.price.toString(),
|
|
681
|
-
};
|
|
682
|
-
};
|
|
683
|
-
ItemListed.prototype.toJSON = function () {
|
|
684
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
685
|
-
};
|
|
686
|
-
ItemListed.fromJSONField = function (typeArg, field) {
|
|
687
|
-
return ItemListed.reified(typeArg).new({
|
|
688
|
-
kiosk: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.kiosk),
|
|
689
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id),
|
|
690
|
-
price: (0, reified_1.decodeFromJSONField)("u64", field.price),
|
|
691
|
-
});
|
|
692
|
-
};
|
|
693
|
-
ItemListed.fromJSON = function (typeArg, json) {
|
|
694
|
-
if (json.$typeName !== ItemListed.$typeName) {
|
|
695
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
696
|
-
}
|
|
697
|
-
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(ItemListed.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
698
|
-
return ItemListed.fromJSONField(typeArg, json);
|
|
699
|
-
};
|
|
700
|
-
ItemListed.fromSuiParsedData = function (typeArg, content) {
|
|
701
|
-
if (content.dataType !== "moveObject") {
|
|
702
|
-
throw new Error("not an object");
|
|
703
|
-
}
|
|
704
|
-
if (!isItemListed(content.type)) {
|
|
705
|
-
throw new Error("object at ".concat(content.fields.id, " is not a ItemListed object"));
|
|
706
|
-
}
|
|
707
|
-
return ItemListed.fromFieldsWithTypes(typeArg, content);
|
|
708
|
-
};
|
|
709
|
-
ItemListed.fromSuiObjectData = function (typeArg, data) {
|
|
710
|
-
if (data.bcs) {
|
|
711
|
-
if (data.bcs.dataType !== "moveObject" || !isItemListed(data.bcs.type)) {
|
|
712
|
-
throw new Error("object at is not a ItemListed object");
|
|
713
|
-
}
|
|
714
|
-
var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
715
|
-
if (gotTypeArgs.length !== 1) {
|
|
716
|
-
throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
|
|
717
|
-
}
|
|
718
|
-
var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
719
|
-
var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
720
|
-
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
721
|
-
throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
|
|
722
|
-
}
|
|
723
|
-
return ItemListed.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
724
|
-
}
|
|
725
|
-
if (data.content) {
|
|
726
|
-
return ItemListed.fromSuiParsedData(typeArg, data.content);
|
|
727
|
-
}
|
|
728
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
729
|
-
};
|
|
730
|
-
ItemListed.fetch = function (client, typeArg, id) {
|
|
731
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
732
|
-
var res;
|
|
733
|
-
var _a, _b;
|
|
734
|
-
return __generator(this, function (_c) {
|
|
735
|
-
switch (_c.label) {
|
|
736
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
737
|
-
case 1:
|
|
738
|
-
res = _c.sent();
|
|
739
|
-
if (res.error) {
|
|
740
|
-
throw new Error("error fetching ItemListed object at id ".concat(id, ": ").concat(res.error.code));
|
|
741
|
-
}
|
|
742
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isItemListed(res.data.bcs.type)) {
|
|
743
|
-
throw new Error("object at id ".concat(id, " is not a ItemListed object"));
|
|
744
|
-
}
|
|
745
|
-
return [2 /*return*/, ItemListed.fromSuiObjectData(typeArg, res.data)];
|
|
746
|
-
}
|
|
747
|
-
});
|
|
748
|
-
});
|
|
749
|
-
};
|
|
750
|
-
ItemListed.$typeName = "".concat(index_1.PKG_V26, "::kiosk::ItemListed");
|
|
751
|
-
ItemListed.$numTypeParams = 1;
|
|
752
|
-
ItemListed.$isPhantom = [true];
|
|
753
|
-
return ItemListed;
|
|
754
|
-
}());
|
|
755
|
-
exports.ItemListed = ItemListed;
|
|
756
|
-
/* ============================== ItemPurchased =============================== */
|
|
757
|
-
function isItemPurchased(type) {
|
|
758
|
-
type = (0, util_1.compressSuiType)(type);
|
|
759
|
-
return type.startsWith("".concat(index_1.PKG_V26, "::kiosk::ItemPurchased") + "<");
|
|
760
|
-
}
|
|
761
|
-
var ItemPurchased = /** @class */ (function () {
|
|
762
|
-
function ItemPurchased(typeArgs, fields) {
|
|
763
|
-
this.__StructClass = true;
|
|
764
|
-
this.$typeName = ItemPurchased.$typeName;
|
|
765
|
-
this.$isPhantom = ItemPurchased.$isPhantom;
|
|
766
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ItemPurchased.$typeName], __read(typeArgs), false));
|
|
767
|
-
this.$typeArgs = typeArgs;
|
|
768
|
-
this.kiosk = fields.kiosk;
|
|
769
|
-
this.id = fields.id;
|
|
770
|
-
this.price = fields.price;
|
|
771
|
-
}
|
|
772
|
-
ItemPurchased.reified = function (T) {
|
|
773
|
-
var _this = this;
|
|
774
|
-
return {
|
|
775
|
-
typeName: ItemPurchased.$typeName,
|
|
776
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ItemPurchased.$typeName], [(0, reified_1.extractType)(T)], false)),
|
|
777
|
-
typeArgs: [(0, reified_1.extractType)(T)],
|
|
778
|
-
isPhantom: ItemPurchased.$isPhantom,
|
|
779
|
-
reifiedTypeArgs: [T],
|
|
780
|
-
fromFields: function (fields) { return ItemPurchased.fromFields(T, fields); },
|
|
781
|
-
fromFieldsWithTypes: function (item) { return ItemPurchased.fromFieldsWithTypes(T, item); },
|
|
782
|
-
fromBcs: function (data) { return ItemPurchased.fromBcs(T, data); },
|
|
783
|
-
bcs: ItemPurchased.bcs,
|
|
784
|
-
fromJSONField: function (field) { return ItemPurchased.fromJSONField(T, field); },
|
|
785
|
-
fromJSON: function (json) { return ItemPurchased.fromJSON(T, json); },
|
|
786
|
-
fromSuiParsedData: function (content) { return ItemPurchased.fromSuiParsedData(T, content); },
|
|
787
|
-
fromSuiObjectData: function (content) { return ItemPurchased.fromSuiObjectData(T, content); },
|
|
788
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
789
|
-
return [2 /*return*/, ItemPurchased.fetch(client, T, id)];
|
|
790
|
-
}); }); },
|
|
791
|
-
new: function (fields) {
|
|
792
|
-
return new ItemPurchased([(0, reified_1.extractType)(T)], fields);
|
|
793
|
-
},
|
|
794
|
-
kind: "StructClassReified",
|
|
795
|
-
};
|
|
796
|
-
};
|
|
797
|
-
Object.defineProperty(ItemPurchased, "r", {
|
|
798
|
-
get: function () {
|
|
799
|
-
return ItemPurchased.reified;
|
|
800
|
-
},
|
|
801
|
-
enumerable: false,
|
|
802
|
-
configurable: true
|
|
803
|
-
});
|
|
804
|
-
ItemPurchased.phantom = function (T) {
|
|
805
|
-
return (0, reified_1.phantom)(ItemPurchased.reified(T));
|
|
806
|
-
};
|
|
807
|
-
Object.defineProperty(ItemPurchased, "p", {
|
|
808
|
-
get: function () {
|
|
809
|
-
return ItemPurchased.phantom;
|
|
810
|
-
},
|
|
811
|
-
enumerable: false,
|
|
812
|
-
configurable: true
|
|
813
|
-
});
|
|
814
|
-
Object.defineProperty(ItemPurchased, "bcs", {
|
|
815
|
-
get: function () {
|
|
816
|
-
return bcs_1.bcs.struct("ItemPurchased", {
|
|
817
|
-
kiosk: structs_2.ID.bcs,
|
|
818
|
-
id: structs_2.ID.bcs,
|
|
819
|
-
price: bcs_1.bcs.u64(),
|
|
820
|
-
});
|
|
821
|
-
},
|
|
822
|
-
enumerable: false,
|
|
823
|
-
configurable: true
|
|
824
|
-
});
|
|
825
|
-
ItemPurchased.fromFields = function (typeArg, fields) {
|
|
826
|
-
return ItemPurchased.reified(typeArg).new({
|
|
827
|
-
kiosk: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.kiosk),
|
|
828
|
-
id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id),
|
|
829
|
-
price: (0, reified_1.decodeFromFields)("u64", fields.price),
|
|
830
|
-
});
|
|
831
|
-
};
|
|
832
|
-
ItemPurchased.fromFieldsWithTypes = function (typeArg, item) {
|
|
833
|
-
if (!isItemPurchased(item.type)) {
|
|
834
|
-
throw new Error("not a ItemPurchased type");
|
|
835
|
-
}
|
|
836
|
-
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
837
|
-
return ItemPurchased.reified(typeArg).new({
|
|
838
|
-
kiosk: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.kiosk),
|
|
839
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id),
|
|
840
|
-
price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
|
|
841
|
-
});
|
|
842
|
-
};
|
|
843
|
-
ItemPurchased.fromBcs = function (typeArg, data) {
|
|
844
|
-
return ItemPurchased.fromFields(typeArg, ItemPurchased.bcs.parse(data));
|
|
845
|
-
};
|
|
846
|
-
ItemPurchased.prototype.toJSONField = function () {
|
|
847
|
-
return {
|
|
848
|
-
kiosk: this.kiosk,
|
|
849
|
-
id: this.id,
|
|
850
|
-
price: this.price.toString(),
|
|
851
|
-
};
|
|
852
|
-
};
|
|
853
|
-
ItemPurchased.prototype.toJSON = function () {
|
|
854
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
855
|
-
};
|
|
856
|
-
ItemPurchased.fromJSONField = function (typeArg, field) {
|
|
857
|
-
return ItemPurchased.reified(typeArg).new({
|
|
858
|
-
kiosk: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.kiosk),
|
|
859
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id),
|
|
860
|
-
price: (0, reified_1.decodeFromJSONField)("u64", field.price),
|
|
861
|
-
});
|
|
862
|
-
};
|
|
863
|
-
ItemPurchased.fromJSON = function (typeArg, json) {
|
|
864
|
-
if (json.$typeName !== ItemPurchased.$typeName) {
|
|
865
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
866
|
-
}
|
|
867
|
-
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(ItemPurchased.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
868
|
-
return ItemPurchased.fromJSONField(typeArg, json);
|
|
869
|
-
};
|
|
870
|
-
ItemPurchased.fromSuiParsedData = function (typeArg, content) {
|
|
871
|
-
if (content.dataType !== "moveObject") {
|
|
872
|
-
throw new Error("not an object");
|
|
873
|
-
}
|
|
874
|
-
if (!isItemPurchased(content.type)) {
|
|
875
|
-
throw new Error("object at ".concat(content.fields.id, " is not a ItemPurchased object"));
|
|
876
|
-
}
|
|
877
|
-
return ItemPurchased.fromFieldsWithTypes(typeArg, content);
|
|
878
|
-
};
|
|
879
|
-
ItemPurchased.fromSuiObjectData = function (typeArg, data) {
|
|
880
|
-
if (data.bcs) {
|
|
881
|
-
if (data.bcs.dataType !== "moveObject" || !isItemPurchased(data.bcs.type)) {
|
|
882
|
-
throw new Error("object at is not a ItemPurchased object");
|
|
883
|
-
}
|
|
884
|
-
var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
885
|
-
if (gotTypeArgs.length !== 1) {
|
|
886
|
-
throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
|
|
887
|
-
}
|
|
888
|
-
var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
889
|
-
var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
890
|
-
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
891
|
-
throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
|
|
892
|
-
}
|
|
893
|
-
return ItemPurchased.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
894
|
-
}
|
|
895
|
-
if (data.content) {
|
|
896
|
-
return ItemPurchased.fromSuiParsedData(typeArg, data.content);
|
|
897
|
-
}
|
|
898
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
899
|
-
};
|
|
900
|
-
ItemPurchased.fetch = function (client, typeArg, id) {
|
|
901
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
902
|
-
var res;
|
|
903
|
-
var _a, _b;
|
|
904
|
-
return __generator(this, function (_c) {
|
|
905
|
-
switch (_c.label) {
|
|
906
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
907
|
-
case 1:
|
|
908
|
-
res = _c.sent();
|
|
909
|
-
if (res.error) {
|
|
910
|
-
throw new Error("error fetching ItemPurchased object at id ".concat(id, ": ").concat(res.error.code));
|
|
911
|
-
}
|
|
912
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isItemPurchased(res.data.bcs.type)) {
|
|
913
|
-
throw new Error("object at id ".concat(id, " is not a ItemPurchased object"));
|
|
914
|
-
}
|
|
915
|
-
return [2 /*return*/, ItemPurchased.fromSuiObjectData(typeArg, res.data)];
|
|
916
|
-
}
|
|
917
|
-
});
|
|
918
|
-
});
|
|
919
|
-
};
|
|
920
|
-
ItemPurchased.$typeName = "".concat(index_1.PKG_V26, "::kiosk::ItemPurchased");
|
|
921
|
-
ItemPurchased.$numTypeParams = 1;
|
|
922
|
-
ItemPurchased.$isPhantom = [true];
|
|
923
|
-
return ItemPurchased;
|
|
924
|
-
}());
|
|
925
|
-
exports.ItemPurchased = ItemPurchased;
|
|
926
|
-
/* ============================== Kiosk =============================== */
|
|
927
|
-
function isKiosk(type) {
|
|
928
|
-
type = (0, util_1.compressSuiType)(type);
|
|
929
|
-
return type === "".concat(index_1.PKG_V26, "::kiosk::Kiosk");
|
|
930
|
-
}
|
|
931
|
-
var Kiosk = /** @class */ (function () {
|
|
932
|
-
function Kiosk(typeArgs, fields) {
|
|
933
|
-
this.__StructClass = true;
|
|
934
|
-
this.$typeName = Kiosk.$typeName;
|
|
935
|
-
this.$isPhantom = Kiosk.$isPhantom;
|
|
936
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Kiosk.$typeName], __read(typeArgs), false));
|
|
937
|
-
this.$typeArgs = typeArgs;
|
|
938
|
-
this.id = fields.id;
|
|
939
|
-
this.profits = fields.profits;
|
|
940
|
-
this.owner = fields.owner;
|
|
941
|
-
this.itemCount = fields.itemCount;
|
|
942
|
-
this.allowExtensions = fields.allowExtensions;
|
|
943
|
-
}
|
|
944
|
-
Kiosk.reified = function () {
|
|
945
|
-
var _this = this;
|
|
946
|
-
return {
|
|
947
|
-
typeName: Kiosk.$typeName,
|
|
948
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Kiosk.$typeName], [], false)),
|
|
949
|
-
typeArgs: [],
|
|
950
|
-
isPhantom: Kiosk.$isPhantom,
|
|
951
|
-
reifiedTypeArgs: [],
|
|
952
|
-
fromFields: function (fields) { return Kiosk.fromFields(fields); },
|
|
953
|
-
fromFieldsWithTypes: function (item) { return Kiosk.fromFieldsWithTypes(item); },
|
|
954
|
-
fromBcs: function (data) { return Kiosk.fromBcs(data); },
|
|
955
|
-
bcs: Kiosk.bcs,
|
|
956
|
-
fromJSONField: function (field) { return Kiosk.fromJSONField(field); },
|
|
957
|
-
fromJSON: function (json) { return Kiosk.fromJSON(json); },
|
|
958
|
-
fromSuiParsedData: function (content) { return Kiosk.fromSuiParsedData(content); },
|
|
959
|
-
fromSuiObjectData: function (content) { return Kiosk.fromSuiObjectData(content); },
|
|
960
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
961
|
-
return [2 /*return*/, Kiosk.fetch(client, id)];
|
|
962
|
-
}); }); },
|
|
963
|
-
new: function (fields) {
|
|
964
|
-
return new Kiosk([], fields);
|
|
965
|
-
},
|
|
966
|
-
kind: "StructClassReified",
|
|
967
|
-
};
|
|
968
|
-
};
|
|
969
|
-
Object.defineProperty(Kiosk, "r", {
|
|
970
|
-
get: function () {
|
|
971
|
-
return Kiosk.reified();
|
|
972
|
-
},
|
|
973
|
-
enumerable: false,
|
|
974
|
-
configurable: true
|
|
975
|
-
});
|
|
976
|
-
Kiosk.phantom = function () {
|
|
977
|
-
return (0, reified_1.phantom)(Kiosk.reified());
|
|
978
|
-
};
|
|
979
|
-
Object.defineProperty(Kiosk, "p", {
|
|
980
|
-
get: function () {
|
|
981
|
-
return Kiosk.phantom();
|
|
982
|
-
},
|
|
983
|
-
enumerable: false,
|
|
984
|
-
configurable: true
|
|
985
|
-
});
|
|
986
|
-
Object.defineProperty(Kiosk, "bcs", {
|
|
987
|
-
get: function () {
|
|
988
|
-
return bcs_1.bcs.struct("Kiosk", {
|
|
989
|
-
id: structs_2.UID.bcs,
|
|
990
|
-
profits: structs_1.Balance.bcs,
|
|
991
|
-
owner: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
|
|
992
|
-
item_count: bcs_1.bcs.u32(),
|
|
993
|
-
allow_extensions: bcs_1.bcs.bool(),
|
|
994
|
-
});
|
|
995
|
-
},
|
|
996
|
-
enumerable: false,
|
|
997
|
-
configurable: true
|
|
998
|
-
});
|
|
999
|
-
Kiosk.fromFields = function (fields) {
|
|
1000
|
-
return Kiosk.reified().new({
|
|
1001
|
-
id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
|
|
1002
|
-
profits: (0, reified_1.decodeFromFields)(structs_1.Balance.reified(reified.phantom(structs_3.SUI.reified())), fields.profits),
|
|
1003
|
-
owner: (0, reified_1.decodeFromFields)("address", fields.owner),
|
|
1004
|
-
itemCount: (0, reified_1.decodeFromFields)("u32", fields.item_count),
|
|
1005
|
-
allowExtensions: (0, reified_1.decodeFromFields)("bool", fields.allow_extensions),
|
|
1006
|
-
});
|
|
1007
|
-
};
|
|
1008
|
-
Kiosk.fromFieldsWithTypes = function (item) {
|
|
1009
|
-
if (!isKiosk(item.type)) {
|
|
1010
|
-
throw new Error("not a Kiosk type");
|
|
1011
|
-
}
|
|
1012
|
-
return Kiosk.reified().new({
|
|
1013
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
1014
|
-
profits: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.Balance.reified(reified.phantom(structs_3.SUI.reified())), item.fields.profits),
|
|
1015
|
-
owner: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.owner),
|
|
1016
|
-
itemCount: (0, reified_1.decodeFromFieldsWithTypes)("u32", item.fields.item_count),
|
|
1017
|
-
allowExtensions: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.allow_extensions),
|
|
1018
|
-
});
|
|
1019
|
-
};
|
|
1020
|
-
Kiosk.fromBcs = function (data) {
|
|
1021
|
-
return Kiosk.fromFields(Kiosk.bcs.parse(data));
|
|
1022
|
-
};
|
|
1023
|
-
Kiosk.prototype.toJSONField = function () {
|
|
1024
|
-
return {
|
|
1025
|
-
id: this.id,
|
|
1026
|
-
profits: this.profits.toJSONField(),
|
|
1027
|
-
owner: this.owner,
|
|
1028
|
-
itemCount: this.itemCount,
|
|
1029
|
-
allowExtensions: this.allowExtensions,
|
|
1030
|
-
};
|
|
1031
|
-
};
|
|
1032
|
-
Kiosk.prototype.toJSON = function () {
|
|
1033
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1034
|
-
};
|
|
1035
|
-
Kiosk.fromJSONField = function (field) {
|
|
1036
|
-
return Kiosk.reified().new({
|
|
1037
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
1038
|
-
profits: (0, reified_1.decodeFromJSONField)(structs_1.Balance.reified(reified.phantom(structs_3.SUI.reified())), field.profits),
|
|
1039
|
-
owner: (0, reified_1.decodeFromJSONField)("address", field.owner),
|
|
1040
|
-
itemCount: (0, reified_1.decodeFromJSONField)("u32", field.itemCount),
|
|
1041
|
-
allowExtensions: (0, reified_1.decodeFromJSONField)("bool", field.allowExtensions),
|
|
1042
|
-
});
|
|
1043
|
-
};
|
|
1044
|
-
Kiosk.fromJSON = function (json) {
|
|
1045
|
-
if (json.$typeName !== Kiosk.$typeName) {
|
|
1046
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1047
|
-
}
|
|
1048
|
-
return Kiosk.fromJSONField(json);
|
|
1049
|
-
};
|
|
1050
|
-
Kiosk.fromSuiParsedData = function (content) {
|
|
1051
|
-
if (content.dataType !== "moveObject") {
|
|
1052
|
-
throw new Error("not an object");
|
|
1053
|
-
}
|
|
1054
|
-
if (!isKiosk(content.type)) {
|
|
1055
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Kiosk object"));
|
|
1056
|
-
}
|
|
1057
|
-
return Kiosk.fromFieldsWithTypes(content);
|
|
1058
|
-
};
|
|
1059
|
-
Kiosk.fromSuiObjectData = function (data) {
|
|
1060
|
-
if (data.bcs) {
|
|
1061
|
-
if (data.bcs.dataType !== "moveObject" || !isKiosk(data.bcs.type)) {
|
|
1062
|
-
throw new Error("object at is not a Kiosk object");
|
|
1063
|
-
}
|
|
1064
|
-
return Kiosk.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1065
|
-
}
|
|
1066
|
-
if (data.content) {
|
|
1067
|
-
return Kiosk.fromSuiParsedData(data.content);
|
|
1068
|
-
}
|
|
1069
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1070
|
-
};
|
|
1071
|
-
Kiosk.fetch = function (client, id) {
|
|
1072
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1073
|
-
var res;
|
|
1074
|
-
var _a, _b;
|
|
1075
|
-
return __generator(this, function (_c) {
|
|
1076
|
-
switch (_c.label) {
|
|
1077
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1078
|
-
case 1:
|
|
1079
|
-
res = _c.sent();
|
|
1080
|
-
if (res.error) {
|
|
1081
|
-
throw new Error("error fetching Kiosk object at id ".concat(id, ": ").concat(res.error.code));
|
|
1082
|
-
}
|
|
1083
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isKiosk(res.data.bcs.type)) {
|
|
1084
|
-
throw new Error("object at id ".concat(id, " is not a Kiosk object"));
|
|
1085
|
-
}
|
|
1086
|
-
return [2 /*return*/, Kiosk.fromSuiObjectData(res.data)];
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
});
|
|
1090
|
-
};
|
|
1091
|
-
Kiosk.$typeName = "".concat(index_1.PKG_V26, "::kiosk::Kiosk");
|
|
1092
|
-
Kiosk.$numTypeParams = 0;
|
|
1093
|
-
Kiosk.$isPhantom = [];
|
|
1094
|
-
return Kiosk;
|
|
1095
|
-
}());
|
|
1096
|
-
exports.Kiosk = Kiosk;
|
|
1097
|
-
/* ============================== KioskOwnerCap =============================== */
|
|
1098
|
-
function isKioskOwnerCap(type) {
|
|
1099
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1100
|
-
return type === "".concat(index_1.PKG_V26, "::kiosk::KioskOwnerCap");
|
|
1101
|
-
}
|
|
1102
|
-
var KioskOwnerCap = /** @class */ (function () {
|
|
1103
|
-
function KioskOwnerCap(typeArgs, fields) {
|
|
1104
|
-
this.__StructClass = true;
|
|
1105
|
-
this.$typeName = KioskOwnerCap.$typeName;
|
|
1106
|
-
this.$isPhantom = KioskOwnerCap.$isPhantom;
|
|
1107
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([KioskOwnerCap.$typeName], __read(typeArgs), false));
|
|
1108
|
-
this.$typeArgs = typeArgs;
|
|
1109
|
-
this.id = fields.id;
|
|
1110
|
-
this.for = fields.for;
|
|
1111
|
-
}
|
|
1112
|
-
KioskOwnerCap.reified = function () {
|
|
1113
|
-
var _this = this;
|
|
1114
|
-
return {
|
|
1115
|
-
typeName: KioskOwnerCap.$typeName,
|
|
1116
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([KioskOwnerCap.$typeName], [], false)),
|
|
1117
|
-
typeArgs: [],
|
|
1118
|
-
isPhantom: KioskOwnerCap.$isPhantom,
|
|
1119
|
-
reifiedTypeArgs: [],
|
|
1120
|
-
fromFields: function (fields) { return KioskOwnerCap.fromFields(fields); },
|
|
1121
|
-
fromFieldsWithTypes: function (item) { return KioskOwnerCap.fromFieldsWithTypes(item); },
|
|
1122
|
-
fromBcs: function (data) { return KioskOwnerCap.fromBcs(data); },
|
|
1123
|
-
bcs: KioskOwnerCap.bcs,
|
|
1124
|
-
fromJSONField: function (field) { return KioskOwnerCap.fromJSONField(field); },
|
|
1125
|
-
fromJSON: function (json) { return KioskOwnerCap.fromJSON(json); },
|
|
1126
|
-
fromSuiParsedData: function (content) { return KioskOwnerCap.fromSuiParsedData(content); },
|
|
1127
|
-
fromSuiObjectData: function (content) { return KioskOwnerCap.fromSuiObjectData(content); },
|
|
1128
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1129
|
-
return [2 /*return*/, KioskOwnerCap.fetch(client, id)];
|
|
1130
|
-
}); }); },
|
|
1131
|
-
new: function (fields) {
|
|
1132
|
-
return new KioskOwnerCap([], fields);
|
|
1133
|
-
},
|
|
1134
|
-
kind: "StructClassReified",
|
|
1135
|
-
};
|
|
1136
|
-
};
|
|
1137
|
-
Object.defineProperty(KioskOwnerCap, "r", {
|
|
1138
|
-
get: function () {
|
|
1139
|
-
return KioskOwnerCap.reified();
|
|
1140
|
-
},
|
|
1141
|
-
enumerable: false,
|
|
1142
|
-
configurable: true
|
|
1143
|
-
});
|
|
1144
|
-
KioskOwnerCap.phantom = function () {
|
|
1145
|
-
return (0, reified_1.phantom)(KioskOwnerCap.reified());
|
|
1146
|
-
};
|
|
1147
|
-
Object.defineProperty(KioskOwnerCap, "p", {
|
|
1148
|
-
get: function () {
|
|
1149
|
-
return KioskOwnerCap.phantom();
|
|
1150
|
-
},
|
|
1151
|
-
enumerable: false,
|
|
1152
|
-
configurable: true
|
|
1153
|
-
});
|
|
1154
|
-
Object.defineProperty(KioskOwnerCap, "bcs", {
|
|
1155
|
-
get: function () {
|
|
1156
|
-
return bcs_1.bcs.struct("KioskOwnerCap", {
|
|
1157
|
-
id: structs_2.UID.bcs,
|
|
1158
|
-
for: structs_2.ID.bcs,
|
|
1159
|
-
});
|
|
1160
|
-
},
|
|
1161
|
-
enumerable: false,
|
|
1162
|
-
configurable: true
|
|
1163
|
-
});
|
|
1164
|
-
KioskOwnerCap.fromFields = function (fields) {
|
|
1165
|
-
return KioskOwnerCap.reified().new({
|
|
1166
|
-
id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
|
|
1167
|
-
for: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.for),
|
|
1168
|
-
});
|
|
1169
|
-
};
|
|
1170
|
-
KioskOwnerCap.fromFieldsWithTypes = function (item) {
|
|
1171
|
-
if (!isKioskOwnerCap(item.type)) {
|
|
1172
|
-
throw new Error("not a KioskOwnerCap type");
|
|
1173
|
-
}
|
|
1174
|
-
return KioskOwnerCap.reified().new({
|
|
1175
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
1176
|
-
for: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.for),
|
|
1177
|
-
});
|
|
1178
|
-
};
|
|
1179
|
-
KioskOwnerCap.fromBcs = function (data) {
|
|
1180
|
-
return KioskOwnerCap.fromFields(KioskOwnerCap.bcs.parse(data));
|
|
1181
|
-
};
|
|
1182
|
-
KioskOwnerCap.prototype.toJSONField = function () {
|
|
1183
|
-
return {
|
|
1184
|
-
id: this.id,
|
|
1185
|
-
for: this.for,
|
|
1186
|
-
};
|
|
1187
|
-
};
|
|
1188
|
-
KioskOwnerCap.prototype.toJSON = function () {
|
|
1189
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1190
|
-
};
|
|
1191
|
-
KioskOwnerCap.fromJSONField = function (field) {
|
|
1192
|
-
return KioskOwnerCap.reified().new({
|
|
1193
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
1194
|
-
for: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.for),
|
|
1195
|
-
});
|
|
1196
|
-
};
|
|
1197
|
-
KioskOwnerCap.fromJSON = function (json) {
|
|
1198
|
-
if (json.$typeName !== KioskOwnerCap.$typeName) {
|
|
1199
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1200
|
-
}
|
|
1201
|
-
return KioskOwnerCap.fromJSONField(json);
|
|
1202
|
-
};
|
|
1203
|
-
KioskOwnerCap.fromSuiParsedData = function (content) {
|
|
1204
|
-
if (content.dataType !== "moveObject") {
|
|
1205
|
-
throw new Error("not an object");
|
|
1206
|
-
}
|
|
1207
|
-
if (!isKioskOwnerCap(content.type)) {
|
|
1208
|
-
throw new Error("object at ".concat(content.fields.id, " is not a KioskOwnerCap object"));
|
|
1209
|
-
}
|
|
1210
|
-
return KioskOwnerCap.fromFieldsWithTypes(content);
|
|
1211
|
-
};
|
|
1212
|
-
KioskOwnerCap.fromSuiObjectData = function (data) {
|
|
1213
|
-
if (data.bcs) {
|
|
1214
|
-
if (data.bcs.dataType !== "moveObject" || !isKioskOwnerCap(data.bcs.type)) {
|
|
1215
|
-
throw new Error("object at is not a KioskOwnerCap object");
|
|
1216
|
-
}
|
|
1217
|
-
return KioskOwnerCap.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1218
|
-
}
|
|
1219
|
-
if (data.content) {
|
|
1220
|
-
return KioskOwnerCap.fromSuiParsedData(data.content);
|
|
1221
|
-
}
|
|
1222
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1223
|
-
};
|
|
1224
|
-
KioskOwnerCap.fetch = function (client, id) {
|
|
1225
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1226
|
-
var res;
|
|
1227
|
-
var _a, _b;
|
|
1228
|
-
return __generator(this, function (_c) {
|
|
1229
|
-
switch (_c.label) {
|
|
1230
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1231
|
-
case 1:
|
|
1232
|
-
res = _c.sent();
|
|
1233
|
-
if (res.error) {
|
|
1234
|
-
throw new Error("error fetching KioskOwnerCap object at id ".concat(id, ": ").concat(res.error.code));
|
|
1235
|
-
}
|
|
1236
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isKioskOwnerCap(res.data.bcs.type)) {
|
|
1237
|
-
throw new Error("object at id ".concat(id, " is not a KioskOwnerCap object"));
|
|
1238
|
-
}
|
|
1239
|
-
return [2 /*return*/, KioskOwnerCap.fromSuiObjectData(res.data)];
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
});
|
|
1243
|
-
};
|
|
1244
|
-
KioskOwnerCap.$typeName = "".concat(index_1.PKG_V26, "::kiosk::KioskOwnerCap");
|
|
1245
|
-
KioskOwnerCap.$numTypeParams = 0;
|
|
1246
|
-
KioskOwnerCap.$isPhantom = [];
|
|
1247
|
-
return KioskOwnerCap;
|
|
1248
|
-
}());
|
|
1249
|
-
exports.KioskOwnerCap = KioskOwnerCap;
|
|
1250
|
-
/* ============================== Listing =============================== */
|
|
1251
|
-
function isListing(type) {
|
|
1252
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1253
|
-
return type === "".concat(index_1.PKG_V26, "::kiosk::Listing");
|
|
1254
|
-
}
|
|
1255
|
-
var Listing = /** @class */ (function () {
|
|
1256
|
-
function Listing(typeArgs, fields) {
|
|
1257
|
-
this.__StructClass = true;
|
|
1258
|
-
this.$typeName = Listing.$typeName;
|
|
1259
|
-
this.$isPhantom = Listing.$isPhantom;
|
|
1260
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Listing.$typeName], __read(typeArgs), false));
|
|
1261
|
-
this.$typeArgs = typeArgs;
|
|
1262
|
-
this.id = fields.id;
|
|
1263
|
-
this.isExclusive = fields.isExclusive;
|
|
1264
|
-
}
|
|
1265
|
-
Listing.reified = function () {
|
|
1266
|
-
var _this = this;
|
|
1267
|
-
return {
|
|
1268
|
-
typeName: Listing.$typeName,
|
|
1269
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Listing.$typeName], [], false)),
|
|
1270
|
-
typeArgs: [],
|
|
1271
|
-
isPhantom: Listing.$isPhantom,
|
|
1272
|
-
reifiedTypeArgs: [],
|
|
1273
|
-
fromFields: function (fields) { return Listing.fromFields(fields); },
|
|
1274
|
-
fromFieldsWithTypes: function (item) { return Listing.fromFieldsWithTypes(item); },
|
|
1275
|
-
fromBcs: function (data) { return Listing.fromBcs(data); },
|
|
1276
|
-
bcs: Listing.bcs,
|
|
1277
|
-
fromJSONField: function (field) { return Listing.fromJSONField(field); },
|
|
1278
|
-
fromJSON: function (json) { return Listing.fromJSON(json); },
|
|
1279
|
-
fromSuiParsedData: function (content) { return Listing.fromSuiParsedData(content); },
|
|
1280
|
-
fromSuiObjectData: function (content) { return Listing.fromSuiObjectData(content); },
|
|
1281
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1282
|
-
return [2 /*return*/, Listing.fetch(client, id)];
|
|
1283
|
-
}); }); },
|
|
1284
|
-
new: function (fields) {
|
|
1285
|
-
return new Listing([], fields);
|
|
1286
|
-
},
|
|
1287
|
-
kind: "StructClassReified",
|
|
1288
|
-
};
|
|
1289
|
-
};
|
|
1290
|
-
Object.defineProperty(Listing, "r", {
|
|
1291
|
-
get: function () {
|
|
1292
|
-
return Listing.reified();
|
|
1293
|
-
},
|
|
1294
|
-
enumerable: false,
|
|
1295
|
-
configurable: true
|
|
1296
|
-
});
|
|
1297
|
-
Listing.phantom = function () {
|
|
1298
|
-
return (0, reified_1.phantom)(Listing.reified());
|
|
1299
|
-
};
|
|
1300
|
-
Object.defineProperty(Listing, "p", {
|
|
1301
|
-
get: function () {
|
|
1302
|
-
return Listing.phantom();
|
|
1303
|
-
},
|
|
1304
|
-
enumerable: false,
|
|
1305
|
-
configurable: true
|
|
1306
|
-
});
|
|
1307
|
-
Object.defineProperty(Listing, "bcs", {
|
|
1308
|
-
get: function () {
|
|
1309
|
-
return bcs_1.bcs.struct("Listing", {
|
|
1310
|
-
id: structs_2.ID.bcs,
|
|
1311
|
-
is_exclusive: bcs_1.bcs.bool(),
|
|
1312
|
-
});
|
|
1313
|
-
},
|
|
1314
|
-
enumerable: false,
|
|
1315
|
-
configurable: true
|
|
1316
|
-
});
|
|
1317
|
-
Listing.fromFields = function (fields) {
|
|
1318
|
-
return Listing.reified().new({
|
|
1319
|
-
id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id),
|
|
1320
|
-
isExclusive: (0, reified_1.decodeFromFields)("bool", fields.is_exclusive),
|
|
1321
|
-
});
|
|
1322
|
-
};
|
|
1323
|
-
Listing.fromFieldsWithTypes = function (item) {
|
|
1324
|
-
if (!isListing(item.type)) {
|
|
1325
|
-
throw new Error("not a Listing type");
|
|
1326
|
-
}
|
|
1327
|
-
return Listing.reified().new({
|
|
1328
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id),
|
|
1329
|
-
isExclusive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_exclusive),
|
|
1330
|
-
});
|
|
1331
|
-
};
|
|
1332
|
-
Listing.fromBcs = function (data) {
|
|
1333
|
-
return Listing.fromFields(Listing.bcs.parse(data));
|
|
1334
|
-
};
|
|
1335
|
-
Listing.prototype.toJSONField = function () {
|
|
1336
|
-
return {
|
|
1337
|
-
id: this.id,
|
|
1338
|
-
isExclusive: this.isExclusive,
|
|
1339
|
-
};
|
|
1340
|
-
};
|
|
1341
|
-
Listing.prototype.toJSON = function () {
|
|
1342
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1343
|
-
};
|
|
1344
|
-
Listing.fromJSONField = function (field) {
|
|
1345
|
-
return Listing.reified().new({
|
|
1346
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id),
|
|
1347
|
-
isExclusive: (0, reified_1.decodeFromJSONField)("bool", field.isExclusive),
|
|
1348
|
-
});
|
|
1349
|
-
};
|
|
1350
|
-
Listing.fromJSON = function (json) {
|
|
1351
|
-
if (json.$typeName !== Listing.$typeName) {
|
|
1352
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1353
|
-
}
|
|
1354
|
-
return Listing.fromJSONField(json);
|
|
1355
|
-
};
|
|
1356
|
-
Listing.fromSuiParsedData = function (content) {
|
|
1357
|
-
if (content.dataType !== "moveObject") {
|
|
1358
|
-
throw new Error("not an object");
|
|
1359
|
-
}
|
|
1360
|
-
if (!isListing(content.type)) {
|
|
1361
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Listing object"));
|
|
1362
|
-
}
|
|
1363
|
-
return Listing.fromFieldsWithTypes(content);
|
|
1364
|
-
};
|
|
1365
|
-
Listing.fromSuiObjectData = function (data) {
|
|
1366
|
-
if (data.bcs) {
|
|
1367
|
-
if (data.bcs.dataType !== "moveObject" || !isListing(data.bcs.type)) {
|
|
1368
|
-
throw new Error("object at is not a Listing object");
|
|
1369
|
-
}
|
|
1370
|
-
return Listing.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1371
|
-
}
|
|
1372
|
-
if (data.content) {
|
|
1373
|
-
return Listing.fromSuiParsedData(data.content);
|
|
1374
|
-
}
|
|
1375
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1376
|
-
};
|
|
1377
|
-
Listing.fetch = function (client, id) {
|
|
1378
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1379
|
-
var res;
|
|
1380
|
-
var _a, _b;
|
|
1381
|
-
return __generator(this, function (_c) {
|
|
1382
|
-
switch (_c.label) {
|
|
1383
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1384
|
-
case 1:
|
|
1385
|
-
res = _c.sent();
|
|
1386
|
-
if (res.error) {
|
|
1387
|
-
throw new Error("error fetching Listing object at id ".concat(id, ": ").concat(res.error.code));
|
|
1388
|
-
}
|
|
1389
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isListing(res.data.bcs.type)) {
|
|
1390
|
-
throw new Error("object at id ".concat(id, " is not a Listing object"));
|
|
1391
|
-
}
|
|
1392
|
-
return [2 /*return*/, Listing.fromSuiObjectData(res.data)];
|
|
1393
|
-
}
|
|
1394
|
-
});
|
|
1395
|
-
});
|
|
1396
|
-
};
|
|
1397
|
-
Listing.$typeName = "".concat(index_1.PKG_V26, "::kiosk::Listing");
|
|
1398
|
-
Listing.$numTypeParams = 0;
|
|
1399
|
-
Listing.$isPhantom = [];
|
|
1400
|
-
return Listing;
|
|
1401
|
-
}());
|
|
1402
|
-
exports.Listing = Listing;
|
|
1403
|
-
/* ============================== Lock =============================== */
|
|
1404
|
-
function isLock(type) {
|
|
1405
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1406
|
-
return type === "".concat(index_1.PKG_V26, "::kiosk::Lock");
|
|
1407
|
-
}
|
|
1408
|
-
var Lock = /** @class */ (function () {
|
|
1409
|
-
function Lock(typeArgs, fields) {
|
|
1410
|
-
this.__StructClass = true;
|
|
1411
|
-
this.$typeName = Lock.$typeName;
|
|
1412
|
-
this.$isPhantom = Lock.$isPhantom;
|
|
1413
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Lock.$typeName], __read(typeArgs), false));
|
|
1414
|
-
this.$typeArgs = typeArgs;
|
|
1415
|
-
this.id = fields.id;
|
|
1416
|
-
}
|
|
1417
|
-
Lock.reified = function () {
|
|
1418
|
-
var _this = this;
|
|
1419
|
-
return {
|
|
1420
|
-
typeName: Lock.$typeName,
|
|
1421
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Lock.$typeName], [], false)),
|
|
1422
|
-
typeArgs: [],
|
|
1423
|
-
isPhantom: Lock.$isPhantom,
|
|
1424
|
-
reifiedTypeArgs: [],
|
|
1425
|
-
fromFields: function (fields) { return Lock.fromFields(fields); },
|
|
1426
|
-
fromFieldsWithTypes: function (item) { return Lock.fromFieldsWithTypes(item); },
|
|
1427
|
-
fromBcs: function (data) { return Lock.fromBcs(data); },
|
|
1428
|
-
bcs: Lock.bcs,
|
|
1429
|
-
fromJSONField: function (field) { return Lock.fromJSONField(field); },
|
|
1430
|
-
fromJSON: function (json) { return Lock.fromJSON(json); },
|
|
1431
|
-
fromSuiParsedData: function (content) { return Lock.fromSuiParsedData(content); },
|
|
1432
|
-
fromSuiObjectData: function (content) { return Lock.fromSuiObjectData(content); },
|
|
1433
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1434
|
-
return [2 /*return*/, Lock.fetch(client, id)];
|
|
1435
|
-
}); }); },
|
|
1436
|
-
new: function (fields) {
|
|
1437
|
-
return new Lock([], fields);
|
|
1438
|
-
},
|
|
1439
|
-
kind: "StructClassReified",
|
|
1440
|
-
};
|
|
1441
|
-
};
|
|
1442
|
-
Object.defineProperty(Lock, "r", {
|
|
1443
|
-
get: function () {
|
|
1444
|
-
return Lock.reified();
|
|
1445
|
-
},
|
|
1446
|
-
enumerable: false,
|
|
1447
|
-
configurable: true
|
|
1448
|
-
});
|
|
1449
|
-
Lock.phantom = function () {
|
|
1450
|
-
return (0, reified_1.phantom)(Lock.reified());
|
|
1451
|
-
};
|
|
1452
|
-
Object.defineProperty(Lock, "p", {
|
|
1453
|
-
get: function () {
|
|
1454
|
-
return Lock.phantom();
|
|
1455
|
-
},
|
|
1456
|
-
enumerable: false,
|
|
1457
|
-
configurable: true
|
|
1458
|
-
});
|
|
1459
|
-
Object.defineProperty(Lock, "bcs", {
|
|
1460
|
-
get: function () {
|
|
1461
|
-
return bcs_1.bcs.struct("Lock", {
|
|
1462
|
-
id: structs_2.ID.bcs,
|
|
1463
|
-
});
|
|
1464
|
-
},
|
|
1465
|
-
enumerable: false,
|
|
1466
|
-
configurable: true
|
|
1467
|
-
});
|
|
1468
|
-
Lock.fromFields = function (fields) {
|
|
1469
|
-
return Lock.reified().new({ id: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.id) });
|
|
1470
|
-
};
|
|
1471
|
-
Lock.fromFieldsWithTypes = function (item) {
|
|
1472
|
-
if (!isLock(item.type)) {
|
|
1473
|
-
throw new Error("not a Lock type");
|
|
1474
|
-
}
|
|
1475
|
-
return Lock.reified().new({ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.id) });
|
|
1476
|
-
};
|
|
1477
|
-
Lock.fromBcs = function (data) {
|
|
1478
|
-
return Lock.fromFields(Lock.bcs.parse(data));
|
|
1479
|
-
};
|
|
1480
|
-
Lock.prototype.toJSONField = function () {
|
|
1481
|
-
return {
|
|
1482
|
-
id: this.id,
|
|
1483
|
-
};
|
|
1484
|
-
};
|
|
1485
|
-
Lock.prototype.toJSON = function () {
|
|
1486
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1487
|
-
};
|
|
1488
|
-
Lock.fromJSONField = function (field) {
|
|
1489
|
-
return Lock.reified().new({ id: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.id) });
|
|
1490
|
-
};
|
|
1491
|
-
Lock.fromJSON = function (json) {
|
|
1492
|
-
if (json.$typeName !== Lock.$typeName) {
|
|
1493
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1494
|
-
}
|
|
1495
|
-
return Lock.fromJSONField(json);
|
|
1496
|
-
};
|
|
1497
|
-
Lock.fromSuiParsedData = function (content) {
|
|
1498
|
-
if (content.dataType !== "moveObject") {
|
|
1499
|
-
throw new Error("not an object");
|
|
1500
|
-
}
|
|
1501
|
-
if (!isLock(content.type)) {
|
|
1502
|
-
throw new Error("object at ".concat(content.fields.id, " is not a Lock object"));
|
|
1503
|
-
}
|
|
1504
|
-
return Lock.fromFieldsWithTypes(content);
|
|
1505
|
-
};
|
|
1506
|
-
Lock.fromSuiObjectData = function (data) {
|
|
1507
|
-
if (data.bcs) {
|
|
1508
|
-
if (data.bcs.dataType !== "moveObject" || !isLock(data.bcs.type)) {
|
|
1509
|
-
throw new Error("object at is not a Lock object");
|
|
1510
|
-
}
|
|
1511
|
-
return Lock.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1512
|
-
}
|
|
1513
|
-
if (data.content) {
|
|
1514
|
-
return Lock.fromSuiParsedData(data.content);
|
|
1515
|
-
}
|
|
1516
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1517
|
-
};
|
|
1518
|
-
Lock.fetch = function (client, id) {
|
|
1519
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1520
|
-
var res;
|
|
1521
|
-
var _a, _b;
|
|
1522
|
-
return __generator(this, function (_c) {
|
|
1523
|
-
switch (_c.label) {
|
|
1524
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1525
|
-
case 1:
|
|
1526
|
-
res = _c.sent();
|
|
1527
|
-
if (res.error) {
|
|
1528
|
-
throw new Error("error fetching Lock object at id ".concat(id, ": ").concat(res.error.code));
|
|
1529
|
-
}
|
|
1530
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isLock(res.data.bcs.type)) {
|
|
1531
|
-
throw new Error("object at id ".concat(id, " is not a Lock object"));
|
|
1532
|
-
}
|
|
1533
|
-
return [2 /*return*/, Lock.fromSuiObjectData(res.data)];
|
|
1534
|
-
}
|
|
1535
|
-
});
|
|
1536
|
-
});
|
|
1537
|
-
};
|
|
1538
|
-
Lock.$typeName = "".concat(index_1.PKG_V26, "::kiosk::Lock");
|
|
1539
|
-
Lock.$numTypeParams = 0;
|
|
1540
|
-
Lock.$isPhantom = [];
|
|
1541
|
-
return Lock;
|
|
1542
|
-
}());
|
|
1543
|
-
exports.Lock = Lock;
|
|
1544
|
-
/* ============================== PurchaseCap =============================== */
|
|
1545
|
-
function isPurchaseCap(type) {
|
|
1546
|
-
type = (0, util_1.compressSuiType)(type);
|
|
1547
|
-
return type.startsWith("".concat(index_1.PKG_V26, "::kiosk::PurchaseCap") + "<");
|
|
1548
|
-
}
|
|
1549
|
-
var PurchaseCap = /** @class */ (function () {
|
|
1550
|
-
function PurchaseCap(typeArgs, fields) {
|
|
1551
|
-
this.__StructClass = true;
|
|
1552
|
-
this.$typeName = PurchaseCap.$typeName;
|
|
1553
|
-
this.$isPhantom = PurchaseCap.$isPhantom;
|
|
1554
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([PurchaseCap.$typeName], __read(typeArgs), false));
|
|
1555
|
-
this.$typeArgs = typeArgs;
|
|
1556
|
-
this.id = fields.id;
|
|
1557
|
-
this.kioskId = fields.kioskId;
|
|
1558
|
-
this.itemId = fields.itemId;
|
|
1559
|
-
this.minPrice = fields.minPrice;
|
|
1560
|
-
}
|
|
1561
|
-
PurchaseCap.reified = function (T) {
|
|
1562
|
-
var _this = this;
|
|
1563
|
-
return {
|
|
1564
|
-
typeName: PurchaseCap.$typeName,
|
|
1565
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([PurchaseCap.$typeName], [(0, reified_1.extractType)(T)], false)),
|
|
1566
|
-
typeArgs: [(0, reified_1.extractType)(T)],
|
|
1567
|
-
isPhantom: PurchaseCap.$isPhantom,
|
|
1568
|
-
reifiedTypeArgs: [T],
|
|
1569
|
-
fromFields: function (fields) { return PurchaseCap.fromFields(T, fields); },
|
|
1570
|
-
fromFieldsWithTypes: function (item) { return PurchaseCap.fromFieldsWithTypes(T, item); },
|
|
1571
|
-
fromBcs: function (data) { return PurchaseCap.fromBcs(T, data); },
|
|
1572
|
-
bcs: PurchaseCap.bcs,
|
|
1573
|
-
fromJSONField: function (field) { return PurchaseCap.fromJSONField(T, field); },
|
|
1574
|
-
fromJSON: function (json) { return PurchaseCap.fromJSON(T, json); },
|
|
1575
|
-
fromSuiParsedData: function (content) { return PurchaseCap.fromSuiParsedData(T, content); },
|
|
1576
|
-
fromSuiObjectData: function (content) { return PurchaseCap.fromSuiObjectData(T, content); },
|
|
1577
|
-
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1578
|
-
return [2 /*return*/, PurchaseCap.fetch(client, T, id)];
|
|
1579
|
-
}); }); },
|
|
1580
|
-
new: function (fields) {
|
|
1581
|
-
return new PurchaseCap([(0, reified_1.extractType)(T)], fields);
|
|
1582
|
-
},
|
|
1583
|
-
kind: "StructClassReified",
|
|
1584
|
-
};
|
|
1585
|
-
};
|
|
1586
|
-
Object.defineProperty(PurchaseCap, "r", {
|
|
1587
|
-
get: function () {
|
|
1588
|
-
return PurchaseCap.reified;
|
|
1589
|
-
},
|
|
1590
|
-
enumerable: false,
|
|
1591
|
-
configurable: true
|
|
1592
|
-
});
|
|
1593
|
-
PurchaseCap.phantom = function (T) {
|
|
1594
|
-
return (0, reified_1.phantom)(PurchaseCap.reified(T));
|
|
1595
|
-
};
|
|
1596
|
-
Object.defineProperty(PurchaseCap, "p", {
|
|
1597
|
-
get: function () {
|
|
1598
|
-
return PurchaseCap.phantom;
|
|
1599
|
-
},
|
|
1600
|
-
enumerable: false,
|
|
1601
|
-
configurable: true
|
|
1602
|
-
});
|
|
1603
|
-
Object.defineProperty(PurchaseCap, "bcs", {
|
|
1604
|
-
get: function () {
|
|
1605
|
-
return bcs_1.bcs.struct("PurchaseCap", {
|
|
1606
|
-
id: structs_2.UID.bcs,
|
|
1607
|
-
kiosk_id: structs_2.ID.bcs,
|
|
1608
|
-
item_id: structs_2.ID.bcs,
|
|
1609
|
-
min_price: bcs_1.bcs.u64(),
|
|
1610
|
-
});
|
|
1611
|
-
},
|
|
1612
|
-
enumerable: false,
|
|
1613
|
-
configurable: true
|
|
1614
|
-
});
|
|
1615
|
-
PurchaseCap.fromFields = function (typeArg, fields) {
|
|
1616
|
-
return PurchaseCap.reified(typeArg).new({
|
|
1617
|
-
id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
|
|
1618
|
-
kioskId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.kiosk_id),
|
|
1619
|
-
itemId: (0, reified_1.decodeFromFields)(structs_2.ID.reified(), fields.item_id),
|
|
1620
|
-
minPrice: (0, reified_1.decodeFromFields)("u64", fields.min_price),
|
|
1621
|
-
});
|
|
1622
|
-
};
|
|
1623
|
-
PurchaseCap.fromFieldsWithTypes = function (typeArg, item) {
|
|
1624
|
-
if (!isPurchaseCap(item.type)) {
|
|
1625
|
-
throw new Error("not a PurchaseCap type");
|
|
1626
|
-
}
|
|
1627
|
-
(0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
|
|
1628
|
-
return PurchaseCap.reified(typeArg).new({
|
|
1629
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
|
|
1630
|
-
kioskId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.kiosk_id),
|
|
1631
|
-
itemId: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.ID.reified(), item.fields.item_id),
|
|
1632
|
-
minPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.min_price),
|
|
1633
|
-
});
|
|
1634
|
-
};
|
|
1635
|
-
PurchaseCap.fromBcs = function (typeArg, data) {
|
|
1636
|
-
return PurchaseCap.fromFields(typeArg, PurchaseCap.bcs.parse(data));
|
|
1637
|
-
};
|
|
1638
|
-
PurchaseCap.prototype.toJSONField = function () {
|
|
1639
|
-
return {
|
|
1640
|
-
id: this.id,
|
|
1641
|
-
kioskId: this.kioskId,
|
|
1642
|
-
itemId: this.itemId,
|
|
1643
|
-
minPrice: this.minPrice.toString(),
|
|
1644
|
-
};
|
|
1645
|
-
};
|
|
1646
|
-
PurchaseCap.prototype.toJSON = function () {
|
|
1647
|
-
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1648
|
-
};
|
|
1649
|
-
PurchaseCap.fromJSONField = function (typeArg, field) {
|
|
1650
|
-
return PurchaseCap.reified(typeArg).new({
|
|
1651
|
-
id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
|
|
1652
|
-
kioskId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.kioskId),
|
|
1653
|
-
itemId: (0, reified_1.decodeFromJSONField)(structs_2.ID.reified(), field.itemId),
|
|
1654
|
-
minPrice: (0, reified_1.decodeFromJSONField)("u64", field.minPrice),
|
|
1655
|
-
});
|
|
1656
|
-
};
|
|
1657
|
-
PurchaseCap.fromJSON = function (typeArg, json) {
|
|
1658
|
-
if (json.$typeName !== PurchaseCap.$typeName) {
|
|
1659
|
-
throw new Error("not a WithTwoGenerics json object");
|
|
1660
|
-
}
|
|
1661
|
-
(0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(PurchaseCap.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
|
|
1662
|
-
return PurchaseCap.fromJSONField(typeArg, json);
|
|
1663
|
-
};
|
|
1664
|
-
PurchaseCap.fromSuiParsedData = function (typeArg, content) {
|
|
1665
|
-
if (content.dataType !== "moveObject") {
|
|
1666
|
-
throw new Error("not an object");
|
|
1667
|
-
}
|
|
1668
|
-
if (!isPurchaseCap(content.type)) {
|
|
1669
|
-
throw new Error("object at ".concat(content.fields.id, " is not a PurchaseCap object"));
|
|
1670
|
-
}
|
|
1671
|
-
return PurchaseCap.fromFieldsWithTypes(typeArg, content);
|
|
1672
|
-
};
|
|
1673
|
-
PurchaseCap.fromSuiObjectData = function (typeArg, data) {
|
|
1674
|
-
if (data.bcs) {
|
|
1675
|
-
if (data.bcs.dataType !== "moveObject" || !isPurchaseCap(data.bcs.type)) {
|
|
1676
|
-
throw new Error("object at is not a PurchaseCap object");
|
|
1677
|
-
}
|
|
1678
|
-
var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
|
|
1679
|
-
if (gotTypeArgs.length !== 1) {
|
|
1680
|
-
throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
|
|
1681
|
-
}
|
|
1682
|
-
var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
|
|
1683
|
-
var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
|
|
1684
|
-
if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
|
|
1685
|
-
throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
|
|
1686
|
-
}
|
|
1687
|
-
return PurchaseCap.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1688
|
-
}
|
|
1689
|
-
if (data.content) {
|
|
1690
|
-
return PurchaseCap.fromSuiParsedData(typeArg, data.content);
|
|
1691
|
-
}
|
|
1692
|
-
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1693
|
-
};
|
|
1694
|
-
PurchaseCap.fetch = function (client, typeArg, id) {
|
|
1695
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1696
|
-
var res;
|
|
1697
|
-
var _a, _b;
|
|
1698
|
-
return __generator(this, function (_c) {
|
|
1699
|
-
switch (_c.label) {
|
|
1700
|
-
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
1701
|
-
case 1:
|
|
1702
|
-
res = _c.sent();
|
|
1703
|
-
if (res.error) {
|
|
1704
|
-
throw new Error("error fetching PurchaseCap object at id ".concat(id, ": ").concat(res.error.code));
|
|
1705
|
-
}
|
|
1706
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isPurchaseCap(res.data.bcs.type)) {
|
|
1707
|
-
throw new Error("object at id ".concat(id, " is not a PurchaseCap object"));
|
|
1708
|
-
}
|
|
1709
|
-
return [2 /*return*/, PurchaseCap.fromSuiObjectData(typeArg, res.data)];
|
|
1710
|
-
}
|
|
1711
|
-
});
|
|
1712
|
-
});
|
|
1713
|
-
};
|
|
1714
|
-
PurchaseCap.$typeName = "".concat(index_1.PKG_V26, "::kiosk::PurchaseCap");
|
|
1715
|
-
PurchaseCap.$numTypeParams = 1;
|
|
1716
|
-
PurchaseCap.$isPhantom = [true];
|
|
1717
|
-
return PurchaseCap;
|
|
1718
|
-
}());
|
|
1719
|
-
exports.PurchaseCap = PurchaseCap;
|