@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,1054 @@
|
|
|
1
|
+
import * as reified from "../../../../_framework/reified";
|
|
2
|
+
import {PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr, Vector, assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom, ToTypeStr as ToPhantom} from "../../../../_framework/reified";
|
|
3
|
+
import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
|
|
4
|
+
import {String} from "../../0x1/string/structs";
|
|
5
|
+
import {TypeName} from "../../0x1/type-name/structs";
|
|
6
|
+
import {Balance} from "../../0x2/balance/structs";
|
|
7
|
+
import {ObjectTable} from "../../0x2/object-table/structs";
|
|
8
|
+
import {ID, UID} from "../../0x2/object/structs";
|
|
9
|
+
import {SUI} from "../../0x2/sui/structs";
|
|
10
|
+
import {TransferPolicy} from "../../0x2/transfer-policy/structs";
|
|
11
|
+
import {VecMap} from "../../0x2/vec-map/structs";
|
|
12
|
+
import {ManagerCap, Tails} from "../../0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs";
|
|
13
|
+
import {bcs, fromB64, fromHEX, toHEX} from "@mysten/bcs";
|
|
14
|
+
import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
|
|
15
|
+
|
|
16
|
+
/* ============================== WithdrawEvent =============================== */
|
|
17
|
+
|
|
18
|
+
export function isWithdrawEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::WithdrawEvent"; }
|
|
19
|
+
|
|
20
|
+
export interface WithdrawEventFields { sender: ToField<"address">; receiver: ToField<"address">; amount: ToField<"u64"> }
|
|
21
|
+
|
|
22
|
+
export type WithdrawEventReified = Reified< WithdrawEvent, WithdrawEventFields >;
|
|
23
|
+
|
|
24
|
+
export class WithdrawEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::WithdrawEvent"; static readonly $numTypeParams = 0;
|
|
25
|
+
|
|
26
|
+
readonly $typeName = WithdrawEvent.$typeName;
|
|
27
|
+
|
|
28
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::WithdrawEvent";
|
|
29
|
+
|
|
30
|
+
readonly $typeArgs: [];
|
|
31
|
+
|
|
32
|
+
readonly sender: ToField<"address">; readonly receiver: ToField<"address">; readonly amount: ToField<"u64">
|
|
33
|
+
|
|
34
|
+
private constructor(typeArgs: [], fields: WithdrawEventFields, ) { this.$fullTypeName = composeSuiType( WithdrawEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::WithdrawEvent"; this.$typeArgs = typeArgs;
|
|
35
|
+
|
|
36
|
+
this.sender = fields.sender;; this.receiver = fields.receiver;; this.amount = fields.amount; }
|
|
37
|
+
|
|
38
|
+
static reified( ): WithdrawEventReified { return { typeName: WithdrawEvent.$typeName, fullTypeName: composeSuiType( WithdrawEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::WithdrawEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => WithdrawEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => WithdrawEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => WithdrawEvent.fromBcs( data, ), bcs: WithdrawEvent.bcs, fromJSONField: (field: any) => WithdrawEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => WithdrawEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => WithdrawEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => WithdrawEvent.fetch( client, id, ), new: ( fields: WithdrawEventFields, ) => { return new WithdrawEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
39
|
+
|
|
40
|
+
static get r() { return WithdrawEvent.reified() }
|
|
41
|
+
|
|
42
|
+
static phantom( ): PhantomReified<ToTypeStr<WithdrawEvent>> { return phantom(WithdrawEvent.reified( )); } static get p() { return WithdrawEvent.phantom() }
|
|
43
|
+
|
|
44
|
+
static get bcs() { return bcs.struct("WithdrawEvent", {
|
|
45
|
+
|
|
46
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), receiver: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), amount: bcs.u64()
|
|
47
|
+
|
|
48
|
+
}) };
|
|
49
|
+
|
|
50
|
+
static fromFields( fields: Record<string, any> ): WithdrawEvent { return WithdrawEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), receiver: decodeFromFields("address", fields.receiver), amount: decodeFromFields("u64", fields.amount) } ) }
|
|
51
|
+
|
|
52
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): WithdrawEvent { if (!isWithdrawEvent(item.type)) { throw new Error("not a WithdrawEvent type");
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return WithdrawEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), receiver: decodeFromFieldsWithTypes("address", item.fields.receiver), amount: decodeFromFieldsWithTypes("u64", item.fields.amount) } ) }
|
|
57
|
+
|
|
58
|
+
static fromBcs( data: Uint8Array ): WithdrawEvent { return WithdrawEvent.fromFields( WithdrawEvent.bcs.parse(data) ) }
|
|
59
|
+
|
|
60
|
+
toJSONField() { return {
|
|
61
|
+
|
|
62
|
+
sender: this.sender,receiver: this.receiver,amount: this.amount.toString(),
|
|
63
|
+
|
|
64
|
+
} }
|
|
65
|
+
|
|
66
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
67
|
+
|
|
68
|
+
static fromJSONField( field: any ): WithdrawEvent { return WithdrawEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), receiver: decodeFromJSONField("address", field.receiver), amount: decodeFromJSONField("u64", field.amount) } ) }
|
|
69
|
+
|
|
70
|
+
static fromJSON( json: Record<string, any> ): WithdrawEvent { if (json.$typeName !== WithdrawEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
71
|
+
|
|
72
|
+
return WithdrawEvent.fromJSONField( json, ) }
|
|
73
|
+
|
|
74
|
+
static fromSuiParsedData( content: SuiParsedData ): WithdrawEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isWithdrawEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a WithdrawEvent object`); } return WithdrawEvent.fromFieldsWithTypes( content ); }
|
|
75
|
+
|
|
76
|
+
static async fetch( client: SuiClient, id: string ): Promise<WithdrawEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching WithdrawEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isWithdrawEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a WithdrawEvent object`); }
|
|
77
|
+
return WithdrawEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ============================== LevelUpEvent =============================== */
|
|
82
|
+
|
|
83
|
+
export function isLevelUpEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::LevelUpEvent"; }
|
|
84
|
+
|
|
85
|
+
export interface LevelUpEventFields { nftId: ToField<ID>; number: ToField<"u64">; sender: ToField<"address">; level: ToField<"u64"> }
|
|
86
|
+
|
|
87
|
+
export type LevelUpEventReified = Reified< LevelUpEvent, LevelUpEventFields >;
|
|
88
|
+
|
|
89
|
+
export class LevelUpEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::LevelUpEvent"; static readonly $numTypeParams = 0;
|
|
90
|
+
|
|
91
|
+
readonly $typeName = LevelUpEvent.$typeName;
|
|
92
|
+
|
|
93
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::LevelUpEvent";
|
|
94
|
+
|
|
95
|
+
readonly $typeArgs: [];
|
|
96
|
+
|
|
97
|
+
readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly sender: ToField<"address">; readonly level: ToField<"u64">
|
|
98
|
+
|
|
99
|
+
private constructor(typeArgs: [], fields: LevelUpEventFields, ) { this.$fullTypeName = composeSuiType( LevelUpEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::LevelUpEvent"; this.$typeArgs = typeArgs;
|
|
100
|
+
|
|
101
|
+
this.nftId = fields.nftId;; this.number = fields.number;; this.sender = fields.sender;; this.level = fields.level; }
|
|
102
|
+
|
|
103
|
+
static reified( ): LevelUpEventReified { return { typeName: LevelUpEvent.$typeName, fullTypeName: composeSuiType( LevelUpEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::LevelUpEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => LevelUpEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => LevelUpEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => LevelUpEvent.fromBcs( data, ), bcs: LevelUpEvent.bcs, fromJSONField: (field: any) => LevelUpEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => LevelUpEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => LevelUpEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => LevelUpEvent.fetch( client, id, ), new: ( fields: LevelUpEventFields, ) => { return new LevelUpEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
104
|
+
|
|
105
|
+
static get r() { return LevelUpEvent.reified() }
|
|
106
|
+
|
|
107
|
+
static phantom( ): PhantomReified<ToTypeStr<LevelUpEvent>> { return phantom(LevelUpEvent.reified( )); } static get p() { return LevelUpEvent.phantom() }
|
|
108
|
+
|
|
109
|
+
static get bcs() { return bcs.struct("LevelUpEvent", {
|
|
110
|
+
|
|
111
|
+
nft_id: ID.bcs, number: bcs.u64(), sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), level: bcs.u64()
|
|
112
|
+
|
|
113
|
+
}) };
|
|
114
|
+
|
|
115
|
+
static fromFields( fields: Record<string, any> ): LevelUpEvent { return LevelUpEvent.reified( ).new( { nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), sender: decodeFromFields("address", fields.sender), level: decodeFromFields("u64", fields.level) } ) }
|
|
116
|
+
|
|
117
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): LevelUpEvent { if (!isLevelUpEvent(item.type)) { throw new Error("not a LevelUpEvent type");
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return LevelUpEvent.reified( ).new( { nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), sender: decodeFromFieldsWithTypes("address", item.fields.sender), level: decodeFromFieldsWithTypes("u64", item.fields.level) } ) }
|
|
122
|
+
|
|
123
|
+
static fromBcs( data: Uint8Array ): LevelUpEvent { return LevelUpEvent.fromFields( LevelUpEvent.bcs.parse(data) ) }
|
|
124
|
+
|
|
125
|
+
toJSONField() { return {
|
|
126
|
+
|
|
127
|
+
nftId: this.nftId,number: this.number.toString(),sender: this.sender,level: this.level.toString(),
|
|
128
|
+
|
|
129
|
+
} }
|
|
130
|
+
|
|
131
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
132
|
+
|
|
133
|
+
static fromJSONField( field: any ): LevelUpEvent { return LevelUpEvent.reified( ).new( { nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), sender: decodeFromJSONField("address", field.sender), level: decodeFromJSONField("u64", field.level) } ) }
|
|
134
|
+
|
|
135
|
+
static fromJSON( json: Record<string, any> ): LevelUpEvent { if (json.$typeName !== LevelUpEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
136
|
+
|
|
137
|
+
return LevelUpEvent.fromJSONField( json, ) }
|
|
138
|
+
|
|
139
|
+
static fromSuiParsedData( content: SuiParsedData ): LevelUpEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isLevelUpEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a LevelUpEvent object`); } return LevelUpEvent.fromFieldsWithTypes( content ); }
|
|
140
|
+
|
|
141
|
+
static async fetch( client: SuiClient, id: string ): Promise<LevelUpEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching LevelUpEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isLevelUpEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a LevelUpEvent object`); }
|
|
142
|
+
return LevelUpEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* ============================== NftExtension =============================== */
|
|
147
|
+
|
|
148
|
+
export function isNftExtension(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::NftExtension"; }
|
|
149
|
+
|
|
150
|
+
export interface NftExtensionFields { id: ToField<UID>; nftTable: ToField<ObjectTable<"address", ToPhantom<Tails>>>; nftManagerCap: ToField<ManagerCap>; policy: ToField<TransferPolicy<ToPhantom<Tails>>>; fee: ToField<Balance<ToPhantom<SUI>>> }
|
|
151
|
+
|
|
152
|
+
export type NftExtensionReified = Reified< NftExtension, NftExtensionFields >;
|
|
153
|
+
|
|
154
|
+
export class NftExtension implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::NftExtension"; static readonly $numTypeParams = 0;
|
|
155
|
+
|
|
156
|
+
readonly $typeName = NftExtension.$typeName;
|
|
157
|
+
|
|
158
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::NftExtension";
|
|
159
|
+
|
|
160
|
+
readonly $typeArgs: [];
|
|
161
|
+
|
|
162
|
+
readonly id: ToField<UID>; readonly nftTable: ToField<ObjectTable<"address", ToPhantom<Tails>>>; readonly nftManagerCap: ToField<ManagerCap>; readonly policy: ToField<TransferPolicy<ToPhantom<Tails>>>; readonly fee: ToField<Balance<ToPhantom<SUI>>>
|
|
163
|
+
|
|
164
|
+
private constructor(typeArgs: [], fields: NftExtensionFields, ) { this.$fullTypeName = composeSuiType( NftExtension.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::NftExtension"; this.$typeArgs = typeArgs;
|
|
165
|
+
|
|
166
|
+
this.id = fields.id;; this.nftTable = fields.nftTable;; this.nftManagerCap = fields.nftManagerCap;; this.policy = fields.policy;; this.fee = fields.fee; }
|
|
167
|
+
|
|
168
|
+
static reified( ): NftExtensionReified { return { typeName: NftExtension.$typeName, fullTypeName: composeSuiType( NftExtension.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::NftExtension", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => NftExtension.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => NftExtension.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => NftExtension.fromBcs( data, ), bcs: NftExtension.bcs, fromJSONField: (field: any) => NftExtension.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => NftExtension.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => NftExtension.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => NftExtension.fetch( client, id, ), new: ( fields: NftExtensionFields, ) => { return new NftExtension( [], fields ) }, kind: "StructClassReified", } }
|
|
169
|
+
|
|
170
|
+
static get r() { return NftExtension.reified() }
|
|
171
|
+
|
|
172
|
+
static phantom( ): PhantomReified<ToTypeStr<NftExtension>> { return phantom(NftExtension.reified( )); } static get p() { return NftExtension.phantom() }
|
|
173
|
+
|
|
174
|
+
static get bcs() { return bcs.struct("NftExtension", {
|
|
175
|
+
|
|
176
|
+
id: UID.bcs, nft_table: ObjectTable.bcs, nft_manager_cap: ManagerCap.bcs, policy: TransferPolicy.bcs, fee: Balance.bcs
|
|
177
|
+
|
|
178
|
+
}) };
|
|
179
|
+
|
|
180
|
+
static fromFields( fields: Record<string, any> ): NftExtension { return NftExtension.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), nftTable: decodeFromFields(ObjectTable.reified(reified.phantom("address"), reified.phantom(Tails.reified())), fields.nft_table), nftManagerCap: decodeFromFields(ManagerCap.reified(), fields.nft_manager_cap), policy: decodeFromFields(TransferPolicy.reified(reified.phantom(Tails.reified())), fields.policy), fee: decodeFromFields(Balance.reified(reified.phantom(SUI.reified())), fields.fee) } ) }
|
|
181
|
+
|
|
182
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): NftExtension { if (!isNftExtension(item.type)) { throw new Error("not a NftExtension type");
|
|
183
|
+
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return NftExtension.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), nftTable: decodeFromFieldsWithTypes(ObjectTable.reified(reified.phantom("address"), reified.phantom(Tails.reified())), item.fields.nft_table), nftManagerCap: decodeFromFieldsWithTypes(ManagerCap.reified(), item.fields.nft_manager_cap), policy: decodeFromFieldsWithTypes(TransferPolicy.reified(reified.phantom(Tails.reified())), item.fields.policy), fee: decodeFromFieldsWithTypes(Balance.reified(reified.phantom(SUI.reified())), item.fields.fee) } ) }
|
|
187
|
+
|
|
188
|
+
static fromBcs( data: Uint8Array ): NftExtension { return NftExtension.fromFields( NftExtension.bcs.parse(data) ) }
|
|
189
|
+
|
|
190
|
+
toJSONField() { return {
|
|
191
|
+
|
|
192
|
+
id: this.id,nftTable: this.nftTable.toJSONField(),nftManagerCap: this.nftManagerCap.toJSONField(),policy: this.policy.toJSONField(),fee: this.fee.toJSONField(),
|
|
193
|
+
|
|
194
|
+
} }
|
|
195
|
+
|
|
196
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
197
|
+
|
|
198
|
+
static fromJSONField( field: any ): NftExtension { return NftExtension.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), nftTable: decodeFromJSONField(ObjectTable.reified(reified.phantom("address"), reified.phantom(Tails.reified())), field.nftTable), nftManagerCap: decodeFromJSONField(ManagerCap.reified(), field.nftManagerCap), policy: decodeFromJSONField(TransferPolicy.reified(reified.phantom(Tails.reified())), field.policy), fee: decodeFromJSONField(Balance.reified(reified.phantom(SUI.reified())), field.fee) } ) }
|
|
199
|
+
|
|
200
|
+
static fromJSON( json: Record<string, any> ): NftExtension { if (json.$typeName !== NftExtension.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
201
|
+
|
|
202
|
+
return NftExtension.fromJSONField( json, ) }
|
|
203
|
+
|
|
204
|
+
static fromSuiParsedData( content: SuiParsedData ): NftExtension { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isNftExtension(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a NftExtension object`); } return NftExtension.fromFieldsWithTypes( content ); }
|
|
205
|
+
|
|
206
|
+
static async fetch( client: SuiClient, id: string ): Promise<NftExtension> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching NftExtension object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isNftExtension(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a NftExtension object`); }
|
|
207
|
+
return NftExtension.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* ============================== ClaimProfitSharingEvent =============================== */
|
|
212
|
+
|
|
213
|
+
export function isClaimProfitSharingEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ClaimProfitSharingEvent"; }
|
|
214
|
+
|
|
215
|
+
export interface ClaimProfitSharingEventFields { value: ToField<"u64">; token: ToField<TypeName>; sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64">; level: ToField<"u64"> }
|
|
216
|
+
|
|
217
|
+
export type ClaimProfitSharingEventReified = Reified< ClaimProfitSharingEvent, ClaimProfitSharingEventFields >;
|
|
218
|
+
|
|
219
|
+
export class ClaimProfitSharingEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ClaimProfitSharingEvent"; static readonly $numTypeParams = 0;
|
|
220
|
+
|
|
221
|
+
readonly $typeName = ClaimProfitSharingEvent.$typeName;
|
|
222
|
+
|
|
223
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ClaimProfitSharingEvent";
|
|
224
|
+
|
|
225
|
+
readonly $typeArgs: [];
|
|
226
|
+
|
|
227
|
+
readonly value: ToField<"u64">; readonly token: ToField<TypeName>; readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly level: ToField<"u64">
|
|
228
|
+
|
|
229
|
+
private constructor(typeArgs: [], fields: ClaimProfitSharingEventFields, ) { this.$fullTypeName = composeSuiType( ClaimProfitSharingEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ClaimProfitSharingEvent"; this.$typeArgs = typeArgs;
|
|
230
|
+
|
|
231
|
+
this.value = fields.value;; this.token = fields.token;; this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number;; this.level = fields.level; }
|
|
232
|
+
|
|
233
|
+
static reified( ): ClaimProfitSharingEventReified { return { typeName: ClaimProfitSharingEvent.$typeName, fullTypeName: composeSuiType( ClaimProfitSharingEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ClaimProfitSharingEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => ClaimProfitSharingEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => ClaimProfitSharingEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => ClaimProfitSharingEvent.fromBcs( data, ), bcs: ClaimProfitSharingEvent.bcs, fromJSONField: (field: any) => ClaimProfitSharingEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => ClaimProfitSharingEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => ClaimProfitSharingEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => ClaimProfitSharingEvent.fetch( client, id, ), new: ( fields: ClaimProfitSharingEventFields, ) => { return new ClaimProfitSharingEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
234
|
+
|
|
235
|
+
static get r() { return ClaimProfitSharingEvent.reified() }
|
|
236
|
+
|
|
237
|
+
static phantom( ): PhantomReified<ToTypeStr<ClaimProfitSharingEvent>> { return phantom(ClaimProfitSharingEvent.reified( )); } static get p() { return ClaimProfitSharingEvent.phantom() }
|
|
238
|
+
|
|
239
|
+
static get bcs() { return bcs.struct("ClaimProfitSharingEvent", {
|
|
240
|
+
|
|
241
|
+
value: bcs.u64(), token: TypeName.bcs, sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64(), level: bcs.u64()
|
|
242
|
+
|
|
243
|
+
}) };
|
|
244
|
+
|
|
245
|
+
static fromFields( fields: Record<string, any> ): ClaimProfitSharingEvent { return ClaimProfitSharingEvent.reified( ).new( { value: decodeFromFields("u64", fields.value), token: decodeFromFields(TypeName.reified(), fields.token), sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), level: decodeFromFields("u64", fields.level) } ) }
|
|
246
|
+
|
|
247
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): ClaimProfitSharingEvent { if (!isClaimProfitSharingEvent(item.type)) { throw new Error("not a ClaimProfitSharingEvent type");
|
|
248
|
+
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return ClaimProfitSharingEvent.reified( ).new( { value: decodeFromFieldsWithTypes("u64", item.fields.value), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), level: decodeFromFieldsWithTypes("u64", item.fields.level) } ) }
|
|
252
|
+
|
|
253
|
+
static fromBcs( data: Uint8Array ): ClaimProfitSharingEvent { return ClaimProfitSharingEvent.fromFields( ClaimProfitSharingEvent.bcs.parse(data) ) }
|
|
254
|
+
|
|
255
|
+
toJSONField() { return {
|
|
256
|
+
|
|
257
|
+
value: this.value.toString(),token: this.token.toJSONField(),sender: this.sender,nftId: this.nftId,number: this.number.toString(),level: this.level.toString(),
|
|
258
|
+
|
|
259
|
+
} }
|
|
260
|
+
|
|
261
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
262
|
+
|
|
263
|
+
static fromJSONField( field: any ): ClaimProfitSharingEvent { return ClaimProfitSharingEvent.reified( ).new( { value: decodeFromJSONField("u64", field.value), token: decodeFromJSONField(TypeName.reified(), field.token), sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), level: decodeFromJSONField("u64", field.level) } ) }
|
|
264
|
+
|
|
265
|
+
static fromJSON( json: Record<string, any> ): ClaimProfitSharingEvent { if (json.$typeName !== ClaimProfitSharingEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
266
|
+
|
|
267
|
+
return ClaimProfitSharingEvent.fromJSONField( json, ) }
|
|
268
|
+
|
|
269
|
+
static fromSuiParsedData( content: SuiParsedData ): ClaimProfitSharingEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isClaimProfitSharingEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a ClaimProfitSharingEvent object`); } return ClaimProfitSharingEvent.fromFieldsWithTypes( content ); }
|
|
270
|
+
|
|
271
|
+
static async fetch( client: SuiClient, id: string ): Promise<ClaimProfitSharingEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching ClaimProfitSharingEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isClaimProfitSharingEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a ClaimProfitSharingEvent object`); }
|
|
272
|
+
return ClaimProfitSharingEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
273
|
+
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* ============================== ClaimProfitSharingEventV2 =============================== */
|
|
277
|
+
|
|
278
|
+
export function isClaimProfitSharingEventV2(type: string): boolean { type = compressSuiType(type); return type === "0x48b15aafeb26ade39d0c2a3b8c3635bfe8396084812b6fcaeb1104eac793b4a5::tails_staking::ClaimProfitSharingEventV2"; }
|
|
279
|
+
|
|
280
|
+
export interface ClaimProfitSharingEventV2Fields { value: ToField<"u64">; token: ToField<TypeName>; sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64">; level: ToField<"u64">; name: ToField<String> }
|
|
281
|
+
|
|
282
|
+
export type ClaimProfitSharingEventV2Reified = Reified< ClaimProfitSharingEventV2, ClaimProfitSharingEventV2Fields >;
|
|
283
|
+
|
|
284
|
+
export class ClaimProfitSharingEventV2 implements StructClass { static readonly $typeName = "0x48b15aafeb26ade39d0c2a3b8c3635bfe8396084812b6fcaeb1104eac793b4a5::tails_staking::ClaimProfitSharingEventV2"; static readonly $numTypeParams = 0;
|
|
285
|
+
|
|
286
|
+
readonly $typeName = ClaimProfitSharingEventV2.$typeName;
|
|
287
|
+
|
|
288
|
+
readonly $fullTypeName: "0x48b15aafeb26ade39d0c2a3b8c3635bfe8396084812b6fcaeb1104eac793b4a5::tails_staking::ClaimProfitSharingEventV2";
|
|
289
|
+
|
|
290
|
+
readonly $typeArgs: [];
|
|
291
|
+
|
|
292
|
+
readonly value: ToField<"u64">; readonly token: ToField<TypeName>; readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly level: ToField<"u64">; readonly name: ToField<String>
|
|
293
|
+
|
|
294
|
+
private constructor(typeArgs: [], fields: ClaimProfitSharingEventV2Fields, ) { this.$fullTypeName = composeSuiType( ClaimProfitSharingEventV2.$typeName, ...typeArgs ) as "0x48b15aafeb26ade39d0c2a3b8c3635bfe8396084812b6fcaeb1104eac793b4a5::tails_staking::ClaimProfitSharingEventV2"; this.$typeArgs = typeArgs;
|
|
295
|
+
|
|
296
|
+
this.value = fields.value;; this.token = fields.token;; this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number;; this.level = fields.level;; this.name = fields.name; }
|
|
297
|
+
|
|
298
|
+
static reified( ): ClaimProfitSharingEventV2Reified { return { typeName: ClaimProfitSharingEventV2.$typeName, fullTypeName: composeSuiType( ClaimProfitSharingEventV2.$typeName, ...[] ) as "0x48b15aafeb26ade39d0c2a3b8c3635bfe8396084812b6fcaeb1104eac793b4a5::tails_staking::ClaimProfitSharingEventV2", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => ClaimProfitSharingEventV2.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => ClaimProfitSharingEventV2.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => ClaimProfitSharingEventV2.fromBcs( data, ), bcs: ClaimProfitSharingEventV2.bcs, fromJSONField: (field: any) => ClaimProfitSharingEventV2.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => ClaimProfitSharingEventV2.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => ClaimProfitSharingEventV2.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => ClaimProfitSharingEventV2.fetch( client, id, ), new: ( fields: ClaimProfitSharingEventV2Fields, ) => { return new ClaimProfitSharingEventV2( [], fields ) }, kind: "StructClassReified", } }
|
|
299
|
+
|
|
300
|
+
static get r() { return ClaimProfitSharingEventV2.reified() }
|
|
301
|
+
|
|
302
|
+
static phantom( ): PhantomReified<ToTypeStr<ClaimProfitSharingEventV2>> { return phantom(ClaimProfitSharingEventV2.reified( )); } static get p() { return ClaimProfitSharingEventV2.phantom() }
|
|
303
|
+
|
|
304
|
+
static get bcs() { return bcs.struct("ClaimProfitSharingEventV2", {
|
|
305
|
+
|
|
306
|
+
value: bcs.u64(), token: TypeName.bcs, sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64(), level: bcs.u64(), name: String.bcs
|
|
307
|
+
|
|
308
|
+
}) };
|
|
309
|
+
|
|
310
|
+
static fromFields( fields: Record<string, any> ): ClaimProfitSharingEventV2 { return ClaimProfitSharingEventV2.reified( ).new( { value: decodeFromFields("u64", fields.value), token: decodeFromFields(TypeName.reified(), fields.token), sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), level: decodeFromFields("u64", fields.level), name: decodeFromFields(String.reified(), fields.name) } ) }
|
|
311
|
+
|
|
312
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): ClaimProfitSharingEventV2 { if (!isClaimProfitSharingEventV2(item.type)) { throw new Error("not a ClaimProfitSharingEventV2 type");
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return ClaimProfitSharingEventV2.reified( ).new( { value: decodeFromFieldsWithTypes("u64", item.fields.value), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token), sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), level: decodeFromFieldsWithTypes("u64", item.fields.level), name: decodeFromFieldsWithTypes(String.reified(), item.fields.name) } ) }
|
|
317
|
+
|
|
318
|
+
static fromBcs( data: Uint8Array ): ClaimProfitSharingEventV2 { return ClaimProfitSharingEventV2.fromFields( ClaimProfitSharingEventV2.bcs.parse(data) ) }
|
|
319
|
+
|
|
320
|
+
toJSONField() { return {
|
|
321
|
+
|
|
322
|
+
value: this.value.toString(),token: this.token.toJSONField(),sender: this.sender,nftId: this.nftId,number: this.number.toString(),level: this.level.toString(),name: this.name,
|
|
323
|
+
|
|
324
|
+
} }
|
|
325
|
+
|
|
326
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
327
|
+
|
|
328
|
+
static fromJSONField( field: any ): ClaimProfitSharingEventV2 { return ClaimProfitSharingEventV2.reified( ).new( { value: decodeFromJSONField("u64", field.value), token: decodeFromJSONField(TypeName.reified(), field.token), sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), level: decodeFromJSONField("u64", field.level), name: decodeFromJSONField(String.reified(), field.name) } ) }
|
|
329
|
+
|
|
330
|
+
static fromJSON( json: Record<string, any> ): ClaimProfitSharingEventV2 { if (json.$typeName !== ClaimProfitSharingEventV2.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
331
|
+
|
|
332
|
+
return ClaimProfitSharingEventV2.fromJSONField( json, ) }
|
|
333
|
+
|
|
334
|
+
static fromSuiParsedData( content: SuiParsedData ): ClaimProfitSharingEventV2 { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isClaimProfitSharingEventV2(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a ClaimProfitSharingEventV2 object`); } return ClaimProfitSharingEventV2.fromFieldsWithTypes( content ); }
|
|
335
|
+
|
|
336
|
+
static async fetch( client: SuiClient, id: string ): Promise<ClaimProfitSharingEventV2> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching ClaimProfitSharingEventV2 object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isClaimProfitSharingEventV2(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a ClaimProfitSharingEventV2 object`); }
|
|
337
|
+
return ClaimProfitSharingEventV2.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
338
|
+
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* ============================== DailyAttendEvent =============================== */
|
|
342
|
+
|
|
343
|
+
export function isDailyAttendEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::DailyAttendEvent"; }
|
|
344
|
+
|
|
345
|
+
export interface DailyAttendEventFields { sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64">; tsMs: ToField<"u64">; expEarn: ToField<"u64"> }
|
|
346
|
+
|
|
347
|
+
export type DailyAttendEventReified = Reified< DailyAttendEvent, DailyAttendEventFields >;
|
|
348
|
+
|
|
349
|
+
export class DailyAttendEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::DailyAttendEvent"; static readonly $numTypeParams = 0;
|
|
350
|
+
|
|
351
|
+
readonly $typeName = DailyAttendEvent.$typeName;
|
|
352
|
+
|
|
353
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::DailyAttendEvent";
|
|
354
|
+
|
|
355
|
+
readonly $typeArgs: [];
|
|
356
|
+
|
|
357
|
+
readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly tsMs: ToField<"u64">; readonly expEarn: ToField<"u64">
|
|
358
|
+
|
|
359
|
+
private constructor(typeArgs: [], fields: DailyAttendEventFields, ) { this.$fullTypeName = composeSuiType( DailyAttendEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::DailyAttendEvent"; this.$typeArgs = typeArgs;
|
|
360
|
+
|
|
361
|
+
this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number;; this.tsMs = fields.tsMs;; this.expEarn = fields.expEarn; }
|
|
362
|
+
|
|
363
|
+
static reified( ): DailyAttendEventReified { return { typeName: DailyAttendEvent.$typeName, fullTypeName: composeSuiType( DailyAttendEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::DailyAttendEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => DailyAttendEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => DailyAttendEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => DailyAttendEvent.fromBcs( data, ), bcs: DailyAttendEvent.bcs, fromJSONField: (field: any) => DailyAttendEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => DailyAttendEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => DailyAttendEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => DailyAttendEvent.fetch( client, id, ), new: ( fields: DailyAttendEventFields, ) => { return new DailyAttendEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
364
|
+
|
|
365
|
+
static get r() { return DailyAttendEvent.reified() }
|
|
366
|
+
|
|
367
|
+
static phantom( ): PhantomReified<ToTypeStr<DailyAttendEvent>> { return phantom(DailyAttendEvent.reified( )); } static get p() { return DailyAttendEvent.phantom() }
|
|
368
|
+
|
|
369
|
+
static get bcs() { return bcs.struct("DailyAttendEvent", {
|
|
370
|
+
|
|
371
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64(), ts_ms: bcs.u64(), exp_earn: bcs.u64()
|
|
372
|
+
|
|
373
|
+
}) };
|
|
374
|
+
|
|
375
|
+
static fromFields( fields: Record<string, any> ): DailyAttendEvent { return DailyAttendEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), tsMs: decodeFromFields("u64", fields.ts_ms), expEarn: decodeFromFields("u64", fields.exp_earn) } ) }
|
|
376
|
+
|
|
377
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): DailyAttendEvent { if (!isDailyAttendEvent(item.type)) { throw new Error("not a DailyAttendEvent type");
|
|
378
|
+
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return DailyAttendEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms), expEarn: decodeFromFieldsWithTypes("u64", item.fields.exp_earn) } ) }
|
|
382
|
+
|
|
383
|
+
static fromBcs( data: Uint8Array ): DailyAttendEvent { return DailyAttendEvent.fromFields( DailyAttendEvent.bcs.parse(data) ) }
|
|
384
|
+
|
|
385
|
+
toJSONField() { return {
|
|
386
|
+
|
|
387
|
+
sender: this.sender,nftId: this.nftId,number: this.number.toString(),tsMs: this.tsMs.toString(),expEarn: this.expEarn.toString(),
|
|
388
|
+
|
|
389
|
+
} }
|
|
390
|
+
|
|
391
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
392
|
+
|
|
393
|
+
static fromJSONField( field: any ): DailyAttendEvent { return DailyAttendEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), tsMs: decodeFromJSONField("u64", field.tsMs), expEarn: decodeFromJSONField("u64", field.expEarn) } ) }
|
|
394
|
+
|
|
395
|
+
static fromJSON( json: Record<string, any> ): DailyAttendEvent { if (json.$typeName !== DailyAttendEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
396
|
+
|
|
397
|
+
return DailyAttendEvent.fromJSONField( json, ) }
|
|
398
|
+
|
|
399
|
+
static fromSuiParsedData( content: SuiParsedData ): DailyAttendEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isDailyAttendEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a DailyAttendEvent object`); } return DailyAttendEvent.fromFieldsWithTypes( content ); }
|
|
400
|
+
|
|
401
|
+
static async fetch( client: SuiClient, id: string ): Promise<DailyAttendEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching DailyAttendEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isDailyAttendEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a DailyAttendEvent object`); }
|
|
402
|
+
return DailyAttendEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
403
|
+
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* ============================== Partner =============================== */
|
|
407
|
+
|
|
408
|
+
export function isPartner(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::Partner"; }
|
|
409
|
+
|
|
410
|
+
export interface PartnerFields { id: ToField<UID>; expAllocation: ToField<"u64">; partnerTraits: ToField<VecMap<String, String>> }
|
|
411
|
+
|
|
412
|
+
export type PartnerReified = Reified< Partner, PartnerFields >;
|
|
413
|
+
|
|
414
|
+
export class Partner implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::Partner"; static readonly $numTypeParams = 0;
|
|
415
|
+
|
|
416
|
+
readonly $typeName = Partner.$typeName;
|
|
417
|
+
|
|
418
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::Partner";
|
|
419
|
+
|
|
420
|
+
readonly $typeArgs: [];
|
|
421
|
+
|
|
422
|
+
readonly id: ToField<UID>; readonly expAllocation: ToField<"u64">; readonly partnerTraits: ToField<VecMap<String, String>>
|
|
423
|
+
|
|
424
|
+
private constructor(typeArgs: [], fields: PartnerFields, ) { this.$fullTypeName = composeSuiType( Partner.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::Partner"; this.$typeArgs = typeArgs;
|
|
425
|
+
|
|
426
|
+
this.id = fields.id;; this.expAllocation = fields.expAllocation;; this.partnerTraits = fields.partnerTraits; }
|
|
427
|
+
|
|
428
|
+
static reified( ): PartnerReified { return { typeName: Partner.$typeName, fullTypeName: composeSuiType( Partner.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::Partner", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Partner.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Partner.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Partner.fromBcs( data, ), bcs: Partner.bcs, fromJSONField: (field: any) => Partner.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Partner.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Partner.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Partner.fetch( client, id, ), new: ( fields: PartnerFields, ) => { return new Partner( [], fields ) }, kind: "StructClassReified", } }
|
|
429
|
+
|
|
430
|
+
static get r() { return Partner.reified() }
|
|
431
|
+
|
|
432
|
+
static phantom( ): PhantomReified<ToTypeStr<Partner>> { return phantom(Partner.reified( )); } static get p() { return Partner.phantom() }
|
|
433
|
+
|
|
434
|
+
static get bcs() { return bcs.struct("Partner", {
|
|
435
|
+
|
|
436
|
+
id: UID.bcs, exp_allocation: bcs.u64(), partner_traits: VecMap.bcs(String.bcs, String.bcs)
|
|
437
|
+
|
|
438
|
+
}) };
|
|
439
|
+
|
|
440
|
+
static fromFields( fields: Record<string, any> ): Partner { return Partner.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), expAllocation: decodeFromFields("u64", fields.exp_allocation), partnerTraits: decodeFromFields(VecMap.reified(String.reified(), String.reified()), fields.partner_traits) } ) }
|
|
441
|
+
|
|
442
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): Partner { if (!isPartner(item.type)) { throw new Error("not a Partner type");
|
|
443
|
+
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return Partner.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), expAllocation: decodeFromFieldsWithTypes("u64", item.fields.exp_allocation), partnerTraits: decodeFromFieldsWithTypes(VecMap.reified(String.reified(), String.reified()), item.fields.partner_traits) } ) }
|
|
447
|
+
|
|
448
|
+
static fromBcs( data: Uint8Array ): Partner { return Partner.fromFields( Partner.bcs.parse(data) ) }
|
|
449
|
+
|
|
450
|
+
toJSONField() { return {
|
|
451
|
+
|
|
452
|
+
id: this.id,expAllocation: this.expAllocation.toString(),partnerTraits: this.partnerTraits.toJSONField(),
|
|
453
|
+
|
|
454
|
+
} }
|
|
455
|
+
|
|
456
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
457
|
+
|
|
458
|
+
static fromJSONField( field: any ): Partner { return Partner.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), expAllocation: decodeFromJSONField("u64", field.expAllocation), partnerTraits: decodeFromJSONField(VecMap.reified(String.reified(), String.reified()), field.partnerTraits) } ) }
|
|
459
|
+
|
|
460
|
+
static fromJSON( json: Record<string, any> ): Partner { if (json.$typeName !== Partner.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
461
|
+
|
|
462
|
+
return Partner.fromJSONField( json, ) }
|
|
463
|
+
|
|
464
|
+
static fromSuiParsedData( content: SuiParsedData ): Partner { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPartner(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Partner object`); } return Partner.fromFieldsWithTypes( content ); }
|
|
465
|
+
|
|
466
|
+
static async fetch( client: SuiClient, id: string ): Promise<Partner> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Partner object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPartner(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Partner object`); }
|
|
467
|
+
return Partner.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* ============================== PartnerKey =============================== */
|
|
472
|
+
|
|
473
|
+
export function isPartnerKey(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::PartnerKey"; }
|
|
474
|
+
|
|
475
|
+
export interface PartnerKeyFields { id: ToField<UID>; for: ToField<ID>; partner: ToField<String> }
|
|
476
|
+
|
|
477
|
+
export type PartnerKeyReified = Reified< PartnerKey, PartnerKeyFields >;
|
|
478
|
+
|
|
479
|
+
export class PartnerKey implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::PartnerKey"; static readonly $numTypeParams = 0;
|
|
480
|
+
|
|
481
|
+
readonly $typeName = PartnerKey.$typeName;
|
|
482
|
+
|
|
483
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::PartnerKey";
|
|
484
|
+
|
|
485
|
+
readonly $typeArgs: [];
|
|
486
|
+
|
|
487
|
+
readonly id: ToField<UID>; readonly for: ToField<ID>; readonly partner: ToField<String>
|
|
488
|
+
|
|
489
|
+
private constructor(typeArgs: [], fields: PartnerKeyFields, ) { this.$fullTypeName = composeSuiType( PartnerKey.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::PartnerKey"; this.$typeArgs = typeArgs;
|
|
490
|
+
|
|
491
|
+
this.id = fields.id;; this.for = fields.for;; this.partner = fields.partner; }
|
|
492
|
+
|
|
493
|
+
static reified( ): PartnerKeyReified { return { typeName: PartnerKey.$typeName, fullTypeName: composeSuiType( PartnerKey.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::PartnerKey", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PartnerKey.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PartnerKey.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PartnerKey.fromBcs( data, ), bcs: PartnerKey.bcs, fromJSONField: (field: any) => PartnerKey.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PartnerKey.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PartnerKey.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PartnerKey.fetch( client, id, ), new: ( fields: PartnerKeyFields, ) => { return new PartnerKey( [], fields ) }, kind: "StructClassReified", } }
|
|
494
|
+
|
|
495
|
+
static get r() { return PartnerKey.reified() }
|
|
496
|
+
|
|
497
|
+
static phantom( ): PhantomReified<ToTypeStr<PartnerKey>> { return phantom(PartnerKey.reified( )); } static get p() { return PartnerKey.phantom() }
|
|
498
|
+
|
|
499
|
+
static get bcs() { return bcs.struct("PartnerKey", {
|
|
500
|
+
|
|
501
|
+
id: UID.bcs, for: ID.bcs, partner: String.bcs
|
|
502
|
+
|
|
503
|
+
}) };
|
|
504
|
+
|
|
505
|
+
static fromFields( fields: Record<string, any> ): PartnerKey { return PartnerKey.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), for: decodeFromFields(ID.reified(), fields.for), partner: decodeFromFields(String.reified(), fields.partner) } ) }
|
|
506
|
+
|
|
507
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): PartnerKey { if (!isPartnerKey(item.type)) { throw new Error("not a PartnerKey type");
|
|
508
|
+
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return PartnerKey.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), for: decodeFromFieldsWithTypes(ID.reified(), item.fields.for), partner: decodeFromFieldsWithTypes(String.reified(), item.fields.partner) } ) }
|
|
512
|
+
|
|
513
|
+
static fromBcs( data: Uint8Array ): PartnerKey { return PartnerKey.fromFields( PartnerKey.bcs.parse(data) ) }
|
|
514
|
+
|
|
515
|
+
toJSONField() { return {
|
|
516
|
+
|
|
517
|
+
id: this.id,for: this.for,partner: this.partner,
|
|
518
|
+
|
|
519
|
+
} }
|
|
520
|
+
|
|
521
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
522
|
+
|
|
523
|
+
static fromJSONField( field: any ): PartnerKey { return PartnerKey.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), for: decodeFromJSONField(ID.reified(), field.for), partner: decodeFromJSONField(String.reified(), field.partner) } ) }
|
|
524
|
+
|
|
525
|
+
static fromJSON( json: Record<string, any> ): PartnerKey { if (json.$typeName !== PartnerKey.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
526
|
+
|
|
527
|
+
return PartnerKey.fromJSONField( json, ) }
|
|
528
|
+
|
|
529
|
+
static fromSuiParsedData( content: SuiParsedData ): PartnerKey { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPartnerKey(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PartnerKey object`); } return PartnerKey.fromFieldsWithTypes( content ); }
|
|
530
|
+
|
|
531
|
+
static async fetch( client: SuiClient, id: string ): Promise<PartnerKey> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PartnerKey object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPartnerKey(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PartnerKey object`); }
|
|
532
|
+
return PartnerKey.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/* ============================== ProfitSharing =============================== */
|
|
537
|
+
|
|
538
|
+
export function isProfitSharing(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharing<"); }
|
|
539
|
+
|
|
540
|
+
export interface ProfitSharingFields<TOKEN extends PhantomTypeArgument> { levelProfits: ToField<Vector<"u64">>; levelUsers: ToField<Vector<"u64">>; total: ToField<"u64">; remaining: ToField<"u64">; pool: ToField<Balance<TOKEN>> }
|
|
541
|
+
|
|
542
|
+
export type ProfitSharingReified<TOKEN extends PhantomTypeArgument> = Reified< ProfitSharing<TOKEN>, ProfitSharingFields<TOKEN> >;
|
|
543
|
+
|
|
544
|
+
export class ProfitSharing<TOKEN extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharing"; static readonly $numTypeParams = 1;
|
|
545
|
+
|
|
546
|
+
readonly $typeName = ProfitSharing.$typeName;
|
|
547
|
+
|
|
548
|
+
readonly $fullTypeName: `0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharing<${PhantomToTypeStr<TOKEN>}>`;
|
|
549
|
+
|
|
550
|
+
readonly $typeArgs: [PhantomToTypeStr<TOKEN>];
|
|
551
|
+
|
|
552
|
+
readonly levelProfits: ToField<Vector<"u64">>; readonly levelUsers: ToField<Vector<"u64">>; readonly total: ToField<"u64">; readonly remaining: ToField<"u64">; readonly pool: ToField<Balance<TOKEN>>
|
|
553
|
+
|
|
554
|
+
private constructor(typeArgs: [PhantomToTypeStr<TOKEN>], fields: ProfitSharingFields<TOKEN>, ) { this.$fullTypeName = composeSuiType( ProfitSharing.$typeName, ...typeArgs ) as `0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharing<${PhantomToTypeStr<TOKEN>}>`; this.$typeArgs = typeArgs;
|
|
555
|
+
|
|
556
|
+
this.levelProfits = fields.levelProfits;; this.levelUsers = fields.levelUsers;; this.total = fields.total;; this.remaining = fields.remaining;; this.pool = fields.pool; }
|
|
557
|
+
|
|
558
|
+
static reified<TOKEN extends PhantomReified<PhantomTypeArgument>>( TOKEN: TOKEN ): ProfitSharingReified<ToPhantomTypeArgument<TOKEN>> { return { typeName: ProfitSharing.$typeName, fullTypeName: composeSuiType( ProfitSharing.$typeName, ...[extractType(TOKEN)] ) as `0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharing<${PhantomToTypeStr<ToPhantomTypeArgument<TOKEN>>}>`, typeArgs: [ extractType(TOKEN) ] as [PhantomToTypeStr<ToPhantomTypeArgument<TOKEN>>], reifiedTypeArgs: [TOKEN], fromFields: (fields: Record<string, any>) => ProfitSharing.fromFields( TOKEN, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => ProfitSharing.fromFieldsWithTypes( TOKEN, item, ), fromBcs: (data: Uint8Array) => ProfitSharing.fromBcs( TOKEN, data, ), bcs: ProfitSharing.bcs, fromJSONField: (field: any) => ProfitSharing.fromJSONField( TOKEN, field, ), fromJSON: (json: Record<string, any>) => ProfitSharing.fromJSON( TOKEN, json, ), fromSuiParsedData: (content: SuiParsedData) => ProfitSharing.fromSuiParsedData( TOKEN, content, ), fetch: async (client: SuiClient, id: string) => ProfitSharing.fetch( client, TOKEN, id, ), new: ( fields: ProfitSharingFields<ToPhantomTypeArgument<TOKEN>>, ) => { return new ProfitSharing( [extractType(TOKEN)], fields ) }, kind: "StructClassReified", } }
|
|
559
|
+
|
|
560
|
+
static get r() { return ProfitSharing.reified }
|
|
561
|
+
|
|
562
|
+
static phantom<TOKEN extends PhantomReified<PhantomTypeArgument>>( TOKEN: TOKEN ): PhantomReified<ToTypeStr<ProfitSharing<ToPhantomTypeArgument<TOKEN>>>> { return phantom(ProfitSharing.reified( TOKEN )); } static get p() { return ProfitSharing.phantom }
|
|
563
|
+
|
|
564
|
+
static get bcs() { return bcs.struct("ProfitSharing", {
|
|
565
|
+
|
|
566
|
+
level_profits: bcs.vector(bcs.u64()), level_users: bcs.vector(bcs.u64()), total: bcs.u64(), remaining: bcs.u64(), pool: Balance.bcs
|
|
567
|
+
|
|
568
|
+
}) };
|
|
569
|
+
|
|
570
|
+
static fromFields<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, fields: Record<string, any> ): ProfitSharing<ToPhantomTypeArgument<TOKEN>> { return ProfitSharing.reified( typeArg, ).new( { levelProfits: decodeFromFields(reified.vector("u64"), fields.level_profits), levelUsers: decodeFromFields(reified.vector("u64"), fields.level_users), total: decodeFromFields("u64", fields.total), remaining: decodeFromFields("u64", fields.remaining), pool: decodeFromFields(Balance.reified(typeArg), fields.pool) } ) }
|
|
571
|
+
|
|
572
|
+
static fromFieldsWithTypes<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, item: FieldsWithTypes ): ProfitSharing<ToPhantomTypeArgument<TOKEN>> { if (!isProfitSharing(item.type)) { throw new Error("not a ProfitSharing type");
|
|
573
|
+
|
|
574
|
+
} assertFieldsWithTypesArgsMatch(item, [typeArg]);
|
|
575
|
+
|
|
576
|
+
return ProfitSharing.reified( typeArg, ).new( { levelProfits: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.level_profits), levelUsers: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.level_users), total: decodeFromFieldsWithTypes("u64", item.fields.total), remaining: decodeFromFieldsWithTypes("u64", item.fields.remaining), pool: decodeFromFieldsWithTypes(Balance.reified(typeArg), item.fields.pool) } ) }
|
|
577
|
+
|
|
578
|
+
static fromBcs<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, data: Uint8Array ): ProfitSharing<ToPhantomTypeArgument<TOKEN>> { return ProfitSharing.fromFields( typeArg, ProfitSharing.bcs.parse(data) ) }
|
|
579
|
+
|
|
580
|
+
toJSONField() { return {
|
|
581
|
+
|
|
582
|
+
levelProfits: fieldToJSON<Vector<"u64">>(`vector<u64>`, this.levelProfits),levelUsers: fieldToJSON<Vector<"u64">>(`vector<u64>`, this.levelUsers),total: this.total.toString(),remaining: this.remaining.toString(),pool: this.pool.toJSONField(),
|
|
583
|
+
|
|
584
|
+
} }
|
|
585
|
+
|
|
586
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
587
|
+
|
|
588
|
+
static fromJSONField<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, field: any ): ProfitSharing<ToPhantomTypeArgument<TOKEN>> { return ProfitSharing.reified( typeArg, ).new( { levelProfits: decodeFromJSONField(reified.vector("u64"), field.levelProfits), levelUsers: decodeFromJSONField(reified.vector("u64"), field.levelUsers), total: decodeFromJSONField("u64", field.total), remaining: decodeFromJSONField("u64", field.remaining), pool: decodeFromJSONField(Balance.reified(typeArg), field.pool) } ) }
|
|
589
|
+
|
|
590
|
+
static fromJSON<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, json: Record<string, any> ): ProfitSharing<ToPhantomTypeArgument<TOKEN>> { if (json.$typeName !== ProfitSharing.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(ProfitSharing.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
|
|
591
|
+
|
|
592
|
+
return ProfitSharing.fromJSONField( typeArg, json, ) }
|
|
593
|
+
|
|
594
|
+
static fromSuiParsedData<TOKEN extends PhantomReified<PhantomTypeArgument>>( typeArg: TOKEN, content: SuiParsedData ): ProfitSharing<ToPhantomTypeArgument<TOKEN>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isProfitSharing(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a ProfitSharing object`); } return ProfitSharing.fromFieldsWithTypes( typeArg, content ); }
|
|
595
|
+
|
|
596
|
+
static async fetch<TOKEN extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: TOKEN, id: string ): Promise<ProfitSharing<ToPhantomTypeArgument<TOKEN>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching ProfitSharing object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isProfitSharing(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a ProfitSharing object`); }
|
|
597
|
+
return ProfitSharing.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
|
|
598
|
+
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* ============================== ProfitSharingEvent =============================== */
|
|
602
|
+
|
|
603
|
+
export function isProfitSharingEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharingEvent"; }
|
|
604
|
+
|
|
605
|
+
export interface ProfitSharingEventFields { levelProfits: ToField<Vector<"u64">>; value: ToField<"u64">; token: ToField<TypeName> }
|
|
606
|
+
|
|
607
|
+
export type ProfitSharingEventReified = Reified< ProfitSharingEvent, ProfitSharingEventFields >;
|
|
608
|
+
|
|
609
|
+
export class ProfitSharingEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharingEvent"; static readonly $numTypeParams = 0;
|
|
610
|
+
|
|
611
|
+
readonly $typeName = ProfitSharingEvent.$typeName;
|
|
612
|
+
|
|
613
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharingEvent";
|
|
614
|
+
|
|
615
|
+
readonly $typeArgs: [];
|
|
616
|
+
|
|
617
|
+
readonly levelProfits: ToField<Vector<"u64">>; readonly value: ToField<"u64">; readonly token: ToField<TypeName>
|
|
618
|
+
|
|
619
|
+
private constructor(typeArgs: [], fields: ProfitSharingEventFields, ) { this.$fullTypeName = composeSuiType( ProfitSharingEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharingEvent"; this.$typeArgs = typeArgs;
|
|
620
|
+
|
|
621
|
+
this.levelProfits = fields.levelProfits;; this.value = fields.value;; this.token = fields.token; }
|
|
622
|
+
|
|
623
|
+
static reified( ): ProfitSharingEventReified { return { typeName: ProfitSharingEvent.$typeName, fullTypeName: composeSuiType( ProfitSharingEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::ProfitSharingEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => ProfitSharingEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => ProfitSharingEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => ProfitSharingEvent.fromBcs( data, ), bcs: ProfitSharingEvent.bcs, fromJSONField: (field: any) => ProfitSharingEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => ProfitSharingEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => ProfitSharingEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => ProfitSharingEvent.fetch( client, id, ), new: ( fields: ProfitSharingEventFields, ) => { return new ProfitSharingEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
624
|
+
|
|
625
|
+
static get r() { return ProfitSharingEvent.reified() }
|
|
626
|
+
|
|
627
|
+
static phantom( ): PhantomReified<ToTypeStr<ProfitSharingEvent>> { return phantom(ProfitSharingEvent.reified( )); } static get p() { return ProfitSharingEvent.phantom() }
|
|
628
|
+
|
|
629
|
+
static get bcs() { return bcs.struct("ProfitSharingEvent", {
|
|
630
|
+
|
|
631
|
+
level_profits: bcs.vector(bcs.u64()), value: bcs.u64(), token: TypeName.bcs
|
|
632
|
+
|
|
633
|
+
}) };
|
|
634
|
+
|
|
635
|
+
static fromFields( fields: Record<string, any> ): ProfitSharingEvent { return ProfitSharingEvent.reified( ).new( { levelProfits: decodeFromFields(reified.vector("u64"), fields.level_profits), value: decodeFromFields("u64", fields.value), token: decodeFromFields(TypeName.reified(), fields.token) } ) }
|
|
636
|
+
|
|
637
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): ProfitSharingEvent { if (!isProfitSharingEvent(item.type)) { throw new Error("not a ProfitSharingEvent type");
|
|
638
|
+
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
return ProfitSharingEvent.reified( ).new( { levelProfits: decodeFromFieldsWithTypes(reified.vector("u64"), item.fields.level_profits), value: decodeFromFieldsWithTypes("u64", item.fields.value), token: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.token) } ) }
|
|
642
|
+
|
|
643
|
+
static fromBcs( data: Uint8Array ): ProfitSharingEvent { return ProfitSharingEvent.fromFields( ProfitSharingEvent.bcs.parse(data) ) }
|
|
644
|
+
|
|
645
|
+
toJSONField() { return {
|
|
646
|
+
|
|
647
|
+
levelProfits: fieldToJSON<Vector<"u64">>(`vector<u64>`, this.levelProfits),value: this.value.toString(),token: this.token.toJSONField(),
|
|
648
|
+
|
|
649
|
+
} }
|
|
650
|
+
|
|
651
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
652
|
+
|
|
653
|
+
static fromJSONField( field: any ): ProfitSharingEvent { return ProfitSharingEvent.reified( ).new( { levelProfits: decodeFromJSONField(reified.vector("u64"), field.levelProfits), value: decodeFromJSONField("u64", field.value), token: decodeFromJSONField(TypeName.reified(), field.token) } ) }
|
|
654
|
+
|
|
655
|
+
static fromJSON( json: Record<string, any> ): ProfitSharingEvent { if (json.$typeName !== ProfitSharingEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
656
|
+
|
|
657
|
+
return ProfitSharingEvent.fromJSONField( json, ) }
|
|
658
|
+
|
|
659
|
+
static fromSuiParsedData( content: SuiParsedData ): ProfitSharingEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isProfitSharingEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a ProfitSharingEvent object`); } return ProfitSharingEvent.fromFieldsWithTypes( content ); }
|
|
660
|
+
|
|
661
|
+
static async fetch( client: SuiClient, id: string ): Promise<ProfitSharingEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching ProfitSharingEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isProfitSharingEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a ProfitSharingEvent object`); }
|
|
662
|
+
return ProfitSharingEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
663
|
+
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/* ============================== SnapshotNftEvent =============================== */
|
|
667
|
+
|
|
668
|
+
export function isSnapshotNftEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::SnapshotNftEvent"; }
|
|
669
|
+
|
|
670
|
+
export interface SnapshotNftEventFields { sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64">; tsMs: ToField<"u64">; expEarn: ToField<"u64"> }
|
|
671
|
+
|
|
672
|
+
export type SnapshotNftEventReified = Reified< SnapshotNftEvent, SnapshotNftEventFields >;
|
|
673
|
+
|
|
674
|
+
export class SnapshotNftEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::SnapshotNftEvent"; static readonly $numTypeParams = 0;
|
|
675
|
+
|
|
676
|
+
readonly $typeName = SnapshotNftEvent.$typeName;
|
|
677
|
+
|
|
678
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::SnapshotNftEvent";
|
|
679
|
+
|
|
680
|
+
readonly $typeArgs: [];
|
|
681
|
+
|
|
682
|
+
readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly tsMs: ToField<"u64">; readonly expEarn: ToField<"u64">
|
|
683
|
+
|
|
684
|
+
private constructor(typeArgs: [], fields: SnapshotNftEventFields, ) { this.$fullTypeName = composeSuiType( SnapshotNftEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::SnapshotNftEvent"; this.$typeArgs = typeArgs;
|
|
685
|
+
|
|
686
|
+
this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number;; this.tsMs = fields.tsMs;; this.expEarn = fields.expEarn; }
|
|
687
|
+
|
|
688
|
+
static reified( ): SnapshotNftEventReified { return { typeName: SnapshotNftEvent.$typeName, fullTypeName: composeSuiType( SnapshotNftEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::SnapshotNftEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => SnapshotNftEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => SnapshotNftEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => SnapshotNftEvent.fromBcs( data, ), bcs: SnapshotNftEvent.bcs, fromJSONField: (field: any) => SnapshotNftEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => SnapshotNftEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => SnapshotNftEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => SnapshotNftEvent.fetch( client, id, ), new: ( fields: SnapshotNftEventFields, ) => { return new SnapshotNftEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
689
|
+
|
|
690
|
+
static get r() { return SnapshotNftEvent.reified() }
|
|
691
|
+
|
|
692
|
+
static phantom( ): PhantomReified<ToTypeStr<SnapshotNftEvent>> { return phantom(SnapshotNftEvent.reified( )); } static get p() { return SnapshotNftEvent.phantom() }
|
|
693
|
+
|
|
694
|
+
static get bcs() { return bcs.struct("SnapshotNftEvent", {
|
|
695
|
+
|
|
696
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64(), ts_ms: bcs.u64(), exp_earn: bcs.u64()
|
|
697
|
+
|
|
698
|
+
}) };
|
|
699
|
+
|
|
700
|
+
static fromFields( fields: Record<string, any> ): SnapshotNftEvent { return SnapshotNftEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), tsMs: decodeFromFields("u64", fields.ts_ms), expEarn: decodeFromFields("u64", fields.exp_earn) } ) }
|
|
701
|
+
|
|
702
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): SnapshotNftEvent { if (!isSnapshotNftEvent(item.type)) { throw new Error("not a SnapshotNftEvent type");
|
|
703
|
+
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
return SnapshotNftEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms), expEarn: decodeFromFieldsWithTypes("u64", item.fields.exp_earn) } ) }
|
|
707
|
+
|
|
708
|
+
static fromBcs( data: Uint8Array ): SnapshotNftEvent { return SnapshotNftEvent.fromFields( SnapshotNftEvent.bcs.parse(data) ) }
|
|
709
|
+
|
|
710
|
+
toJSONField() { return {
|
|
711
|
+
|
|
712
|
+
sender: this.sender,nftId: this.nftId,number: this.number.toString(),tsMs: this.tsMs.toString(),expEarn: this.expEarn.toString(),
|
|
713
|
+
|
|
714
|
+
} }
|
|
715
|
+
|
|
716
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
717
|
+
|
|
718
|
+
static fromJSONField( field: any ): SnapshotNftEvent { return SnapshotNftEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), tsMs: decodeFromJSONField("u64", field.tsMs), expEarn: decodeFromJSONField("u64", field.expEarn) } ) }
|
|
719
|
+
|
|
720
|
+
static fromJSON( json: Record<string, any> ): SnapshotNftEvent { if (json.$typeName !== SnapshotNftEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
721
|
+
|
|
722
|
+
return SnapshotNftEvent.fromJSONField( json, ) }
|
|
723
|
+
|
|
724
|
+
static fromSuiParsedData( content: SuiParsedData ): SnapshotNftEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isSnapshotNftEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a SnapshotNftEvent object`); } return SnapshotNftEvent.fromFieldsWithTypes( content ); }
|
|
725
|
+
|
|
726
|
+
static async fetch( client: SuiClient, id: string ): Promise<SnapshotNftEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching SnapshotNftEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isSnapshotNftEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a SnapshotNftEvent object`); }
|
|
727
|
+
return SnapshotNftEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
728
|
+
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/* ============================== StakeNftEvent =============================== */
|
|
732
|
+
|
|
733
|
+
export function isStakeNftEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::StakeNftEvent"; }
|
|
734
|
+
|
|
735
|
+
export interface StakeNftEventFields { sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64">; tsMs: ToField<"u64"> }
|
|
736
|
+
|
|
737
|
+
export type StakeNftEventReified = Reified< StakeNftEvent, StakeNftEventFields >;
|
|
738
|
+
|
|
739
|
+
export class StakeNftEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::StakeNftEvent"; static readonly $numTypeParams = 0;
|
|
740
|
+
|
|
741
|
+
readonly $typeName = StakeNftEvent.$typeName;
|
|
742
|
+
|
|
743
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::StakeNftEvent";
|
|
744
|
+
|
|
745
|
+
readonly $typeArgs: [];
|
|
746
|
+
|
|
747
|
+
readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly tsMs: ToField<"u64">
|
|
748
|
+
|
|
749
|
+
private constructor(typeArgs: [], fields: StakeNftEventFields, ) { this.$fullTypeName = composeSuiType( StakeNftEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::StakeNftEvent"; this.$typeArgs = typeArgs;
|
|
750
|
+
|
|
751
|
+
this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number;; this.tsMs = fields.tsMs; }
|
|
752
|
+
|
|
753
|
+
static reified( ): StakeNftEventReified { return { typeName: StakeNftEvent.$typeName, fullTypeName: composeSuiType( StakeNftEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::StakeNftEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => StakeNftEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => StakeNftEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => StakeNftEvent.fromBcs( data, ), bcs: StakeNftEvent.bcs, fromJSONField: (field: any) => StakeNftEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => StakeNftEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => StakeNftEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => StakeNftEvent.fetch( client, id, ), new: ( fields: StakeNftEventFields, ) => { return new StakeNftEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
754
|
+
|
|
755
|
+
static get r() { return StakeNftEvent.reified() }
|
|
756
|
+
|
|
757
|
+
static phantom( ): PhantomReified<ToTypeStr<StakeNftEvent>> { return phantom(StakeNftEvent.reified( )); } static get p() { return StakeNftEvent.phantom() }
|
|
758
|
+
|
|
759
|
+
static get bcs() { return bcs.struct("StakeNftEvent", {
|
|
760
|
+
|
|
761
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64(), ts_ms: bcs.u64()
|
|
762
|
+
|
|
763
|
+
}) };
|
|
764
|
+
|
|
765
|
+
static fromFields( fields: Record<string, any> ): StakeNftEvent { return StakeNftEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), tsMs: decodeFromFields("u64", fields.ts_ms) } ) }
|
|
766
|
+
|
|
767
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): StakeNftEvent { if (!isStakeNftEvent(item.type)) { throw new Error("not a StakeNftEvent type");
|
|
768
|
+
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
return StakeNftEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms) } ) }
|
|
772
|
+
|
|
773
|
+
static fromBcs( data: Uint8Array ): StakeNftEvent { return StakeNftEvent.fromFields( StakeNftEvent.bcs.parse(data) ) }
|
|
774
|
+
|
|
775
|
+
toJSONField() { return {
|
|
776
|
+
|
|
777
|
+
sender: this.sender,nftId: this.nftId,number: this.number.toString(),tsMs: this.tsMs.toString(),
|
|
778
|
+
|
|
779
|
+
} }
|
|
780
|
+
|
|
781
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
782
|
+
|
|
783
|
+
static fromJSONField( field: any ): StakeNftEvent { return StakeNftEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), tsMs: decodeFromJSONField("u64", field.tsMs) } ) }
|
|
784
|
+
|
|
785
|
+
static fromJSON( json: Record<string, any> ): StakeNftEvent { if (json.$typeName !== StakeNftEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
786
|
+
|
|
787
|
+
return StakeNftEvent.fromJSONField( json, ) }
|
|
788
|
+
|
|
789
|
+
static fromSuiParsedData( content: SuiParsedData ): StakeNftEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isStakeNftEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a StakeNftEvent object`); } return StakeNftEvent.fromFieldsWithTypes( content ); }
|
|
790
|
+
|
|
791
|
+
static async fetch( client: SuiClient, id: string ): Promise<StakeNftEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching StakeNftEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isStakeNftEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a StakeNftEvent object`); }
|
|
792
|
+
return StakeNftEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
793
|
+
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/* ============================== TransferNftEvent =============================== */
|
|
797
|
+
|
|
798
|
+
export function isTransferNftEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::TransferNftEvent"; }
|
|
799
|
+
|
|
800
|
+
export interface TransferNftEventFields { sender: ToField<"address">; receiver: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64"> }
|
|
801
|
+
|
|
802
|
+
export type TransferNftEventReified = Reified< TransferNftEvent, TransferNftEventFields >;
|
|
803
|
+
|
|
804
|
+
export class TransferNftEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::TransferNftEvent"; static readonly $numTypeParams = 0;
|
|
805
|
+
|
|
806
|
+
readonly $typeName = TransferNftEvent.$typeName;
|
|
807
|
+
|
|
808
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::TransferNftEvent";
|
|
809
|
+
|
|
810
|
+
readonly $typeArgs: [];
|
|
811
|
+
|
|
812
|
+
readonly sender: ToField<"address">; readonly receiver: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">
|
|
813
|
+
|
|
814
|
+
private constructor(typeArgs: [], fields: TransferNftEventFields, ) { this.$fullTypeName = composeSuiType( TransferNftEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::TransferNftEvent"; this.$typeArgs = typeArgs;
|
|
815
|
+
|
|
816
|
+
this.sender = fields.sender;; this.receiver = fields.receiver;; this.nftId = fields.nftId;; this.number = fields.number; }
|
|
817
|
+
|
|
818
|
+
static reified( ): TransferNftEventReified { return { typeName: TransferNftEvent.$typeName, fullTypeName: composeSuiType( TransferNftEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::TransferNftEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => TransferNftEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TransferNftEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => TransferNftEvent.fromBcs( data, ), bcs: TransferNftEvent.bcs, fromJSONField: (field: any) => TransferNftEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => TransferNftEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => TransferNftEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => TransferNftEvent.fetch( client, id, ), new: ( fields: TransferNftEventFields, ) => { return new TransferNftEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
819
|
+
|
|
820
|
+
static get r() { return TransferNftEvent.reified() }
|
|
821
|
+
|
|
822
|
+
static phantom( ): PhantomReified<ToTypeStr<TransferNftEvent>> { return phantom(TransferNftEvent.reified( )); } static get p() { return TransferNftEvent.phantom() }
|
|
823
|
+
|
|
824
|
+
static get bcs() { return bcs.struct("TransferNftEvent", {
|
|
825
|
+
|
|
826
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), receiver: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64()
|
|
827
|
+
|
|
828
|
+
}) };
|
|
829
|
+
|
|
830
|
+
static fromFields( fields: Record<string, any> ): TransferNftEvent { return TransferNftEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), receiver: decodeFromFields("address", fields.receiver), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number) } ) }
|
|
831
|
+
|
|
832
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): TransferNftEvent { if (!isTransferNftEvent(item.type)) { throw new Error("not a TransferNftEvent type");
|
|
833
|
+
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return TransferNftEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), receiver: decodeFromFieldsWithTypes("address", item.fields.receiver), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number) } ) }
|
|
837
|
+
|
|
838
|
+
static fromBcs( data: Uint8Array ): TransferNftEvent { return TransferNftEvent.fromFields( TransferNftEvent.bcs.parse(data) ) }
|
|
839
|
+
|
|
840
|
+
toJSONField() { return {
|
|
841
|
+
|
|
842
|
+
sender: this.sender,receiver: this.receiver,nftId: this.nftId,number: this.number.toString(),
|
|
843
|
+
|
|
844
|
+
} }
|
|
845
|
+
|
|
846
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
847
|
+
|
|
848
|
+
static fromJSONField( field: any ): TransferNftEvent { return TransferNftEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), receiver: decodeFromJSONField("address", field.receiver), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number) } ) }
|
|
849
|
+
|
|
850
|
+
static fromJSON( json: Record<string, any> ): TransferNftEvent { if (json.$typeName !== TransferNftEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
851
|
+
|
|
852
|
+
return TransferNftEvent.fromJSONField( json, ) }
|
|
853
|
+
|
|
854
|
+
static fromSuiParsedData( content: SuiParsedData ): TransferNftEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTransferNftEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TransferNftEvent object`); } return TransferNftEvent.fromFieldsWithTypes( content ); }
|
|
855
|
+
|
|
856
|
+
static async fetch( client: SuiClient, id: string ): Promise<TransferNftEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TransferNftEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTransferNftEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TransferNftEvent object`); }
|
|
857
|
+
return TransferNftEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
858
|
+
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/* ============================== UnstakeNftEvent =============================== */
|
|
862
|
+
|
|
863
|
+
export function isUnstakeNftEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UnstakeNftEvent"; }
|
|
864
|
+
|
|
865
|
+
export interface UnstakeNftEventFields { sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64"> }
|
|
866
|
+
|
|
867
|
+
export type UnstakeNftEventReified = Reified< UnstakeNftEvent, UnstakeNftEventFields >;
|
|
868
|
+
|
|
869
|
+
export class UnstakeNftEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UnstakeNftEvent"; static readonly $numTypeParams = 0;
|
|
870
|
+
|
|
871
|
+
readonly $typeName = UnstakeNftEvent.$typeName;
|
|
872
|
+
|
|
873
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UnstakeNftEvent";
|
|
874
|
+
|
|
875
|
+
readonly $typeArgs: [];
|
|
876
|
+
|
|
877
|
+
readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">
|
|
878
|
+
|
|
879
|
+
private constructor(typeArgs: [], fields: UnstakeNftEventFields, ) { this.$fullTypeName = composeSuiType( UnstakeNftEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UnstakeNftEvent"; this.$typeArgs = typeArgs;
|
|
880
|
+
|
|
881
|
+
this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number; }
|
|
882
|
+
|
|
883
|
+
static reified( ): UnstakeNftEventReified { return { typeName: UnstakeNftEvent.$typeName, fullTypeName: composeSuiType( UnstakeNftEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UnstakeNftEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => UnstakeNftEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => UnstakeNftEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => UnstakeNftEvent.fromBcs( data, ), bcs: UnstakeNftEvent.bcs, fromJSONField: (field: any) => UnstakeNftEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => UnstakeNftEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => UnstakeNftEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => UnstakeNftEvent.fetch( client, id, ), new: ( fields: UnstakeNftEventFields, ) => { return new UnstakeNftEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
884
|
+
|
|
885
|
+
static get r() { return UnstakeNftEvent.reified() }
|
|
886
|
+
|
|
887
|
+
static phantom( ): PhantomReified<ToTypeStr<UnstakeNftEvent>> { return phantom(UnstakeNftEvent.reified( )); } static get p() { return UnstakeNftEvent.phantom() }
|
|
888
|
+
|
|
889
|
+
static get bcs() { return bcs.struct("UnstakeNftEvent", {
|
|
890
|
+
|
|
891
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64()
|
|
892
|
+
|
|
893
|
+
}) };
|
|
894
|
+
|
|
895
|
+
static fromFields( fields: Record<string, any> ): UnstakeNftEvent { return UnstakeNftEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number) } ) }
|
|
896
|
+
|
|
897
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): UnstakeNftEvent { if (!isUnstakeNftEvent(item.type)) { throw new Error("not a UnstakeNftEvent type");
|
|
898
|
+
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
return UnstakeNftEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number) } ) }
|
|
902
|
+
|
|
903
|
+
static fromBcs( data: Uint8Array ): UnstakeNftEvent { return UnstakeNftEvent.fromFields( UnstakeNftEvent.bcs.parse(data) ) }
|
|
904
|
+
|
|
905
|
+
toJSONField() { return {
|
|
906
|
+
|
|
907
|
+
sender: this.sender,nftId: this.nftId,number: this.number.toString(),
|
|
908
|
+
|
|
909
|
+
} }
|
|
910
|
+
|
|
911
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
912
|
+
|
|
913
|
+
static fromJSONField( field: any ): UnstakeNftEvent { return UnstakeNftEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number) } ) }
|
|
914
|
+
|
|
915
|
+
static fromJSON( json: Record<string, any> ): UnstakeNftEvent { if (json.$typeName !== UnstakeNftEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
916
|
+
|
|
917
|
+
return UnstakeNftEvent.fromJSONField( json, ) }
|
|
918
|
+
|
|
919
|
+
static fromSuiParsedData( content: SuiParsedData ): UnstakeNftEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUnstakeNftEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a UnstakeNftEvent object`); } return UnstakeNftEvent.fromFieldsWithTypes( content ); }
|
|
920
|
+
|
|
921
|
+
static async fetch( client: SuiClient, id: string ): Promise<UnstakeNftEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching UnstakeNftEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUnstakeNftEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a UnstakeNftEvent object`); }
|
|
922
|
+
return UnstakeNftEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
923
|
+
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/* ============================== UpdateDepositEvent =============================== */
|
|
927
|
+
|
|
928
|
+
export function isUpdateDepositEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateDepositEvent"; }
|
|
929
|
+
|
|
930
|
+
export interface UpdateDepositEventFields { sender: ToField<"address">; nftId: ToField<ID>; number: ToField<"u64">; before: ToField<"u64">; after: ToField<"u64"> }
|
|
931
|
+
|
|
932
|
+
export type UpdateDepositEventReified = Reified< UpdateDepositEvent, UpdateDepositEventFields >;
|
|
933
|
+
|
|
934
|
+
export class UpdateDepositEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateDepositEvent"; static readonly $numTypeParams = 0;
|
|
935
|
+
|
|
936
|
+
readonly $typeName = UpdateDepositEvent.$typeName;
|
|
937
|
+
|
|
938
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateDepositEvent";
|
|
939
|
+
|
|
940
|
+
readonly $typeArgs: [];
|
|
941
|
+
|
|
942
|
+
readonly sender: ToField<"address">; readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly before: ToField<"u64">; readonly after: ToField<"u64">
|
|
943
|
+
|
|
944
|
+
private constructor(typeArgs: [], fields: UpdateDepositEventFields, ) { this.$fullTypeName = composeSuiType( UpdateDepositEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateDepositEvent"; this.$typeArgs = typeArgs;
|
|
945
|
+
|
|
946
|
+
this.sender = fields.sender;; this.nftId = fields.nftId;; this.number = fields.number;; this.before = fields.before;; this.after = fields.after; }
|
|
947
|
+
|
|
948
|
+
static reified( ): UpdateDepositEventReified { return { typeName: UpdateDepositEvent.$typeName, fullTypeName: composeSuiType( UpdateDepositEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateDepositEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => UpdateDepositEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => UpdateDepositEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => UpdateDepositEvent.fromBcs( data, ), bcs: UpdateDepositEvent.bcs, fromJSONField: (field: any) => UpdateDepositEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => UpdateDepositEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => UpdateDepositEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => UpdateDepositEvent.fetch( client, id, ), new: ( fields: UpdateDepositEventFields, ) => { return new UpdateDepositEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
949
|
+
|
|
950
|
+
static get r() { return UpdateDepositEvent.reified() }
|
|
951
|
+
|
|
952
|
+
static phantom( ): PhantomReified<ToTypeStr<UpdateDepositEvent>> { return phantom(UpdateDepositEvent.reified( )); } static get p() { return UpdateDepositEvent.phantom() }
|
|
953
|
+
|
|
954
|
+
static get bcs() { return bcs.struct("UpdateDepositEvent", {
|
|
955
|
+
|
|
956
|
+
sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), nft_id: ID.bcs, number: bcs.u64(), before: bcs.u64(), after: bcs.u64()
|
|
957
|
+
|
|
958
|
+
}) };
|
|
959
|
+
|
|
960
|
+
static fromFields( fields: Record<string, any> ): UpdateDepositEvent { return UpdateDepositEvent.reified( ).new( { sender: decodeFromFields("address", fields.sender), nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), before: decodeFromFields("u64", fields.before), after: decodeFromFields("u64", fields.after) } ) }
|
|
961
|
+
|
|
962
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): UpdateDepositEvent { if (!isUpdateDepositEvent(item.type)) { throw new Error("not a UpdateDepositEvent type");
|
|
963
|
+
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
return UpdateDepositEvent.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), before: decodeFromFieldsWithTypes("u64", item.fields.before), after: decodeFromFieldsWithTypes("u64", item.fields.after) } ) }
|
|
967
|
+
|
|
968
|
+
static fromBcs( data: Uint8Array ): UpdateDepositEvent { return UpdateDepositEvent.fromFields( UpdateDepositEvent.bcs.parse(data) ) }
|
|
969
|
+
|
|
970
|
+
toJSONField() { return {
|
|
971
|
+
|
|
972
|
+
sender: this.sender,nftId: this.nftId,number: this.number.toString(),before: this.before.toString(),after: this.after.toString(),
|
|
973
|
+
|
|
974
|
+
} }
|
|
975
|
+
|
|
976
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
977
|
+
|
|
978
|
+
static fromJSONField( field: any ): UpdateDepositEvent { return UpdateDepositEvent.reified( ).new( { sender: decodeFromJSONField("address", field.sender), nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), before: decodeFromJSONField("u64", field.before), after: decodeFromJSONField("u64", field.after) } ) }
|
|
979
|
+
|
|
980
|
+
static fromJSON( json: Record<string, any> ): UpdateDepositEvent { if (json.$typeName !== UpdateDepositEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
981
|
+
|
|
982
|
+
return UpdateDepositEvent.fromJSONField( json, ) }
|
|
983
|
+
|
|
984
|
+
static fromSuiParsedData( content: SuiParsedData ): UpdateDepositEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUpdateDepositEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a UpdateDepositEvent object`); } return UpdateDepositEvent.fromFieldsWithTypes( content ); }
|
|
985
|
+
|
|
986
|
+
static async fetch( client: SuiClient, id: string ): Promise<UpdateDepositEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching UpdateDepositEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUpdateDepositEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a UpdateDepositEvent object`); }
|
|
987
|
+
return UpdateDepositEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
988
|
+
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/* ============================== UpdateUrlEvent =============================== */
|
|
992
|
+
|
|
993
|
+
export function isUpdateUrlEvent(type: string): boolean { type = compressSuiType(type); return type === "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateUrlEvent"; }
|
|
994
|
+
|
|
995
|
+
export interface UpdateUrlEventFields { nftId: ToField<ID>; number: ToField<"u64">; level: ToField<"u64">; url: ToField<Vector<"u8">> }
|
|
996
|
+
|
|
997
|
+
export type UpdateUrlEventReified = Reified< UpdateUrlEvent, UpdateUrlEventFields >;
|
|
998
|
+
|
|
999
|
+
export class UpdateUrlEvent implements StructClass { static readonly $typeName = "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateUrlEvent"; static readonly $numTypeParams = 0;
|
|
1000
|
+
|
|
1001
|
+
readonly $typeName = UpdateUrlEvent.$typeName;
|
|
1002
|
+
|
|
1003
|
+
readonly $fullTypeName: "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateUrlEvent";
|
|
1004
|
+
|
|
1005
|
+
readonly $typeArgs: [];
|
|
1006
|
+
|
|
1007
|
+
readonly nftId: ToField<ID>; readonly number: ToField<"u64">; readonly level: ToField<"u64">; readonly url: ToField<Vector<"u8">>
|
|
1008
|
+
|
|
1009
|
+
private constructor(typeArgs: [], fields: UpdateUrlEventFields, ) { this.$fullTypeName = composeSuiType( UpdateUrlEvent.$typeName, ...typeArgs ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateUrlEvent"; this.$typeArgs = typeArgs;
|
|
1010
|
+
|
|
1011
|
+
this.nftId = fields.nftId;; this.number = fields.number;; this.level = fields.level;; this.url = fields.url; }
|
|
1012
|
+
|
|
1013
|
+
static reified( ): UpdateUrlEventReified { return { typeName: UpdateUrlEvent.$typeName, fullTypeName: composeSuiType( UpdateUrlEvent.$typeName, ...[] ) as "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f::tails_staking::UpdateUrlEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => UpdateUrlEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => UpdateUrlEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => UpdateUrlEvent.fromBcs( data, ), bcs: UpdateUrlEvent.bcs, fromJSONField: (field: any) => UpdateUrlEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => UpdateUrlEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => UpdateUrlEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => UpdateUrlEvent.fetch( client, id, ), new: ( fields: UpdateUrlEventFields, ) => { return new UpdateUrlEvent( [], fields ) }, kind: "StructClassReified", } }
|
|
1014
|
+
|
|
1015
|
+
static get r() { return UpdateUrlEvent.reified() }
|
|
1016
|
+
|
|
1017
|
+
static phantom( ): PhantomReified<ToTypeStr<UpdateUrlEvent>> { return phantom(UpdateUrlEvent.reified( )); } static get p() { return UpdateUrlEvent.phantom() }
|
|
1018
|
+
|
|
1019
|
+
static get bcs() { return bcs.struct("UpdateUrlEvent", {
|
|
1020
|
+
|
|
1021
|
+
nft_id: ID.bcs, number: bcs.u64(), level: bcs.u64(), url: bcs.vector(bcs.u8())
|
|
1022
|
+
|
|
1023
|
+
}) };
|
|
1024
|
+
|
|
1025
|
+
static fromFields( fields: Record<string, any> ): UpdateUrlEvent { return UpdateUrlEvent.reified( ).new( { nftId: decodeFromFields(ID.reified(), fields.nft_id), number: decodeFromFields("u64", fields.number), level: decodeFromFields("u64", fields.level), url: decodeFromFields(reified.vector("u8"), fields.url) } ) }
|
|
1026
|
+
|
|
1027
|
+
static fromFieldsWithTypes( item: FieldsWithTypes ): UpdateUrlEvent { if (!isUpdateUrlEvent(item.type)) { throw new Error("not a UpdateUrlEvent type");
|
|
1028
|
+
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
return UpdateUrlEvent.reified( ).new( { nftId: decodeFromFieldsWithTypes(ID.reified(), item.fields.nft_id), number: decodeFromFieldsWithTypes("u64", item.fields.number), level: decodeFromFieldsWithTypes("u64", item.fields.level), url: decodeFromFieldsWithTypes(reified.vector("u8"), item.fields.url) } ) }
|
|
1032
|
+
|
|
1033
|
+
static fromBcs( data: Uint8Array ): UpdateUrlEvent { return UpdateUrlEvent.fromFields( UpdateUrlEvent.bcs.parse(data) ) }
|
|
1034
|
+
|
|
1035
|
+
toJSONField() { return {
|
|
1036
|
+
|
|
1037
|
+
nftId: this.nftId,number: this.number.toString(),level: this.level.toString(),url: fieldToJSON<Vector<"u8">>(`vector<u8>`, this.url),
|
|
1038
|
+
|
|
1039
|
+
} }
|
|
1040
|
+
|
|
1041
|
+
toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
|
|
1042
|
+
|
|
1043
|
+
static fromJSONField( field: any ): UpdateUrlEvent { return UpdateUrlEvent.reified( ).new( { nftId: decodeFromJSONField(ID.reified(), field.nftId), number: decodeFromJSONField("u64", field.number), level: decodeFromJSONField("u64", field.level), url: decodeFromJSONField(reified.vector("u8"), field.url) } ) }
|
|
1044
|
+
|
|
1045
|
+
static fromJSON( json: Record<string, any> ): UpdateUrlEvent { if (json.$typeName !== UpdateUrlEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
|
|
1046
|
+
|
|
1047
|
+
return UpdateUrlEvent.fromJSONField( json, ) }
|
|
1048
|
+
|
|
1049
|
+
static fromSuiParsedData( content: SuiParsedData ): UpdateUrlEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUpdateUrlEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a UpdateUrlEvent object`); } return UpdateUrlEvent.fromFieldsWithTypes( content ); }
|
|
1050
|
+
|
|
1051
|
+
static async fetch( client: SuiClient, id: string ): Promise<UpdateUrlEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching UpdateUrlEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUpdateUrlEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a UpdateUrlEvent object`); }
|
|
1052
|
+
return UpdateUrlEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
|
|
1053
|
+
|
|
1054
|
+
}
|