@typus/typus-sdk 1.2.66 → 1.2.68-tgld

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.
Files changed (51) hide show
  1. package/lib/config.json +155 -0
  2. package/lib/mainnet.json +2 -2
  3. package/lib/utils/airdrop/authority-entry.d.ts +22 -0
  4. package/lib/utils/airdrop/authority-entry.js +138 -0
  5. package/lib/utils/airdrop/user-entry.d.ts +10 -0
  6. package/lib/utils/airdrop/user-entry.js +21 -0
  7. package/lib/utils/airdrop/view-functions.d.ts +10 -0
  8. package/lib/utils/airdrop/view-functions.js +72 -0
  9. package/lib/utils/api/defillama/tvl.d.ts +1 -0
  10. package/lib/utils/api/defillama/tvl.js +59 -0
  11. package/lib/utils/{leader-board.d.ts → api/sentio/leader-board.d.ts} +0 -7
  12. package/lib/utils/api/sentio/leader-board.js +104 -0
  13. package/lib/utils/api/sentio/reward-generated.d.ts +10 -0
  14. package/lib/utils/api/sentio/reward-generated.js +256 -0
  15. package/lib/utils/leaderboard/authority-entry.d.ts +22 -0
  16. package/lib/utils/leaderboard/authority-entry.js +91 -0
  17. package/lib/utils/leaderboard/view-function.d.ts +21 -0
  18. package/lib/utils/leaderboard/view-function.js +92 -0
  19. package/lib/utils/locked-period-vault/user-entry.d.ts +81 -0
  20. package/lib/utils/locked-period-vault/user-entry.js +101 -0
  21. package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +4 -0
  22. package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +5 -1
  23. package/lib/utils/typus-dov-single-v2/user-entry.d.ts +4 -0
  24. package/lib/utils/typus-dov-single-v2/user-entry.js +10 -2
  25. package/lib/utils/typus-dov-single-v2/user-history.js +22 -3
  26. package/lib/utils/user/view-functions.d.ts +9 -0
  27. package/lib/utils/user/view-functions.js +71 -0
  28. package/package.json +1 -1
  29. package/lib/utils/leader-board.js +0 -333
  30. package/lib/utils/typus-dov-double/authorized-entry.d.ts +0 -102
  31. package/lib/utils/typus-dov-double/authorized-entry.js +0 -295
  32. package/lib/utils/typus-dov-double/manager-entry.d.ts +0 -219
  33. package/lib/utils/typus-dov-double/manager-entry.js +0 -584
  34. package/lib/utils/typus-dov-double/portfolio-vault.d.ts +0 -68
  35. package/lib/utils/typus-dov-double/portfolio-vault.js +0 -303
  36. package/lib/utils/typus-dov-double/user-entry.d.ts +0 -93
  37. package/lib/utils/typus-dov-double/user-entry.js +0 -280
  38. package/lib/utils/typus-dov-double/view-function.d.ts +0 -11
  39. package/lib/utils/typus-dov-double/view-function.js +0 -213
  40. package/lib/utils/typus-dov-single/db-data.d.ts +0 -19
  41. package/lib/utils/typus-dov-single/db-data.js +0 -226
  42. package/lib/utils/typus-dov-single/portfolio-vault.d.ts +0 -63
  43. package/lib/utils/typus-dov-single/portfolio-vault.js +0 -284
  44. package/lib/utils/typus-dov-single/registry.d.ts +0 -14
  45. package/lib/utils/typus-dov-single/registry.js +0 -126
  46. package/lib/utils/typus-dov-single/user-entry.d.ts +0 -103
  47. package/lib/utils/typus-dov-single/user-entry.js +0 -388
  48. package/lib/utils/typus-dov-single/user-history.d.ts +0 -17
  49. package/lib/utils/typus-dov-single/user-history.js +0 -146
  50. package/lib/utils/typus-dov-single/view-function.d.ts +0 -50
  51. package/lib/utils/typus-dov-single/view-function.js +0 -444
@@ -0,0 +1,155 @@
1
+ {
2
+ "MAINNET": {
3
+ "RPC_ENDPOINT": "https://fullnode.mainnet.sui.io:443",
4
+ "TYPUS_VERSION": "",
5
+ "TGLD_COIN_METADATA": "",
6
+ "TGLD_TOKEN_POLICY": "",
7
+ "NFT_TRANSFER_POLICY": "0x55475b9e16d9a0176dcef37f83a1921b15f2cbd2711a5f30b9d952c0c8f5f957",
8
+ "PACKAGE_ORIGIN": {
9
+ "DOV_SINGLE": "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a",
10
+ "FRAMEWORK": "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274",
11
+ "MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
12
+ "NFT": "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196",
13
+ "ORACLE": "0x855eb2d260ee42b898266e6df90bfd3c4ed821ccb253a352c159c223244a4b8a",
14
+ "TYPUS": ""
15
+ },
16
+ "PACKAGE": {
17
+ "DOV_SINGLE": "0x1ee07392805d5b26a1c248b5739b768d426579ac1f4aeb50152f7ca06d3e2a00",
18
+ "FRAMEWORK": "0x6e3a0fa749edd4808a9f827f9b49b02b319d221b8391b01a94974e4b09393591",
19
+ "MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
20
+ "NFT": "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196",
21
+ "ORACLE": "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd",
22
+ "TYPUS": ""
23
+ },
24
+ "REGISTRY": {
25
+ "AIRDROP": "",
26
+ "DOV_SINGLE": "0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8",
27
+ "LEADERBOARD": "",
28
+ "MFUD": "0xb8d7e7ab783e56700c0212bd9f0938bba9dd3e7241c149e6c52b21334ec45ece",
29
+ "TGLD": "",
30
+ "USER": ""
31
+ },
32
+ "TOKEN": {
33
+ "FUD": "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
34
+ "MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d::mfud::MFUD",
35
+ "SUI": "0x2::sui::SUI",
36
+ "TGLD": ""
37
+ },
38
+ "ORACLE": {
39
+ "APT": "0x401ed2a4de92950351c54edaa9a8dce5e38bdb6b06e248935c6f6f7d361a99d6",
40
+ "CETUS": "0xaedaa2e76661471924c1ca7edae069317cbe082798dd3bfa31694dc873102532",
41
+ "JUP": "0xd4a5fe0b48a6f8cbe528b5760462f0d9cad8080c8aebb1a9c63c2176c58fb3b3",
42
+ "NAVX": "0x726c5bafa4e8240d36bb42493c82bca30b920e2bcab1da1dca973322352e9f63",
43
+ "SCA": "0x8eb94035d6d54ad6b444dd67310b9ff54a05a54ecf77d5b22a43a75495774bb6",
44
+ "SOL": "0x9712ad1cba00a437fb669e4df1a59568e4267bd8a8ce989452fb63c9f00b59ab",
45
+ "SUI": "0xeb6b3e3300ff884604ead6172b0aeadee3854980cab65a7feb57300b04b74cc1",
46
+ "TURBOS": "0x819ff07b5768d7b9b428b69b123140f6a74b04eaa978a4cbab9055025bd1536d",
47
+ "WBTC": "0x61813dc2e46dba41b14507857827f0ed7e99b0be242548828769728b81c8fab5",
48
+ "WETH": "0x253bbaaa35275240cf6df03258489707ea059762831e4102ebaabafd442bc935"
49
+ }
50
+ },
51
+ "TESTNET": {
52
+ "RPC_ENDPOINT": "https://fullnode.testnet.sui.io:443",
53
+ "TYPUS_VERSION": "0x2edc980f55e31ba3c660f4e2650e915fd47fb33b524b01a52a116719adac8be7",
54
+ "TGLD_COIN_METADATA": "0xf77f8aabe64dccef0e568f2ef58a6ca74bdfb31786507cc35b7626a4df0d0ebc",
55
+ "TGLD_TOKEN_POLICY": "0x17875c2f772053cd148bd2b8b8a40160db3f841825d8963192f8394d5c18974c",
56
+ "NFT_TRANSFER_POLICY": "0x1c62271ecc443c3d92a8fe8f5662e877856d26b971d967f66937a65f55160831",
57
+ "PACKAGE_ORIGIN": {
58
+ "DOV_SINGLE": "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f",
59
+ "FRAMEWORK": "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded",
60
+ "MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
61
+ "NFT": "0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828",
62
+ "ORACLE": "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73",
63
+ "TYPUS": "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277"
64
+ },
65
+ "PACKAGE": {
66
+ "DOV_SINGLE": "0xbbf2e2662033fceead636974e50221ec04a0dfd082cd1a32e3b1f90c11ed7aa5",
67
+ "FRAMEWORK": "0xa304e225551b619b07c06d8965462b268138b2c5774fd22ad8853ef91fbb9771",
68
+ "MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
69
+ "NFT": "0x0f5162014f18686640b8d0adefd60c3fe5b377413ec4f1e77001c67d96f8501a",
70
+ "ORACLE": "0x71fbc7acaf513561dabdeb846e7dd5288108e56edb0b6de8d4999c4dfce21f66",
71
+ "TYPUS": "0xc0d2e234cd1211a0f7b0bac8798d6e8fa8ab5db29d779245c4c4280eb6d16b94"
72
+ },
73
+ "REGISTRY": {
74
+ "AIRDROP": "0xfb2fbf261f6050d100bcd026ffa0076e088506b1bec26313947239303e2a0224",
75
+ "DOV_SINGLE": "0x0285cbf4aa8585be6c978235d11d06fa35773266ede040d38d34e1d79b049460",
76
+ "LEADERBOARD": "0x4faabe5a4a509a145fc9bae95761d34c11571da4cb25d681f06ffcbadbc355e7",
77
+ "MFUD": "0x7ad87901531693f1baa541712947860dcc543617e11b14993ad70d20daf159c6",
78
+ "TGLD": "0x2118b4056c89d90a6dc40d198fbe239cb8e83f7ea20daaf4ea53341c7fdb043c",
79
+ "USER": "0x5f1894a3680949111a7530d63ceda6857d31521ab2de625e9f826cae17c9a7f3"
80
+ },
81
+ "TOKEN": {
82
+ "FUD": "0x461efa7ee5aa1b27e44450d79e2104e7fc0991461e9eb1c2a3fc1f44cd554856::fud::FUD",
83
+ "MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c::mfud::MFUD",
84
+ "SUI": "0x2::sui::SUI",
85
+ "TGLD": "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::tgld::TGLD",
86
+ "USDT": "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT"
87
+ },
88
+ "ORACLE": {
89
+ "AFSUI": "0xacd75f051b8be445226f92d873fbf9bbc26fe25cec5708b1aeec44286dbbef5b",
90
+ "APT": "0x984e79d6cf30cc518e5e69dacacfa8db3e5f0674535c533061a7990c8a714c48",
91
+ "BUCK": "0x22ef75c17468f6ed24574f26011f7fcf61a7b983009c9ba6cacc28ae24ff1782",
92
+ "CETUS": "0xe8142c490363475a4ad0b9af02ac5a543962584f3a99cdb8754d909be6ec550d",
93
+ "INJ": "0xcdf04e2c9f400a713dc46748bc6eddddf472e669e604d13ed1eae8895a46d6c9",
94
+ "JUP": "0xd4a5fe0b48a6f8cbe528b5760462f0d9cad8080c8aebb1a9c63c2176c58fb3b3",
95
+ "NAVX": "0x726c5bafa4e8240d36bb42493c82bca30b920e2bcab1da1dca973322352e9f63",
96
+ "SCA": "0x8eb94035d6d54ad6b444dd67310b9ff54a05a54ecf77d5b22a43a75495774bb6",
97
+ "SEI": "0x3ad81c9951cb4e2e8908c184cea7e9cb52822ef7679f166ef9acf870bfc8e4f2",
98
+ "SOL": "0x0edabd97c679967e00d508c766fb4be0195890f96343bd3a58e10fa5e8063c96",
99
+ "SUI": "0x770f17817e809f22d3cf3ba5f452056622a31dd6a1db7c60c94c5a598aff9a29",
100
+ "TURBOS": "0x9fb8a445ba7ed37251f0ccd778b6cd7010174734562a18921d0684d4e01afe34",
101
+ "USDY": "0x604408004efddc03323cd6f6a72b98695dbdced57a630ca2622e6b96fc94a3f6",
102
+ "WBTC": "0xaa72a2b370cf45a7b1363a2b9e3f0c57c05863375b984e2ca0928973574404f2",
103
+ "WETH": "0x0ac9f9275eb0ac33b7f59741b1df67a6783af2db6d2a4e5aba8ce350d5b6b260"
104
+ }
105
+ },
106
+ "MOVEMENT": {
107
+ "RPC_ENDPOINT": "https://sui.devnet.m2.movementlabs.xyz:443",
108
+ "TYPUS_VERSION": "0x78f91a4142a62881bc5ac6f84d43144e02ba32ddec3e0bb2985f6980d044032a",
109
+ "PACKAGE_ORIGIN": {
110
+ "DOV_SINGLE": "0x773fbd026bcdffa6ca746c995a440b711e4b55fb220a6552e12041ede12a5b6b",
111
+ "FRAMEWORK": "0x421b30b0ebf1a60834adaa946cbb8fd0595c42d90c99bfac79a7f450b55c1a44",
112
+ "ORACLE": "0xbf0ff0490f2c33fe0dfea8407cca4c4d4be30a877f5dbffcbad1a078673845da",
113
+ "TOKEN": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e",
114
+ "TYPUS": "0xc7dc8f963a06a3675d9d423435d65c1144b0df1a17aa67b2ec7acabad96be2a4"
115
+ },
116
+ "PACKAGE": {
117
+ "DOV_SINGLE": "0x773fbd026bcdffa6ca746c995a440b711e4b55fb220a6552e12041ede12a5b6b",
118
+ "FRAMEWORK": "0x421b30b0ebf1a60834adaa946cbb8fd0595c42d90c99bfac79a7f450b55c1a44",
119
+ "ORACLE": "0xbf0ff0490f2c33fe0dfea8407cca4c4d4be30a877f5dbffcbad1a078673845da",
120
+ "TOKEN": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e",
121
+ "TYPUS": "0xc7dc8f963a06a3675d9d423435d65c1144b0df1a17aa67b2ec7acabad96be2a4"
122
+ },
123
+ "REGISTRY": {
124
+ "AIRDROP": "0x4300030cda3b3c4774f2bf108fc0461e9d48f6ab91ddd38da80cd4e51f509303",
125
+ "DOV_SINGLE": "0x2cdcf02854b3d75bb3abd2589a20f1288e2b80a4e7021fd8ade30c765d4b477b",
126
+ "LEADERBOARD": "0xf7991a4cbd5ec7977c9950d77ee0e944e8e84b768048ca9c3296acd7226cdcf9"
127
+ },
128
+ "TOKEN_REGISTRY": {
129
+ "BTC": "0x811bed2a13066c606638d71e695799022752291c94e46c334511a837cee7603f",
130
+ "ETH": "0x07323910600d887a12694c8c5dd3c61d919d711a8f34236d385d88a4881b08b5",
131
+ "SOL": "0x10dcc6468670b773e0ab1cbdb57e5e0fd79f29ec259bdbd45ba81a7b9675106c",
132
+ "USDC": "0x6ad27e79cd914de17e68a4cd2a564de65e9cce4b57798c93e96354d8a00e965e",
133
+ "USDT": "0xf9a3d1334132dd916e65abf23680d618b39de0fed6c92a338f30895fe0b134fe"
134
+ },
135
+ "TOKEN": {
136
+ "SUI": "0x2::sui::SUI",
137
+ "BTC": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e::btc::BTC",
138
+ "ETH": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e::eth::ETH",
139
+ "SOL": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e::sol::SOL",
140
+ "USDC": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e::usdc::USDC",
141
+ "USDT": "0xad00cb50c52af6e61b2dc45e7c80a4e0bf6149a5e45b08623fcec33a83361d2e::usdt::USDT"
142
+ },
143
+ "ORACLE_MANAGER_CAP": {
144
+ "SUIUSDC": "0xcda9da5c6fc39bde7adae554b192d9a50c5ff65b8e0c815d646623ab065d63b4",
145
+ "SUIUSDT": "0xcda9da5c6fc39bde7adae554b192d9a50c5ff65b8e0c815d646623ab065d63b4"
146
+ },
147
+ "ORACLE": {
148
+ "SUIUSDC": "0xf7d081223650168e7e7ea02fc2289e6e0795decdbeddb951c1609937b9dfe0cf",
149
+ "SUIUSDT": "0xf26ff14cc14e9342139d6a6c45775f98f006f8d39c8e8dee0aadf8127ce9118f"
150
+ },
151
+ "VAULT": {
152
+ "0": "2hkoQrhPcvch8CMtVx3XkwPDjDDEwr89bkn8Qq5VAg24"
153
+ }
154
+ }
155
+ }
package/lib/mainnet.json CHANGED
@@ -30,12 +30,12 @@
30
30
  "SCALLOP_MARKET": "0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9",
31
31
  "SCALLOP_REWARD_POOL_FOR_SUI": "0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9",
32
32
  "SCALLOP_REWARD_POOL_FOR_USDC": "0xf4268cc9b9413b9bfe09e8966b8de650494c9e5784bf0930759cfef4904daff8",
33
- "VERSION": "2.19.3",
33
+ "VERSION": "2.22.3",
34
34
  "EXP_GUESS_PACKAGE": "0x32d670520a10a87b8c042d2259c2d1f7c319329bafcf6f893ad9aaf01a43db8b",
35
35
  "EXP_GUESS_PACKAGE_ORIGIN": "0x32d670520a10a87b8c042d2259c2d1f7c319329bafcf6f893ad9aaf01a43db8b",
36
36
  "EXP_GUESS_REGISTRY": "0x70c6cbe6764b315cee1b24f483a0fc8307f047f1fab2a0d4438624845e6ba3f2",
37
37
  "FRAMEWORK_PACKAGE": "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274",
38
- "SINGLE_COLLATERAL_PACKAGE": "0x7de806a4277bc31aa12afdce194c38f89cb2f171539a426375dbe730db2d0221",
38
+ "SINGLE_COLLATERAL_PACKAGE": "0x1ee07392805d5b26a1c248b5739b768d426579ac1f4aeb50152f7ca06d3e2a00",
39
39
  "SINGLE_COLLATERAL_PACKAGE_ORIGIN": "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a",
40
40
  "SINGLE_COLLATERAL_REGISTRY": "0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8",
41
41
  "SINGLE_COLLATERAL_PORTFOLIO_VAULT_REGISTRY": "0xa1a186d050e3172ef4701c16048c99b11f785969874fa2642b9cbcf59cde7fc0",
@@ -0,0 +1,22 @@
1
+ import { TransactionBlock } from "@mysten/sui.js/transactions";
2
+ /**
3
+ public fun remove_airdrop<TOKEN>(
4
+ version: &Version,
5
+ typus_airdrop_registry: &mut TypusAirdropRegistry,
6
+ key: String,
7
+ ctx: &mut TxContext,
8
+ ): Balance<TOKEN>
9
+ */
10
+ export declare function getRemoveAirdropTx(gasBudget: number, packageId: string, version: string, typusLeaderboardRegistry: string, key: string, typeArguments: string[], sender: string): Promise<TransactionBlock>;
11
+ /**
12
+ public fun set_airdrop<TOKEN>(
13
+ version: &Version,
14
+ typus_airdrop_registry: &mut TypusAirdropRegistry,
15
+ key: String,
16
+ mut coins: vector<Coin<TOKEN>>,
17
+ mut users: vector<address>,
18
+ mut values: vector<u64>,
19
+ ctx: &mut TxContext,
20
+ )
21
+ */
22
+ export declare function getSetAirdropTx(gasBudget: number, packageId: string, version: string, typusLeaderboardRegistry: string, key: string, coins: string[], amount: string, users: string[], values: string[], typeArguments: string[]): Promise<TransactionBlock>;
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __read = (this && this.__read) || function (o, n) {
39
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
40
+ if (!m) return o;
41
+ var i = m.call(o), r, ar = [], e;
42
+ try {
43
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
+ }
45
+ catch (error) { e = { error: error }; }
46
+ finally {
47
+ try {
48
+ if (r && !r.done && (m = i["return"])) m.call(i);
49
+ }
50
+ finally { if (e) throw e.error; }
51
+ }
52
+ return ar;
53
+ };
54
+ Object.defineProperty(exports, "__esModule", { value: true });
55
+ exports.getSetAirdropTx = exports.getRemoveAirdropTx = void 0;
56
+ var transactions_1 = require("@mysten/sui.js/transactions");
57
+ /**
58
+ public fun remove_airdrop<TOKEN>(
59
+ version: &Version,
60
+ typus_airdrop_registry: &mut TypusAirdropRegistry,
61
+ key: String,
62
+ ctx: &mut TxContext,
63
+ ): Balance<TOKEN>
64
+ */
65
+ function getRemoveAirdropTx(gasBudget, packageId, version, typusLeaderboardRegistry, key, typeArguments, sender) {
66
+ return __awaiter(this, void 0, void 0, function () {
67
+ var tx, balance, coin;
68
+ return __generator(this, function (_a) {
69
+ tx = new transactions_1.TransactionBlock();
70
+ balance = tx.moveCall({
71
+ target: "".concat(packageId, "::airdrop::remove_airdrop"),
72
+ typeArguments: typeArguments,
73
+ arguments: [tx.object(version), tx.object(typusLeaderboardRegistry), tx.object(key)],
74
+ });
75
+ coin = tx.moveCall({
76
+ target: "0x2::coin::from_balance",
77
+ typeArguments: typeArguments,
78
+ arguments: [balance],
79
+ });
80
+ tx.transferObjects([coin], sender);
81
+ tx.setGasBudget(gasBudget);
82
+ return [2 /*return*/, tx];
83
+ });
84
+ });
85
+ }
86
+ exports.getRemoveAirdropTx = getRemoveAirdropTx;
87
+ /**
88
+ public fun set_airdrop<TOKEN>(
89
+ version: &Version,
90
+ typus_airdrop_registry: &mut TypusAirdropRegistry,
91
+ key: String,
92
+ mut coins: vector<Coin<TOKEN>>,
93
+ mut users: vector<address>,
94
+ mut values: vector<u64>,
95
+ ctx: &mut TxContext,
96
+ )
97
+ */
98
+ function getSetAirdropTx(gasBudget, packageId, version, typusLeaderboardRegistry, key, coins, amount, users, values, typeArguments) {
99
+ return __awaiter(this, void 0, void 0, function () {
100
+ var tx, _a, coin;
101
+ return __generator(this, function (_b) {
102
+ tx = new transactions_1.TransactionBlock();
103
+ if (typeArguments[0] == "0x2::sui::SUI" ||
104
+ typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
105
+ _a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
106
+ tx.moveCall({
107
+ target: "".concat(packageId, "::airdrop::set_airdrop"),
108
+ typeArguments: typeArguments,
109
+ arguments: [
110
+ tx.object(version),
111
+ tx.object(typusLeaderboardRegistry),
112
+ tx.object(key),
113
+ tx.makeMoveVec({ objects: [coin] }),
114
+ tx.pure(users),
115
+ tx.pure(values),
116
+ ],
117
+ });
118
+ }
119
+ else {
120
+ tx.moveCall({
121
+ target: "".concat(packageId, "::airdrop::set_airdrop"),
122
+ typeArguments: typeArguments,
123
+ arguments: [
124
+ tx.object(version),
125
+ tx.object(typusLeaderboardRegistry),
126
+ tx.object(key),
127
+ tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
128
+ tx.pure(users),
129
+ tx.pure(values),
130
+ ],
131
+ });
132
+ }
133
+ tx.setGasBudget(gasBudget);
134
+ return [2 /*return*/, tx];
135
+ });
136
+ });
137
+ }
138
+ exports.getSetAirdropTx = getSetAirdropTx;
@@ -0,0 +1,10 @@
1
+ import { TransactionBlock } from "@mysten/sui.js/transactions";
2
+ export declare function getClaimAirdropTx(input: {
3
+ tx: TransactionBlock;
4
+ typusPackageId: string;
5
+ typusEcosystemVersion: string;
6
+ typusAirdropRegistry: string;
7
+ typeArguments: string[];
8
+ key: string;
9
+ user: string;
10
+ }): TransactionBlock;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getClaimAirdropTx = void 0;
4
+ function getClaimAirdropTx(input) {
5
+ var result = input.tx.moveCall({
6
+ target: "".concat(input.typusPackageId, "::airdrop::claim_airdrop"),
7
+ typeArguments: input.typeArguments,
8
+ arguments: [
9
+ input.tx.object(input.typusEcosystemVersion),
10
+ input.tx.object(input.typusAirdropRegistry),
11
+ input.tx.pure(input.key),
12
+ ],
13
+ });
14
+ input.tx.moveCall({
15
+ target: "".concat(input.typusPackageId, "::utils::transfer_balance_opt"),
16
+ typeArguments: [input.typeArguments[0]],
17
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
18
+ });
19
+ return input.tx;
20
+ }
21
+ exports.getClaimAirdropTx = getClaimAirdropTx;
@@ -0,0 +1,10 @@
1
+ import { SuiClient } from "@mysten/sui.js/client";
2
+ export declare const SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
3
+ export declare function getAirdrop(input: {
4
+ provider: SuiClient;
5
+ typusPackageId: string;
6
+ typusEcosystemVersion: string;
7
+ typusAirdropRegistry: string;
8
+ key: string;
9
+ user: string;
10
+ }): Promise<string[]>;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getAirdrop = exports.SENDER = void 0;
40
+ var transactions_1 = require("@mysten/sui.js/transactions");
41
+ var bcs_1 = require("@mysten/bcs");
42
+ exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
43
+ function getAirdrop(input) {
44
+ return __awaiter(this, void 0, void 0, function () {
45
+ var transactionBlock, results, bytes, reader;
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0:
49
+ transactionBlock = new transactions_1.TransactionBlock();
50
+ transactionBlock.moveCall({
51
+ target: "".concat(input.typusPackageId, "::airdrop::get_airdrop"),
52
+ typeArguments: [],
53
+ arguments: [
54
+ transactionBlock.pure(input.typusEcosystemVersion),
55
+ transactionBlock.pure(input.typusAirdropRegistry),
56
+ transactionBlock.pure(input.key),
57
+ transactionBlock.pure(input.user),
58
+ ],
59
+ });
60
+ return [4 /*yield*/, input.provider.devInspectTransactionBlock({ sender: exports.SENDER, transactionBlock: transactionBlock })];
61
+ case 1:
62
+ results = (_a.sent()).results;
63
+ bytes = results[results.length - 1].returnValues[0][0];
64
+ reader = new bcs_1.BcsReader(new Uint8Array(bytes));
65
+ return [2 /*return*/, reader.readVec(function (reader) {
66
+ return reader.read64();
67
+ })];
68
+ }
69
+ });
70
+ });
71
+ }
72
+ exports.getAirdrop = getAirdrop;
@@ -0,0 +1 @@
1
+ export declare function getTvl(): Promise<number>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getTvl = void 0;
40
+ function getTvl() {
41
+ return __awaiter(this, void 0, void 0, function () {
42
+ var response, data;
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0: return [4 /*yield*/, fetch("https://api.llama.fi/tvl/typus-finance", {
46
+ method: "GET",
47
+ })];
48
+ case 1:
49
+ response = _a.sent();
50
+ return [4 /*yield*/, response.json()];
51
+ case 2:
52
+ data = _a.sent();
53
+ // console.log(data);
54
+ return [2 /*return*/, data];
55
+ }
56
+ });
57
+ });
58
+ }
59
+ exports.getTvl = getTvl;
@@ -1,9 +1,3 @@
1
- export declare function getDepositorLeaderBoard(start?: string, end?: string, step?: number): Promise<LeaderBoard[]>;
2
- export declare function getBidderLeaderBoard(startTimestamp?: string, end?: string): Promise<LeaderBoard[]>;
3
- interface LeaderBoard {
4
- user: string;
5
- score: number;
6
- }
7
1
  export interface ExpLeaderBoard {
8
2
  nft_id: string;
9
3
  total_exp_earn: number;
@@ -11,4 +5,3 @@ export interface ExpLeaderBoard {
11
5
  }
12
6
  export declare function getExpLeaderBoardWithOwner(expLeaderBoard: ExpLeaderBoard[], ownerMap: Map<string, string>): Promise<ExpLeaderBoard[]>;
13
7
  export declare function getExpLeaderBoard(startTimestamp: string, endTimestamp?: string): Promise<ExpLeaderBoard[]>;
14
- export {};
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ // const apiUrl = "https://app.sentio.xyz/api/v1/insights/wayne/typus/query";
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __generator = (this && this.__generator) || function (thisArg, body) {
13
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
14
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
15
+ function verb(n) { return function (v) { return step([n, v]); }; }
16
+ function step(op) {
17
+ if (f) throw new TypeError("Generator is already executing.");
18
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
19
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
20
+ if (y = 0, t) op = [op[0] & 2, t.value];
21
+ switch (op[0]) {
22
+ case 0: case 1: t = op; break;
23
+ case 4: _.label++; return { value: op[1], done: false };
24
+ case 5: _.label++; y = op[1]; op = [0]; continue;
25
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
26
+ default:
27
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
28
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
30
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31
+ if (t[2]) _.ops.pop();
32
+ _.trys.pop(); continue;
33
+ }
34
+ op = body.call(thisArg, _);
35
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
36
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
37
+ }
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.getExpLeaderBoard = exports.getExpLeaderBoardWithOwner = void 0;
41
+ function getExpLeaderBoardWithOwner(expLeaderBoard, ownerMap) {
42
+ return __awaiter(this, void 0, void 0, function () {
43
+ return __generator(this, function (_a) {
44
+ return [2 /*return*/, expLeaderBoard.map(function (l) {
45
+ l.owner = ownerMap.get(l.nft_id);
46
+ return l;
47
+ })];
48
+ });
49
+ });
50
+ }
51
+ exports.getExpLeaderBoardWithOwner = getExpLeaderBoardWithOwner;
52
+ var headers = {
53
+ "api-key": "tz3JJ6stG7Fux6ueRSRA5mdpC9U0lozI3",
54
+ "Content-Type": "application/json",
55
+ };
56
+ function getExpLeaderBoard(startTimestamp, endTimestamp) {
57
+ return __awaiter(this, void 0, void 0, function () {
58
+ var apiUrl, _endTimestamp, requestData, jsonData, response, data;
59
+ return __generator(this, function (_a) {
60
+ switch (_a.label) {
61
+ case 0:
62
+ apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_v2/sql/execute";
63
+ _endTimestamp = endTimestamp ? endTimestamp : "9999999999";
64
+ requestData = {
65
+ sqlQuery: {
66
+ // sql: `SELECT S.distinct_id AS owner, SUM(E.exp_earn) AS total_exp_earn
67
+ // FROM ExpUp E
68
+ // JOIN (
69
+ // SELECT number, distinct_id
70
+ // FROM StakeNft
71
+ // WHERE (number, timestamp) IN (
72
+ // SELECT number, MAX(timestamp) AS max_timestamp
73
+ // FROM StakeNft
74
+ // GROUP BY number
75
+ // )
76
+ // ) S ON E.number = S.number
77
+ // WHERE E.timestamp >= ${startTimestamp} && E.timestamp < ${_endTimestamp}
78
+ // GROUP BY owner
79
+ // ORDER BY total_exp_earn DESC;`,
80
+ sql: "\n SELECT E.nft_id as nft_id, SUM(E.exp_earn) as total_exp_earn\n FROM ExpUp E\n WHERE E.timestamp >= ".concat(startTimestamp, " && E.timestamp < ").concat(_endTimestamp, "\n GROUP BY nft_id\n ORDER BY total_exp_earn DESC;\n "),
81
+ size: 200,
82
+ },
83
+ };
84
+ jsonData = JSON.stringify(requestData);
85
+ return [4 /*yield*/, fetch(apiUrl, {
86
+ method: "POST",
87
+ headers: headers,
88
+ body: jsonData,
89
+ })];
90
+ case 1:
91
+ response = _a.sent();
92
+ return [4 /*yield*/, response.json()];
93
+ case 2:
94
+ data = _a.sent();
95
+ return [2 /*return*/, data.result.rows];
96
+ }
97
+ });
98
+ });
99
+ }
100
+ exports.getExpLeaderBoard = getExpLeaderBoard;
101
+ // (async () => {
102
+ // const res1 = await getExpLeaderBoard("0");
103
+ // console.log(res1);
104
+ // })();
@@ -0,0 +1,10 @@
1
+ export declare function getTotalDepositorIncentive(): Promise<TokenAmount>;
2
+ export declare function getTotalPremium(): Promise<number>;
3
+ export declare function getTotalProfitSharingClaimed(): Promise<TokenAmount[]>;
4
+ import { SuiClient } from "@mysten/sui.js/client";
5
+ export declare function getTotalProfitSharing(provider: SuiClient): Promise<TokenAmount[]>;
6
+ interface TokenAmount {
7
+ token: string;
8
+ total_amount: string;
9
+ }
10
+ export {};