@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 * as reified from "../../../../_framework/reified";
|
|
2
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, Vector, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom} from "../../../../_framework/reified";
|
|
3
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
4
|
+
import {bcs, fromB64} from "@mysten/bcs";
|
|
5
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
6
|
+
|
|
7
|
+
/* ============================== PriceIdentifier =============================== */
|
|
8
|
+
|
|
9
|
+
export function isPriceIdentifier(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_identifier::PriceIdentifier"; }
|
|
10
|
+
|
|
11
|
+
export interface PriceIdentifierFields { bytes: ToField<Vector<"u8">> }
|
|
12
|
+
|
|
13
|
+
export type PriceIdentifierReified = Reified< PriceIdentifier, PriceIdentifierFields >;
|
|
14
|
+
|
|
15
|
+
export class PriceIdentifier implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_identifier::PriceIdentifier"; static readonly $numTypeParams = 0;
|
|
16
|
+
|
|
17
|
+
readonly $typeName = PriceIdentifier.$typeName;
|
|
18
|
+
|
|
19
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_identifier::PriceIdentifier";
|
|
20
|
+
|
|
21
|
+
readonly $typeArgs: [];
|
|
22
|
+
|
|
23
|
+
readonly bytes: ToField<Vector<"u8">>
|
|
24
|
+
|
|
25
|
+
private constructor(typeArgs: [], fields: PriceIdentifierFields, ) { this.$fullTypeName = composeSuiType( PriceIdentifier.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_identifier::PriceIdentifier"; this.$typeArgs = typeArgs;
|
|
26
|
+
|
|
27
|
+
this.bytes = fields.bytes; }
|
|
28
|
+
|
|
29
|
+
static reified( ): PriceIdentifierReified { return { typeName: PriceIdentifier.$typeName, fullTypeName: composeSuiType( PriceIdentifier.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_identifier::PriceIdentifier", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PriceIdentifier.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PriceIdentifier.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PriceIdentifier.fromBcs( data, ), bcs: PriceIdentifier.bcs, fromJSONField: (field: any) => PriceIdentifier.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PriceIdentifier.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PriceIdentifier.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PriceIdentifier.fetch( client, id, ), new: ( fields: PriceIdentifierFields, ) => { return new PriceIdentifier( [], fields ) }, kind: "StructClassReified", } }
|
|
30
|
+
|
|
31
|
+
static get r() { return PriceIdentifier.reified() }
|
|
32
|
+
|
|
33
|
+
static phantom( ): PhantomReified<ToTypeStr<PriceIdentifier>> { return phantom(PriceIdentifier.reified( )); } static get p() { return PriceIdentifier.phantom() }
|
|
34
|
+
|
|
35
|
+
static get bcs() { return bcs.struct("PriceIdentifier", {
|
|
36
|
+
|
|
37
|
+
bytes: bcs.vector(bcs.u8())
|
|
38
|
+
|
|
39
|
+
}) };
|
|
40
|
+
|
|
41
|
+
static fromFields( fields: Record<string, any> ): PriceIdentifier { return PriceIdentifier.reified( ).new( { bytes: decodeFromFields(reified.vector("u8"), fields.bytes) } ) }
|
|
42
|
+
|
|
43
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PriceIdentifier { if (!isPriceIdentifier(item.type)) { throw new Error("not a PriceIdentifier type");
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return PriceIdentifier.reified( ).new( { bytes: decodeFromFieldsWithTypes(reified.vector("u8"), item.fields.bytes) } ) }
|
|
48
|
+
|
|
49
|
+
static fromBcs( data: Uint8Array ): PriceIdentifier { return PriceIdentifier.fromFields( PriceIdentifier.bcs.parse(data) ) }
|
|
50
|
+
|
|
51
|
+
toJSONField() { return {
|
|
52
|
+
|
|
53
|
+
bytes: fieldToJSON<Vector<"u8">>(`vector<u8>`, this.bytes),
|
|
54
|
+
|
|
55
|
+
} }
|
|
56
|
+
|
|
57
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
58
|
+
|
|
59
|
+
static fromJSONField( field: any ): PriceIdentifier { return PriceIdentifier.reified( ).new( { bytes: decodeFromJSONField(reified.vector("u8"), field.bytes) } ) }
|
|
60
|
+
|
|
61
|
+
static fromJSON( json: Record<string, any> ): PriceIdentifier { if (json.$typeName !== PriceIdentifier.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
62
|
+
|
|
63
|
+
return PriceIdentifier.fromJSONField( json, ) }
|
|
64
|
+
|
|
65
|
+
static fromSuiParsedData( content: SuiParsedData ): PriceIdentifier { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPriceIdentifier(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PriceIdentifier object`); } return PriceIdentifier.fromFieldsWithTypes( content ); }
|
|
66
|
+
|
|
67
|
+
static async fetch( client: SuiClient, id: string ): Promise<PriceIdentifier> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PriceIdentifier object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPriceIdentifier(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PriceIdentifier object`); }
|
|
68
|
+
return PriceIdentifier.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 {PriceFeed} from "../price-feed/structs";
|
|
5
|
+
import {bcs, fromB64} from "@mysten/bcs";
|
|
6
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
7
|
+
|
|
8
|
+
/* ============================== PriceInfo =============================== */
|
|
9
|
+
|
|
10
|
+
export function isPriceInfo(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfo"; }
|
|
11
|
+
|
|
12
|
+
export interface PriceInfoFields { attestationTime: ToField<"u64">; arrivalTime: ToField<"u64">; priceFeed: ToField<PriceFeed> }
|
|
13
|
+
|
|
14
|
+
export type PriceInfoReified = Reified< PriceInfo, PriceInfoFields >;
|
|
15
|
+
|
|
16
|
+
export class PriceInfo implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfo"; static readonly $numTypeParams = 0;
|
|
17
|
+
|
|
18
|
+
readonly $typeName = PriceInfo.$typeName;
|
|
19
|
+
|
|
20
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfo";
|
|
21
|
+
|
|
22
|
+
readonly $typeArgs: [];
|
|
23
|
+
|
|
24
|
+
readonly attestationTime: ToField<"u64">; readonly arrivalTime: ToField<"u64">; readonly priceFeed: ToField<PriceFeed>
|
|
25
|
+
|
|
26
|
+
private constructor(typeArgs: [], fields: PriceInfoFields, ) { this.$fullTypeName = composeSuiType( PriceInfo.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfo"; this.$typeArgs = typeArgs;
|
|
27
|
+
|
|
28
|
+
this.attestationTime = fields.attestationTime;; this.arrivalTime = fields.arrivalTime;; this.priceFeed = fields.priceFeed; }
|
|
29
|
+
|
|
30
|
+
static reified( ): PriceInfoReified { return { typeName: PriceInfo.$typeName, fullTypeName: composeSuiType( PriceInfo.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfo", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PriceInfo.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PriceInfo.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PriceInfo.fromBcs( data, ), bcs: PriceInfo.bcs, fromJSONField: (field: any) => PriceInfo.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PriceInfo.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PriceInfo.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PriceInfo.fetch( client, id, ), new: ( fields: PriceInfoFields, ) => { return new PriceInfo( [], fields ) }, kind: "StructClassReified", } }
|
|
31
|
+
|
|
32
|
+
static get r() { return PriceInfo.reified() }
|
|
33
|
+
|
|
34
|
+
static phantom( ): PhantomReified<ToTypeStr<PriceInfo>> { return phantom(PriceInfo.reified( )); } static get p() { return PriceInfo.phantom() }
|
|
35
|
+
|
|
36
|
+
static get bcs() { return bcs.struct("PriceInfo", {
|
|
37
|
+
|
|
38
|
+
attestation_time: bcs.u64(), arrival_time: bcs.u64(), price_feed: PriceFeed.bcs
|
|
39
|
+
|
|
40
|
+
}) };
|
|
41
|
+
|
|
42
|
+
static fromFields( fields: Record<string, any> ): PriceInfo { return PriceInfo.reified( ).new( { attestationTime: decodeFromFields("u64", fields.attestation_time), arrivalTime: decodeFromFields("u64", fields.arrival_time), priceFeed: decodeFromFields(PriceFeed.reified(), fields.price_feed) } ) }
|
|
43
|
+
|
|
44
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PriceInfo { if (!isPriceInfo(item.type)) { throw new Error("not a PriceInfo type");
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return PriceInfo.reified( ).new( { attestationTime: decodeFromFieldsWithTypes("u64", item.fields.attestation_time), arrivalTime: decodeFromFieldsWithTypes("u64", item.fields.arrival_time), priceFeed: decodeFromFieldsWithTypes(PriceFeed.reified(), item.fields.price_feed) } ) }
|
|
49
|
+
|
|
50
|
+
static fromBcs( data: Uint8Array ): PriceInfo { return PriceInfo.fromFields( PriceInfo.bcs.parse(data) ) }
|
|
51
|
+
|
|
52
|
+
toJSONField() { return {
|
|
53
|
+
|
|
54
|
+
attestationTime: this.attestationTime.toString(),arrivalTime: this.arrivalTime.toString(),priceFeed: this.priceFeed.toJSONField(),
|
|
55
|
+
|
|
56
|
+
} }
|
|
57
|
+
|
|
58
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
59
|
+
|
|
60
|
+
static fromJSONField( field: any ): PriceInfo { return PriceInfo.reified( ).new( { attestationTime: decodeFromJSONField("u64", field.attestationTime), arrivalTime: decodeFromJSONField("u64", field.arrivalTime), priceFeed: decodeFromJSONField(PriceFeed.reified(), field.priceFeed) } ) }
|
|
61
|
+
|
|
62
|
+
static fromJSON( json: Record<string, any> ): PriceInfo { if (json.$typeName !== PriceInfo.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
63
|
+
|
|
64
|
+
return PriceInfo.fromJSONField( json, ) }
|
|
65
|
+
|
|
66
|
+
static fromSuiParsedData( content: SuiParsedData ): PriceInfo { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPriceInfo(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PriceInfo object`); } return PriceInfo.fromFieldsWithTypes( content ); }
|
|
67
|
+
|
|
68
|
+
static async fetch( client: SuiClient, id: string ): Promise<PriceInfo> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PriceInfo object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPriceInfo(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PriceInfo object`); }
|
|
69
|
+
return PriceInfo.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ============================== PriceInfoObject =============================== */
|
|
74
|
+
|
|
75
|
+
export function isPriceInfoObject(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfoObject"; }
|
|
76
|
+
|
|
77
|
+
export interface PriceInfoObjectFields { id: ToField<UID>; priceInfo: ToField<PriceInfo> }
|
|
78
|
+
|
|
79
|
+
export type PriceInfoObjectReified = Reified< PriceInfoObject, PriceInfoObjectFields >;
|
|
80
|
+
|
|
81
|
+
export class PriceInfoObject implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfoObject"; static readonly $numTypeParams = 0;
|
|
82
|
+
|
|
83
|
+
readonly $typeName = PriceInfoObject.$typeName;
|
|
84
|
+
|
|
85
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfoObject";
|
|
86
|
+
|
|
87
|
+
readonly $typeArgs: [];
|
|
88
|
+
|
|
89
|
+
readonly id: ToField<UID>; readonly priceInfo: ToField<PriceInfo>
|
|
90
|
+
|
|
91
|
+
private constructor(typeArgs: [], fields: PriceInfoObjectFields, ) { this.$fullTypeName = composeSuiType( PriceInfoObject.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfoObject"; this.$typeArgs = typeArgs;
|
|
92
|
+
|
|
93
|
+
this.id = fields.id;; this.priceInfo = fields.priceInfo; }
|
|
94
|
+
|
|
95
|
+
static reified( ): PriceInfoObjectReified { return { typeName: PriceInfoObject.$typeName, fullTypeName: composeSuiType( PriceInfoObject.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_info::PriceInfoObject", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PriceInfoObject.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PriceInfoObject.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PriceInfoObject.fromBcs( data, ), bcs: PriceInfoObject.bcs, fromJSONField: (field: any) => PriceInfoObject.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PriceInfoObject.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PriceInfoObject.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PriceInfoObject.fetch( client, id, ), new: ( fields: PriceInfoObjectFields, ) => { return new PriceInfoObject( [], fields ) }, kind: "StructClassReified", } }
|
|
96
|
+
|
|
97
|
+
static get r() { return PriceInfoObject.reified() }
|
|
98
|
+
|
|
99
|
+
static phantom( ): PhantomReified<ToTypeStr<PriceInfoObject>> { return phantom(PriceInfoObject.reified( )); } static get p() { return PriceInfoObject.phantom() }
|
|
100
|
+
|
|
101
|
+
static get bcs() { return bcs.struct("PriceInfoObject", {
|
|
102
|
+
|
|
103
|
+
id: UID.bcs, price_info: PriceInfo.bcs
|
|
104
|
+
|
|
105
|
+
}) };
|
|
106
|
+
|
|
107
|
+
static fromFields( fields: Record<string, any> ): PriceInfoObject { return PriceInfoObject.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), priceInfo: decodeFromFields(PriceInfo.reified(), fields.price_info) } ) }
|
|
108
|
+
|
|
109
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PriceInfoObject { if (!isPriceInfoObject(item.type)) { throw new Error("not a PriceInfoObject type");
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return PriceInfoObject.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), priceInfo: decodeFromFieldsWithTypes(PriceInfo.reified(), item.fields.price_info) } ) }
|
|
114
|
+
|
|
115
|
+
static fromBcs( data: Uint8Array ): PriceInfoObject { return PriceInfoObject.fromFields( PriceInfoObject.bcs.parse(data) ) }
|
|
116
|
+
|
|
117
|
+
toJSONField() { return {
|
|
118
|
+
|
|
119
|
+
id: this.id,priceInfo: this.priceInfo.toJSONField(),
|
|
120
|
+
|
|
121
|
+
} }
|
|
122
|
+
|
|
123
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
124
|
+
|
|
125
|
+
static fromJSONField( field: any ): PriceInfoObject { return PriceInfoObject.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), priceInfo: decodeFromJSONField(PriceInfo.reified(), field.priceInfo) } ) }
|
|
126
|
+
|
|
127
|
+
static fromJSON( json: Record<string, any> ): PriceInfoObject { if (json.$typeName !== PriceInfoObject.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
128
|
+
|
|
129
|
+
return PriceInfoObject.fromJSONField( json, ) }
|
|
130
|
+
|
|
131
|
+
static fromSuiParsedData( content: SuiParsedData ): PriceInfoObject { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPriceInfoObject(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PriceInfoObject object`); } return PriceInfoObject.fromFieldsWithTypes( content ); }
|
|
132
|
+
|
|
133
|
+
static async fetch( client: SuiClient, id: string ): Promise<PriceInfoObject> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PriceInfoObject object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPriceInfoObject(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PriceInfoObject object`); }
|
|
134
|
+
return PriceInfoObject.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
135
|
+
|
|
136
|
+
}
|
|
@@ -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
|
+
/* ============================== PriceStatus =============================== */
|
|
7
|
+
|
|
8
|
+
export function isPriceStatus(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_status::PriceStatus"; }
|
|
9
|
+
|
|
10
|
+
export interface PriceStatusFields { status: ToField<"u64"> }
|
|
11
|
+
|
|
12
|
+
export type PriceStatusReified = Reified< PriceStatus, PriceStatusFields >;
|
|
13
|
+
|
|
14
|
+
export class PriceStatus implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_status::PriceStatus"; static readonly $numTypeParams = 0;
|
|
15
|
+
|
|
16
|
+
readonly $typeName = PriceStatus.$typeName;
|
|
17
|
+
|
|
18
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_status::PriceStatus";
|
|
19
|
+
|
|
20
|
+
readonly $typeArgs: [];
|
|
21
|
+
|
|
22
|
+
readonly status: ToField<"u64">
|
|
23
|
+
|
|
24
|
+
private constructor(typeArgs: [], fields: PriceStatusFields, ) { this.$fullTypeName = composeSuiType( PriceStatus.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_status::PriceStatus"; this.$typeArgs = typeArgs;
|
|
25
|
+
|
|
26
|
+
this.status = fields.status; }
|
|
27
|
+
|
|
28
|
+
static reified( ): PriceStatusReified { return { typeName: PriceStatus.$typeName, fullTypeName: composeSuiType( PriceStatus.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::price_status::PriceStatus", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PriceStatus.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PriceStatus.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PriceStatus.fromBcs( data, ), bcs: PriceStatus.bcs, fromJSONField: (field: any) => PriceStatus.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PriceStatus.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PriceStatus.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PriceStatus.fetch( client, id, ), new: ( fields: PriceStatusFields, ) => { return new PriceStatus( [], fields ) }, kind: "StructClassReified", } }
|
|
29
|
+
|
|
30
|
+
static get r() { return PriceStatus.reified() }
|
|
31
|
+
|
|
32
|
+
static phantom( ): PhantomReified<ToTypeStr<PriceStatus>> { return phantom(PriceStatus.reified( )); } static get p() { return PriceStatus.phantom() }
|
|
33
|
+
|
|
34
|
+
static get bcs() { return bcs.struct("PriceStatus", {
|
|
35
|
+
|
|
36
|
+
status: bcs.u64()
|
|
37
|
+
|
|
38
|
+
}) };
|
|
39
|
+
|
|
40
|
+
static fromFields( fields: Record<string, any> ): PriceStatus { return PriceStatus.reified( ).new( { status: decodeFromFields("u64", fields.status) } ) }
|
|
41
|
+
|
|
42
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PriceStatus { if (!isPriceStatus(item.type)) { throw new Error("not a PriceStatus type");
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return PriceStatus.reified( ).new( { status: decodeFromFieldsWithTypes("u64", item.fields.status) } ) }
|
|
47
|
+
|
|
48
|
+
static fromBcs( data: Uint8Array ): PriceStatus { return PriceStatus.fromFields( PriceStatus.bcs.parse(data) ) }
|
|
49
|
+
|
|
50
|
+
toJSONField() { return {
|
|
51
|
+
|
|
52
|
+
status: this.status.toString(),
|
|
53
|
+
|
|
54
|
+
} }
|
|
55
|
+
|
|
56
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
57
|
+
|
|
58
|
+
static fromJSONField( field: any ): PriceStatus { return PriceStatus.reified( ).new( { status: decodeFromJSONField("u64", field.status) } ) }
|
|
59
|
+
|
|
60
|
+
static fromJSON( json: Record<string, any> ): PriceStatus { if (json.$typeName !== PriceStatus.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
61
|
+
|
|
62
|
+
return PriceStatus.fromJSONField( json, ) }
|
|
63
|
+
|
|
64
|
+
static fromSuiParsedData( content: SuiParsedData ): PriceStatus { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPriceStatus(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PriceStatus object`); } return PriceStatus.fromFieldsWithTypes( content ); }
|
|
65
|
+
|
|
66
|
+
static async fetch( client: SuiClient, id: string ): Promise<PriceStatus> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PriceStatus object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPriceStatus(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PriceStatus object`); }
|
|
67
|
+
return PriceStatus.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeStr, TypeArgument, Vector, assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom, toBcs, ToTypeStr as ToPhantom} from "../../../../_framework/reified";
|
|
3
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
4
|
+
import {Table} from "../../0x2/table/structs";
|
|
5
|
+
import {BcsType, bcs, fromB64} from "@mysten/bcs";
|
|
6
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
7
|
+
|
|
8
|
+
/* ============================== Set =============================== */
|
|
9
|
+
|
|
10
|
+
export function isSet(type: string): boolean { type = compressSuiType(type); return type.startsWith("0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Set<"); }
|
|
11
|
+
|
|
12
|
+
export interface SetFields<A extends TypeArgument> { keys: ToField<Vector<A>>; elems: ToField<Table<ToPhantom<A>, ToPhantom<Unit>>> }
|
|
13
|
+
|
|
14
|
+
export type SetReified<A extends TypeArgument> = Reified< Set<A>, SetFields<A> >;
|
|
15
|
+
|
|
16
|
+
export class Set<A extends TypeArgument> implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Set"; static readonly $numTypeParams = 1;
|
|
17
|
+
|
|
18
|
+
readonly $typeName = Set.$typeName;
|
|
19
|
+
|
|
20
|
+
readonly $fullTypeName: `0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Set<${ToTypeStr<A>}>`;
|
|
21
|
+
|
|
22
|
+
readonly $typeArgs: [ToTypeStr<A>];
|
|
23
|
+
|
|
24
|
+
readonly keys: ToField<Vector<A>>; readonly elems: ToField<Table<ToPhantom<A>, ToPhantom<Unit>>>
|
|
25
|
+
|
|
26
|
+
private constructor(typeArgs: [ToTypeStr<A>], fields: SetFields<A>, ) { this.$fullTypeName = composeSuiType( Set.$typeName, ...typeArgs ) as `0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Set<${ToTypeStr<A>}>`; this.$typeArgs = typeArgs;
|
|
27
|
+
|
|
28
|
+
this.keys = fields.keys;; this.elems = fields.elems; }
|
|
29
|
+
|
|
30
|
+
static reified<A extends Reified<TypeArgument, any>>( A: A ): SetReified<ToTypeArgument<A>> { return { typeName: Set.$typeName, fullTypeName: composeSuiType( Set.$typeName, ...[extractType(A)] ) as `0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Set<${ToTypeStr<ToTypeArgument<A>>}>`, typeArgs: [ extractType(A) ] as [ToTypeStr<ToTypeArgument<A>>], reifiedTypeArgs: [A], fromFields: (fields: Record<string, any>) => Set.fromFields( A, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Set.fromFieldsWithTypes( A, item, ), fromBcs: (data: Uint8Array) => Set.fromBcs( A, data, ), bcs: Set.bcs(toBcs(A)), fromJSONField: (field: any) => Set.fromJSONField( A, field, ), fromJSON: (json: Record<string, any>) => Set.fromJSON( A, json, ), fromSuiParsedData: (content: SuiParsedData) => Set.fromSuiParsedData( A, content, ), fetch: async (client: SuiClient, id: string) => Set.fetch( client, A, id, ), new: ( fields: SetFields<ToTypeArgument<A>>, ) => { return new Set( [extractType(A)], fields ) }, kind: "StructClassReified", } }
|
|
31
|
+
|
|
32
|
+
static get r() { return Set.reified }
|
|
33
|
+
|
|
34
|
+
static phantom<A extends Reified<TypeArgument, any>>( A: A ): PhantomReified<ToTypeStr<Set<ToTypeArgument<A>>>> { return phantom(Set.reified( A )); } static get p() { return Set.phantom }
|
|
35
|
+
|
|
36
|
+
static get bcs() { return <A extends BcsType<any>>(A: A) => bcs.struct(`Set<${A.name}>`, {
|
|
37
|
+
|
|
38
|
+
keys: bcs.vector(A), elems: Table.bcs
|
|
39
|
+
|
|
40
|
+
}) };
|
|
41
|
+
|
|
42
|
+
static fromFields<A extends Reified<TypeArgument, any>>( typeArg: A, fields: Record<string, any> ): Set<ToTypeArgument<A>> { return Set.reified( typeArg, ).new( { keys: decodeFromFields(reified.vector(typeArg), fields.keys), elems: decodeFromFields(Table.reified(reified.phantom(typeArg), reified.phantom(Unit.reified())), fields.elems) } ) }
|
|
43
|
+
|
|
44
|
+
static fromFieldsWithTypes<A extends Reified<TypeArgument, any>>( typeArg: A, item: FieldsWithTypes ): Set<ToTypeArgument<A>> { if (!isSet(item.type)) { throw new Error("not a Set type");
|
|
45
|
+
|
|
46
|
+
} assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
47
|
+
|
|
48
|
+
return Set.reified( typeArg, ).new( { keys: decodeFromFieldsWithTypes(reified.vector(typeArg), item.fields.keys), elems: decodeFromFieldsWithTypes(Table.reified(reified.phantom(typeArg), reified.phantom(Unit.reified())), item.fields.elems) } ) }
|
|
49
|
+
|
|
50
|
+
static fromBcs<A extends Reified<TypeArgument, any>>( typeArg: A, data: Uint8Array ): Set<ToTypeArgument<A>> { const typeArgs = [typeArg];
|
|
51
|
+
|
|
52
|
+
return Set.fromFields( typeArg, Set.bcs( toBcs(typeArgs[0]) ).parse(data) ) }
|
|
53
|
+
|
|
54
|
+
toJSONField() { return {
|
|
55
|
+
|
|
56
|
+
keys: fieldToJSON<Vector<A>>(`vector<${this.$typeArgs[0]}>`, this.keys),elems: this.elems.toJSONField(),
|
|
57
|
+
|
|
58
|
+
} }
|
|
59
|
+
|
|
60
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
61
|
+
|
|
62
|
+
static fromJSONField<A extends Reified<TypeArgument, any>>( typeArg: A, field: any ): Set<ToTypeArgument<A>> { return Set.reified( typeArg, ).new( { keys: decodeFromJSONField(reified.vector(typeArg), field.keys), elems: decodeFromJSONField(Table.reified(reified.phantom(typeArg), reified.phantom(Unit.reified())), field.elems) } ) }
|
|
63
|
+
|
|
64
|
+
static fromJSON<A extends Reified<TypeArgument, any>>( typeArg: A, json: Record<string, any> ): Set<ToTypeArgument<A>> { if (json.$typeName !== Set.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(Set.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
|
|
65
|
+
|
|
66
|
+
return Set.fromJSONField( typeArg, json, ) }
|
|
67
|
+
|
|
68
|
+
static fromSuiParsedData<A extends Reified<TypeArgument, any>>( typeArg: A, content: SuiParsedData ): Set<ToTypeArgument<A>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isSet(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Set object`); } return Set.fromFieldsWithTypes( typeArg, content ); }
|
|
69
|
+
|
|
70
|
+
static async fetch<A extends Reified<TypeArgument, any>>( client: SuiClient, typeArg: A, id: string ): Promise<Set<ToTypeArgument<A>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Set object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isSet(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Set object`); }
|
|
71
|
+
return Set.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ============================== Unit =============================== */
|
|
76
|
+
|
|
77
|
+
export function isUnit(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Unit"; }
|
|
78
|
+
|
|
79
|
+
export interface UnitFields { dummyField: ToField<"bool"> }
|
|
80
|
+
|
|
81
|
+
export type UnitReified = Reified< Unit, UnitFields >;
|
|
82
|
+
|
|
83
|
+
export class Unit implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Unit"; static readonly $numTypeParams = 0;
|
|
84
|
+
|
|
85
|
+
readonly $typeName = Unit.$typeName;
|
|
86
|
+
|
|
87
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Unit";
|
|
88
|
+
|
|
89
|
+
readonly $typeArgs: [];
|
|
90
|
+
|
|
91
|
+
readonly dummyField: ToField<"bool">
|
|
92
|
+
|
|
93
|
+
private constructor(typeArgs: [], fields: UnitFields, ) { this.$fullTypeName = composeSuiType( Unit.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Unit"; this.$typeArgs = typeArgs;
|
|
94
|
+
|
|
95
|
+
this.dummyField = fields.dummyField; }
|
|
96
|
+
|
|
97
|
+
static reified( ): UnitReified { return { typeName: Unit.$typeName, fullTypeName: composeSuiType( Unit.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set::Unit", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Unit.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Unit.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Unit.fromBcs( data, ), bcs: Unit.bcs, fromJSONField: (field: any) => Unit.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Unit.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Unit.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Unit.fetch( client, id, ), new: ( fields: UnitFields, ) => { return new Unit( [], fields ) }, kind: "StructClassReified", } }
|
|
98
|
+
|
|
99
|
+
static get r() { return Unit.reified() }
|
|
100
|
+
|
|
101
|
+
static phantom( ): PhantomReified<ToTypeStr<Unit>> { return phantom(Unit.reified( )); } static get p() { return Unit.phantom() }
|
|
102
|
+
|
|
103
|
+
static get bcs() { return bcs.struct("Unit", {
|
|
104
|
+
|
|
105
|
+
dummy_field: bcs.bool()
|
|
106
|
+
|
|
107
|
+
}) };
|
|
108
|
+
|
|
109
|
+
static fromFields( fields: Record<string, any> ): Unit { return Unit.reified( ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
|
|
110
|
+
|
|
111
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Unit { if (!isUnit(item.type)) { throw new Error("not a Unit type");
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return Unit.reified( ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
|
|
116
|
+
|
|
117
|
+
static fromBcs( data: Uint8Array ): Unit { return Unit.fromFields( Unit.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 ): Unit { return Unit.reified( ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
|
|
128
|
+
|
|
129
|
+
static fromJSON( json: Record<string, any> ): Unit { if (json.$typeName !== Unit.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
130
|
+
|
|
131
|
+
return Unit.fromJSONField( json, ) }
|
|
132
|
+
|
|
133
|
+
static fromSuiParsedData( content: SuiParsedData ): Unit { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUnit(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Unit object`); } return Unit.fromFieldsWithTypes( content ); }
|
|
134
|
+
|
|
135
|
+
static async fetch( client: SuiClient, id: string ): Promise<Unit> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Unit object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUnit(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Unit object`); }
|
|
136
|
+
return Unit.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
137
|
+
|
|
138
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, Vector, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom} from "../../../../_framework/reified";
|
|
3
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
4
|
+
import {DataSource} from "../data-source/structs";
|
|
5
|
+
import {bcs, fromB64} from "@mysten/bcs";
|
|
6
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
7
|
+
|
|
8
|
+
/* ============================== DataSources =============================== */
|
|
9
|
+
|
|
10
|
+
export function isDataSources(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_data_sources::DataSources"; }
|
|
11
|
+
|
|
12
|
+
export interface DataSourcesFields { sources: ToField<Vector<DataSource>> }
|
|
13
|
+
|
|
14
|
+
export type DataSourcesReified = Reified< DataSources, DataSourcesFields >;
|
|
15
|
+
|
|
16
|
+
export class DataSources implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_data_sources::DataSources"; static readonly $numTypeParams = 0;
|
|
17
|
+
|
|
18
|
+
readonly $typeName = DataSources.$typeName;
|
|
19
|
+
|
|
20
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_data_sources::DataSources";
|
|
21
|
+
|
|
22
|
+
readonly $typeArgs: [];
|
|
23
|
+
|
|
24
|
+
readonly sources: ToField<Vector<DataSource>>
|
|
25
|
+
|
|
26
|
+
private constructor(typeArgs: [], fields: DataSourcesFields, ) { this.$fullTypeName = composeSuiType( DataSources.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_data_sources::DataSources"; this.$typeArgs = typeArgs;
|
|
27
|
+
|
|
28
|
+
this.sources = fields.sources; }
|
|
29
|
+
|
|
30
|
+
static reified( ): DataSourcesReified { return { typeName: DataSources.$typeName, fullTypeName: composeSuiType( DataSources.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_data_sources::DataSources", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => DataSources.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => DataSources.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => DataSources.fromBcs( data, ), bcs: DataSources.bcs, fromJSONField: (field: any) => DataSources.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => DataSources.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => DataSources.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => DataSources.fetch( client, id, ), new: ( fields: DataSourcesFields, ) => { return new DataSources( [], fields ) }, kind: "StructClassReified", } }
|
|
31
|
+
|
|
32
|
+
static get r() { return DataSources.reified() }
|
|
33
|
+
|
|
34
|
+
static phantom( ): PhantomReified<ToTypeStr<DataSources>> { return phantom(DataSources.reified( )); } static get p() { return DataSources.phantom() }
|
|
35
|
+
|
|
36
|
+
static get bcs() { return bcs.struct("DataSources", {
|
|
37
|
+
|
|
38
|
+
sources: bcs.vector(DataSource.bcs)
|
|
39
|
+
|
|
40
|
+
}) };
|
|
41
|
+
|
|
42
|
+
static fromFields( fields: Record<string, any> ): DataSources { return DataSources.reified( ).new( { sources: decodeFromFields(reified.vector(DataSource.reified()), fields.sources) } ) }
|
|
43
|
+
|
|
44
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): DataSources { if (!isDataSources(item.type)) { throw new Error("not a DataSources type");
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return DataSources.reified( ).new( { sources: decodeFromFieldsWithTypes(reified.vector(DataSource.reified()), item.fields.sources) } ) }
|
|
49
|
+
|
|
50
|
+
static fromBcs( data: Uint8Array ): DataSources { return DataSources.fromFields( DataSources.bcs.parse(data) ) }
|
|
51
|
+
|
|
52
|
+
toJSONField() { return {
|
|
53
|
+
|
|
54
|
+
sources: fieldToJSON<Vector<DataSource>>(`vector<0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::data_source::DataSource>`, this.sources),
|
|
55
|
+
|
|
56
|
+
} }
|
|
57
|
+
|
|
58
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
59
|
+
|
|
60
|
+
static fromJSONField( field: any ): DataSources { return DataSources.reified( ).new( { sources: decodeFromJSONField(reified.vector(DataSource.reified()), field.sources) } ) }
|
|
61
|
+
|
|
62
|
+
static fromJSON( json: Record<string, any> ): DataSources { if (json.$typeName !== DataSources.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
63
|
+
|
|
64
|
+
return DataSources.fromJSONField( json, ) }
|
|
65
|
+
|
|
66
|
+
static fromSuiParsedData( content: SuiParsedData ): DataSources { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isDataSources(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a DataSources object`); } return DataSources.fromFieldsWithTypes( content ); }
|
|
67
|
+
|
|
68
|
+
static async fetch( client: SuiClient, id: string ): Promise<DataSources> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching DataSources object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isDataSources(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a DataSources object`); }
|
|
69
|
+
return DataSources.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
70
|
+
|
|
71
|
+
}
|
|
@@ -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, fromHEX, toHEX} from "@mysten/bcs";
|
|
4
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
5
|
+
|
|
6
|
+
/* ============================== PythFeeRecipient =============================== */
|
|
7
|
+
|
|
8
|
+
export function isPythFeeRecipient(type: string): boolean { type = compressSuiType(type); return type === "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_fee_recipient::PythFeeRecipient"; }
|
|
9
|
+
|
|
10
|
+
export interface PythFeeRecipientFields { recipient: ToField<"address"> }
|
|
11
|
+
|
|
12
|
+
export type PythFeeRecipientReified = Reified< PythFeeRecipient, PythFeeRecipientFields >;
|
|
13
|
+
|
|
14
|
+
export class PythFeeRecipient implements StructClass { static readonly $typeName = "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_fee_recipient::PythFeeRecipient"; static readonly $numTypeParams = 0;
|
|
15
|
+
|
|
16
|
+
readonly $typeName = PythFeeRecipient.$typeName;
|
|
17
|
+
|
|
18
|
+
readonly $fullTypeName: "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_fee_recipient::PythFeeRecipient";
|
|
19
|
+
|
|
20
|
+
readonly $typeArgs: [];
|
|
21
|
+
|
|
22
|
+
readonly recipient: ToField<"address">
|
|
23
|
+
|
|
24
|
+
private constructor(typeArgs: [], fields: PythFeeRecipientFields, ) { this.$fullTypeName = composeSuiType( PythFeeRecipient.$typeName, ...typeArgs ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_fee_recipient::PythFeeRecipient"; this.$typeArgs = typeArgs;
|
|
25
|
+
|
|
26
|
+
this.recipient = fields.recipient; }
|
|
27
|
+
|
|
28
|
+
static reified( ): PythFeeRecipientReified { return { typeName: PythFeeRecipient.$typeName, fullTypeName: composeSuiType( PythFeeRecipient.$typeName, ...[] ) as "0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3::set_fee_recipient::PythFeeRecipient", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PythFeeRecipient.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PythFeeRecipient.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PythFeeRecipient.fromBcs( data, ), bcs: PythFeeRecipient.bcs, fromJSONField: (field: any) => PythFeeRecipient.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PythFeeRecipient.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PythFeeRecipient.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PythFeeRecipient.fetch( client, id, ), new: ( fields: PythFeeRecipientFields, ) => { return new PythFeeRecipient( [], fields ) }, kind: "StructClassReified", } }
|
|
29
|
+
|
|
30
|
+
static get r() { return PythFeeRecipient.reified() }
|
|
31
|
+
|
|
32
|
+
static phantom( ): PhantomReified<ToTypeStr<PythFeeRecipient>> { return phantom(PythFeeRecipient.reified( )); } static get p() { return PythFeeRecipient.phantom() }
|
|
33
|
+
|
|
34
|
+
static get bcs() { return bcs.struct("PythFeeRecipient", {
|
|
35
|
+
|
|
36
|
+
recipient: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), })
|
|
37
|
+
|
|
38
|
+
}) };
|
|
39
|
+
|
|
40
|
+
static fromFields( fields: Record<string, any> ): PythFeeRecipient { return PythFeeRecipient.reified( ).new( { recipient: decodeFromFields("address", fields.recipient) } ) }
|
|
41
|
+
|
|
42
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PythFeeRecipient { if (!isPythFeeRecipient(item.type)) { throw new Error("not a PythFeeRecipient type");
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return PythFeeRecipient.reified( ).new( { recipient: decodeFromFieldsWithTypes("address", item.fields.recipient) } ) }
|
|
47
|
+
|
|
48
|
+
static fromBcs( data: Uint8Array ): PythFeeRecipient { return PythFeeRecipient.fromFields( PythFeeRecipient.bcs.parse(data) ) }
|
|
49
|
+
|
|
50
|
+
toJSONField() { return {
|
|
51
|
+
|
|
52
|
+
recipient: this.recipient,
|
|
53
|
+
|
|
54
|
+
} }
|
|
55
|
+
|
|
56
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
57
|
+
|
|
58
|
+
static fromJSONField( field: any ): PythFeeRecipient { return PythFeeRecipient.reified( ).new( { recipient: decodeFromJSONField("address", field.recipient) } ) }
|
|
59
|
+
|
|
60
|
+
static fromJSON( json: Record<string, any> ): PythFeeRecipient { if (json.$typeName !== PythFeeRecipient.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
61
|
+
|
|
62
|
+
return PythFeeRecipient.fromJSONField( json, ) }
|
|
63
|
+
|
|
64
|
+
static fromSuiParsedData( content: SuiParsedData ): PythFeeRecipient { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPythFeeRecipient(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PythFeeRecipient object`); } return PythFeeRecipient.fromFieldsWithTypes( content ); }
|
|
65
|
+
|
|
66
|
+
static async fetch( client: SuiClient, id: string ): Promise<PythFeeRecipient> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PythFeeRecipient object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPythFeeRecipient(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PythFeeRecipient object`); }
|
|
67
|
+
return PythFeeRecipient.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
68
|
+
|
|
69
|
+
}
|