@typus/typus-sdk 1.4.3-c → 1.4.3-e
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/package.json +10 -2
- package/src/_dependencies/source/0x1/ascii/structs.ts +135 -0
- package/src/_dependencies/source/0x1/bit-vector/structs.ts +70 -0
- package/src/_dependencies/source/0x1/fixed-point32/structs.ts +69 -0
- package/src/_dependencies/source/0x1/index.ts +1 -0
- package/src/_dependencies/source/0x1/init.ts +16 -0
- package/src/_dependencies/source/0x1/option/structs.ts +74 -0
- package/src/_dependencies/source/0x1/string/structs.ts +70 -0
- package/src/_dependencies/source/0x1/type-name/structs.ts +70 -0
- package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.ts +1 -0
- package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.ts +14 -0
- package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.ts +203 -0
- package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.ts +317 -0
- package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.ts +69 -0
- package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.ts +69 -0
- package/src/_dependencies/source/0x2/authenticator-state/structs.ts +332 -0
- package/src/_dependencies/source/0x2/bag/structs.ts +70 -0
- package/src/_dependencies/source/0x2/balance/structs.ts +134 -0
- package/src/_dependencies/source/0x2/bcs/structs.ts +70 -0
- package/src/_dependencies/source/0x2/bls12381/structs.ts +264 -0
- package/src/_dependencies/source/0x2/borrow/structs.ts +138 -0
- package/src/_dependencies/source/0x2/clock/structs.ts +70 -0
- package/src/_dependencies/source/0x2/coin/structs.ts +400 -0
- package/src/_dependencies/source/0x2/deny-list/structs.ts +139 -0
- package/src/_dependencies/source/0x2/display/structs.ts +202 -0
- package/src/_dependencies/source/0x2/dynamic-field/structs.ts +70 -0
- package/src/_dependencies/source/0x2/dynamic-object-field/structs.ts +71 -0
- package/src/_dependencies/source/0x2/groth16/structs.ts +265 -0
- package/src/_dependencies/source/0x2/group-ops/structs.ts +70 -0
- package/src/_dependencies/source/0x2/index.ts +1 -0
- package/src/_dependencies/source/0x2/init.ts +125 -0
- package/src/_dependencies/source/0x2/kiosk/structs.ts +658 -0
- package/src/_dependencies/source/0x2/kiosk-extension/structs.ts +135 -0
- package/src/_dependencies/source/0x2/linked-table/structs.ts +136 -0
- package/src/_dependencies/source/0x2/object/structs.ts +134 -0
- package/src/_dependencies/source/0x2/object-bag/structs.ts +70 -0
- package/src/_dependencies/source/0x2/object-table/structs.ts +70 -0
- package/src/_dependencies/source/0x2/package/structs.ts +267 -0
- package/src/_dependencies/source/0x2/priority-queue/structs.ts +139 -0
- package/src/_dependencies/source/0x2/random/structs.ts +202 -0
- package/src/_dependencies/source/0x2/sui/structs.ts +69 -0
- package/src/_dependencies/source/0x2/table/structs.ts +70 -0
- package/src/_dependencies/source/0x2/table-vec/structs.ts +71 -0
- package/src/_dependencies/source/0x2/token/structs.ts +401 -0
- package/src/_dependencies/source/0x2/transfer/structs.ts +70 -0
- package/src/_dependencies/source/0x2/transfer-policy/structs.ts +400 -0
- package/src/_dependencies/source/0x2/tx-context/structs.ts +70 -0
- package/src/_dependencies/source/0x2/url/structs.ts +70 -0
- package/src/_dependencies/source/0x2/vec-map/structs.ts +135 -0
- package/src/_dependencies/source/0x2/vec-set/structs.ts +72 -0
- package/src/_dependencies/source/0x2/versioned/structs.ts +135 -0
- package/src/_dependencies/source/0x2/zklogin-verified-id/structs.ts +71 -0
- package/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.ts +71 -0
- package/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.ts +1 -0
- package/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.ts +5 -0
- package/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.ts +70 -0
- package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.ts +1 -0
- package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.ts +8 -0
- package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.ts +69 -0
- package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.ts +135 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.ts +400 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.ts +372 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.ts +205 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.ts +333 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.ts +1 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.ts +48 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.ts +465 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-object-table/structs.ts +136 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.ts +140 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.ts +268 -0
- package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.ts +332 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.ts +466 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.ts +1 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.ts +36 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.ts +134 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.ts +333 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.ts +71 -0
- package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.ts +856 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.ts +1049 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.ts +1 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.ts +104 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.ts +1054 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.ts +592 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.ts +461 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.ts +592 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.ts +69 -0
- package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.ts +2351 -0
- package/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.ts +1 -0
- package/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.ts +3 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.ts +71 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.ts +203 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.ts +70 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.ts +528 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.ts +69 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.ts +1 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.ts +54 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.ts +136 -0
- package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs.ts +1829 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.ts +398 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.ts +1 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.ts +18 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.ts +71 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.ts +69 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.ts +71 -0
- package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.ts +70 -0
- package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.ts +1 -0
- package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.ts +11 -0
- package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.ts +134 -0
- package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.ts +134 -0
- package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.ts +69 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes20/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes32/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/consumed-vaas/structs.ts +72 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/cursor/structs.ts +72 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/emitter/structs.ts +200 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/external-address/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/fee-collector/structs.ts +72 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/governance-message/structs.ts +137 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-set/structs.ts +71 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-signature/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/index.ts +1 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/init.ts +65 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/migrate/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/package-utils/structs.ts +266 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/publish-message/structs.ts +136 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set/structs.ts +136 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set-fee/structs.ts +134 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/setup/structs.ts +70 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/state/structs.ts +142 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/transfer-fee/structs.ts +134 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/update-guardian-set/structs.ts +201 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/upgrade-contract/structs.ts +201 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/vaa/structs.ts +72 -0
- package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/version-control/structs.ts +134 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/batch-price-attestation/structs.ts +136 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/contract-upgrade/structs.ts +136 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/data-source/structs.ts +70 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/event/structs.ts +135 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance/structs.ts +71 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-action/structs.ts +69 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-instruction/structs.ts +71 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/hot-potato-vector/structs.ts +72 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/i64/structs.ts +69 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/index.ts +1 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/init.ts +59 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/migrate/structs.ts +70 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price/structs.ts +70 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-feed/structs.ts +71 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-identifier/structs.ts +70 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-info/structs.ts +136 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-status/structs.ts +69 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set/structs.ts +138 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-data-sources/structs.ts +71 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-fee-recipient/structs.ts +69 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-governance-data-source/structs.ts +70 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-stale-price-threshold/structs.ts +69 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-update-fee/structs.ts +69 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/setup/structs.ts +70 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/state/structs.ts +203 -0
- package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/version-control/structs.ts +134 -0
- package/src/_framework/init-source.ts +39 -0
- package/src/_framework/loader.ts +69 -0
- package/src/_framework/reified.ts +442 -0
- package/src/_framework/util.ts +265 -0
- package/src/airdrop/authority-entry.ts +101 -0
- package/src/airdrop/index.ts +3 -0
- package/src/airdrop/user-entry.ts +24 -0
- package/src/airdrop/view-function.ts +36 -0
- package/src/auto-bid/index.ts +2 -0
- package/src/auto-bid/user-entry.ts +256 -0
- package/src/auto-bid/view-function.ts +285 -0
- package/src/constants/constant.ts +32 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/token.ts +194 -0
- package/src/index.ts +11 -0
- package/src/leaderboard/authority-entry.ts +63 -0
- package/src/leaderboard/index.ts +2 -0
- package/src/leaderboard/view-function.ts +66 -0
- package/src/tails-exp-dice/api.ts +46 -0
- package/src/tails-exp-dice/fetch.ts +347 -0
- package/src/tails-exp-dice/index.ts +4 -0
- package/src/tails-exp-dice/user-entry.ts +241 -0
- package/src/tails-exp-dice/view-function.ts +111 -0
- package/src/tails-staking/authority-entry.ts +333 -0
- package/src/tails-staking/index.ts +3 -0
- package/src/tails-staking/user-entry.ts +401 -0
- package/src/tails-staking/view-function.ts +86 -0
- package/src/typus-dov-single-v2/entry/authority-entry.ts +171 -0
- package/src/typus-dov-single-v2/entry/index.ts +3 -0
- package/src/typus-dov-single-v2/entry/mfud-user-entry.ts +591 -0
- package/src/typus-dov-single-v2/entry/user-entry.ts +573 -0
- package/src/typus-dov-single-v2/function/bidding.ts +823 -0
- package/src/typus-dov-single-v2/function/index.ts +3 -0
- package/src/typus-dov-single-v2/function/token.ts +38 -0
- package/src/typus-dov-single-v2/function/vault.ts +24 -0
- package/src/typus-dov-single-v2/history/index.ts +2 -0
- package/src/typus-dov-single-v2/history/user-history.ts +929 -0
- package/src/typus-dov-single-v2/history/vault-history.ts +452 -0
- package/src/typus-dov-single-v2/index.ts +4 -0
- package/src/typus-dov-single-v2/view-function.ts +705 -0
- package/src/typus-nft/fetch.ts +428 -0
- package/src/typus-nft/index.ts +2 -0
- package/src/typus-nft/user-entry.ts +113 -0
- package/src/typus-perp/admin/functions.ts +141 -0
- package/src/typus-perp/admin/structs.ts +793 -0
- package/src/typus-perp/fetch.ts +253 -0
- package/src/typus-perp/index.ts +9 -0
- package/src/typus-perp/init.ts +96 -0
- package/src/typus-perp/lp-pool/functions.ts +694 -0
- package/src/typus-perp/lp-pool/structs.ts +3884 -0
- package/src/typus-perp/math/functions.ts +53 -0
- package/src/typus-perp/oracle/functions.ts +32 -0
- package/src/typus-perp/oracle/structs.ts +317 -0
- package/src/typus-perp/position/functions.ts +887 -0
- package/src/typus-perp/position/structs.ts +1637 -0
- package/src/typus-perp/readVec.ts +118 -0
- package/src/typus-perp/stake-pool/functions.ts +421 -0
- package/src/typus-perp/stake-pool/structs.ts +3873 -0
- package/src/typus-perp/symbol/functions.ts +24 -0
- package/src/typus-perp/symbol/structs.ts +165 -0
- package/src/typus-perp/tlp/functions.ts +50 -0
- package/src/typus-perp/tlp/structs.ts +287 -0
- package/src/typus-perp/token-interface/functions.ts +29 -0
- package/src/typus-perp/trading/functions.ts +1046 -0
- package/src/typus-perp/trading/structs.ts +4541 -0
- package/src/typus-perp/treasury-caps/functions.ts +36 -0
- package/src/typus-perp/treasury-caps/structs.ts +151 -0
- package/src/typus-perp/user/order.ts +221 -0
- package/src/typus-perp/user/orderWithBidReceipt.ts +176 -0
- package/src/typus-perp/user/tlp.ts +234 -0
- package/src/user/index.ts +1 -0
- package/src/user/view-function.ts +33 -0
- package/src/utils/.DS_Store +0 -0
- package/src/utils/api/defillama/index.ts +1 -0
- package/src/utils/api/defillama/tvl.ts +11 -0
- package/src/utils/api/index.ts +3 -0
- package/src/utils/api/price.ts +101 -0
- package/src/utils/api/sentio/index.ts +2 -0
- package/src/utils/api/sentio/leader-board.ts +259 -0
- package/src/utils/api/sentio/reward-generated.ts +392 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/load_env.ts +5 -0
- package/src/utils/mint.ts +16 -0
- package/src/utils/pyth/constant.ts +71 -0
- package/src/utils/pyth/index.ts +2 -0
- package/src/utils/pyth/pythClient.ts +52 -0
- package/src/utils/tools.ts +38 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom, ToTypeStr as ToPhantom} from "../../../../_framework/reified";
|
|
3
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
4
|
+
import {TypeName} from "../../0x1/type-name/structs";
|
|
5
|
+
import {UID} from "../../0x2/object/structs";
|
|
6
|
+
import {BigVector} from "../big-vector/structs";
|
|
7
|
+
import {bcs, fromB64, fromHEX, toHEX} from "@mysten/bcs";
|
|
8
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
9
|
+
|
|
10
|
+
/* ============================== Delivery =============================== */
|
|
11
|
+
|
|
12
|
+
export function isDelivery(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Delivery"; }
|
|
13
|
+
|
|
14
|
+
export interface DeliveryFields { signer: ToField<"address">; index: ToField<"u64">; token: ToField<TypeName>; price: ToField<"u64">; size: ToField<"u64">; bidderBidValue: ToField<"u64">; bidderFee: ToField<"u64">; incentiveBidValue: ToField<"u64">; incentiveFee: ToField<"u64"> }
|
|
15
|
+
|
|
16
|
+
export type DeliveryReified = Reified< Delivery, DeliveryFields >;
|
|
17
|
+
|
|
18
|
+
export class Delivery implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Delivery"; static readonly $numTypeParams = 0;
|
|
19
|
+
|
|
20
|
+
readonly $typeName = Delivery.$typeName;
|
|
21
|
+
|
|
22
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Delivery";
|
|
23
|
+
|
|
24
|
+
readonly $typeArgs: [];
|
|
25
|
+
|
|
26
|
+
readonly signer: ToField<"address">; readonly index: ToField<"u64">; readonly token: ToField<TypeName>; readonly price: ToField<"u64">; readonly size: ToField<"u64">; readonly bidderBidValue: ToField<"u64">; readonly bidderFee: ToField<"u64">; readonly incentiveBidValue: ToField<"u64">; readonly incentiveFee: ToField<"u64">
|
|
27
|
+
|
|
28
|
+
private constructor(typeArgs: [], fields: DeliveryFields, ) { this.$fullTypeName = composeSuiType( Delivery.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Delivery"; this.$typeArgs = typeArgs;
|
|
29
|
+
|
|
30
|
+
this.signer = fields.signer;; this.index = fields.index;; this.token = fields.token;; this.price = fields.price;; this.size = fields.size;; this.bidderBidValue = fields.bidderBidValue;; this.bidderFee = fields.bidderFee;; this.incentiveBidValue = fields.incentiveBidValue;; this.incentiveFee = fields.incentiveFee; }
|
|
31
|
+
|
|
32
|
+
static reified( ): DeliveryReified { return { typeName: Delivery.$typeName, fullTypeName: composeSuiType( Delivery.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Delivery", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Delivery.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Delivery.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Delivery.fromBcs( data, ), bcs: Delivery.bcs, fromJSONField: (field: any) => Delivery.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Delivery.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Delivery.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Delivery.fetch( client, id, ), new: ( fields: DeliveryFields, ) => { return new Delivery( [], fields ) }, kind: "StructClassReified", } }
|
|
33
|
+
|
|
34
|
+
static get r() { return Delivery.reified() }
|
|
35
|
+
|
|
36
|
+
static phantom( ): PhantomReified<ToTypeStr<Delivery>> { return phantom(Delivery.reified( )); } static get p() { return Delivery.phantom() }
|
|
37
|
+
|
|
38
|
+
static get bcs() { return bcs.struct("Delivery", {
|
|
39
|
+
|
|
40
|
+
signer: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), index: bcs.u64(), token: TypeName.bcs, price: bcs.u64(), size: bcs.u64(), bidder_bid_value: bcs.u64(), bidder_fee: bcs.u64(), incentive_bid_value: bcs.u64(), incentive_fee: bcs.u64()
|
|
41
|
+
|
|
42
|
+
}) };
|
|
43
|
+
|
|
44
|
+
static fromFields( fields: Record<string, any> ): Delivery { return Delivery.reified( ).new( { signer: decodeFromFields("address", fields.signer), index: decodeFromFields("u64", fields.index), token: decodeFromFields(TypeName.reified(), fields.token), price: decodeFromFields("u64", fields.price), size: decodeFromFields("u64", fields.size), bidderBidValue: decodeFromFields("u64", fields.bidder_bid_value), bidderFee: decodeFromFields("u64", fields.bidder_fee), incentiveBidValue: decodeFromFields("u64", fields.incentive_bid_value), incentiveFee: decodeFromFields("u64", fields.incentive_fee) } ) }
|
|
45
|
+
|
|
46
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Delivery { if (!isDelivery(item.type)) { throw new Error("not a Delivery type");
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return Delivery.reified( ).new( { signer: decodeFromFieldsWithTypes("address", item.fields.signer), index: decodeFromFieldsWithTypes("u64", item.fields.index), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), price: decodeFromFieldsWithTypes("u64", item.fields.price), size: decodeFromFieldsWithTypes("u64", item.fields.size), bidderBidValue: decodeFromFieldsWithTypes("u64", item.fields.bidder_bid_value), bidderFee: decodeFromFieldsWithTypes("u64", item.fields.bidder_fee), incentiveBidValue: decodeFromFieldsWithTypes("u64", item.fields.incentive_bid_value), incentiveFee: decodeFromFieldsWithTypes("u64", item.fields.incentive_fee) } ) }
|
|
51
|
+
|
|
52
|
+
static fromBcs( data: Uint8Array ): Delivery { return Delivery.fromFields( Delivery.bcs.parse(data) ) }
|
|
53
|
+
|
|
54
|
+
toJSONField() { return {
|
|
55
|
+
|
|
56
|
+
signer: this.signer,index: this.index.toString(),token: this.token.toJSONField(),price: this.price.toString(),size: this.size.toString(),bidderBidValue: this.bidderBidValue.toString(),bidderFee: this.bidderFee.toString(),incentiveBidValue: this.incentiveBidValue.toString(),incentiveFee: this.incentiveFee.toString(),
|
|
57
|
+
|
|
58
|
+
} }
|
|
59
|
+
|
|
60
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
61
|
+
|
|
62
|
+
static fromJSONField( field: any ): Delivery { return Delivery.reified( ).new( { signer: decodeFromJSONField("address", field.signer), index: decodeFromJSONField("u64", field.index), token: decodeFromJSONField(TypeName.reified(), field.token), price: decodeFromJSONField("u64", field.price), size: decodeFromJSONField("u64", field.size), bidderBidValue: decodeFromJSONField("u64", field.bidderBidValue), bidderFee: decodeFromJSONField("u64", field.bidderFee), incentiveBidValue: decodeFromJSONField("u64", field.incentiveBidValue), incentiveFee: decodeFromJSONField("u64", field.incentiveFee) } ) }
|
|
63
|
+
|
|
64
|
+
static fromJSON( json: Record<string, any> ): Delivery { if (json.$typeName !== Delivery.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
65
|
+
|
|
66
|
+
return Delivery.fromJSONField( json, ) }
|
|
67
|
+
|
|
68
|
+
static fromSuiParsedData( content: SuiParsedData ): Delivery { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isDelivery(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Delivery object`); } return Delivery.fromFieldsWithTypes( content ); }
|
|
69
|
+
|
|
70
|
+
static async fetch( client: SuiClient, id: string ): Promise<Delivery> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Delivery object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isDelivery(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Delivery object`); }
|
|
71
|
+
return Delivery.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ============================== Terminate =============================== */
|
|
76
|
+
|
|
77
|
+
export function isTerminate(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Terminate"; }
|
|
78
|
+
|
|
79
|
+
export interface TerminateFields { signer: ToField<"address">; index: ToField<"u64">; token: ToField<TypeName> }
|
|
80
|
+
|
|
81
|
+
export type TerminateReified = Reified< Terminate, TerminateFields >;
|
|
82
|
+
|
|
83
|
+
export class Terminate implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Terminate"; static readonly $numTypeParams = 0;
|
|
84
|
+
|
|
85
|
+
readonly $typeName = Terminate.$typeName;
|
|
86
|
+
|
|
87
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Terminate";
|
|
88
|
+
|
|
89
|
+
readonly $typeArgs: [];
|
|
90
|
+
|
|
91
|
+
readonly signer: ToField<"address">; readonly index: ToField<"u64">; readonly token: ToField<TypeName>
|
|
92
|
+
|
|
93
|
+
private constructor(typeArgs: [], fields: TerminateFields, ) { this.$fullTypeName = composeSuiType( Terminate.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Terminate"; this.$typeArgs = typeArgs;
|
|
94
|
+
|
|
95
|
+
this.signer = fields.signer;; this.index = fields.index;; this.token = fields.token; }
|
|
96
|
+
|
|
97
|
+
static reified( ): TerminateReified { return { typeName: Terminate.$typeName, fullTypeName: composeSuiType( Terminate.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Terminate", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Terminate.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Terminate.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Terminate.fromBcs( data, ), bcs: Terminate.bcs, fromJSONField: (field: any) => Terminate.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Terminate.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Terminate.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Terminate.fetch( client, id, ), new: ( fields: TerminateFields, ) => { return new Terminate( [], fields ) }, kind: "StructClassReified", } }
|
|
98
|
+
|
|
99
|
+
static get r() { return Terminate.reified() }
|
|
100
|
+
|
|
101
|
+
static phantom( ): PhantomReified<ToTypeStr<Terminate>> { return phantom(Terminate.reified( )); } static get p() { return Terminate.phantom() }
|
|
102
|
+
|
|
103
|
+
static get bcs() { return bcs.struct("Terminate", {
|
|
104
|
+
|
|
105
|
+
signer: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), index: bcs.u64(), token: TypeName.bcs
|
|
106
|
+
|
|
107
|
+
}) };
|
|
108
|
+
|
|
109
|
+
static fromFields( fields: Record<string, any> ): Terminate { return Terminate.reified( ).new( { signer: decodeFromFields("address", fields.signer), index: decodeFromFields("u64", fields.index), token: decodeFromFields(TypeName.reified(), fields.token) } ) }
|
|
110
|
+
|
|
111
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Terminate { if (!isTerminate(item.type)) { throw new Error("not a Terminate type");
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return Terminate.reified( ).new( { signer: decodeFromFieldsWithTypes("address", item.fields.signer), index: decodeFromFieldsWithTypes("u64", item.fields.index), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token) } ) }
|
|
116
|
+
|
|
117
|
+
static fromBcs( data: Uint8Array ): Terminate { return Terminate.fromFields( Terminate.bcs.parse(data) ) }
|
|
118
|
+
|
|
119
|
+
toJSONField() { return {
|
|
120
|
+
|
|
121
|
+
signer: this.signer,index: this.index.toString(),token: this.token.toJSONField(),
|
|
122
|
+
|
|
123
|
+
} }
|
|
124
|
+
|
|
125
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
126
|
+
|
|
127
|
+
static fromJSONField( field: any ): Terminate { return Terminate.reified( ).new( { signer: decodeFromJSONField("address", field.signer), index: decodeFromJSONField("u64", field.index), token: decodeFromJSONField(TypeName.reified(), field.token) } ) }
|
|
128
|
+
|
|
129
|
+
static fromJSON( json: Record<string, any> ): Terminate { if (json.$typeName !== Terminate.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
130
|
+
|
|
131
|
+
return Terminate.fromJSONField( json, ) }
|
|
132
|
+
|
|
133
|
+
static fromSuiParsedData( content: SuiParsedData ): Terminate { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTerminate(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Terminate object`); } return Terminate.fromFieldsWithTypes( content ); }
|
|
134
|
+
|
|
135
|
+
static async fetch( client: SuiClient, id: string ): Promise<Terminate> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Terminate object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTerminate(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Terminate object`); }
|
|
136
|
+
return Terminate.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ============================== Auction =============================== */
|
|
141
|
+
|
|
142
|
+
export function isAuction(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Auction"; }
|
|
143
|
+
|
|
144
|
+
export interface AuctionFields { id: ToField<UID>; index: ToField<"u64">; token: ToField<TypeName>; startTsMs: ToField<"u64">; endTsMs: ToField<"u64">; size: ToField<"u64">; decaySpeed: ToField<"u64">; initialPrice: ToField<"u64">; finalPrice: ToField<"u64">; feeBp: ToField<"u64">; incentiveBp: ToField<"u64">; tokenDecimal: ToField<"u64">; sizeDecimal: ToField<"u64">; totalBidSize: ToField<"u64">; ableToRemoveBid: ToField<"bool">; bids: ToField<BigVector<ToPhantom<Bid>>>; bidIndex: ToField<"u64"> }
|
|
145
|
+
|
|
146
|
+
export type AuctionReified = Reified< Auction, AuctionFields >;
|
|
147
|
+
|
|
148
|
+
export class Auction implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Auction"; static readonly $numTypeParams = 0;
|
|
149
|
+
|
|
150
|
+
readonly $typeName = Auction.$typeName;
|
|
151
|
+
|
|
152
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Auction";
|
|
153
|
+
|
|
154
|
+
readonly $typeArgs: [];
|
|
155
|
+
|
|
156
|
+
readonly id: ToField<UID>; readonly index: ToField<"u64">; readonly token: ToField<TypeName>; readonly startTsMs: ToField<"u64">; readonly endTsMs: ToField<"u64">; readonly size: ToField<"u64">; readonly decaySpeed: ToField<"u64">; readonly initialPrice: ToField<"u64">; readonly finalPrice: ToField<"u64">; readonly feeBp: ToField<"u64">; readonly incentiveBp: ToField<"u64">; readonly tokenDecimal: ToField<"u64">; readonly sizeDecimal: ToField<"u64">; readonly totalBidSize: ToField<"u64">; readonly ableToRemoveBid: ToField<"bool">; readonly bids: ToField<BigVector<ToPhantom<Bid>>>; readonly bidIndex: ToField<"u64">
|
|
157
|
+
|
|
158
|
+
private constructor(typeArgs: [], fields: AuctionFields, ) { this.$fullTypeName = composeSuiType( Auction.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Auction"; this.$typeArgs = typeArgs;
|
|
159
|
+
|
|
160
|
+
this.id = fields.id;; this.index = fields.index;; this.token = fields.token;; this.startTsMs = fields.startTsMs;; this.endTsMs = fields.endTsMs;; this.size = fields.size;; this.decaySpeed = fields.decaySpeed;; this.initialPrice = fields.initialPrice;; this.finalPrice = fields.finalPrice;; this.feeBp = fields.feeBp;; this.incentiveBp = fields.incentiveBp;; this.tokenDecimal = fields.tokenDecimal;; this.sizeDecimal = fields.sizeDecimal;; this.totalBidSize = fields.totalBidSize;; this.ableToRemoveBid = fields.ableToRemoveBid;; this.bids = fields.bids;; this.bidIndex = fields.bidIndex; }
|
|
161
|
+
|
|
162
|
+
static reified( ): AuctionReified { return { typeName: Auction.$typeName, fullTypeName: composeSuiType( Auction.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Auction", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Auction.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Auction.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Auction.fromBcs( data, ), bcs: Auction.bcs, fromJSONField: (field: any) => Auction.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Auction.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Auction.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Auction.fetch( client, id, ), new: ( fields: AuctionFields, ) => { return new Auction( [], fields ) }, kind: "StructClassReified", } }
|
|
163
|
+
|
|
164
|
+
static get r() { return Auction.reified() }
|
|
165
|
+
|
|
166
|
+
static phantom( ): PhantomReified<ToTypeStr<Auction>> { return phantom(Auction.reified( )); } static get p() { return Auction.phantom() }
|
|
167
|
+
|
|
168
|
+
static get bcs() { return bcs.struct("Auction", {
|
|
169
|
+
|
|
170
|
+
id: UID.bcs, index: bcs.u64(), token: TypeName.bcs, start_ts_ms: bcs.u64(), end_ts_ms: bcs.u64(), size: bcs.u64(), decay_speed: bcs.u64(), initial_price: bcs.u64(), final_price: bcs.u64(), fee_bp: bcs.u64(), incentive_bp: bcs.u64(), token_decimal: bcs.u64(), size_decimal: bcs.u64(), total_bid_size: bcs.u64(), able_to_remove_bid: bcs.bool(), bids: BigVector.bcs, bid_index: bcs.u64()
|
|
171
|
+
|
|
172
|
+
}) };
|
|
173
|
+
|
|
174
|
+
static fromFields( fields: Record<string, any> ): Auction { return Auction.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), index: decodeFromFields("u64", fields.index), token: decodeFromFields(TypeName.reified(), fields.token), startTsMs: decodeFromFields("u64", fields.start_ts_ms), endTsMs: decodeFromFields("u64", fields.end_ts_ms), size: decodeFromFields("u64", fields.size), decaySpeed: decodeFromFields("u64", fields.decay_speed), initialPrice: decodeFromFields("u64", fields.initial_price), finalPrice: decodeFromFields("u64", fields.final_price), feeBp: decodeFromFields("u64", fields.fee_bp), incentiveBp: decodeFromFields("u64", fields.incentive_bp), tokenDecimal: decodeFromFields("u64", fields.token_decimal), sizeDecimal: decodeFromFields("u64", fields.size_decimal), totalBidSize: decodeFromFields("u64", fields.total_bid_size), ableToRemoveBid: decodeFromFields("bool", fields.able_to_remove_bid), bids: decodeFromFields(BigVector.reified(reified.phantom(Bid.reified())), fields.bids), bidIndex: decodeFromFields("u64", fields.bid_index) } ) }
|
|
175
|
+
|
|
176
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Auction { if (!isAuction(item.type)) { throw new Error("not a Auction type");
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return Auction.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), index: decodeFromFieldsWithTypes("u64", item.fields.index), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), startTsMs: decodeFromFieldsWithTypes("u64", item.fields.start_ts_ms), endTsMs: decodeFromFieldsWithTypes("u64", item.fields.end_ts_ms), size: decodeFromFieldsWithTypes("u64", item.fields.size), decaySpeed: decodeFromFieldsWithTypes("u64", item.fields.decay_speed), initialPrice: decodeFromFieldsWithTypes("u64", item.fields.initial_price), finalPrice: decodeFromFieldsWithTypes("u64", item.fields.final_price), feeBp: decodeFromFieldsWithTypes("u64", item.fields.fee_bp), incentiveBp: decodeFromFieldsWithTypes("u64", item.fields.incentive_bp), tokenDecimal: decodeFromFieldsWithTypes("u64", item.fields.token_decimal), sizeDecimal: decodeFromFieldsWithTypes("u64", item.fields.size_decimal), totalBidSize: decodeFromFieldsWithTypes("u64", item.fields.total_bid_size), ableToRemoveBid: decodeFromFieldsWithTypes("bool", item.fields.able_to_remove_bid), bids: decodeFromFieldsWithTypes(BigVector.reified(reified.phantom(Bid.reified())), item.fields.bids), bidIndex: decodeFromFieldsWithTypes("u64", item.fields.bid_index) } ) }
|
|
181
|
+
|
|
182
|
+
static fromBcs( data: Uint8Array ): Auction { return Auction.fromFields( Auction.bcs.parse(data) ) }
|
|
183
|
+
|
|
184
|
+
toJSONField() { return {
|
|
185
|
+
|
|
186
|
+
id: this.id,index: this.index.toString(),token: this.token.toJSONField(),startTsMs: this.startTsMs.toString(),endTsMs: this.endTsMs.toString(),size: this.size.toString(),decaySpeed: this.decaySpeed.toString(),initialPrice: this.initialPrice.toString(),finalPrice: this.finalPrice.toString(),feeBp: this.feeBp.toString(),incentiveBp: this.incentiveBp.toString(),tokenDecimal: this.tokenDecimal.toString(),sizeDecimal: this.sizeDecimal.toString(),totalBidSize: this.totalBidSize.toString(),ableToRemoveBid: this.ableToRemoveBid,bids: this.bids.toJSONField(),bidIndex: this.bidIndex.toString(),
|
|
187
|
+
|
|
188
|
+
} }
|
|
189
|
+
|
|
190
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
191
|
+
|
|
192
|
+
static fromJSONField( field: any ): Auction { return Auction.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), index: decodeFromJSONField("u64", field.index), token: decodeFromJSONField(TypeName.reified(), field.token), startTsMs: decodeFromJSONField("u64", field.startTsMs), endTsMs: decodeFromJSONField("u64", field.endTsMs), size: decodeFromJSONField("u64", field.size), decaySpeed: decodeFromJSONField("u64", field.decaySpeed), initialPrice: decodeFromJSONField("u64", field.initialPrice), finalPrice: decodeFromJSONField("u64", field.finalPrice), feeBp: decodeFromJSONField("u64", field.feeBp), incentiveBp: decodeFromJSONField("u64", field.incentiveBp), tokenDecimal: decodeFromJSONField("u64", field.tokenDecimal), sizeDecimal: decodeFromJSONField("u64", field.sizeDecimal), totalBidSize: decodeFromJSONField("u64", field.totalBidSize), ableToRemoveBid: decodeFromJSONField("bool", field.ableToRemoveBid), bids: decodeFromJSONField(BigVector.reified(reified.phantom(Bid.reified())), field.bids), bidIndex: decodeFromJSONField("u64", field.bidIndex) } ) }
|
|
193
|
+
|
|
194
|
+
static fromJSON( json: Record<string, any> ): Auction { if (json.$typeName !== Auction.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
195
|
+
|
|
196
|
+
return Auction.fromJSONField( json, ) }
|
|
197
|
+
|
|
198
|
+
static fromSuiParsedData( content: SuiParsedData ): Auction { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isAuction(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Auction object`); } return Auction.fromFieldsWithTypes( content ); }
|
|
199
|
+
|
|
200
|
+
static async fetch( client: SuiClient, id: string ): Promise<Auction> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Auction object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isAuction(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Auction object`); }
|
|
201
|
+
return Auction.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
202
|
+
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* ============================== Bid =============================== */
|
|
206
|
+
|
|
207
|
+
export function isBid(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Bid"; }
|
|
208
|
+
|
|
209
|
+
export interface BidFields { index: ToField<"u64">; bidder: ToField<"address">; price: ToField<"u64">; size: ToField<"u64">; bidderBalance: ToField<"u64">; incentiveBalance: ToField<"u64">; feeDiscount: ToField<"u64">; tsMs: ToField<"u64"> }
|
|
210
|
+
|
|
211
|
+
export type BidReified = Reified< Bid, BidFields >;
|
|
212
|
+
|
|
213
|
+
export class Bid implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Bid"; static readonly $numTypeParams = 0;
|
|
214
|
+
|
|
215
|
+
readonly $typeName = Bid.$typeName;
|
|
216
|
+
|
|
217
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Bid";
|
|
218
|
+
|
|
219
|
+
readonly $typeArgs: [];
|
|
220
|
+
|
|
221
|
+
readonly index: ToField<"u64">; readonly bidder: ToField<"address">; readonly price: ToField<"u64">; readonly size: ToField<"u64">; readonly bidderBalance: ToField<"u64">; readonly incentiveBalance: ToField<"u64">; readonly feeDiscount: ToField<"u64">; readonly tsMs: ToField<"u64">
|
|
222
|
+
|
|
223
|
+
private constructor(typeArgs: [], fields: BidFields, ) { this.$fullTypeName = composeSuiType( Bid.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Bid"; this.$typeArgs = typeArgs;
|
|
224
|
+
|
|
225
|
+
this.index = fields.index;; this.bidder = fields.bidder;; this.price = fields.price;; this.size = fields.size;; this.bidderBalance = fields.bidderBalance;; this.incentiveBalance = fields.incentiveBalance;; this.feeDiscount = fields.feeDiscount;; this.tsMs = fields.tsMs; }
|
|
226
|
+
|
|
227
|
+
static reified( ): BidReified { return { typeName: Bid.$typeName, fullTypeName: composeSuiType( Bid.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::Bid", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Bid.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Bid.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Bid.fromBcs( data, ), bcs: Bid.bcs, fromJSONField: (field: any) => Bid.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Bid.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Bid.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Bid.fetch( client, id, ), new: ( fields: BidFields, ) => { return new Bid( [], fields ) }, kind: "StructClassReified", } }
|
|
228
|
+
|
|
229
|
+
static get r() { return Bid.reified() }
|
|
230
|
+
|
|
231
|
+
static phantom( ): PhantomReified<ToTypeStr<Bid>> { return phantom(Bid.reified( )); } static get p() { return Bid.phantom() }
|
|
232
|
+
|
|
233
|
+
static get bcs() { return bcs.struct("Bid", {
|
|
234
|
+
|
|
235
|
+
index: bcs.u64(), bidder: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), price: bcs.u64(), size: bcs.u64(), bidder_balance: bcs.u64(), incentive_balance: bcs.u64(), fee_discount: bcs.u64(), ts_ms: bcs.u64()
|
|
236
|
+
|
|
237
|
+
}) };
|
|
238
|
+
|
|
239
|
+
static fromFields( fields: Record<string, any> ): Bid { return Bid.reified( ).new( { index: decodeFromFields("u64", fields.index), bidder: decodeFromFields("address", fields.bidder), price: decodeFromFields("u64", fields.price), size: decodeFromFields("u64", fields.size), bidderBalance: decodeFromFields("u64", fields.bidder_balance), incentiveBalance: decodeFromFields("u64", fields.incentive_balance), feeDiscount: decodeFromFields("u64", fields.fee_discount), tsMs: decodeFromFields("u64", fields.ts_ms) } ) }
|
|
240
|
+
|
|
241
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Bid { if (!isBid(item.type)) { throw new Error("not a Bid type");
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return Bid.reified( ).new( { index: decodeFromFieldsWithTypes("u64", item.fields.index), bidder: decodeFromFieldsWithTypes("address", item.fields.bidder), price: decodeFromFieldsWithTypes("u64", item.fields.price), size: decodeFromFieldsWithTypes("u64", item.fields.size), bidderBalance: decodeFromFieldsWithTypes("u64", item.fields.bidder_balance), incentiveBalance: decodeFromFieldsWithTypes("u64", item.fields.incentive_balance), feeDiscount: decodeFromFieldsWithTypes("u64", item.fields.fee_discount), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms) } ) }
|
|
246
|
+
|
|
247
|
+
static fromBcs( data: Uint8Array ): Bid { return Bid.fromFields( Bid.bcs.parse(data) ) }
|
|
248
|
+
|
|
249
|
+
toJSONField() { return {
|
|
250
|
+
|
|
251
|
+
index: this.index.toString(),bidder: this.bidder,price: this.price.toString(),size: this.size.toString(),bidderBalance: this.bidderBalance.toString(),incentiveBalance: this.incentiveBalance.toString(),feeDiscount: this.feeDiscount.toString(),tsMs: this.tsMs.toString(),
|
|
252
|
+
|
|
253
|
+
} }
|
|
254
|
+
|
|
255
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
256
|
+
|
|
257
|
+
static fromJSONField( field: any ): Bid { return Bid.reified( ).new( { index: decodeFromJSONField("u64", field.index), bidder: decodeFromJSONField("address", field.bidder), price: decodeFromJSONField("u64", field.price), size: decodeFromJSONField("u64", field.size), bidderBalance: decodeFromJSONField("u64", field.bidderBalance), incentiveBalance: decodeFromJSONField("u64", field.incentiveBalance), feeDiscount: decodeFromJSONField("u64", field.feeDiscount), tsMs: decodeFromJSONField("u64", field.tsMs) } ) }
|
|
258
|
+
|
|
259
|
+
static fromJSON( json: Record<string, any> ): Bid { if (json.$typeName !== Bid.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
260
|
+
|
|
261
|
+
return Bid.fromJSONField( json, ) }
|
|
262
|
+
|
|
263
|
+
static fromSuiParsedData( content: SuiParsedData ): Bid { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isBid(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Bid object`); } return Bid.fromFieldsWithTypes( content ); }
|
|
264
|
+
|
|
265
|
+
static async fetch( client: SuiClient, id: string ): Promise<Bid> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Bid object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isBid(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Bid object`); }
|
|
266
|
+
return Bid.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
267
|
+
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* ============================== DUTCH =============================== */
|
|
271
|
+
|
|
272
|
+
export function isDUTCH(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::DUTCH"; }
|
|
273
|
+
|
|
274
|
+
export interface DUTCHFields { dummyField: ToField<"bool"> }
|
|
275
|
+
|
|
276
|
+
export type DUTCHReified = Reified< DUTCH, DUTCHFields >;
|
|
277
|
+
|
|
278
|
+
export class DUTCH implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::DUTCH"; static readonly $numTypeParams = 0;
|
|
279
|
+
|
|
280
|
+
readonly $typeName = DUTCH.$typeName;
|
|
281
|
+
|
|
282
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::DUTCH";
|
|
283
|
+
|
|
284
|
+
readonly $typeArgs: [];
|
|
285
|
+
|
|
286
|
+
readonly dummyField: ToField<"bool">
|
|
287
|
+
|
|
288
|
+
private constructor(typeArgs: [], fields: DUTCHFields, ) { this.$fullTypeName = composeSuiType( DUTCH.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::DUTCH"; this.$typeArgs = typeArgs;
|
|
289
|
+
|
|
290
|
+
this.dummyField = fields.dummyField; }
|
|
291
|
+
|
|
292
|
+
static reified( ): DUTCHReified { return { typeName: DUTCH.$typeName, fullTypeName: composeSuiType( DUTCH.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::DUTCH", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => DUTCH.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => DUTCH.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => DUTCH.fromBcs( data, ), bcs: DUTCH.bcs, fromJSONField: (field: any) => DUTCH.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => DUTCH.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => DUTCH.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => DUTCH.fetch( client, id, ), new: ( fields: DUTCHFields, ) => { return new DUTCH( [], fields ) }, kind: "StructClassReified", } }
|
|
293
|
+
|
|
294
|
+
static get r() { return DUTCH.reified() }
|
|
295
|
+
|
|
296
|
+
static phantom( ): PhantomReified<ToTypeStr<DUTCH>> { return phantom(DUTCH.reified( )); } static get p() { return DUTCH.phantom() }
|
|
297
|
+
|
|
298
|
+
static get bcs() { return bcs.struct("DUTCH", {
|
|
299
|
+
|
|
300
|
+
dummy_field: bcs.bool()
|
|
301
|
+
|
|
302
|
+
}) };
|
|
303
|
+
|
|
304
|
+
static fromFields( fields: Record<string, any> ): DUTCH { return DUTCH.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
305
|
+
|
|
306
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): DUTCH { if (!isDUTCH(item.type)) { throw new Error("not a DUTCH type");
|
|
307
|
+
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return DUTCH.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
311
|
+
|
|
312
|
+
static fromBcs( data: Uint8Array ): DUTCH { return DUTCH.fromFields( DUTCH.bcs.parse(data) ) }
|
|
313
|
+
|
|
314
|
+
toJSONField() { return {
|
|
315
|
+
|
|
316
|
+
dummyField: this.dummyField,
|
|
317
|
+
|
|
318
|
+
} }
|
|
319
|
+
|
|
320
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
321
|
+
|
|
322
|
+
static fromJSONField( field: any ): DUTCH { return DUTCH.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
323
|
+
|
|
324
|
+
static fromJSON( json: Record<string, any> ): DUTCH { if (json.$typeName !== DUTCH.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
325
|
+
|
|
326
|
+
return DUTCH.fromJSONField( json, ) }
|
|
327
|
+
|
|
328
|
+
static fromSuiParsedData( content: SuiParsedData ): DUTCH { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isDUTCH(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a DUTCH object`); } return DUTCH.fromFieldsWithTypes( content ); }
|
|
329
|
+
|
|
330
|
+
static async fetch( client: SuiClient, id: string ): Promise<DUTCH> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching DUTCH object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isDUTCH(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a DUTCH object`); }
|
|
331
|
+
return DUTCH.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
332
|
+
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* ============================== NewBid =============================== */
|
|
336
|
+
|
|
337
|
+
export function isNewBid(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::NewBid"; }
|
|
338
|
+
|
|
339
|
+
export interface NewBidFields { signer: ToField<"address">; index: ToField<"u64">; token: ToField<TypeName>; bidIndex: ToField<"u64">; price: ToField<"u64">; size: ToField<"u64">; bidderBalance: ToField<"u64">; incentiveBalance: ToField<"u64">; tsMs: ToField<"u64"> }
|
|
340
|
+
|
|
341
|
+
export type NewBidReified = Reified< NewBid, NewBidFields >;
|
|
342
|
+
|
|
343
|
+
export class NewBid implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::NewBid"; static readonly $numTypeParams = 0;
|
|
344
|
+
|
|
345
|
+
readonly $typeName = NewBid.$typeName;
|
|
346
|
+
|
|
347
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::NewBid";
|
|
348
|
+
|
|
349
|
+
readonly $typeArgs: [];
|
|
350
|
+
|
|
351
|
+
readonly signer: ToField<"address">; readonly index: ToField<"u64">; readonly token: ToField<TypeName>; readonly bidIndex: ToField<"u64">; readonly price: ToField<"u64">; readonly size: ToField<"u64">; readonly bidderBalance: ToField<"u64">; readonly incentiveBalance: ToField<"u64">; readonly tsMs: ToField<"u64">
|
|
352
|
+
|
|
353
|
+
private constructor(typeArgs: [], fields: NewBidFields, ) { this.$fullTypeName = composeSuiType( NewBid.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::NewBid"; this.$typeArgs = typeArgs;
|
|
354
|
+
|
|
355
|
+
this.signer = fields.signer;; this.index = fields.index;; this.token = fields.token;; this.bidIndex = fields.bidIndex;; this.price = fields.price;; this.size = fields.size;; this.bidderBalance = fields.bidderBalance;; this.incentiveBalance = fields.incentiveBalance;; this.tsMs = fields.tsMs; }
|
|
356
|
+
|
|
357
|
+
static reified( ): NewBidReified { return { typeName: NewBid.$typeName, fullTypeName: composeSuiType( NewBid.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::NewBid", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => NewBid.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => NewBid.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => NewBid.fromBcs( data, ), bcs: NewBid.bcs, fromJSONField: (field: any) => NewBid.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => NewBid.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => NewBid.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => NewBid.fetch( client, id, ), new: ( fields: NewBidFields, ) => { return new NewBid( [], fields ) }, kind: "StructClassReified", } }
|
|
358
|
+
|
|
359
|
+
static get r() { return NewBid.reified() }
|
|
360
|
+
|
|
361
|
+
static phantom( ): PhantomReified<ToTypeStr<NewBid>> { return phantom(NewBid.reified( )); } static get p() { return NewBid.phantom() }
|
|
362
|
+
|
|
363
|
+
static get bcs() { return bcs.struct("NewBid", {
|
|
364
|
+
|
|
365
|
+
signer: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), index: bcs.u64(), token: TypeName.bcs, bid_index: bcs.u64(), price: bcs.u64(), size: bcs.u64(), bidder_balance: bcs.u64(), incentive_balance: bcs.u64(), ts_ms: bcs.u64()
|
|
366
|
+
|
|
367
|
+
}) };
|
|
368
|
+
|
|
369
|
+
static fromFields( fields: Record<string, any> ): NewBid { return NewBid.reified( ).new( { signer: decodeFromFields("address", fields.signer), index: decodeFromFields("u64", fields.index), token: decodeFromFields(TypeName.reified(), fields.token), bidIndex: decodeFromFields("u64", fields.bid_index), price: decodeFromFields("u64", fields.price), size: decodeFromFields("u64", fields.size), bidderBalance: decodeFromFields("u64", fields.bidder_balance), incentiveBalance: decodeFromFields("u64", fields.incentive_balance), tsMs: decodeFromFields("u64", fields.ts_ms) } ) }
|
|
370
|
+
|
|
371
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): NewBid { if (!isNewBid(item.type)) { throw new Error("not a NewBid type");
|
|
372
|
+
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return NewBid.reified( ).new( { signer: decodeFromFieldsWithTypes("address", item.fields.signer), index: decodeFromFieldsWithTypes("u64", item.fields.index), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), bidIndex: decodeFromFieldsWithTypes("u64", item.fields.bid_index), price: decodeFromFieldsWithTypes("u64", item.fields.price), size: decodeFromFieldsWithTypes("u64", item.fields.size), bidderBalance: decodeFromFieldsWithTypes("u64", item.fields.bidder_balance), incentiveBalance: decodeFromFieldsWithTypes("u64", item.fields.incentive_balance), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms) } ) }
|
|
376
|
+
|
|
377
|
+
static fromBcs( data: Uint8Array ): NewBid { return NewBid.fromFields( NewBid.bcs.parse(data) ) }
|
|
378
|
+
|
|
379
|
+
toJSONField() { return {
|
|
380
|
+
|
|
381
|
+
signer: this.signer,index: this.index.toString(),token: this.token.toJSONField(),bidIndex: this.bidIndex.toString(),price: this.price.toString(),size: this.size.toString(),bidderBalance: this.bidderBalance.toString(),incentiveBalance: this.incentiveBalance.toString(),tsMs: this.tsMs.toString(),
|
|
382
|
+
|
|
383
|
+
} }
|
|
384
|
+
|
|
385
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
386
|
+
|
|
387
|
+
static fromJSONField( field: any ): NewBid { return NewBid.reified( ).new( { signer: decodeFromJSONField("address", field.signer), index: decodeFromJSONField("u64", field.index), token: decodeFromJSONField(TypeName.reified(), field.token), bidIndex: decodeFromJSONField("u64", field.bidIndex), price: decodeFromJSONField("u64", field.price), size: decodeFromJSONField("u64", field.size), bidderBalance: decodeFromJSONField("u64", field.bidderBalance), incentiveBalance: decodeFromJSONField("u64", field.incentiveBalance), tsMs: decodeFromJSONField("u64", field.tsMs) } ) }
|
|
388
|
+
|
|
389
|
+
static fromJSON( json: Record<string, any> ): NewBid { if (json.$typeName !== NewBid.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
390
|
+
|
|
391
|
+
return NewBid.fromJSONField( json, ) }
|
|
392
|
+
|
|
393
|
+
static fromSuiParsedData( content: SuiParsedData ): NewBid { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isNewBid(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a NewBid object`); } return NewBid.fromFieldsWithTypes( content ); }
|
|
394
|
+
|
|
395
|
+
static async fetch( client: SuiClient, id: string ): Promise<NewBid> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching NewBid object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isNewBid(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a NewBid object`); }
|
|
396
|
+
return NewBid.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
397
|
+
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* ============================== RemoveBid =============================== */
|
|
401
|
+
|
|
402
|
+
export function isRemoveBid(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::RemoveBid"; }
|
|
403
|
+
|
|
404
|
+
export interface RemoveBidFields { signer: ToField<"address">; index: ToField<"u64">; token: ToField<TypeName>; bidIndex: ToField<"u64">; price: ToField<"u64">; size: ToField<"u64">; bidderBalance: ToField<"u64">; incentiveBalance: ToField<"u64">; feeDiscount: ToField<"u64">; tsMs: ToField<"u64"> }
|
|
405
|
+
|
|
406
|
+
export type RemoveBidReified = Reified< RemoveBid, RemoveBidFields >;
|
|
407
|
+
|
|
408
|
+
export class RemoveBid implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::RemoveBid"; static readonly $numTypeParams = 0;
|
|
409
|
+
|
|
410
|
+
readonly $typeName = RemoveBid.$typeName;
|
|
411
|
+
|
|
412
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::RemoveBid";
|
|
413
|
+
|
|
414
|
+
readonly $typeArgs: [];
|
|
415
|
+
|
|
416
|
+
readonly signer: ToField<"address">; readonly index: ToField<"u64">; readonly token: ToField<TypeName>; readonly bidIndex: ToField<"u64">; readonly price: ToField<"u64">; readonly size: ToField<"u64">; readonly bidderBalance: ToField<"u64">; readonly incentiveBalance: ToField<"u64">; readonly feeDiscount: ToField<"u64">; readonly tsMs: ToField<"u64">
|
|
417
|
+
|
|
418
|
+
private constructor(typeArgs: [], fields: RemoveBidFields, ) { this.$fullTypeName = composeSuiType( RemoveBid.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::RemoveBid"; this.$typeArgs = typeArgs;
|
|
419
|
+
|
|
420
|
+
this.signer = fields.signer;; this.index = fields.index;; this.token = fields.token;; this.bidIndex = fields.bidIndex;; this.price = fields.price;; this.size = fields.size;; this.bidderBalance = fields.bidderBalance;; this.incentiveBalance = fields.incentiveBalance;; this.feeDiscount = fields.feeDiscount;; this.tsMs = fields.tsMs; }
|
|
421
|
+
|
|
422
|
+
static reified( ): RemoveBidReified { return { typeName: RemoveBid.$typeName, fullTypeName: composeSuiType( RemoveBid.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::RemoveBid", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => RemoveBid.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => RemoveBid.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => RemoveBid.fromBcs( data, ), bcs: RemoveBid.bcs, fromJSONField: (field: any) => RemoveBid.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => RemoveBid.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => RemoveBid.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => RemoveBid.fetch( client, id, ), new: ( fields: RemoveBidFields, ) => { return new RemoveBid( [], fields ) }, kind: "StructClassReified", } }
|
|
423
|
+
|
|
424
|
+
static get r() { return RemoveBid.reified() }
|
|
425
|
+
|
|
426
|
+
static phantom( ): PhantomReified<ToTypeStr<RemoveBid>> { return phantom(RemoveBid.reified( )); } static get p() { return RemoveBid.phantom() }
|
|
427
|
+
|
|
428
|
+
static get bcs() { return bcs.struct("RemoveBid", {
|
|
429
|
+
|
|
430
|
+
signer: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), index: bcs.u64(), token: TypeName.bcs, bid_index: bcs.u64(), price: bcs.u64(), size: bcs.u64(), bidder_balance: bcs.u64(), incentive_balance: bcs.u64(), fee_discount: bcs.u64(), ts_ms: bcs.u64()
|
|
431
|
+
|
|
432
|
+
}) };
|
|
433
|
+
|
|
434
|
+
static fromFields( fields: Record<string, any> ): RemoveBid { return RemoveBid.reified( ).new( { signer: decodeFromFields("address", fields.signer), index: decodeFromFields("u64", fields.index), token: decodeFromFields(TypeName.reified(), fields.token), bidIndex: decodeFromFields("u64", fields.bid_index), price: decodeFromFields("u64", fields.price), size: decodeFromFields("u64", fields.size), bidderBalance: decodeFromFields("u64", fields.bidder_balance), incentiveBalance: decodeFromFields("u64", fields.incentive_balance), feeDiscount: decodeFromFields("u64", fields.fee_discount), tsMs: decodeFromFields("u64", fields.ts_ms) } ) }
|
|
435
|
+
|
|
436
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): RemoveBid { if (!isRemoveBid(item.type)) { throw new Error("not a RemoveBid type");
|
|
437
|
+
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return RemoveBid.reified( ).new( { signer: decodeFromFieldsWithTypes("address", item.fields.signer), index: decodeFromFieldsWithTypes("u64", item.fields.index), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), bidIndex: decodeFromFieldsWithTypes("u64", item.fields.bid_index), price: decodeFromFieldsWithTypes("u64", item.fields.price), size: decodeFromFieldsWithTypes("u64", item.fields.size), bidderBalance: decodeFromFieldsWithTypes("u64", item.fields.bidder_balance), incentiveBalance: decodeFromFieldsWithTypes("u64", item.fields.incentive_balance), feeDiscount: decodeFromFieldsWithTypes("u64", item.fields.fee_discount), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms) } ) }
|
|
441
|
+
|
|
442
|
+
static fromBcs( data: Uint8Array ): RemoveBid { return RemoveBid.fromFields( RemoveBid.bcs.parse(data) ) }
|
|
443
|
+
|
|
444
|
+
toJSONField() { return {
|
|
445
|
+
|
|
446
|
+
signer: this.signer,index: this.index.toString(),token: this.token.toJSONField(),bidIndex: this.bidIndex.toString(),price: this.price.toString(),size: this.size.toString(),bidderBalance: this.bidderBalance.toString(),incentiveBalance: this.incentiveBalance.toString(),feeDiscount: this.feeDiscount.toString(),tsMs: this.tsMs.toString(),
|
|
447
|
+
|
|
448
|
+
} }
|
|
449
|
+
|
|
450
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
451
|
+
|
|
452
|
+
static fromJSONField( field: any ): RemoveBid { return RemoveBid.reified( ).new( { signer: decodeFromJSONField("address", field.signer), index: decodeFromJSONField("u64", field.index), token: decodeFromJSONField(TypeName.reified(), field.token), bidIndex: decodeFromJSONField("u64", field.bidIndex), price: decodeFromJSONField("u64", field.price), size: decodeFromJSONField("u64", field.size), bidderBalance: decodeFromJSONField("u64", field.bidderBalance), incentiveBalance: decodeFromJSONField("u64", field.incentiveBalance), feeDiscount: decodeFromJSONField("u64", field.feeDiscount), tsMs: decodeFromJSONField("u64", field.tsMs) } ) }
|
|
453
|
+
|
|
454
|
+
static fromJSON( json: Record<string, any> ): RemoveBid { if (json.$typeName !== RemoveBid.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
455
|
+
|
|
456
|
+
return RemoveBid.fromJSONField( json, ) }
|
|
457
|
+
|
|
458
|
+
static fromSuiParsedData( content: SuiParsedData ): RemoveBid { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isRemoveBid(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a RemoveBid object`); } return RemoveBid.fromFieldsWithTypes( content ); }
|
|
459
|
+
|
|
460
|
+
static async fetch( client: SuiClient, id: string ): Promise<RemoveBid> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching RemoveBid object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isRemoveBid(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a RemoveBid object`); }
|
|
461
|
+
return RemoveBid.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
462
|
+
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/* ============================== UpdateAuctionConfig =============================== */
|
|
466
|
+
|
|
467
|
+
export function isUpdateAuctionConfig(type: string): boolean { type = compressSuiType(type); return type === "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::UpdateAuctionConfig"; }
|
|
468
|
+
|
|
469
|
+
export interface UpdateAuctionConfigFields { signer: ToField<"address">; index: ToField<"u64">; prevStartTsMs: ToField<"u64">; prevEndTsMs: ToField<"u64">; prevDecaySpeed: ToField<"u64">; prevInitialPrice: ToField<"u64">; prevFinalPrice: ToField<"u64">; prevFeeBp: ToField<"u64">; prevIncentiveBp: ToField<"u64">; prevTokenDecimal: ToField<"u64">; prevSizeDecimal: ToField<"u64">; prevAbleToRemoveBid: ToField<"bool">; startTsMs: ToField<"u64">; endTsMs: ToField<"u64">; decaySpeed: ToField<"u64">; initialPrice: ToField<"u64">; finalPrice: ToField<"u64">; feeBp: ToField<"u64">; incentiveBp: ToField<"u64">; tokenDecimal: ToField<"u64">; sizeDecimal: ToField<"u64">; ableToRemoveBid: ToField<"bool"> }
|
|
470
|
+
|
|
471
|
+
export type UpdateAuctionConfigReified = Reified< UpdateAuctionConfig, UpdateAuctionConfigFields >;
|
|
472
|
+
|
|
473
|
+
export class UpdateAuctionConfig implements StructClass { static readonly $typeName = "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::UpdateAuctionConfig"; static readonly $numTypeParams = 0;
|
|
474
|
+
|
|
475
|
+
readonly $typeName = UpdateAuctionConfig.$typeName;
|
|
476
|
+
|
|
477
|
+
readonly $fullTypeName: "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::UpdateAuctionConfig";
|
|
478
|
+
|
|
479
|
+
readonly $typeArgs: [];
|
|
480
|
+
|
|
481
|
+
readonly signer: ToField<"address">; readonly index: ToField<"u64">; readonly prevStartTsMs: ToField<"u64">; readonly prevEndTsMs: ToField<"u64">; readonly prevDecaySpeed: ToField<"u64">; readonly prevInitialPrice: ToField<"u64">; readonly prevFinalPrice: ToField<"u64">; readonly prevFeeBp: ToField<"u64">; readonly prevIncentiveBp: ToField<"u64">; readonly prevTokenDecimal: ToField<"u64">; readonly prevSizeDecimal: ToField<"u64">; readonly prevAbleToRemoveBid: ToField<"bool">; readonly startTsMs: ToField<"u64">; readonly endTsMs: ToField<"u64">; readonly decaySpeed: ToField<"u64">; readonly initialPrice: ToField<"u64">; readonly finalPrice: ToField<"u64">; readonly feeBp: ToField<"u64">; readonly incentiveBp: ToField<"u64">; readonly tokenDecimal: ToField<"u64">; readonly sizeDecimal: ToField<"u64">; readonly ableToRemoveBid: ToField<"bool">
|
|
482
|
+
|
|
483
|
+
private constructor(typeArgs: [], fields: UpdateAuctionConfigFields, ) { this.$fullTypeName = composeSuiType( UpdateAuctionConfig.$typeName, ...typeArgs ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::UpdateAuctionConfig"; this.$typeArgs = typeArgs;
|
|
484
|
+
|
|
485
|
+
this.signer = fields.signer;; this.index = fields.index;; this.prevStartTsMs = fields.prevStartTsMs;; this.prevEndTsMs = fields.prevEndTsMs;; this.prevDecaySpeed = fields.prevDecaySpeed;; this.prevInitialPrice = fields.prevInitialPrice;; this.prevFinalPrice = fields.prevFinalPrice;; this.prevFeeBp = fields.prevFeeBp;; this.prevIncentiveBp = fields.prevIncentiveBp;; this.prevTokenDecimal = fields.prevTokenDecimal;; this.prevSizeDecimal = fields.prevSizeDecimal;; this.prevAbleToRemoveBid = fields.prevAbleToRemoveBid;; this.startTsMs = fields.startTsMs;; this.endTsMs = fields.endTsMs;; this.decaySpeed = fields.decaySpeed;; this.initialPrice = fields.initialPrice;; this.finalPrice = fields.finalPrice;; this.feeBp = fields.feeBp;; this.incentiveBp = fields.incentiveBp;; this.tokenDecimal = fields.tokenDecimal;; this.sizeDecimal = fields.sizeDecimal;; this.ableToRemoveBid = fields.ableToRemoveBid; }
|
|
486
|
+
|
|
487
|
+
static reified( ): UpdateAuctionConfigReified { return { typeName: UpdateAuctionConfig.$typeName, fullTypeName: composeSuiType( UpdateAuctionConfig.$typeName, ...[] ) as "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded::dutch::UpdateAuctionConfig", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => UpdateAuctionConfig.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => UpdateAuctionConfig.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => UpdateAuctionConfig.fromBcs( data, ), bcs: UpdateAuctionConfig.bcs, fromJSONField: (field: any) => UpdateAuctionConfig.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => UpdateAuctionConfig.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => UpdateAuctionConfig.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => UpdateAuctionConfig.fetch( client, id, ), new: ( fields: UpdateAuctionConfigFields, ) => { return new UpdateAuctionConfig( [], fields ) }, kind: "StructClassReified", } }
|
|
488
|
+
|
|
489
|
+
static get r() { return UpdateAuctionConfig.reified() }
|
|
490
|
+
|
|
491
|
+
static phantom( ): PhantomReified<ToTypeStr<UpdateAuctionConfig>> { return phantom(UpdateAuctionConfig.reified( )); } static get p() { return UpdateAuctionConfig.phantom() }
|
|
492
|
+
|
|
493
|
+
static get bcs() { return bcs.struct("UpdateAuctionConfig", {
|
|
494
|
+
|
|
495
|
+
signer: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), index: bcs.u64(), prev_start_ts_ms: bcs.u64(), prev_end_ts_ms: bcs.u64(), prev_decay_speed: bcs.u64(), prev_initial_price: bcs.u64(), prev_final_price: bcs.u64(), prev_fee_bp: bcs.u64(), prev_incentive_bp: bcs.u64(), prev_token_decimal: bcs.u64(), prev_size_decimal: bcs.u64(), prev_able_to_remove_bid: bcs.bool(), start_ts_ms: bcs.u64(), end_ts_ms: bcs.u64(), decay_speed: bcs.u64(), initial_price: bcs.u64(), final_price: bcs.u64(), fee_bp: bcs.u64(), incentive_bp: bcs.u64(), token_decimal: bcs.u64(), size_decimal: bcs.u64(), able_to_remove_bid: bcs.bool()
|
|
496
|
+
|
|
497
|
+
}) };
|
|
498
|
+
|
|
499
|
+
static fromFields( fields: Record<string, any> ): UpdateAuctionConfig { return UpdateAuctionConfig.reified( ).new( { signer: decodeFromFields("address", fields.signer), index: decodeFromFields("u64", fields.index), prevStartTsMs: decodeFromFields("u64", fields.prev_start_ts_ms), prevEndTsMs: decodeFromFields("u64", fields.prev_end_ts_ms), prevDecaySpeed: decodeFromFields("u64", fields.prev_decay_speed), prevInitialPrice: decodeFromFields("u64", fields.prev_initial_price), prevFinalPrice: decodeFromFields("u64", fields.prev_final_price), prevFeeBp: decodeFromFields("u64", fields.prev_fee_bp), prevIncentiveBp: decodeFromFields("u64", fields.prev_incentive_bp), prevTokenDecimal: decodeFromFields("u64", fields.prev_token_decimal), prevSizeDecimal: decodeFromFields("u64", fields.prev_size_decimal), prevAbleToRemoveBid: decodeFromFields("bool", fields.prev_able_to_remove_bid), startTsMs: decodeFromFields("u64", fields.start_ts_ms), endTsMs: decodeFromFields("u64", fields.end_ts_ms), decaySpeed: decodeFromFields("u64", fields.decay_speed), initialPrice: decodeFromFields("u64", fields.initial_price), finalPrice: decodeFromFields("u64", fields.final_price), feeBp: decodeFromFields("u64", fields.fee_bp), incentiveBp: decodeFromFields("u64", fields.incentive_bp), tokenDecimal: decodeFromFields("u64", fields.token_decimal), sizeDecimal: decodeFromFields("u64", fields.size_decimal), ableToRemoveBid: decodeFromFields("bool", fields.able_to_remove_bid) } ) }
|
|
500
|
+
|
|
501
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): UpdateAuctionConfig { if (!isUpdateAuctionConfig(item.type)) { throw new Error("not a UpdateAuctionConfig type");
|
|
502
|
+
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
return UpdateAuctionConfig.reified( ).new( { signer: decodeFromFieldsWithTypes("address", item.fields.signer), index: decodeFromFieldsWithTypes("u64", item.fields.index), prevStartTsMs: decodeFromFieldsWithTypes("u64", item.fields.prev_start_ts_ms), prevEndTsMs: decodeFromFieldsWithTypes("u64", item.fields.prev_end_ts_ms), prevDecaySpeed: decodeFromFieldsWithTypes("u64", item.fields.prev_decay_speed), prevInitialPrice: decodeFromFieldsWithTypes("u64", item.fields.prev_initial_price), prevFinalPrice: decodeFromFieldsWithTypes("u64", item.fields.prev_final_price), prevFeeBp: decodeFromFieldsWithTypes("u64", item.fields.prev_fee_bp), prevIncentiveBp: decodeFromFieldsWithTypes("u64", item.fields.prev_incentive_bp), prevTokenDecimal: decodeFromFieldsWithTypes("u64", item.fields.prev_token_decimal), prevSizeDecimal: decodeFromFieldsWithTypes("u64", item.fields.prev_size_decimal), prevAbleToRemoveBid: decodeFromFieldsWithTypes("bool", item.fields.prev_able_to_remove_bid), startTsMs: decodeFromFieldsWithTypes("u64", item.fields.start_ts_ms), endTsMs: decodeFromFieldsWithTypes("u64", item.fields.end_ts_ms), decaySpeed: decodeFromFieldsWithTypes("u64", item.fields.decay_speed), initialPrice: decodeFromFieldsWithTypes("u64", item.fields.initial_price), finalPrice: decodeFromFieldsWithTypes("u64", item.fields.final_price), feeBp: decodeFromFieldsWithTypes("u64", item.fields.fee_bp), incentiveBp: decodeFromFieldsWithTypes("u64", item.fields.incentive_bp), tokenDecimal: decodeFromFieldsWithTypes("u64", item.fields.token_decimal), sizeDecimal: decodeFromFieldsWithTypes("u64", item.fields.size_decimal), ableToRemoveBid: decodeFromFieldsWithTypes("bool", item.fields.able_to_remove_bid) } ) }
|
|
506
|
+
|
|
507
|
+
static fromBcs( data: Uint8Array ): UpdateAuctionConfig { return UpdateAuctionConfig.fromFields( UpdateAuctionConfig.bcs.parse(data) ) }
|
|
508
|
+
|
|
509
|
+
toJSONField() { return {
|
|
510
|
+
|
|
511
|
+
signer: this.signer,index: this.index.toString(),prevStartTsMs: this.prevStartTsMs.toString(),prevEndTsMs: this.prevEndTsMs.toString(),prevDecaySpeed: this.prevDecaySpeed.toString(),prevInitialPrice: this.prevInitialPrice.toString(),prevFinalPrice: this.prevFinalPrice.toString(),prevFeeBp: this.prevFeeBp.toString(),prevIncentiveBp: this.prevIncentiveBp.toString(),prevTokenDecimal: this.prevTokenDecimal.toString(),prevSizeDecimal: this.prevSizeDecimal.toString(),prevAbleToRemoveBid: this.prevAbleToRemoveBid,startTsMs: this.startTsMs.toString(),endTsMs: this.endTsMs.toString(),decaySpeed: this.decaySpeed.toString(),initialPrice: this.initialPrice.toString(),finalPrice: this.finalPrice.toString(),feeBp: this.feeBp.toString(),incentiveBp: this.incentiveBp.toString(),tokenDecimal: this.tokenDecimal.toString(),sizeDecimal: this.sizeDecimal.toString(),ableToRemoveBid: this.ableToRemoveBid,
|
|
512
|
+
|
|
513
|
+
} }
|
|
514
|
+
|
|
515
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
516
|
+
|
|
517
|
+
static fromJSONField( field: any ): UpdateAuctionConfig { return UpdateAuctionConfig.reified( ).new( { signer: decodeFromJSONField("address", field.signer), index: decodeFromJSONField("u64", field.index), prevStartTsMs: decodeFromJSONField("u64", field.prevStartTsMs), prevEndTsMs: decodeFromJSONField("u64", field.prevEndTsMs), prevDecaySpeed: decodeFromJSONField("u64", field.prevDecaySpeed), prevInitialPrice: decodeFromJSONField("u64", field.prevInitialPrice), prevFinalPrice: decodeFromJSONField("u64", field.prevFinalPrice), prevFeeBp: decodeFromJSONField("u64", field.prevFeeBp), prevIncentiveBp: decodeFromJSONField("u64", field.prevIncentiveBp), prevTokenDecimal: decodeFromJSONField("u64", field.prevTokenDecimal), prevSizeDecimal: decodeFromJSONField("u64", field.prevSizeDecimal), prevAbleToRemoveBid: decodeFromJSONField("bool", field.prevAbleToRemoveBid), startTsMs: decodeFromJSONField("u64", field.startTsMs), endTsMs: decodeFromJSONField("u64", field.endTsMs), decaySpeed: decodeFromJSONField("u64", field.decaySpeed), initialPrice: decodeFromJSONField("u64", field.initialPrice), finalPrice: decodeFromJSONField("u64", field.finalPrice), feeBp: decodeFromJSONField("u64", field.feeBp), incentiveBp: decodeFromJSONField("u64", field.incentiveBp), tokenDecimal: decodeFromJSONField("u64", field.tokenDecimal), sizeDecimal: decodeFromJSONField("u64", field.sizeDecimal), ableToRemoveBid: decodeFromJSONField("bool", field.ableToRemoveBid) } ) }
|
|
518
|
+
|
|
519
|
+
static fromJSON( json: Record<string, any> ): UpdateAuctionConfig { if (json.$typeName !== UpdateAuctionConfig.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
520
|
+
|
|
521
|
+
return UpdateAuctionConfig.fromJSONField( json, ) }
|
|
522
|
+
|
|
523
|
+
static fromSuiParsedData( content: SuiParsedData ): UpdateAuctionConfig { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUpdateAuctionConfig(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a UpdateAuctionConfig object`); } return UpdateAuctionConfig.fromFieldsWithTypes( content ); }
|
|
524
|
+
|
|
525
|
+
static async fetch( client: SuiClient, id: string ): Promise<UpdateAuctionConfig> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching UpdateAuctionConfig object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUpdateAuctionConfig(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a UpdateAuctionConfig object`); }
|
|
526
|
+
return UpdateAuctionConfig.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
527
|
+
|
|
528
|
+
}
|