@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,70 @@
|
|
|
1
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom} from "../../../../_framework/reified";
|
|
2
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
3
|
+
import {ExternalAddress} from "../../0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/external-address/structs";
|
|
4
|
+
import {bcs, fromB64} from "@mysten/bcs";
|
|
5
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
6
|
+
|
|
7
|
+
/* ============================== GovernanceDataSource =============================== */
|
|
8
|
+
|
|
9
|
+
export function isGovernanceDataSource(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_governance_data_source::GovernanceDataSource"; }
|
|
10
|
+
|
|
11
|
+
export interface GovernanceDataSourceFields { emitterChainId: ToField<"u64">; emitterAddress: ToField<ExternalAddress>; initialSequence: ToField<"u64"> }
|
|
12
|
+
|
|
13
|
+
export type GovernanceDataSourceReified = Reified< GovernanceDataSource, GovernanceDataSourceFields >;
|
|
14
|
+
|
|
15
|
+
export class GovernanceDataSource implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_governance_data_source::GovernanceDataSource"; static readonly $numTypeParams = 0;
|
|
16
|
+
|
|
17
|
+
readonly $typeName = GovernanceDataSource.$typeName;
|
|
18
|
+
|
|
19
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_governance_data_source::GovernanceDataSource";
|
|
20
|
+
|
|
21
|
+
readonly $typeArgs: [];
|
|
22
|
+
|
|
23
|
+
readonly emitterChainId: ToField<"u64">; readonly emitterAddress: ToField<ExternalAddress>; readonly initialSequence: ToField<"u64">
|
|
24
|
+
|
|
25
|
+
private constructor(typeArgs: [], fields: GovernanceDataSourceFields, ) { this.$fullTypeName = composeSuiType( GovernanceDataSource.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_governance_data_source::GovernanceDataSource"; this.$typeArgs = typeArgs;
|
|
26
|
+
|
|
27
|
+
this.emitterChainId = fields.emitterChainId;; this.emitterAddress = fields.emitterAddress;; this.initialSequence = fields.initialSequence; }
|
|
28
|
+
|
|
29
|
+
static reified( ): GovernanceDataSourceReified { return { typeName: GovernanceDataSource.$typeName, fullTypeName: composeSuiType( GovernanceDataSource.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_governance_data_source::GovernanceDataSource", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => GovernanceDataSource.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => GovernanceDataSource.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => GovernanceDataSource.fromBcs( data, ), bcs: GovernanceDataSource.bcs, fromJSONField: (field: any) => GovernanceDataSource.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => GovernanceDataSource.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => GovernanceDataSource.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => GovernanceDataSource.fetch( client, id, ), new: ( fields: GovernanceDataSourceFields, ) => { return new GovernanceDataSource( [], fields ) }, kind: "StructClassReified", } }
|
|
30
|
+
|
|
31
|
+
static get r() { return GovernanceDataSource.reified() }
|
|
32
|
+
|
|
33
|
+
static phantom( ): PhantomReified<ToTypeStr<GovernanceDataSource>> { return phantom(GovernanceDataSource.reified( )); } static get p() { return GovernanceDataSource.phantom() }
|
|
34
|
+
|
|
35
|
+
static get bcs() { return bcs.struct("GovernanceDataSource", {
|
|
36
|
+
|
|
37
|
+
emitter_chain_id: bcs.u64(), emitter_address: ExternalAddress.bcs, initial_sequence: bcs.u64()
|
|
38
|
+
|
|
39
|
+
}) };
|
|
40
|
+
|
|
41
|
+
static fromFields( fields: Record<string, any> ): GovernanceDataSource { return GovernanceDataSource.reified( ).new( { emitterChainId: decodeFromFields("u64", fields.emitter_chain_id), emitterAddress: decodeFromFields(ExternalAddress.reified(), fields.emitter_address), initialSequence: decodeFromFields("u64", fields.initial_sequence) } ) }
|
|
42
|
+
|
|
43
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): GovernanceDataSource { if (!isGovernanceDataSource(item.type)) { throw new Error("not a GovernanceDataSource type");
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return GovernanceDataSource.reified( ).new( { emitterChainId: decodeFromFieldsWithTypes("u64", item.fields.emitter_chain_id), emitterAddress: decodeFromFieldsWithTypes(ExternalAddress.reified(), item.fields.emitter_address), initialSequence: decodeFromFieldsWithTypes("u64", item.fields.initial_sequence) } ) }
|
|
48
|
+
|
|
49
|
+
static fromBcs( data: Uint8Array ): GovernanceDataSource { return GovernanceDataSource.fromFields( GovernanceDataSource.bcs.parse(data) ) }
|
|
50
|
+
|
|
51
|
+
toJSONField() { return {
|
|
52
|
+
|
|
53
|
+
emitterChainId: this.emitterChainId.toString(),emitterAddress: this.emitterAddress.toJSONField(),initialSequence: this.initialSequence.toString(),
|
|
54
|
+
|
|
55
|
+
} }
|
|
56
|
+
|
|
57
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
58
|
+
|
|
59
|
+
static fromJSONField( field: any ): GovernanceDataSource { return GovernanceDataSource.reified( ).new( { emitterChainId: decodeFromJSONField("u64", field.emitterChainId), emitterAddress: decodeFromJSONField(ExternalAddress.reified(), field.emitterAddress), initialSequence: decodeFromJSONField("u64", field.initialSequence) } ) }
|
|
60
|
+
|
|
61
|
+
static fromJSON( json: Record<string, any> ): GovernanceDataSource { if (json.$typeName !== GovernanceDataSource.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
62
|
+
|
|
63
|
+
return GovernanceDataSource.fromJSONField( json, ) }
|
|
64
|
+
|
|
65
|
+
static fromSuiParsedData( content: SuiParsedData ): GovernanceDataSource { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isGovernanceDataSource(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a GovernanceDataSource object`); } return GovernanceDataSource.fromFieldsWithTypes( content ); }
|
|
66
|
+
|
|
67
|
+
static async fetch( client: SuiClient, id: string ): Promise<GovernanceDataSource> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching GovernanceDataSource object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isGovernanceDataSource(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a GovernanceDataSource object`); }
|
|
68
|
+
return GovernanceDataSource.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -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
|
+
/* ============================== StalePriceThreshold =============================== */
|
|
7
|
+
|
|
8
|
+
export function isStalePriceThreshold(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_stale_price_threshold::StalePriceThreshold"; }
|
|
9
|
+
|
|
10
|
+
export interface StalePriceThresholdFields { threshold: ToField<"u64"> }
|
|
11
|
+
|
|
12
|
+
export type StalePriceThresholdReified = Reified< StalePriceThreshold, StalePriceThresholdFields >;
|
|
13
|
+
|
|
14
|
+
export class StalePriceThreshold implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_stale_price_threshold::StalePriceThreshold"; static readonly $numTypeParams = 0;
|
|
15
|
+
|
|
16
|
+
readonly $typeName = StalePriceThreshold.$typeName;
|
|
17
|
+
|
|
18
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_stale_price_threshold::StalePriceThreshold";
|
|
19
|
+
|
|
20
|
+
readonly $typeArgs: [];
|
|
21
|
+
|
|
22
|
+
readonly threshold: ToField<"u64">
|
|
23
|
+
|
|
24
|
+
private constructor(typeArgs: [], fields: StalePriceThresholdFields, ) { this.$fullTypeName = composeSuiType( StalePriceThreshold.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_stale_price_threshold::StalePriceThreshold"; this.$typeArgs = typeArgs;
|
|
25
|
+
|
|
26
|
+
this.threshold = fields.threshold; }
|
|
27
|
+
|
|
28
|
+
static reified( ): StalePriceThresholdReified { return { typeName: StalePriceThreshold.$typeName, fullTypeName: composeSuiType( StalePriceThreshold.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_stale_price_threshold::StalePriceThreshold", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => StalePriceThreshold.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => StalePriceThreshold.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => StalePriceThreshold.fromBcs( data, ), bcs: StalePriceThreshold.bcs, fromJSONField: (field: any) => StalePriceThreshold.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => StalePriceThreshold.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => StalePriceThreshold.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => StalePriceThreshold.fetch( client, id, ), new: ( fields: StalePriceThresholdFields, ) => { return new StalePriceThreshold( [], fields ) }, kind: "StructClassReified", } }
|
|
29
|
+
|
|
30
|
+
static get r() { return StalePriceThreshold.reified() }
|
|
31
|
+
|
|
32
|
+
static phantom( ): PhantomReified<ToTypeStr<StalePriceThreshold>> { return phantom(StalePriceThreshold.reified( )); } static get p() { return StalePriceThreshold.phantom() }
|
|
33
|
+
|
|
34
|
+
static get bcs() { return bcs.struct("StalePriceThreshold", {
|
|
35
|
+
|
|
36
|
+
threshold: bcs.u64()
|
|
37
|
+
|
|
38
|
+
}) };
|
|
39
|
+
|
|
40
|
+
static fromFields( fields: Record<string, any> ): StalePriceThreshold { return StalePriceThreshold.reified( ).new( { threshold: decodeFromFields("u64", fields.threshold) } ) }
|
|
41
|
+
|
|
42
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): StalePriceThreshold { if (!isStalePriceThreshold(item.type)) { throw new Error("not a StalePriceThreshold type");
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return StalePriceThreshold.reified( ).new( { threshold: decodeFromFieldsWithTypes("u64", item.fields.threshold) } ) }
|
|
47
|
+
|
|
48
|
+
static fromBcs( data: Uint8Array ): StalePriceThreshold { return StalePriceThreshold.fromFields( StalePriceThreshold.bcs.parse(data) ) }
|
|
49
|
+
|
|
50
|
+
toJSONField() { return {
|
|
51
|
+
|
|
52
|
+
threshold: this.threshold.toString(),
|
|
53
|
+
|
|
54
|
+
} }
|
|
55
|
+
|
|
56
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
57
|
+
|
|
58
|
+
static fromJSONField( field: any ): StalePriceThreshold { return StalePriceThreshold.reified( ).new( { threshold: decodeFromJSONField("u64", field.threshold) } ) }
|
|
59
|
+
|
|
60
|
+
static fromJSON( json: Record<string, any> ): StalePriceThreshold { if (json.$typeName !== StalePriceThreshold.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
61
|
+
|
|
62
|
+
return StalePriceThreshold.fromJSONField( json, ) }
|
|
63
|
+
|
|
64
|
+
static fromSuiParsedData( content: SuiParsedData ): StalePriceThreshold { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isStalePriceThreshold(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a StalePriceThreshold object`); } return StalePriceThreshold.fromFieldsWithTypes( content ); }
|
|
65
|
+
|
|
66
|
+
static async fetch( client: SuiClient, id: string ): Promise<StalePriceThreshold> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching StalePriceThreshold object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isStalePriceThreshold(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a StalePriceThreshold object`); }
|
|
67
|
+
return StalePriceThreshold.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -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
|
+
/* ============================== UpdateFee =============================== */
|
|
7
|
+
|
|
8
|
+
export function isUpdateFee(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_update_fee::UpdateFee"; }
|
|
9
|
+
|
|
10
|
+
export interface UpdateFeeFields { mantissa: ToField<"u64">; exponent: ToField<"u64"> }
|
|
11
|
+
|
|
12
|
+
export type UpdateFeeReified = Reified< UpdateFee, UpdateFeeFields >;
|
|
13
|
+
|
|
14
|
+
export class UpdateFee implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_update_fee::UpdateFee"; static readonly $numTypeParams = 0;
|
|
15
|
+
|
|
16
|
+
readonly $typeName = UpdateFee.$typeName;
|
|
17
|
+
|
|
18
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_update_fee::UpdateFee";
|
|
19
|
+
|
|
20
|
+
readonly $typeArgs: [];
|
|
21
|
+
|
|
22
|
+
readonly mantissa: ToField<"u64">; readonly exponent: ToField<"u64">
|
|
23
|
+
|
|
24
|
+
private constructor(typeArgs: [], fields: UpdateFeeFields, ) { this.$fullTypeName = composeSuiType( UpdateFee.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_update_fee::UpdateFee"; this.$typeArgs = typeArgs;
|
|
25
|
+
|
|
26
|
+
this.mantissa = fields.mantissa;; this.exponent = fields.exponent; }
|
|
27
|
+
|
|
28
|
+
static reified( ): UpdateFeeReified { return { typeName: UpdateFee.$typeName, fullTypeName: composeSuiType( UpdateFee.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_update_fee::UpdateFee", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => UpdateFee.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => UpdateFee.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => UpdateFee.fromBcs( data, ), bcs: UpdateFee.bcs, fromJSONField: (field: any) => UpdateFee.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => UpdateFee.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => UpdateFee.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => UpdateFee.fetch( client, id, ), new: ( fields: UpdateFeeFields, ) => { return new UpdateFee( [], fields ) }, kind: "StructClassReified", } }
|
|
29
|
+
|
|
30
|
+
static get r() { return UpdateFee.reified() }
|
|
31
|
+
|
|
32
|
+
static phantom( ): PhantomReified<ToTypeStr<UpdateFee>> { return phantom(UpdateFee.reified( )); } static get p() { return UpdateFee.phantom() }
|
|
33
|
+
|
|
34
|
+
static get bcs() { return bcs.struct("UpdateFee", {
|
|
35
|
+
|
|
36
|
+
mantissa: bcs.u64(), exponent: bcs.u64()
|
|
37
|
+
|
|
38
|
+
}) };
|
|
39
|
+
|
|
40
|
+
static fromFields( fields: Record<string, any> ): UpdateFee { return UpdateFee.reified( ).new( { mantissa: decodeFromFields("u64", fields.mantissa), exponent: decodeFromFields("u64", fields.exponent) } ) }
|
|
41
|
+
|
|
42
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): UpdateFee { if (!isUpdateFee(item.type)) { throw new Error("not a UpdateFee type");
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return UpdateFee.reified( ).new( { mantissa: decodeFromFieldsWithTypes("u64", item.fields.mantissa), exponent: decodeFromFieldsWithTypes("u64", item.fields.exponent) } ) }
|
|
47
|
+
|
|
48
|
+
static fromBcs( data: Uint8Array ): UpdateFee { return UpdateFee.fromFields( UpdateFee.bcs.parse(data) ) }
|
|
49
|
+
|
|
50
|
+
toJSONField() { return {
|
|
51
|
+
|
|
52
|
+
mantissa: this.mantissa.toString(),exponent: this.exponent.toString(),
|
|
53
|
+
|
|
54
|
+
} }
|
|
55
|
+
|
|
56
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
57
|
+
|
|
58
|
+
static fromJSONField( field: any ): UpdateFee { return UpdateFee.reified( ).new( { mantissa: decodeFromJSONField("u64", field.mantissa), exponent: decodeFromJSONField("u64", field.exponent) } ) }
|
|
59
|
+
|
|
60
|
+
static fromJSON( json: Record<string, any> ): UpdateFee { if (json.$typeName !== UpdateFee.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
61
|
+
|
|
62
|
+
return UpdateFee.fromJSONField( json, ) }
|
|
63
|
+
|
|
64
|
+
static fromSuiParsedData( content: SuiParsedData ): UpdateFee { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUpdateFee(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a UpdateFee object`); } return UpdateFee.fromFieldsWithTypes( content ); }
|
|
65
|
+
|
|
66
|
+
static async fetch( client: SuiClient, id: string ): Promise<UpdateFee> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching UpdateFee object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUpdateFee(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a UpdateFee object`); }
|
|
67
|
+
return UpdateFee.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
/* ============================== DeployerCap =============================== */
|
|
8
|
+
|
|
9
|
+
export function isDeployerCap(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::setup::DeployerCap"; }
|
|
10
|
+
|
|
11
|
+
export interface DeployerCapFields { id: ToField<UID> }
|
|
12
|
+
|
|
13
|
+
export type DeployerCapReified = Reified< DeployerCap, DeployerCapFields >;
|
|
14
|
+
|
|
15
|
+
export class DeployerCap implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::setup::DeployerCap"; static readonly $numTypeParams = 0;
|
|
16
|
+
|
|
17
|
+
readonly $typeName = DeployerCap.$typeName;
|
|
18
|
+
|
|
19
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::setup::DeployerCap";
|
|
20
|
+
|
|
21
|
+
readonly $typeArgs: [];
|
|
22
|
+
|
|
23
|
+
readonly id: ToField<UID>
|
|
24
|
+
|
|
25
|
+
private constructor(typeArgs: [], fields: DeployerCapFields, ) { this.$fullTypeName = composeSuiType( DeployerCap.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::setup::DeployerCap"; this.$typeArgs = typeArgs;
|
|
26
|
+
|
|
27
|
+
this.id = fields.id; }
|
|
28
|
+
|
|
29
|
+
static reified( ): DeployerCapReified { return { typeName: DeployerCap.$typeName, fullTypeName: composeSuiType( DeployerCap.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::setup::DeployerCap", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => DeployerCap.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => DeployerCap.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => DeployerCap.fromBcs( data, ), bcs: DeployerCap.bcs, fromJSONField: (field: any) => DeployerCap.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => DeployerCap.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => DeployerCap.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => DeployerCap.fetch( client, id, ), new: ( fields: DeployerCapFields, ) => { return new DeployerCap( [], fields ) }, kind: "StructClassReified", } }
|
|
30
|
+
|
|
31
|
+
static get r() { return DeployerCap.reified() }
|
|
32
|
+
|
|
33
|
+
static phantom( ): PhantomReified<ToTypeStr<DeployerCap>> { return phantom(DeployerCap.reified( )); } static get p() { return DeployerCap.phantom() }
|
|
34
|
+
|
|
35
|
+
static get bcs() { return bcs.struct("DeployerCap", {
|
|
36
|
+
|
|
37
|
+
id: UID.bcs
|
|
38
|
+
|
|
39
|
+
}) };
|
|
40
|
+
|
|
41
|
+
static fromFields( fields: Record<string, any> ): DeployerCap { return DeployerCap.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id) } ) }
|
|
42
|
+
|
|
43
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): DeployerCap { if (!isDeployerCap(item.type)) { throw new Error("not a DeployerCap type");
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return DeployerCap.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id) } ) }
|
|
48
|
+
|
|
49
|
+
static fromBcs( data: Uint8Array ): DeployerCap { return DeployerCap.fromFields( DeployerCap.bcs.parse(data) ) }
|
|
50
|
+
|
|
51
|
+
toJSONField() { return {
|
|
52
|
+
|
|
53
|
+
id: this.id,
|
|
54
|
+
|
|
55
|
+
} }
|
|
56
|
+
|
|
57
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
58
|
+
|
|
59
|
+
static fromJSONField( field: any ): DeployerCap { return DeployerCap.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id) } ) }
|
|
60
|
+
|
|
61
|
+
static fromJSON( json: Record<string, any> ): DeployerCap { if (json.$typeName !== DeployerCap.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
62
|
+
|
|
63
|
+
return DeployerCap.fromJSONField( json, ) }
|
|
64
|
+
|
|
65
|
+
static fromSuiParsedData( content: SuiParsedData ): DeployerCap { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isDeployerCap(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a DeployerCap object`); } return DeployerCap.fromFieldsWithTypes( content ); }
|
|
66
|
+
|
|
67
|
+
static async fetch( client: SuiClient, id: string ): Promise<DeployerCap> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching DeployerCap object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isDeployerCap(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a DeployerCap object`); }
|
|
68
|
+
return DeployerCap.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
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 {UpgradeCap} from "../../0x2/package/structs";
|
|
5
|
+
import {ConsumedVAAs} from "../../0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/consumed-vaas/structs";
|
|
6
|
+
import {DataSource} from "../data-source/structs";
|
|
7
|
+
import {bcs, fromB64, fromHEX, toHEX} from "@mysten/bcs";
|
|
8
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
9
|
+
|
|
10
|
+
/* ============================== CurrentDigest =============================== */
|
|
11
|
+
|
|
12
|
+
export function isCurrentDigest(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::CurrentDigest"; }
|
|
13
|
+
|
|
14
|
+
export interface CurrentDigestFields { dummyField: ToField<"bool"> }
|
|
15
|
+
|
|
16
|
+
export type CurrentDigestReified = Reified< CurrentDigest, CurrentDigestFields >;
|
|
17
|
+
|
|
18
|
+
export class CurrentDigest implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::CurrentDigest"; static readonly $numTypeParams = 0;
|
|
19
|
+
|
|
20
|
+
readonly $typeName = CurrentDigest.$typeName;
|
|
21
|
+
|
|
22
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::CurrentDigest";
|
|
23
|
+
|
|
24
|
+
readonly $typeArgs: [];
|
|
25
|
+
|
|
26
|
+
readonly dummyField: ToField<"bool">
|
|
27
|
+
|
|
28
|
+
private constructor(typeArgs: [], fields: CurrentDigestFields, ) { this.$fullTypeName = composeSuiType( CurrentDigest.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::CurrentDigest"; this.$typeArgs = typeArgs;
|
|
29
|
+
|
|
30
|
+
this.dummyField = fields.dummyField; }
|
|
31
|
+
|
|
32
|
+
static reified( ): CurrentDigestReified { return { typeName: CurrentDigest.$typeName, fullTypeName: composeSuiType( CurrentDigest.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::CurrentDigest", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => CurrentDigest.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => CurrentDigest.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => CurrentDigest.fromBcs( data, ), bcs: CurrentDigest.bcs, fromJSONField: (field: any) => CurrentDigest.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => CurrentDigest.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => CurrentDigest.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => CurrentDigest.fetch( client, id, ), new: ( fields: CurrentDigestFields, ) => { return new CurrentDigest( [], fields ) }, kind: "StructClassReified", } }
|
|
33
|
+
|
|
34
|
+
static get r() { return CurrentDigest.reified() }
|
|
35
|
+
|
|
36
|
+
static phantom( ): PhantomReified<ToTypeStr<CurrentDigest>> { return phantom(CurrentDigest.reified( )); } static get p() { return CurrentDigest.phantom() }
|
|
37
|
+
|
|
38
|
+
static get bcs() { return bcs.struct("CurrentDigest", {
|
|
39
|
+
|
|
40
|
+
dummy_field: bcs.bool()
|
|
41
|
+
|
|
42
|
+
}) };
|
|
43
|
+
|
|
44
|
+
static fromFields( fields: Record<string, any> ): CurrentDigest { return CurrentDigest.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
45
|
+
|
|
46
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): CurrentDigest { if (!isCurrentDigest(item.type)) { throw new Error("not a CurrentDigest type");
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return CurrentDigest.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
51
|
+
|
|
52
|
+
static fromBcs( data: Uint8Array ): CurrentDigest { return CurrentDigest.fromFields( CurrentDigest.bcs.parse(data) ) }
|
|
53
|
+
|
|
54
|
+
toJSONField() { return {
|
|
55
|
+
|
|
56
|
+
dummyField: this.dummyField,
|
|
57
|
+
|
|
58
|
+
} }
|
|
59
|
+
|
|
60
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
61
|
+
|
|
62
|
+
static fromJSONField( field: any ): CurrentDigest { return CurrentDigest.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
63
|
+
|
|
64
|
+
static fromJSON( json: Record<string, any> ): CurrentDigest { if (json.$typeName !== CurrentDigest.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
65
|
+
|
|
66
|
+
return CurrentDigest.fromJSONField( json, ) }
|
|
67
|
+
|
|
68
|
+
static fromSuiParsedData( content: SuiParsedData ): CurrentDigest { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isCurrentDigest(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a CurrentDigest object`); } return CurrentDigest.fromFieldsWithTypes( content ); }
|
|
69
|
+
|
|
70
|
+
static async fetch( client: SuiClient, id: string ): Promise<CurrentDigest> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching CurrentDigest object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isCurrentDigest(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a CurrentDigest object`); }
|
|
71
|
+
return CurrentDigest.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ============================== LatestOnly =============================== */
|
|
76
|
+
|
|
77
|
+
export function isLatestOnly(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::LatestOnly"; }
|
|
78
|
+
|
|
79
|
+
export interface LatestOnlyFields { dummyField: ToField<"bool"> }
|
|
80
|
+
|
|
81
|
+
export type LatestOnlyReified = Reified< LatestOnly, LatestOnlyFields >;
|
|
82
|
+
|
|
83
|
+
export class LatestOnly implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::LatestOnly"; static readonly $numTypeParams = 0;
|
|
84
|
+
|
|
85
|
+
readonly $typeName = LatestOnly.$typeName;
|
|
86
|
+
|
|
87
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::LatestOnly";
|
|
88
|
+
|
|
89
|
+
readonly $typeArgs: [];
|
|
90
|
+
|
|
91
|
+
readonly dummyField: ToField<"bool">
|
|
92
|
+
|
|
93
|
+
private constructor(typeArgs: [], fields: LatestOnlyFields, ) { this.$fullTypeName = composeSuiType( LatestOnly.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::LatestOnly"; this.$typeArgs = typeArgs;
|
|
94
|
+
|
|
95
|
+
this.dummyField = fields.dummyField; }
|
|
96
|
+
|
|
97
|
+
static reified( ): LatestOnlyReified { return { typeName: LatestOnly.$typeName, fullTypeName: composeSuiType( LatestOnly.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::LatestOnly", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => LatestOnly.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => LatestOnly.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => LatestOnly.fromBcs( data, ), bcs: LatestOnly.bcs, fromJSONField: (field: any) => LatestOnly.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => LatestOnly.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => LatestOnly.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => LatestOnly.fetch( client, id, ), new: ( fields: LatestOnlyFields, ) => { return new LatestOnly( [], fields ) }, kind: "StructClassReified", } }
|
|
98
|
+
|
|
99
|
+
static get r() { return LatestOnly.reified() }
|
|
100
|
+
|
|
101
|
+
static phantom( ): PhantomReified<ToTypeStr<LatestOnly>> { return phantom(LatestOnly.reified( )); } static get p() { return LatestOnly.phantom() }
|
|
102
|
+
|
|
103
|
+
static get bcs() { return bcs.struct("LatestOnly", {
|
|
104
|
+
|
|
105
|
+
dummy_field: bcs.bool()
|
|
106
|
+
|
|
107
|
+
}) };
|
|
108
|
+
|
|
109
|
+
static fromFields( fields: Record<string, any> ): LatestOnly { return LatestOnly.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
110
|
+
|
|
111
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): LatestOnly { if (!isLatestOnly(item.type)) { throw new Error("not a LatestOnly type");
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return LatestOnly.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
116
|
+
|
|
117
|
+
static fromBcs( data: Uint8Array ): LatestOnly { return LatestOnly.fromFields( LatestOnly.bcs.parse(data) ) }
|
|
118
|
+
|
|
119
|
+
toJSONField() { return {
|
|
120
|
+
|
|
121
|
+
dummyField: this.dummyField,
|
|
122
|
+
|
|
123
|
+
} }
|
|
124
|
+
|
|
125
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
126
|
+
|
|
127
|
+
static fromJSONField( field: any ): LatestOnly { return LatestOnly.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
128
|
+
|
|
129
|
+
static fromJSON( json: Record<string, any> ): LatestOnly { if (json.$typeName !== LatestOnly.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
130
|
+
|
|
131
|
+
return LatestOnly.fromJSONField( json, ) }
|
|
132
|
+
|
|
133
|
+
static fromSuiParsedData( content: SuiParsedData ): LatestOnly { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isLatestOnly(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a LatestOnly object`); } return LatestOnly.fromFieldsWithTypes( content ); }
|
|
134
|
+
|
|
135
|
+
static async fetch( client: SuiClient, id: string ): Promise<LatestOnly> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching LatestOnly object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isLatestOnly(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a LatestOnly object`); }
|
|
136
|
+
return LatestOnly.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ============================== State =============================== */
|
|
141
|
+
|
|
142
|
+
export function isState(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::State"; }
|
|
143
|
+
|
|
144
|
+
export interface StateFields { id: ToField<UID>; governanceDataSource: ToField<DataSource>; stalePriceThreshold: ToField<"u64">; baseUpdateFee: ToField<"u64">; feeRecipientAddress: ToField<"address">; lastExecutedGovernanceSequence: ToField<"u64">; consumedVaas: ToField<ConsumedVAAs>; upgradeCap: ToField<UpgradeCap> }
|
|
145
|
+
|
|
146
|
+
export type StateReified = Reified< State, StateFields >;
|
|
147
|
+
|
|
148
|
+
export class State implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::State"; static readonly $numTypeParams = 0;
|
|
149
|
+
|
|
150
|
+
readonly $typeName = State.$typeName;
|
|
151
|
+
|
|
152
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::State";
|
|
153
|
+
|
|
154
|
+
readonly $typeArgs: [];
|
|
155
|
+
|
|
156
|
+
readonly id: ToField<UID>; readonly governanceDataSource: ToField<DataSource>; readonly stalePriceThreshold: ToField<"u64">; readonly baseUpdateFee: ToField<"u64">; readonly feeRecipientAddress: ToField<"address">; readonly lastExecutedGovernanceSequence: ToField<"u64">; readonly consumedVaas: ToField<ConsumedVAAs>; readonly upgradeCap: ToField<UpgradeCap>
|
|
157
|
+
|
|
158
|
+
private constructor(typeArgs: [], fields: StateFields, ) { this.$fullTypeName = composeSuiType( State.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::State"; this.$typeArgs = typeArgs;
|
|
159
|
+
|
|
160
|
+
this.id = fields.id;; this.governanceDataSource = fields.governanceDataSource;; this.stalePriceThreshold = fields.stalePriceThreshold;; this.baseUpdateFee = fields.baseUpdateFee;; this.feeRecipientAddress = fields.feeRecipientAddress;; this.lastExecutedGovernanceSequence = fields.lastExecutedGovernanceSequence;; this.consumedVaas = fields.consumedVaas;; this.upgradeCap = fields.upgradeCap; }
|
|
161
|
+
|
|
162
|
+
static reified( ): StateReified { return { typeName: State.$typeName, fullTypeName: composeSuiType( State.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::state::State", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => State.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => State.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => State.fromBcs( data, ), bcs: State.bcs, fromJSONField: (field: any) => State.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => State.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => State.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => State.fetch( client, id, ), new: ( fields: StateFields, ) => { return new State( [], fields ) }, kind: "StructClassReified", } }
|
|
163
|
+
|
|
164
|
+
static get r() { return State.reified() }
|
|
165
|
+
|
|
166
|
+
static phantom( ): PhantomReified<ToTypeStr<State>> { return phantom(State.reified( )); } static get p() { return State.phantom() }
|
|
167
|
+
|
|
168
|
+
static get bcs() { return bcs.struct("State", {
|
|
169
|
+
|
|
170
|
+
id: UID.bcs, governance_data_source: DataSource.bcs, stale_price_threshold: bcs.u64(), base_update_fee: bcs.u64(), fee_recipient_address: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), last_executed_governance_sequence: bcs.u64(), consumed_vaas: ConsumedVAAs.bcs, upgrade_cap: UpgradeCap.bcs
|
|
171
|
+
|
|
172
|
+
}) };
|
|
173
|
+
|
|
174
|
+
static fromFields( fields: Record<string, any> ): State { return State.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), governanceDataSource: decodeFromFields(DataSource.reified(), fields.governance_data_source), stalePriceThreshold: decodeFromFields("u64", fields.stale_price_threshold), baseUpdateFee: decodeFromFields("u64", fields.base_update_fee), feeRecipientAddress: decodeFromFields("address", fields.fee_recipient_address), lastExecutedGovernanceSequence: decodeFromFields("u64", fields.last_executed_governance_sequence), consumedVaas: decodeFromFields(ConsumedVAAs.reified(), fields.consumed_vaas), upgradeCap: decodeFromFields(UpgradeCap.reified(), fields.upgrade_cap) } ) }
|
|
175
|
+
|
|
176
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): State { if (!isState(item.type)) { throw new Error("not a State type");
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return State.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), governanceDataSource: decodeFromFieldsWithTypes(DataSource.reified(), item.fields.governance_data_source), stalePriceThreshold: decodeFromFieldsWithTypes("u64", item.fields.stale_price_threshold), baseUpdateFee: decodeFromFieldsWithTypes("u64", item.fields.base_update_fee), feeRecipientAddress: decodeFromFieldsWithTypes("address", item.fields.fee_recipient_address), lastExecutedGovernanceSequence: decodeFromFieldsWithTypes("u64", item.fields.last_executed_governance_sequence), consumedVaas: decodeFromFieldsWithTypes(ConsumedVAAs.reified(), item.fields.consumed_vaas), upgradeCap: decodeFromFieldsWithTypes(UpgradeCap.reified(), item.fields.upgrade_cap) } ) }
|
|
181
|
+
|
|
182
|
+
static fromBcs( data: Uint8Array ): State { return State.fromFields( State.bcs.parse(data) ) }
|
|
183
|
+
|
|
184
|
+
toJSONField() { return {
|
|
185
|
+
|
|
186
|
+
id: this.id,governanceDataSource: this.governanceDataSource.toJSONField(),stalePriceThreshold: this.stalePriceThreshold.toString(),baseUpdateFee: this.baseUpdateFee.toString(),feeRecipientAddress: this.feeRecipientAddress,lastExecutedGovernanceSequence: this.lastExecutedGovernanceSequence.toString(),consumedVaas: this.consumedVaas.toJSONField(),upgradeCap: this.upgradeCap.toJSONField(),
|
|
187
|
+
|
|
188
|
+
} }
|
|
189
|
+
|
|
190
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
191
|
+
|
|
192
|
+
static fromJSONField( field: any ): State { return State.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), governanceDataSource: decodeFromJSONField(DataSource.reified(), field.governanceDataSource), stalePriceThreshold: decodeFromJSONField("u64", field.stalePriceThreshold), baseUpdateFee: decodeFromJSONField("u64", field.baseUpdateFee), feeRecipientAddress: decodeFromJSONField("address", field.feeRecipientAddress), lastExecutedGovernanceSequence: decodeFromJSONField("u64", field.lastExecutedGovernanceSequence), consumedVaas: decodeFromJSONField(ConsumedVAAs.reified(), field.consumedVaas), upgradeCap: decodeFromJSONField(UpgradeCap.reified(), field.upgradeCap) } ) }
|
|
193
|
+
|
|
194
|
+
static fromJSON( json: Record<string, any> ): State { if (json.$typeName !== State.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
195
|
+
|
|
196
|
+
return State.fromJSONField( json, ) }
|
|
197
|
+
|
|
198
|
+
static fromSuiParsedData( content: SuiParsedData ): State { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isState(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a State object`); } return State.fromFieldsWithTypes( content ); }
|
|
199
|
+
|
|
200
|
+
static async fetch( client: SuiClient, id: string ): Promise<State> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching State object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isState(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a State object`); }
|
|
201
|
+
return State.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
202
|
+
|
|
203
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
/* ============================== V__0_1_1 =============================== */
|
|
7
|
+
|
|
8
|
+
export function isV__0_1_1(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__0_1_1"; }
|
|
9
|
+
|
|
10
|
+
export interface V__0_1_1Fields { dummyField: ToField<"bool"> }
|
|
11
|
+
|
|
12
|
+
export type V__0_1_1Reified = Reified< V__0_1_1, V__0_1_1Fields >;
|
|
13
|
+
|
|
14
|
+
export class V__0_1_1 implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__0_1_1"; static readonly $numTypeParams = 0;
|
|
15
|
+
|
|
16
|
+
readonly $typeName = V__0_1_1.$typeName;
|
|
17
|
+
|
|
18
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__0_1_1";
|
|
19
|
+
|
|
20
|
+
readonly $typeArgs: [];
|
|
21
|
+
|
|
22
|
+
readonly dummyField: ToField<"bool">
|
|
23
|
+
|
|
24
|
+
private constructor(typeArgs: [], fields: V__0_1_1Fields, ) { this.$fullTypeName = composeSuiType( V__0_1_1.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__0_1_1"; this.$typeArgs = typeArgs;
|
|
25
|
+
|
|
26
|
+
this.dummyField = fields.dummyField; }
|
|
27
|
+
|
|
28
|
+
static reified( ): V__0_1_1Reified { return { typeName: V__0_1_1.$typeName, fullTypeName: composeSuiType( V__0_1_1.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__0_1_1", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => V__0_1_1.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => V__0_1_1.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => V__0_1_1.fromBcs( data, ), bcs: V__0_1_1.bcs, fromJSONField: (field: any) => V__0_1_1.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => V__0_1_1.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => V__0_1_1.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => V__0_1_1.fetch( client, id, ), new: ( fields: V__0_1_1Fields, ) => { return new V__0_1_1( [], fields ) }, kind: "StructClassReified", } }
|
|
29
|
+
|
|
30
|
+
static get r() { return V__0_1_1.reified() }
|
|
31
|
+
|
|
32
|
+
static phantom( ): PhantomReified<ToTypeStr<V__0_1_1>> { return phantom(V__0_1_1.reified( )); } static get p() { return V__0_1_1.phantom() }
|
|
33
|
+
|
|
34
|
+
static get bcs() { return bcs.struct("V__0_1_1", {
|
|
35
|
+
|
|
36
|
+
dummy_field: bcs.bool()
|
|
37
|
+
|
|
38
|
+
}) };
|
|
39
|
+
|
|
40
|
+
static fromFields( fields: Record<string, any> ): V__0_1_1 { return V__0_1_1.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
41
|
+
|
|
42
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): V__0_1_1 { if (!isV__0_1_1(item.type)) { throw new Error("not a V__0_1_1 type");
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return V__0_1_1.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
47
|
+
|
|
48
|
+
static fromBcs( data: Uint8Array ): V__0_1_1 { return V__0_1_1.fromFields( V__0_1_1.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 ): V__0_1_1 { return V__0_1_1.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
59
|
+
|
|
60
|
+
static fromJSON( json: Record<string, any> ): V__0_1_1 { if (json.$typeName !== V__0_1_1.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
61
|
+
|
|
62
|
+
return V__0_1_1.fromJSONField( json, ) }
|
|
63
|
+
|
|
64
|
+
static fromSuiParsedData( content: SuiParsedData ): V__0_1_1 { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isV__0_1_1(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a V__0_1_1 object`); } return V__0_1_1.fromFieldsWithTypes( content ); }
|
|
65
|
+
|
|
66
|
+
static async fetch( client: SuiClient, id: string ): Promise<V__0_1_1> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching V__0_1_1 object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isV__0_1_1(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a V__0_1_1 object`); }
|
|
67
|
+
return V__0_1_1.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ============================== V__DUMMY =============================== */
|
|
72
|
+
|
|
73
|
+
export function isV__DUMMY(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__DUMMY"; }
|
|
74
|
+
|
|
75
|
+
export interface V__DUMMYFields { dummyField: ToField<"bool"> }
|
|
76
|
+
|
|
77
|
+
export type V__DUMMYReified = Reified< V__DUMMY, V__DUMMYFields >;
|
|
78
|
+
|
|
79
|
+
export class V__DUMMY implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__DUMMY"; static readonly $numTypeParams = 0;
|
|
80
|
+
|
|
81
|
+
readonly $typeName = V__DUMMY.$typeName;
|
|
82
|
+
|
|
83
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__DUMMY";
|
|
84
|
+
|
|
85
|
+
readonly $typeArgs: [];
|
|
86
|
+
|
|
87
|
+
readonly dummyField: ToField<"bool">
|
|
88
|
+
|
|
89
|
+
private constructor(typeArgs: [], fields: V__DUMMYFields, ) { this.$fullTypeName = composeSuiType( V__DUMMY.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__DUMMY"; this.$typeArgs = typeArgs;
|
|
90
|
+
|
|
91
|
+
this.dummyField = fields.dummyField; }
|
|
92
|
+
|
|
93
|
+
static reified( ): V__DUMMYReified { return { typeName: V__DUMMY.$typeName, fullTypeName: composeSuiType( V__DUMMY.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::version_control::V__DUMMY", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => V__DUMMY.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => V__DUMMY.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => V__DUMMY.fromBcs( data, ), bcs: V__DUMMY.bcs, fromJSONField: (field: any) => V__DUMMY.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => V__DUMMY.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => V__DUMMY.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => V__DUMMY.fetch( client, id, ), new: ( fields: V__DUMMYFields, ) => { return new V__DUMMY( [], fields ) }, kind: "StructClassReified", } }
|
|
94
|
+
|
|
95
|
+
static get r() { return V__DUMMY.reified() }
|
|
96
|
+
|
|
97
|
+
static phantom( ): PhantomReified<ToTypeStr<V__DUMMY>> { return phantom(V__DUMMY.reified( )); } static get p() { return V__DUMMY.phantom() }
|
|
98
|
+
|
|
99
|
+
static get bcs() { return bcs.struct("V__DUMMY", {
|
|
100
|
+
|
|
101
|
+
dummy_field: bcs.bool()
|
|
102
|
+
|
|
103
|
+
}) };
|
|
104
|
+
|
|
105
|
+
static fromFields( fields: Record<string, any> ): V__DUMMY { return V__DUMMY.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
106
|
+
|
|
107
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): V__DUMMY { if (!isV__DUMMY(item.type)) { throw new Error("not a V__DUMMY type");
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return V__DUMMY.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
112
|
+
|
|
113
|
+
static fromBcs( data: Uint8Array ): V__DUMMY { return V__DUMMY.fromFields( V__DUMMY.bcs.parse(data) ) }
|
|
114
|
+
|
|
115
|
+
toJSONField() { return {
|
|
116
|
+
|
|
117
|
+
dummyField: this.dummyField,
|
|
118
|
+
|
|
119
|
+
} }
|
|
120
|
+
|
|
121
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
122
|
+
|
|
123
|
+
static fromJSONField( field: any ): V__DUMMY { return V__DUMMY.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
124
|
+
|
|
125
|
+
static fromJSON( json: Record<string, any> ): V__DUMMY { if (json.$typeName !== V__DUMMY.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
126
|
+
|
|
127
|
+
return V__DUMMY.fromJSONField( json, ) }
|
|
128
|
+
|
|
129
|
+
static fromSuiParsedData( content: SuiParsedData ): V__DUMMY { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isV__DUMMY(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a V__DUMMY object`); } return V__DUMMY.fromFieldsWithTypes( content ); }
|
|
130
|
+
|
|
131
|
+
static async fetch( client: SuiClient, id: string ): Promise<V__DUMMY> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching V__DUMMY object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isV__DUMMY(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a V__DUMMY object`); }
|
|
132
|
+
return V__DUMMY.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
133
|
+
|
|
134
|
+
}
|