@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,69 @@
|
|
|
1
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom} from "../../../../_framework/reified";
|
|
2
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
3
|
+
import {bcs, fromB64} from "@mysten/bcs";
|
|
4
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
5
|
+
|
|
6
|
+
/* ============================== PriceData =============================== */
|
|
7
|
+
|
|
8
|
+
export function isPriceData(type: string): boolean { type = compressSuiType(type); return type === "0x2c64e2d3eb17daa7d2652e90957c21e8664418aa41092ddd4734fb6d6c61a133::price_data_pull::PriceData"; }
|
|
9
|
+
|
|
10
|
+
export interface PriceDataFields { dummyField: ToField<"bool"> }
|
|
11
|
+
|
|
12
|
+
export type PriceDataReified = Reified< PriceData, PriceDataFields >;
|
|
13
|
+
|
|
14
|
+
export class PriceData implements StructClass { static readonly $typeName = "0x2c64e2d3eb17daa7d2652e90957c21e8664418aa41092ddd4734fb6d6c61a133::price_data_pull::PriceData"; static readonly $numTypeParams = 0;
|
|
15
|
+
|
|
16
|
+
readonly $typeName = PriceData.$typeName;
|
|
17
|
+
|
|
18
|
+
readonly $fullTypeName: "0x2c64e2d3eb17daa7d2652e90957c21e8664418aa41092ddd4734fb6d6c61a133::price_data_pull::PriceData";
|
|
19
|
+
|
|
20
|
+
readonly $typeArgs: [];
|
|
21
|
+
|
|
22
|
+
readonly dummyField: ToField<"bool">
|
|
23
|
+
|
|
24
|
+
private constructor(typeArgs: [], fields: PriceDataFields, ) { this.$fullTypeName = composeSuiType( PriceData.$typeName, ...typeArgs ) as "0x2c64e2d3eb17daa7d2652e90957c21e8664418aa41092ddd4734fb6d6c61a133::price_data_pull::PriceData"; this.$typeArgs = typeArgs;
|
|
25
|
+
|
|
26
|
+
this.dummyField = fields.dummyField; }
|
|
27
|
+
|
|
28
|
+
static reified( ): PriceDataReified { return { typeName: PriceData.$typeName, fullTypeName: composeSuiType( PriceData.$typeName, ...[] ) as "0x2c64e2d3eb17daa7d2652e90957c21e8664418aa41092ddd4734fb6d6c61a133::price_data_pull::PriceData", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PriceData.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PriceData.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PriceData.fromBcs( data, ), bcs: PriceData.bcs, fromJSONField: (field: any) => PriceData.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PriceData.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PriceData.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PriceData.fetch( client, id, ), new: ( fields: PriceDataFields, ) => { return new PriceData( [], fields ) }, kind: "StructClassReified", } }
|
|
29
|
+
|
|
30
|
+
static get r() { return PriceData.reified() }
|
|
31
|
+
|
|
32
|
+
static phantom( ): PhantomReified<ToTypeStr<PriceData>> { return phantom(PriceData.reified( )); } static get p() { return PriceData.phantom() }
|
|
33
|
+
|
|
34
|
+
static get bcs() { return bcs.struct("PriceData", {
|
|
35
|
+
|
|
36
|
+
dummy_field: bcs.bool()
|
|
37
|
+
|
|
38
|
+
}) };
|
|
39
|
+
|
|
40
|
+
static fromFields( fields: Record<string, any> ): PriceData { return PriceData.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
41
|
+
|
|
42
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PriceData { if (!isPriceData(item.type)) { throw new Error("not a PriceData type");
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return PriceData.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
47
|
+
|
|
48
|
+
static fromBcs( data: Uint8Array ): PriceData { return PriceData.fromFields( PriceData.bcs.parse(data) ) }
|
|
49
|
+
|
|
50
|
+
toJSONField() { return {
|
|
51
|
+
|
|
52
|
+
dummyField: this.dummyField,
|
|
53
|
+
|
|
54
|
+
} }
|
|
55
|
+
|
|
56
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
57
|
+
|
|
58
|
+
static fromJSONField( field: any ): PriceData { return PriceData.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
59
|
+
|
|
60
|
+
static fromJSON( json: Record<string, any> ): PriceData { if (json.$typeName !== PriceData.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
61
|
+
|
|
62
|
+
return PriceData.fromJSONField( json, ) }
|
|
63
|
+
|
|
64
|
+
static fromSuiParsedData( content: SuiParsedData ): PriceData { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPriceData(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PriceData object`); } return PriceData.fromFieldsWithTypes( content ); }
|
|
65
|
+
|
|
66
|
+
static async fetch( client: SuiClient, id: string ): Promise<PriceData> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PriceData object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPriceData(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PriceData object`); }
|
|
67
|
+
return PriceData.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom} from "../../../../_framework/reified";
|
|
2
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
3
|
+
import {UID} from "../../0x2/object/structs";
|
|
4
|
+
import {bcs, fromB64} from "@mysten/bcs";
|
|
5
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
6
|
+
|
|
7
|
+
/* ============================== Price =============================== */
|
|
8
|
+
|
|
9
|
+
export function isPrice(type: string): boolean { type = compressSuiType(type); return type === "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::Price"; }
|
|
10
|
+
|
|
11
|
+
export interface PriceFields { pair: ToField<"u32">; value: ToField<"u128">; decimal: ToField<"u16">; timestamp: ToField<"u128">; round: ToField<"u64"> }
|
|
12
|
+
|
|
13
|
+
export type PriceReified = Reified< Price, PriceFields >;
|
|
14
|
+
|
|
15
|
+
export class Price implements StructClass { static readonly $typeName = "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::Price"; static readonly $numTypeParams = 0;
|
|
16
|
+
|
|
17
|
+
readonly $typeName = Price.$typeName;
|
|
18
|
+
|
|
19
|
+
readonly $fullTypeName: "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::Price";
|
|
20
|
+
|
|
21
|
+
readonly $typeArgs: [];
|
|
22
|
+
|
|
23
|
+
readonly pair: ToField<"u32">; readonly value: ToField<"u128">; readonly decimal: ToField<"u16">; readonly timestamp: ToField<"u128">; readonly round: ToField<"u64">
|
|
24
|
+
|
|
25
|
+
private constructor(typeArgs: [], fields: PriceFields, ) { this.$fullTypeName = composeSuiType( Price.$typeName, ...typeArgs ) as "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::Price"; this.$typeArgs = typeArgs;
|
|
26
|
+
|
|
27
|
+
this.pair = fields.pair;; this.value = fields.value;; this.decimal = fields.decimal;; this.timestamp = fields.timestamp;; this.round = fields.round; }
|
|
28
|
+
|
|
29
|
+
static reified( ): PriceReified { return { typeName: Price.$typeName, fullTypeName: composeSuiType( Price.$typeName, ...[] ) as "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::Price", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Price.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Price.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Price.fromBcs( data, ), bcs: Price.bcs, fromJSONField: (field: any) => Price.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Price.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Price.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Price.fetch( client, id, ), new: ( fields: PriceFields, ) => { return new Price( [], fields ) }, kind: "StructClassReified", } }
|
|
30
|
+
|
|
31
|
+
static get r() { return Price.reified() }
|
|
32
|
+
|
|
33
|
+
static phantom( ): PhantomReified<ToTypeStr<Price>> { return phantom(Price.reified( )); } static get p() { return Price.phantom() }
|
|
34
|
+
|
|
35
|
+
static get bcs() { return bcs.struct("Price", {
|
|
36
|
+
|
|
37
|
+
pair: bcs.u32(), value: bcs.u128(), decimal: bcs.u16(), timestamp: bcs.u128(), round: bcs.u64()
|
|
38
|
+
|
|
39
|
+
}) };
|
|
40
|
+
|
|
41
|
+
static fromFields( fields: Record<string, any> ): Price { return Price.reified( ).new( { pair: decodeFromFields("u32", fields.pair), value: decodeFromFields("u128", fields.value), decimal: decodeFromFields("u16", fields.decimal), timestamp: decodeFromFields("u128", fields.timestamp), round: decodeFromFields("u64", fields.round) } ) }
|
|
42
|
+
|
|
43
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Price { if (!isPrice(item.type)) { throw new Error("not a Price type");
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return Price.reified( ).new( { pair: decodeFromFieldsWithTypes("u32", item.fields.pair), value: decodeFromFieldsWithTypes("u128", item.fields.value), decimal: decodeFromFieldsWithTypes("u16", item.fields.decimal), timestamp: decodeFromFieldsWithTypes("u128", item.fields.timestamp), round: decodeFromFieldsWithTypes("u64", item.fields.round) } ) }
|
|
48
|
+
|
|
49
|
+
static fromBcs( data: Uint8Array ): Price { return Price.fromFields( Price.bcs.parse(data) ) }
|
|
50
|
+
|
|
51
|
+
toJSONField() { return {
|
|
52
|
+
|
|
53
|
+
pair: this.pair,value: this.value.toString(),decimal: this.decimal,timestamp: this.timestamp.toString(),round: this.round.toString(),
|
|
54
|
+
|
|
55
|
+
} }
|
|
56
|
+
|
|
57
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
58
|
+
|
|
59
|
+
static fromJSONField( field: any ): Price { return Price.reified( ).new( { pair: decodeFromJSONField("u32", field.pair), value: decodeFromJSONField("u128", field.value), decimal: decodeFromJSONField("u16", field.decimal), timestamp: decodeFromJSONField("u128", field.timestamp), round: decodeFromJSONField("u64", field.round) } ) }
|
|
60
|
+
|
|
61
|
+
static fromJSON( json: Record<string, any> ): Price { if (json.$typeName !== Price.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
62
|
+
|
|
63
|
+
return Price.fromJSONField( json, ) }
|
|
64
|
+
|
|
65
|
+
static fromSuiParsedData( content: SuiParsedData ): Price { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPrice(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Price object`); } return Price.fromFieldsWithTypes( content ); }
|
|
66
|
+
|
|
67
|
+
static async fetch( client: SuiClient, id: string ): Promise<Price> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Price object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPrice(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Price object`); }
|
|
68
|
+
return Price.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ============================== OracleHolder =============================== */
|
|
73
|
+
|
|
74
|
+
export function isOracleHolder(type: string): boolean { type = compressSuiType(type); return type === "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::OracleHolder"; }
|
|
75
|
+
|
|
76
|
+
export interface OracleHolderFields { id: ToField<UID> }
|
|
77
|
+
|
|
78
|
+
export type OracleHolderReified = Reified< OracleHolder, OracleHolderFields >;
|
|
79
|
+
|
|
80
|
+
export class OracleHolder implements StructClass { static readonly $typeName = "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::OracleHolder"; static readonly $numTypeParams = 0;
|
|
81
|
+
|
|
82
|
+
readonly $typeName = OracleHolder.$typeName;
|
|
83
|
+
|
|
84
|
+
readonly $fullTypeName: "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::OracleHolder";
|
|
85
|
+
|
|
86
|
+
readonly $typeArgs: [];
|
|
87
|
+
|
|
88
|
+
readonly id: ToField<UID>
|
|
89
|
+
|
|
90
|
+
private constructor(typeArgs: [], fields: OracleHolderFields, ) { this.$fullTypeName = composeSuiType( OracleHolder.$typeName, ...typeArgs ) as "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::OracleHolder"; this.$typeArgs = typeArgs;
|
|
91
|
+
|
|
92
|
+
this.id = fields.id; }
|
|
93
|
+
|
|
94
|
+
static reified( ): OracleHolderReified { return { typeName: OracleHolder.$typeName, fullTypeName: composeSuiType( OracleHolder.$typeName, ...[] ) as "0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a::SupraSValueFeed::OracleHolder", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => OracleHolder.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => OracleHolder.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => OracleHolder.fromBcs( data, ), bcs: OracleHolder.bcs, fromJSONField: (field: any) => OracleHolder.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => OracleHolder.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => OracleHolder.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => OracleHolder.fetch( client, id, ), new: ( fields: OracleHolderFields, ) => { return new OracleHolder( [], fields ) }, kind: "StructClassReified", } }
|
|
95
|
+
|
|
96
|
+
static get r() { return OracleHolder.reified() }
|
|
97
|
+
|
|
98
|
+
static phantom( ): PhantomReified<ToTypeStr<OracleHolder>> { return phantom(OracleHolder.reified( )); } static get p() { return OracleHolder.phantom() }
|
|
99
|
+
|
|
100
|
+
static get bcs() { return bcs.struct("OracleHolder", {
|
|
101
|
+
|
|
102
|
+
id: UID.bcs
|
|
103
|
+
|
|
104
|
+
}) };
|
|
105
|
+
|
|
106
|
+
static fromFields( fields: Record<string, any> ): OracleHolder { return OracleHolder.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id) } ) }
|
|
107
|
+
|
|
108
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): OracleHolder { if (!isOracleHolder(item.type)) { throw new Error("not a OracleHolder type");
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return OracleHolder.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id) } ) }
|
|
113
|
+
|
|
114
|
+
static fromBcs( data: Uint8Array ): OracleHolder { return OracleHolder.fromFields( OracleHolder.bcs.parse(data) ) }
|
|
115
|
+
|
|
116
|
+
toJSONField() { return {
|
|
117
|
+
|
|
118
|
+
id: this.id,
|
|
119
|
+
|
|
120
|
+
} }
|
|
121
|
+
|
|
122
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
123
|
+
|
|
124
|
+
static fromJSONField( field: any ): OracleHolder { return OracleHolder.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id) } ) }
|
|
125
|
+
|
|
126
|
+
static fromJSON( json: Record<string, any> ): OracleHolder { if (json.$typeName !== OracleHolder.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
127
|
+
|
|
128
|
+
return OracleHolder.fromJSONField( json, ) }
|
|
129
|
+
|
|
130
|
+
static fromSuiParsedData( content: SuiParsedData ): OracleHolder { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isOracleHolder(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a OracleHolder object`); } return OracleHolder.fromFieldsWithTypes( content ); }
|
|
131
|
+
|
|
132
|
+
static async fetch( client: SuiClient, id: string ): Promise<OracleHolder> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching OracleHolder object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isOracleHolder(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a OracleHolder object`); }
|
|
133
|
+
return OracleHolder.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
134
|
+
|
|
135
|
+
}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import {PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr, Vector, assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom} from "../../../../_framework/reified";
|
|
3
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
4
|
+
import {String} from "../../0x1/ascii/structs";
|
|
5
|
+
import {TypeName} from "../../0x1/type-name/structs";
|
|
6
|
+
import {Balance} from "../../0x2/balance/structs";
|
|
7
|
+
import {UID} from "../../0x2/object/structs";
|
|
8
|
+
import {BigVector} from "../big-vector/structs";
|
|
9
|
+
import {bcs, fromB64, fromHEX, toHEX} from "@mysten/bcs";
|
|
10
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
11
|
+
|
|
12
|
+
/* ============================== Airdrop =============================== */
|
|
13
|
+
|
|
14
|
+
export function isAirdrop(type: string): boolean { type = compressSuiType(type); return type === "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::Airdrop"; }
|
|
15
|
+
|
|
16
|
+
export interface AirdropFields { user: ToField<"address">; value: ToField<"u64"> }
|
|
17
|
+
|
|
18
|
+
export type AirdropReified = Reified< Airdrop, AirdropFields >;
|
|
19
|
+
|
|
20
|
+
export class Airdrop implements StructClass { static readonly $typeName = "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::Airdrop"; static readonly $numTypeParams = 0;
|
|
21
|
+
|
|
22
|
+
readonly $typeName = Airdrop.$typeName;
|
|
23
|
+
|
|
24
|
+
readonly $fullTypeName: "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::Airdrop";
|
|
25
|
+
|
|
26
|
+
readonly $typeArgs: [];
|
|
27
|
+
|
|
28
|
+
readonly user: ToField<"address">; readonly value: ToField<"u64">
|
|
29
|
+
|
|
30
|
+
private constructor(typeArgs: [], fields: AirdropFields, ) { this.$fullTypeName = composeSuiType( Airdrop.$typeName, ...typeArgs ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::Airdrop"; this.$typeArgs = typeArgs;
|
|
31
|
+
|
|
32
|
+
this.user = fields.user;; this.value = fields.value; }
|
|
33
|
+
|
|
34
|
+
static reified( ): AirdropReified { return { typeName: Airdrop.$typeName, fullTypeName: composeSuiType( Airdrop.$typeName, ...[] ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::Airdrop", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Airdrop.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Airdrop.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Airdrop.fromBcs( data, ), bcs: Airdrop.bcs, fromJSONField: (field: any) => Airdrop.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Airdrop.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Airdrop.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Airdrop.fetch( client, id, ), new: ( fields: AirdropFields, ) => { return new Airdrop( [], fields ) }, kind: "StructClassReified", } }
|
|
35
|
+
|
|
36
|
+
static get r() { return Airdrop.reified() }
|
|
37
|
+
|
|
38
|
+
static phantom( ): PhantomReified<ToTypeStr<Airdrop>> { return phantom(Airdrop.reified( )); } static get p() { return Airdrop.phantom() }
|
|
39
|
+
|
|
40
|
+
static get bcs() { return bcs.struct("Airdrop", {
|
|
41
|
+
|
|
42
|
+
user: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), value: bcs.u64()
|
|
43
|
+
|
|
44
|
+
}) };
|
|
45
|
+
|
|
46
|
+
static fromFields( fields: Record<string, any> ): Airdrop { return Airdrop.reified( ).new( { user: decodeFromFields("address", fields.user), value: decodeFromFields("u64", fields.value) } ) }
|
|
47
|
+
|
|
48
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Airdrop { if (!isAirdrop(item.type)) { throw new Error("not a Airdrop type");
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return Airdrop.reified( ).new( { user: decodeFromFieldsWithTypes("address", item.fields.user), value: decodeFromFieldsWithTypes("u64", item.fields.value) } ) }
|
|
53
|
+
|
|
54
|
+
static fromBcs( data: Uint8Array ): Airdrop { return Airdrop.fromFields( Airdrop.bcs.parse(data) ) }
|
|
55
|
+
|
|
56
|
+
toJSONField() { return {
|
|
57
|
+
|
|
58
|
+
user: this.user,value: this.value.toString(),
|
|
59
|
+
|
|
60
|
+
} }
|
|
61
|
+
|
|
62
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
63
|
+
|
|
64
|
+
static fromJSONField( field: any ): Airdrop { return Airdrop.reified( ).new( { user: decodeFromJSONField("address", field.user), value: decodeFromJSONField("u64", field.value) } ) }
|
|
65
|
+
|
|
66
|
+
static fromJSON( json: Record<string, any> ): Airdrop { if (json.$typeName !== Airdrop.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
67
|
+
|
|
68
|
+
return Airdrop.fromJSONField( json, ) }
|
|
69
|
+
|
|
70
|
+
static fromSuiParsedData( content: SuiParsedData ): Airdrop { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isAirdrop(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Airdrop object`); } return Airdrop.fromFieldsWithTypes( content ); }
|
|
71
|
+
|
|
72
|
+
static async fetch( client: SuiClient, id: string ): Promise<Airdrop> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Airdrop object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isAirdrop(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Airdrop object`); }
|
|
73
|
+
return Airdrop.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ============================== AirdropInfo =============================== */
|
|
78
|
+
|
|
79
|
+
export function isAirdropInfo(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::AirdropInfo<"); }
|
|
80
|
+
|
|
81
|
+
export interface AirdropInfoFields<TOKEN extends PhantomTypeArgument> { id: ToField<UID>; balance: ToField<Balance<TOKEN>>; airdrops: ToField<BigVector> }
|
|
82
|
+
|
|
83
|
+
export type AirdropInfoReified<TOKEN extends PhantomTypeArgument> = Reified< AirdropInfo<TOKEN>, AirdropInfoFields<TOKEN> >;
|
|
84
|
+
|
|
85
|
+
export class AirdropInfo<TOKEN extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::AirdropInfo"; static readonly $numTypeParams = 1;
|
|
86
|
+
|
|
87
|
+
readonly $typeName = AirdropInfo.$typeName;
|
|
88
|
+
|
|
89
|
+
readonly $fullTypeName: `0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::AirdropInfo<${PhantomToTypeStr<TOKEN>}>`;
|
|
90
|
+
|
|
91
|
+
readonly $typeArgs: [PhantomToTypeStr<TOKEN>];
|
|
92
|
+
|
|
93
|
+
readonly id: ToField<UID>; readonly balance: ToField<Balance<TOKEN>>; readonly airdrops: ToField<BigVector>
|
|
94
|
+
|
|
95
|
+
private constructor(typeArgs: [PhantomToTypeStr<TOKEN>], fields: AirdropInfoFields<TOKEN>, ) { this.$fullTypeName = composeSuiType( AirdropInfo.$typeName, ...typeArgs ) as `0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::AirdropInfo<${PhantomToTypeStr<TOKEN>}>`; this.$typeArgs = typeArgs;
|
|
96
|
+
|
|
97
|
+
this.id = fields.id;; this.balance = fields.balance;; this.airdrops = fields.airdrops; }
|
|
98
|
+
|
|
99
|
+
static reified<TOKEN extends PhantomReified<PhantomTypeArgument>>( TOKEN: TOKEN ): AirdropInfoReified<ToPhantomTypeArgument<TOKEN>> { return { typeName: AirdropInfo.$typeName, fullTypeName: composeSuiType( AirdropInfo.$typeName, ...[extractType(TOKEN)] ) as `0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::AirdropInfo<${PhantomToTypeStr<ToPhantomTypeArgument<TOKEN>>}>`, typeArgs: [ extractType(TOKEN) ] as [PhantomToTypeStr<ToPhantomTypeArgument<TOKEN>>], reifiedTypeArgs: [TOKEN], fromFields: (fields: Record<string, any>) => AirdropInfo.fromFields( TOKEN, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => AirdropInfo.fromFieldsWithTypes( TOKEN, item, ), fromBcs: (data: Uint8Array) => AirdropInfo.fromBcs( TOKEN, data, ), bcs: AirdropInfo.bcs, fromJSONField: (field: any) => AirdropInfo.fromJSONField( TOKEN, field, ), fromJSON: (json: Record<string, any>) => AirdropInfo.fromJSON( TOKEN, json, ), fromSuiParsedData: (content: SuiParsedData) => AirdropInfo.fromSuiParsedData( TOKEN, content, ), fetch: async (client: SuiClient, id: string) => AirdropInfo.fetch( client, TOKEN, id, ), new: ( fields: AirdropInfoFields<ToPhantomTypeArgument<TOKEN>>, ) => { return new AirdropInfo( [extractType(TOKEN)], fields ) }, kind: "StructClassReified", } }
|
|
100
|
+
|
|
101
|
+
static get r() { return AirdropInfo.reified }
|
|
102
|
+
|
|
103
|
+
static phantom<TOKEN extends PhantomReified<PhantomTypeArgument>>( TOKEN: TOKEN ): PhantomReified<ToTypeStr<AirdropInfo<ToPhantomTypeArgument<TOKEN>>>> { return phantom(AirdropInfo.reified( TOKEN )); } static get p() { return AirdropInfo.phantom }
|
|
104
|
+
|
|
105
|
+
static get bcs() { return bcs.struct("AirdropInfo", {
|
|
106
|
+
|
|
107
|
+
id: UID.bcs, balance: Balance.bcs, airdrops: BigVector.bcs
|
|
108
|
+
|
|
109
|
+
}) };
|
|
110
|
+
|
|
111
|
+
static fromFields<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, fields: Record<string, any> ): AirdropInfo<ToPhantomTypeArgument<TOKEN>> { return AirdropInfo.reified( typeArg, ).new( { id: decodeFromFields(UID.reified(), fields.id), balance: decodeFromFields(Balance.reified(typeArg), fields.balance), airdrops: decodeFromFields(BigVector.reified(), fields.airdrops) } ) }
|
|
112
|
+
|
|
113
|
+
static fromFieldsWithTypes<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, item: FieldsWithTypes ): AirdropInfo<ToPhantomTypeArgument<TOKEN>> { if (!isAirdropInfo(item.type)) { throw new Error("not a AirdropInfo type");
|
|
114
|
+
|
|
115
|
+
} assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
116
|
+
|
|
117
|
+
return AirdropInfo.reified( typeArg, ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), balance: decodeFromFieldsWithTypes(Balance.reified(typeArg), item.fields.balance), airdrops: decodeFromFieldsWithTypes(BigVector.reified(), item.fields.airdrops) } ) }
|
|
118
|
+
|
|
119
|
+
static fromBcs<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, data: Uint8Array ): AirdropInfo<ToPhantomTypeArgument<TOKEN>> { return AirdropInfo.fromFields( typeArg, AirdropInfo.bcs.parse(data) ) }
|
|
120
|
+
|
|
121
|
+
toJSONField() { return {
|
|
122
|
+
|
|
123
|
+
id: this.id,balance: this.balance.toJSONField(),airdrops: this.airdrops.toJSONField(),
|
|
124
|
+
|
|
125
|
+
} }
|
|
126
|
+
|
|
127
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
128
|
+
|
|
129
|
+
static fromJSONField<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, field: any ): AirdropInfo<ToPhantomTypeArgument<TOKEN>> { return AirdropInfo.reified( typeArg, ).new( { id: decodeFromJSONField(UID.reified(), field.id), balance: decodeFromJSONField(Balance.reified(typeArg), field.balance), airdrops: decodeFromJSONField(BigVector.reified(), field.airdrops) } ) }
|
|
130
|
+
|
|
131
|
+
static fromJSON<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, json: Record<string, any> ): AirdropInfo<ToPhantomTypeArgument<TOKEN>> { if (json.$typeName !== AirdropInfo.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(AirdropInfo.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
|
|
132
|
+
|
|
133
|
+
return AirdropInfo.fromJSONField( typeArg, json, ) }
|
|
134
|
+
|
|
135
|
+
static fromSuiParsedData<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, content: SuiParsedData ): AirdropInfo<ToPhantomTypeArgument<TOKEN>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isAirdropInfo(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a AirdropInfo object`); } return AirdropInfo.fromFieldsWithTypes( typeArg, content ); }
|
|
136
|
+
|
|
137
|
+
static async fetch<TOKEN extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: TOKEN, id: string ): Promise<AirdropInfo<ToPhantomTypeArgument<TOKEN>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching AirdropInfo object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isAirdropInfo(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a AirdropInfo object`); }
|
|
138
|
+
return AirdropInfo.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ============================== ClaimAirdropEvent =============================== */
|
|
143
|
+
|
|
144
|
+
export function isClaimAirdropEvent(type: string): boolean { type = compressSuiType(type); return type === "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::ClaimAirdropEvent"; }
|
|
145
|
+
|
|
146
|
+
export interface ClaimAirdropEventFields { token: ToField<TypeName>; key: ToField<String>; user: ToField<"address">; log: ToField<Vector<"u64">>; bcsPadding: ToField<Vector<Vector<"u8">>> }
|
|
147
|
+
|
|
148
|
+
export type ClaimAirdropEventReified = Reified< ClaimAirdropEvent, ClaimAirdropEventFields >;
|
|
149
|
+
|
|
150
|
+
export class ClaimAirdropEvent implements StructClass { static readonly $typeName = "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::ClaimAirdropEvent"; static readonly $numTypeParams = 0;
|
|
151
|
+
|
|
152
|
+
readonly $typeName = ClaimAirdropEvent.$typeName;
|
|
153
|
+
|
|
154
|
+
readonly $fullTypeName: "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::ClaimAirdropEvent";
|
|
155
|
+
|
|
156
|
+
readonly $typeArgs: [];
|
|
157
|
+
|
|
158
|
+
readonly token: ToField<TypeName>; readonly key: ToField<String>; readonly user: ToField<"address">; readonly log: ToField<Vector<"u64">>; readonly bcsPadding: ToField<Vector<Vector<"u8">>>
|
|
159
|
+
|
|
160
|
+
private constructor(typeArgs: [], fields: ClaimAirdropEventFields, ) { this.$fullTypeName = composeSuiType( ClaimAirdropEvent.$typeName, ...typeArgs ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::ClaimAirdropEvent"; this.$typeArgs = typeArgs;
|
|
161
|
+
|
|
162
|
+
this.token = fields.token;; this.key = fields.key;; this.user = fields.user;; this.log = fields.log;; this.bcsPadding = fields.bcsPadding; }
|
|
163
|
+
|
|
164
|
+
static reified( ): ClaimAirdropEventReified { return { typeName: ClaimAirdropEvent.$typeName, fullTypeName: composeSuiType( ClaimAirdropEvent.$typeName, ...[] ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::ClaimAirdropEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => ClaimAirdropEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => ClaimAirdropEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => ClaimAirdropEvent.fromBcs( data, ), bcs: ClaimAirdropEvent.bcs, fromJSONField: (field: any) => ClaimAirdropEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => ClaimAirdropEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => ClaimAirdropEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => ClaimAirdropEvent.fetch( client, id, ), new: ( fields: ClaimAirdropEventFields, ) => { return new ClaimAirdropEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
165
|
+
|
|
166
|
+
static get r() { return ClaimAirdropEvent.reified() }
|
|
167
|
+
|
|
168
|
+
static phantom( ): PhantomReified<ToTypeStr<ClaimAirdropEvent>> { return phantom(ClaimAirdropEvent.reified( )); } static get p() { return ClaimAirdropEvent.phantom() }
|
|
169
|
+
|
|
170
|
+
static get bcs() { return bcs.struct("ClaimAirdropEvent", {
|
|
171
|
+
|
|
172
|
+
token: TypeName.bcs, key: String.bcs, user: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), log: bcs.vector(bcs.u64()), bcs_padding: bcs.vector(bcs.vector(bcs.u8()))
|
|
173
|
+
|
|
174
|
+
}) };
|
|
175
|
+
|
|
176
|
+
static fromFields( fields: Record<string, any> ): ClaimAirdropEvent { return ClaimAirdropEvent.reified( ).new( { token: decodeFromFields(TypeName.reified(), fields.token), key: decodeFromFields(String.reified(), fields.key), user: decodeFromFields("address", fields.user), log: decodeFromFields(reified.vector("u64"), fields.log), bcsPadding: decodeFromFields(reified.vector(reified.vector("u8")), fields.bcs_padding) } ) }
|
|
177
|
+
|
|
178
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): ClaimAirdropEvent { if (!isClaimAirdropEvent(item.type)) { throw new Error("not a ClaimAirdropEvent type");
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return ClaimAirdropEvent.reified( ).new( { token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), key: decodeFromFieldsWithTypes(String.reified(), item.fields.key), user: decodeFromFieldsWithTypes("address", item.fields.user), log: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.log), bcsPadding: decodeFromFieldsWithTypes(reified.vector(reified.vector("u8")), item.fields.bcs_padding) } ) }
|
|
183
|
+
|
|
184
|
+
static fromBcs( data: Uint8Array ): ClaimAirdropEvent { return ClaimAirdropEvent.fromFields( ClaimAirdropEvent.bcs.parse(data) ) }
|
|
185
|
+
|
|
186
|
+
toJSONField() { return {
|
|
187
|
+
|
|
188
|
+
token: this.token.toJSONField(),key: this.key,user: this.user,log: fieldToJSON<Vector<"u64">>(`vector<u64>`, this.log),bcsPadding: fieldToJSON<Vector<Vector<"u8">>>(`vector<vector<u8>>`, this.bcsPadding),
|
|
189
|
+
|
|
190
|
+
} }
|
|
191
|
+
|
|
192
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
193
|
+
|
|
194
|
+
static fromJSONField( field: any ): ClaimAirdropEvent { return ClaimAirdropEvent.reified( ).new( { token: decodeFromJSONField(TypeName.reified(), field.token), key: decodeFromJSONField(String.reified(), field.key), user: decodeFromJSONField("address", field.user), log: decodeFromJSONField(reified.vector("u64"), field.log), bcsPadding: decodeFromJSONField(reified.vector(reified.vector("u8")), field.bcsPadding) } ) }
|
|
195
|
+
|
|
196
|
+
static fromJSON( json: Record<string, any> ): ClaimAirdropEvent { if (json.$typeName !== ClaimAirdropEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
197
|
+
|
|
198
|
+
return ClaimAirdropEvent.fromJSONField( json, ) }
|
|
199
|
+
|
|
200
|
+
static fromSuiParsedData( content: SuiParsedData ): ClaimAirdropEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isClaimAirdropEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a ClaimAirdropEvent object`); } return ClaimAirdropEvent.fromFieldsWithTypes( content ); }
|
|
201
|
+
|
|
202
|
+
static async fetch( client: SuiClient, id: string ): Promise<ClaimAirdropEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching ClaimAirdropEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isClaimAirdropEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a ClaimAirdropEvent object`); }
|
|
203
|
+
return ClaimAirdropEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* ============================== RemoveAirdropEvent =============================== */
|
|
208
|
+
|
|
209
|
+
export function isRemoveAirdropEvent(type: string): boolean { type = compressSuiType(type); return type === "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::RemoveAirdropEvent"; }
|
|
210
|
+
|
|
211
|
+
export interface RemoveAirdropEventFields { token: ToField<TypeName>; key: ToField<String>; log: ToField<Vector<"u64">>; bcsPadding: ToField<Vector<Vector<"u8">>> }
|
|
212
|
+
|
|
213
|
+
export type RemoveAirdropEventReified = Reified< RemoveAirdropEvent, RemoveAirdropEventFields >;
|
|
214
|
+
|
|
215
|
+
export class RemoveAirdropEvent implements StructClass { static readonly $typeName = "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::RemoveAirdropEvent"; static readonly $numTypeParams = 0;
|
|
216
|
+
|
|
217
|
+
readonly $typeName = RemoveAirdropEvent.$typeName;
|
|
218
|
+
|
|
219
|
+
readonly $fullTypeName: "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::RemoveAirdropEvent";
|
|
220
|
+
|
|
221
|
+
readonly $typeArgs: [];
|
|
222
|
+
|
|
223
|
+
readonly token: ToField<TypeName>; readonly key: ToField<String>; readonly log: ToField<Vector<"u64">>; readonly bcsPadding: ToField<Vector<Vector<"u8">>>
|
|
224
|
+
|
|
225
|
+
private constructor(typeArgs: [], fields: RemoveAirdropEventFields, ) { this.$fullTypeName = composeSuiType( RemoveAirdropEvent.$typeName, ...typeArgs ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::RemoveAirdropEvent"; this.$typeArgs = typeArgs;
|
|
226
|
+
|
|
227
|
+
this.token = fields.token;; this.key = fields.key;; this.log = fields.log;; this.bcsPadding = fields.bcsPadding; }
|
|
228
|
+
|
|
229
|
+
static reified( ): RemoveAirdropEventReified { return { typeName: RemoveAirdropEvent.$typeName, fullTypeName: composeSuiType( RemoveAirdropEvent.$typeName, ...[] ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::RemoveAirdropEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => RemoveAirdropEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => RemoveAirdropEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => RemoveAirdropEvent.fromBcs( data, ), bcs: RemoveAirdropEvent.bcs, fromJSONField: (field: any) => RemoveAirdropEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => RemoveAirdropEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => RemoveAirdropEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => RemoveAirdropEvent.fetch( client, id, ), new: ( fields: RemoveAirdropEventFields, ) => { return new RemoveAirdropEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
230
|
+
|
|
231
|
+
static get r() { return RemoveAirdropEvent.reified() }
|
|
232
|
+
|
|
233
|
+
static phantom( ): PhantomReified<ToTypeStr<RemoveAirdropEvent>> { return phantom(RemoveAirdropEvent.reified( )); } static get p() { return RemoveAirdropEvent.phantom() }
|
|
234
|
+
|
|
235
|
+
static get bcs() { return bcs.struct("RemoveAirdropEvent", {
|
|
236
|
+
|
|
237
|
+
token: TypeName.bcs, key: String.bcs, log: bcs.vector(bcs.u64()), bcs_padding: bcs.vector(bcs.vector(bcs.u8()))
|
|
238
|
+
|
|
239
|
+
}) };
|
|
240
|
+
|
|
241
|
+
static fromFields( fields: Record<string, any> ): RemoveAirdropEvent { return RemoveAirdropEvent.reified( ).new( { token: decodeFromFields(TypeName.reified(), fields.token), key: decodeFromFields(String.reified(), fields.key), log: decodeFromFields(reified.vector("u64"), fields.log), bcsPadding: decodeFromFields(reified.vector(reified.vector("u8")), fields.bcs_padding) } ) }
|
|
242
|
+
|
|
243
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): RemoveAirdropEvent { if (!isRemoveAirdropEvent(item.type)) { throw new Error("not a RemoveAirdropEvent type");
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return RemoveAirdropEvent.reified( ).new( { token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), key: decodeFromFieldsWithTypes(String.reified(), item.fields.key), log: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.log), bcsPadding: decodeFromFieldsWithTypes(reified.vector(reified.vector("u8")), item.fields.bcs_padding) } ) }
|
|
248
|
+
|
|
249
|
+
static fromBcs( data: Uint8Array ): RemoveAirdropEvent { return RemoveAirdropEvent.fromFields( RemoveAirdropEvent.bcs.parse(data) ) }
|
|
250
|
+
|
|
251
|
+
toJSONField() { return {
|
|
252
|
+
|
|
253
|
+
token: this.token.toJSONField(),key: this.key,log: fieldToJSON<Vector<"u64">>(`vector<u64>`, this.log),bcsPadding: fieldToJSON<Vector<Vector<"u8">>>(`vector<vector<u8>>`, this.bcsPadding),
|
|
254
|
+
|
|
255
|
+
} }
|
|
256
|
+
|
|
257
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
258
|
+
|
|
259
|
+
static fromJSONField( field: any ): RemoveAirdropEvent { return RemoveAirdropEvent.reified( ).new( { token: decodeFromJSONField(TypeName.reified(), field.token), key: decodeFromJSONField(String.reified(), field.key), log: decodeFromJSONField(reified.vector("u64"), field.log), bcsPadding: decodeFromJSONField(reified.vector(reified.vector("u8")), field.bcsPadding) } ) }
|
|
260
|
+
|
|
261
|
+
static fromJSON( json: Record<string, any> ): RemoveAirdropEvent { if (json.$typeName !== RemoveAirdropEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
262
|
+
|
|
263
|
+
return RemoveAirdropEvent.fromJSONField( json, ) }
|
|
264
|
+
|
|
265
|
+
static fromSuiParsedData( content: SuiParsedData ): RemoveAirdropEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isRemoveAirdropEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a RemoveAirdropEvent object`); } return RemoveAirdropEvent.fromFieldsWithTypes( content ); }
|
|
266
|
+
|
|
267
|
+
static async fetch( client: SuiClient, id: string ): Promise<RemoveAirdropEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching RemoveAirdropEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isRemoveAirdropEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a RemoveAirdropEvent object`); }
|
|
268
|
+
return RemoveAirdropEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
269
|
+
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* ============================== SetAirdropEvent =============================== */
|
|
273
|
+
|
|
274
|
+
export function isSetAirdropEvent(type: string): boolean { type = compressSuiType(type); return type === "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::SetAirdropEvent"; }
|
|
275
|
+
|
|
276
|
+
export interface SetAirdropEventFields { token: ToField<TypeName>; key: ToField<String>; log: ToField<Vector<"u64">>; bcsPadding: ToField<Vector<Vector<"u8">>> }
|
|
277
|
+
|
|
278
|
+
export type SetAirdropEventReified = Reified< SetAirdropEvent, SetAirdropEventFields >;
|
|
279
|
+
|
|
280
|
+
export class SetAirdropEvent implements StructClass { static readonly $typeName = "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::SetAirdropEvent"; static readonly $numTypeParams = 0;
|
|
281
|
+
|
|
282
|
+
readonly $typeName = SetAirdropEvent.$typeName;
|
|
283
|
+
|
|
284
|
+
readonly $fullTypeName: "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::SetAirdropEvent";
|
|
285
|
+
|
|
286
|
+
readonly $typeArgs: [];
|
|
287
|
+
|
|
288
|
+
readonly token: ToField<TypeName>; readonly key: ToField<String>; readonly log: ToField<Vector<"u64">>; readonly bcsPadding: ToField<Vector<Vector<"u8">>>
|
|
289
|
+
|
|
290
|
+
private constructor(typeArgs: [], fields: SetAirdropEventFields, ) { this.$fullTypeName = composeSuiType( SetAirdropEvent.$typeName, ...typeArgs ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::SetAirdropEvent"; this.$typeArgs = typeArgs;
|
|
291
|
+
|
|
292
|
+
this.token = fields.token;; this.key = fields.key;; this.log = fields.log;; this.bcsPadding = fields.bcsPadding; }
|
|
293
|
+
|
|
294
|
+
static reified( ): SetAirdropEventReified { return { typeName: SetAirdropEvent.$typeName, fullTypeName: composeSuiType( SetAirdropEvent.$typeName, ...[] ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::SetAirdropEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => SetAirdropEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => SetAirdropEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => SetAirdropEvent.fromBcs( data, ), bcs: SetAirdropEvent.bcs, fromJSONField: (field: any) => SetAirdropEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => SetAirdropEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => SetAirdropEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => SetAirdropEvent.fetch( client, id, ), new: ( fields: SetAirdropEventFields, ) => { return new SetAirdropEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
295
|
+
|
|
296
|
+
static get r() { return SetAirdropEvent.reified() }
|
|
297
|
+
|
|
298
|
+
static phantom( ): PhantomReified<ToTypeStr<SetAirdropEvent>> { return phantom(SetAirdropEvent.reified( )); } static get p() { return SetAirdropEvent.phantom() }
|
|
299
|
+
|
|
300
|
+
static get bcs() { return bcs.struct("SetAirdropEvent", {
|
|
301
|
+
|
|
302
|
+
token: TypeName.bcs, key: String.bcs, log: bcs.vector(bcs.u64()), bcs_padding: bcs.vector(bcs.vector(bcs.u8()))
|
|
303
|
+
|
|
304
|
+
}) };
|
|
305
|
+
|
|
306
|
+
static fromFields( fields: Record<string, any> ): SetAirdropEvent { return SetAirdropEvent.reified( ).new( { token: decodeFromFields(TypeName.reified(), fields.token), key: decodeFromFields(String.reified(), fields.key), log: decodeFromFields(reified.vector("u64"), fields.log), bcsPadding: decodeFromFields(reified.vector(reified.vector("u8")), fields.bcs_padding) } ) }
|
|
307
|
+
|
|
308
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): SetAirdropEvent { if (!isSetAirdropEvent(item.type)) { throw new Error("not a SetAirdropEvent type");
|
|
309
|
+
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return SetAirdropEvent.reified( ).new( { token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), key: decodeFromFieldsWithTypes(String.reified(), item.fields.key), log: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.log), bcsPadding: decodeFromFieldsWithTypes(reified.vector(reified.vector("u8")), item.fields.bcs_padding) } ) }
|
|
313
|
+
|
|
314
|
+
static fromBcs( data: Uint8Array ): SetAirdropEvent { return SetAirdropEvent.fromFields( SetAirdropEvent.bcs.parse(data) ) }
|
|
315
|
+
|
|
316
|
+
toJSONField() { return {
|
|
317
|
+
|
|
318
|
+
token: this.token.toJSONField(),key: this.key,log: fieldToJSON<Vector<"u64">>(`vector<u64>`, this.log),bcsPadding: fieldToJSON<Vector<Vector<"u8">>>(`vector<vector<u8>>`, this.bcsPadding),
|
|
319
|
+
|
|
320
|
+
} }
|
|
321
|
+
|
|
322
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
323
|
+
|
|
324
|
+
static fromJSONField( field: any ): SetAirdropEvent { return SetAirdropEvent.reified( ).new( { token: decodeFromJSONField(TypeName.reified(), field.token), key: decodeFromJSONField(String.reified(), field.key), log: decodeFromJSONField(reified.vector("u64"), field.log), bcsPadding: decodeFromJSONField(reified.vector(reified.vector("u8")), field.bcsPadding) } ) }
|
|
325
|
+
|
|
326
|
+
static fromJSON( json: Record<string, any> ): SetAirdropEvent { if (json.$typeName !== SetAirdropEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
327
|
+
|
|
328
|
+
return SetAirdropEvent.fromJSONField( json, ) }
|
|
329
|
+
|
|
330
|
+
static fromSuiParsedData( content: SuiParsedData ): SetAirdropEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isSetAirdropEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a SetAirdropEvent object`); } return SetAirdropEvent.fromFieldsWithTypes( content ); }
|
|
331
|
+
|
|
332
|
+
static async fetch( client: SuiClient, id: string ): Promise<SetAirdropEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching SetAirdropEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isSetAirdropEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a SetAirdropEvent object`); }
|
|
333
|
+
return SetAirdropEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
334
|
+
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* ============================== TypusAirdropRegistry =============================== */
|
|
338
|
+
|
|
339
|
+
export function isTypusAirdropRegistry(type: string): boolean { type = compressSuiType(type); return type === "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::TypusAirdropRegistry"; }
|
|
340
|
+
|
|
341
|
+
export interface TypusAirdropRegistryFields { id: ToField<UID> }
|
|
342
|
+
|
|
343
|
+
export type TypusAirdropRegistryReified = Reified< TypusAirdropRegistry, TypusAirdropRegistryFields >;
|
|
344
|
+
|
|
345
|
+
export class TypusAirdropRegistry implements StructClass { static readonly $typeName = "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::TypusAirdropRegistry"; static readonly $numTypeParams = 0;
|
|
346
|
+
|
|
347
|
+
readonly $typeName = TypusAirdropRegistry.$typeName;
|
|
348
|
+
|
|
349
|
+
readonly $fullTypeName: "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::TypusAirdropRegistry";
|
|
350
|
+
|
|
351
|
+
readonly $typeArgs: [];
|
|
352
|
+
|
|
353
|
+
readonly id: ToField<UID>
|
|
354
|
+
|
|
355
|
+
private constructor(typeArgs: [], fields: TypusAirdropRegistryFields, ) { this.$fullTypeName = composeSuiType( TypusAirdropRegistry.$typeName, ...typeArgs ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::TypusAirdropRegistry"; this.$typeArgs = typeArgs;
|
|
356
|
+
|
|
357
|
+
this.id = fields.id; }
|
|
358
|
+
|
|
359
|
+
static reified( ): TypusAirdropRegistryReified { return { typeName: TypusAirdropRegistry.$typeName, fullTypeName: composeSuiType( TypusAirdropRegistry.$typeName, ...[] ) as "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::airdrop::TypusAirdropRegistry", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => TypusAirdropRegistry.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TypusAirdropRegistry.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => TypusAirdropRegistry.fromBcs( data, ), bcs: TypusAirdropRegistry.bcs, fromJSONField: (field: any) => TypusAirdropRegistry.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => TypusAirdropRegistry.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => TypusAirdropRegistry.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => TypusAirdropRegistry.fetch( client, id, ), new: ( fields: TypusAirdropRegistryFields, ) => { return new TypusAirdropRegistry( [], fields ) }, kind: "StructClassReified", } }
|
|
360
|
+
|
|
361
|
+
static get r() { return TypusAirdropRegistry.reified() }
|
|
362
|
+
|
|
363
|
+
static phantom( ): PhantomReified<ToTypeStr<TypusAirdropRegistry>> { return phantom(TypusAirdropRegistry.reified( )); } static get p() { return TypusAirdropRegistry.phantom() }
|
|
364
|
+
|
|
365
|
+
static get bcs() { return bcs.struct("TypusAirdropRegistry", {
|
|
366
|
+
|
|
367
|
+
id: UID.bcs
|
|
368
|
+
|
|
369
|
+
}) };
|
|
370
|
+
|
|
371
|
+
static fromFields( fields: Record<string, any> ): TypusAirdropRegistry { return TypusAirdropRegistry.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id) } ) }
|
|
372
|
+
|
|
373
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): TypusAirdropRegistry { if (!isTypusAirdropRegistry(item.type)) { throw new Error("not a TypusAirdropRegistry type");
|
|
374
|
+
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
return TypusAirdropRegistry.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id) } ) }
|
|
378
|
+
|
|
379
|
+
static fromBcs( data: Uint8Array ): TypusAirdropRegistry { return TypusAirdropRegistry.fromFields( TypusAirdropRegistry.bcs.parse(data) ) }
|
|
380
|
+
|
|
381
|
+
toJSONField() { return {
|
|
382
|
+
|
|
383
|
+
id: this.id,
|
|
384
|
+
|
|
385
|
+
} }
|
|
386
|
+
|
|
387
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
388
|
+
|
|
389
|
+
static fromJSONField( field: any ): TypusAirdropRegistry { return TypusAirdropRegistry.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id) } ) }
|
|
390
|
+
|
|
391
|
+
static fromJSON( json: Record<string, any> ): TypusAirdropRegistry { if (json.$typeName !== TypusAirdropRegistry.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
392
|
+
|
|
393
|
+
return TypusAirdropRegistry.fromJSONField( json, ) }
|
|
394
|
+
|
|
395
|
+
static fromSuiParsedData( content: SuiParsedData ): TypusAirdropRegistry { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTypusAirdropRegistry(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TypusAirdropRegistry object`); } return TypusAirdropRegistry.fromFieldsWithTypes( content ); }
|
|
396
|
+
|
|
397
|
+
static async fetch( client: SuiClient, id: string ): Promise<TypusAirdropRegistry> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TypusAirdropRegistry object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTypusAirdropRegistry(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TypusAirdropRegistry object`); }
|
|
398
|
+
return TypusAirdropRegistry.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
399
|
+
|
|
400
|
+
}
|