@typus/typus-sdk 1.4.14 → 1.4.16
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/dist/config-mainnet.json +97 -0
- package/dist/config-testnet.json +93 -0
- package/dist/src/typus-dov-single-v2/function/bidding.d.ts +4 -3
- package/dist/src/typus-dov-single-v2/function/bidding.js +14 -9
- package/dist/src/typus-perp/fetch.d.ts +8 -47
- package/dist/src/typus-perp/fetch.js +11 -11
- package/dist/src/typus-perp/index.js +4 -3
- package/dist/src/typus-perp/user/order.d.ts +5 -39
- package/dist/src/typus-perp/user/order.js +14 -14
- package/dist/src/typus-perp/user/orderWithBidReceipt.d.ts +3 -43
- package/dist/src/typus-perp/user/orderWithBidReceipt.js +24 -24
- package/dist/src/typus-perp/user/tlp.d.ts +6 -58
- package/dist/src/typus-perp/user/tlp.js +25 -25
- package/dist/src/typus-safu/view-function.d.ts +35 -5
- package/dist/src/typus-safu/view-function.js +50 -9
- package/dist/src/utils/typusConfig.d.ts +4 -2
- package/dist/src/utils/typusConfig.js +13 -0
- package/package.json +1 -2
- package/dist/config.json +0 -194
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"RPC_ENDPOINT": "https://fullnode.mainnet.sui.io:443",
|
|
3
|
+
"PACKAGE_ORIGIN": {
|
|
4
|
+
"DOV_SINGLE": "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a",
|
|
5
|
+
"DICE": "0x37816d28c34cc0df82655ca97b3f066112a5f3c202cbb4aaa76c8af54e779750",
|
|
6
|
+
"FRAMEWORK": "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274",
|
|
7
|
+
"TOKEN": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
|
|
8
|
+
"NFT": "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196",
|
|
9
|
+
"ORACLE": "0x855eb2d260ee42b898266e6df90bfd3c4ed821ccb253a352c159c223244a4b8a",
|
|
10
|
+
"TYPUS": "0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a",
|
|
11
|
+
"PERP": "",
|
|
12
|
+
"SAFU": "0x8e4f745b9c0748d24d3c4248658a385822c5ae6c38dba4d8739ad2389a14529f"
|
|
13
|
+
},
|
|
14
|
+
"PACKAGE": {
|
|
15
|
+
"DOV_SINGLE": "0xf7ef57f3bd98455262417886b17eb4d5af1a18d2dec19c5b34e512bf4fc10acf",
|
|
16
|
+
"DICE": "0x14f1676b7a3b3a6c35eeff747bdb6fcb5bfe920755086c4af1079c23107c22aa",
|
|
17
|
+
"FRAMEWORK": "0x5c6648fb219c046256488486d23d4af7bc562d5ab5c382e1f4b558066a327fe8",
|
|
18
|
+
"TOKEN": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
|
|
19
|
+
"NFT": "0xba06aae31d9b7c9f651e783272c7e4f776fb5ae17e89d525b75a17b099f58202",
|
|
20
|
+
"ORACLE": "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd",
|
|
21
|
+
"TYPUS": "0xf5c7e61fd28d1ed38711f03e1c5ffc6c5b8435eff386132fc5822efe6d90b138",
|
|
22
|
+
"PERP": "",
|
|
23
|
+
"SAFU": "0x3260c1f95368ce4e2e6c90c4a2447cc0c7da58fdfa49aa207a382dcf51b85611"
|
|
24
|
+
},
|
|
25
|
+
"VERSION": {
|
|
26
|
+
"TYPUS": "0xd2882b992e986250b3304b59530700bc3850939f9a77e9e9dfa9cf1656f84b3d",
|
|
27
|
+
"PERP": "",
|
|
28
|
+
"SAFU": "0x340b1050764bd269739d579f1c99608a59705a23d1a2ea77e47344f695d720df"
|
|
29
|
+
},
|
|
30
|
+
"REGISTRY": {
|
|
31
|
+
"DICE": {
|
|
32
|
+
"COMBO_DICE": "0x16657424191772d40afac15738abb26cdf41172d2d205694b04d1300ad403c55",
|
|
33
|
+
"TAILS_EXP": "0x7679ab7157f13ec945579e3098ba589eb8b4eec841c775799d2aa22b565187c7"
|
|
34
|
+
},
|
|
35
|
+
"DOV": {
|
|
36
|
+
"DOV_SINGLE": "0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8"
|
|
37
|
+
},
|
|
38
|
+
"PERP": {
|
|
39
|
+
"LIQUIDITY_POOL": "",
|
|
40
|
+
"LP_POOL": "",
|
|
41
|
+
"MARKET": "",
|
|
42
|
+
"STAKE_POOL": "",
|
|
43
|
+
"TLP": ""
|
|
44
|
+
},
|
|
45
|
+
"TOKEN": {
|
|
46
|
+
"INJ": "",
|
|
47
|
+
"MFUD": "0xb8d7e7ab783e56700c0212bd9f0938bba9dd3e7241c149e6c52b21334ec45ece",
|
|
48
|
+
"SEI": ""
|
|
49
|
+
},
|
|
50
|
+
"TYPUS": {
|
|
51
|
+
"AIRDROP": "0x4b451f4632bd64af82d5e6fe46e20705c9468bd46d6758a0f7093fde2930d084",
|
|
52
|
+
"LEADERBOARD": "0xc515a3e7fd12ba902f7f1ebe52c676136e1b34cb614ae9c79a46b257ca7d5534",
|
|
53
|
+
"TAILS_STAKING": "0xeca3e88577dc3f45df8b7bace51f26b126271ce4c5fa33b3739fd7b69fc16559",
|
|
54
|
+
"USER": "0xb1b16eb4845b5ee1a29432b1f2bcfe8cbb33c234492baf31a706d82e28e18bce",
|
|
55
|
+
"TGLD": "0x8ee1af362fe9e0a29f6bad48d8ff44249ece5aaa77a4302c2ffcc90950e52ed2"
|
|
56
|
+
},
|
|
57
|
+
"SAFU": {
|
|
58
|
+
"SAFU": "0x61ecdd1a8536663da6e60e93cbe14c61e2ece85366dbfa8b9509b699a52a54d0"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"OBJECT": {
|
|
62
|
+
"NFT_TRANSFER_POLICY": "0x55475b9e16d9a0176dcef37f83a1921b15f2cbd2711a5f30b9d952c0c8f5f957",
|
|
63
|
+
"STRATEGY_POOL": "0x2c60ddd50d76beb00faa025962d566359a6ea05b1f7f19ac6bd050f4db8c885c",
|
|
64
|
+
"TAILS_IDS": "0x3a6a403eb7c123b6f4d25081078b6f07c0ee5987d3ac8ab3e6bcf707c1b0e778",
|
|
65
|
+
"TGLD_COIN_METADATA": "0x3a070c729606334a2be7c51ab28da9a1101b0de01452dd62c10cda0f7a5795d2",
|
|
66
|
+
"TGLD_TOKEN_POLICY": "0xd9461bd329f1df24be9698131b6e2c2b9eaac7c9cf6d76689112f2e57be12009",
|
|
67
|
+
"TLP_TREASURY_CAP": ""
|
|
68
|
+
},
|
|
69
|
+
"ORACLE": {
|
|
70
|
+
"AFSUI": "",
|
|
71
|
+
"APT": "0x401ed2a4de92950351c54edaa9a8dce5e38bdb6b06e248935c6f6f7d361a99d6",
|
|
72
|
+
"BUCK": "",
|
|
73
|
+
"CETUS": "0xaedaa2e76661471924c1ca7edae069317cbe082798dd3bfa31694dc873102532",
|
|
74
|
+
"INJ": "",
|
|
75
|
+
"JUP": "0xd4a5fe0b48a6f8cbe528b5760462f0d9cad8080c8aebb1a9c63c2176c58fb3b3",
|
|
76
|
+
"NAVX": "0x726c5bafa4e8240d36bb42493c82bca30b920e2bcab1da1dca973322352e9f63",
|
|
77
|
+
"SCA": "0x8eb94035d6d54ad6b444dd67310b9ff54a05a54ecf77d5b22a43a75495774bb6",
|
|
78
|
+
"SEI": "",
|
|
79
|
+
"SOL": "0x9712ad1cba00a437fb669e4df1a59568e4267bd8a8ce989452fb63c9f00b59ab",
|
|
80
|
+
"SUI": "0xeb6b3e3300ff884604ead6172b0aeadee3854980cab65a7feb57300b04b74cc1",
|
|
81
|
+
"TURBOS": "0x819ff07b5768d7b9b428b69b123140f6a74b04eaa978a4cbab9055025bd1536d",
|
|
82
|
+
"USDY": "",
|
|
83
|
+
"BTC": "0x61813dc2e46dba41b14507857827f0ed7e99b0be242548828769728b81c8fab5",
|
|
84
|
+
"ETH": "0x253bbaaa35275240cf6df03258489707ea059762831e4102ebaabafd442bc935"
|
|
85
|
+
},
|
|
86
|
+
"TOKEN": {
|
|
87
|
+
"AFSUI": "",
|
|
88
|
+
"FUD": "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
|
|
89
|
+
"MFUD": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d::mfud::MFUD",
|
|
90
|
+
"SUI": "0x2::sui::SUI",
|
|
91
|
+
"TGLD": "0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a::tgld::TGLD",
|
|
92
|
+
"TLP": "",
|
|
93
|
+
"USD": "",
|
|
94
|
+
"USDC": "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
|
|
95
|
+
"USDT": ""
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"RPC_ENDPOINT": "https://sui-testnet.blastapi.io:443/7f446a12-c4ab-4e3c-b2d8-ebb0fcbe5cdd",
|
|
3
|
+
"PACKAGE_ORIGIN": {
|
|
4
|
+
"DOV_SINGLE": "0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f",
|
|
5
|
+
"DICE": "0x9b43ee208a3b235810c145bca1161d1a71d08bfe76b1e55bb3db319ea95d0149",
|
|
6
|
+
"FRAMEWORK": "0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded",
|
|
7
|
+
"TOKEN": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
|
|
8
|
+
"NFT": "0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828",
|
|
9
|
+
"ORACLE": "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73",
|
|
10
|
+
"TYPUS": "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277",
|
|
11
|
+
"PERP": "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c",
|
|
12
|
+
"SAFU": ""
|
|
13
|
+
},
|
|
14
|
+
"PACKAGE": {
|
|
15
|
+
"DOV_SINGLE": "0x2e462aa0224bec76acaea81c51ca5b9ae4b27ec50281a764797c84148c8a463f",
|
|
16
|
+
"DICE": "0x112321a74fb0903aff5c654603c19060552a704b5fb13a6cefa84e1147e66db8",
|
|
17
|
+
"FRAMEWORK": "0x90ca6e2393e3adc91b4e9b70ab16c017e5f70f7094b6f09b913fef2833a656e9",
|
|
18
|
+
"TOKEN": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
|
|
19
|
+
"NFT": "0x0f5162014f18686640b8d0adefd60c3fe5b377413ec4f1e77001c67d96f8501a",
|
|
20
|
+
"ORACLE": "0x71fbc7acaf513561dabdeb846e7dd5288108e56edb0b6de8d4999c4dfce21f66",
|
|
21
|
+
"TYPUS": "0x88124ef8caf346cc19bf7447e72cf540fb6f228f16806effdc3dafccee747264",
|
|
22
|
+
"PERP": "0x5ff329ee25f3936b7f3e191de702cc0dd8beca7e1ac833f7d73ea653d47ef4ad",
|
|
23
|
+
"SAFU": ""
|
|
24
|
+
},
|
|
25
|
+
"VERSION": {
|
|
26
|
+
"TYPUS": "0x2edc980f55e31ba3c660f4e2650e915fd47fb33b524b01a52a116719adac8be7",
|
|
27
|
+
"PERP": "0x3aafe933e23a9e10f3a34febf6a2996961989558315bae46458fd234496e8a97",
|
|
28
|
+
"SAFU": ""
|
|
29
|
+
},
|
|
30
|
+
"REGISTRY": {
|
|
31
|
+
"DICE": {
|
|
32
|
+
"COMBO_DICE": "0x034f58472d9604eee3e1fb5896e4d6a14f426c17c504cdb9dcdc7269ca4ad3b4",
|
|
33
|
+
"TAILS_EXP": "0x37e0c8c80a5099d5dfe1b0aeae62e3f01916be73935090efb9c95279b7bb1ce7"
|
|
34
|
+
},
|
|
35
|
+
"DOV": {
|
|
36
|
+
"DOV_SINGLE": "0x0285cbf4aa8585be6c978235d11d06fa35773266ede040d38d34e1d79b049460"
|
|
37
|
+
},
|
|
38
|
+
"PERP": {
|
|
39
|
+
"LIQUIDITY_POOL": "0x40d1ea0f0dfebbe0b130f08c0c62bfee1c58f6a99c0960cb4f08fd3040bf4714",
|
|
40
|
+
"LP_POOL": "0x0a213c906f7a9fc369f1e7d0ffabb7701bfd1cdff04679b1132c5838306e3394",
|
|
41
|
+
"MARKET": "0xa522a55413d109c568c3d42cbcd0e344000d61086f390df672663424e0329288",
|
|
42
|
+
"STAKE_POOL": "0xc853c36a9317a709ac92b611daa910b43805876ba6ca78fbbab9d51359994c5b",
|
|
43
|
+
"TLP": "0x4e40c46ebe73b3fdca694040747b99a1b25600ddeae26f9fbb8cda5a683d26de"
|
|
44
|
+
},
|
|
45
|
+
"TOKEN": {
|
|
46
|
+
"INJ": "0xcb7e2cb6c8c1138909b5bfec13b92ebde7117c82b395df46e3fe0e3a35d84d14",
|
|
47
|
+
"MFUD": "0x7ad87901531693f1baa541712947860dcc543617e11b14993ad70d20daf159c6",
|
|
48
|
+
"SEI": "0xf1ed3e5474476c7378039d44c7a088e0196129d3a183b3251fff2bb34fc2bcad"
|
|
49
|
+
},
|
|
50
|
+
"TYPUS": {
|
|
51
|
+
"AIRDROP": "0xfb2fbf261f6050d100bcd026ffa0076e088506b1bec26313947239303e2a0224",
|
|
52
|
+
"LEADERBOARD": "0x4faabe5a4a509a145fc9bae95761d34c11571da4cb25d681f06ffcbadbc355e7",
|
|
53
|
+
"TAILS_STAKING": "0x989bd585b580dfc22d9d7656a5807b2f6c8fe36260a2003ef697adc8a38d21af",
|
|
54
|
+
"USER": "0x5f1894a3680949111a7530d63ceda6857d31521ab2de625e9f826cae17c9a7f3",
|
|
55
|
+
"TGLD": "0x2118b4056c89d90a6dc40d198fbe239cb8e83f7ea20daaf4ea53341c7fdb043c"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"OBJECT": {
|
|
59
|
+
"NFT_TRANSFER_POLICY": "0x1c62271ecc443c3d92a8fe8f5662e877856d26b971d967f66937a65f55160831",
|
|
60
|
+
"STRATEGY_POOL": "0x50b01081469d032e04bfcbd057614b1359376920f55c7bebd076e0e2af07a57f",
|
|
61
|
+
"TAILS_IDS": "0xf4ea1c4432823ebde3b0c1f0705a45b08571b48237db879502b8ba336ea5b916",
|
|
62
|
+
"TGLD_COIN_METADATA": "0xf77f8aabe64dccef0e568f2ef58a6ca74bdfb31786507cc35b7626a4df0d0ebc",
|
|
63
|
+
"TGLD_TOKEN_POLICY": "0x17875c2f772053cd148bd2b8b8a40160db3f841825d8963192f8394d5c18974c",
|
|
64
|
+
"TLP_TREASURY_CAP": "0xeb835b5db70144d098f7b4885ac525900fb5a6b47565f31d2275e34479ef7889"
|
|
65
|
+
},
|
|
66
|
+
"ORACLE": {
|
|
67
|
+
"AFSUI": "0xacd75f051b8be445226f92d873fbf9bbc26fe25cec5708b1aeec44286dbbef5b",
|
|
68
|
+
"APT": "0x984e79d6cf30cc518e5e69dacacfa8db3e5f0674535c533061a7990c8a714c48",
|
|
69
|
+
"BUCK": "0x22ef75c17468f6ed24574f26011f7fcf61a7b983009c9ba6cacc28ae24ff1782",
|
|
70
|
+
"CETUS": "0xe8142c490363475a4ad0b9af02ac5a543962584f3a99cdb8754d909be6ec550d",
|
|
71
|
+
"INJ": "0xcdf04e2c9f400a713dc46748bc6eddddf472e669e604d13ed1eae8895a46d6c9",
|
|
72
|
+
"JUP": "0xd4a5fe0b48a6f8cbe528b5760462f0d9cad8080c8aebb1a9c63c2176c58fb3b3",
|
|
73
|
+
"NAVX": "0x726c5bafa4e8240d36bb42493c82bca30b920e2bcab1da1dca973322352e9f63",
|
|
74
|
+
"SCA": "0x8eb94035d6d54ad6b444dd67310b9ff54a05a54ecf77d5b22a43a75495774bb6",
|
|
75
|
+
"SEI": "0x3ad81c9951cb4e2e8908c184cea7e9cb52822ef7679f166ef9acf870bfc8e4f2",
|
|
76
|
+
"SOL": "0x0edabd97c679967e00d508c766fb4be0195890f96343bd3a58e10fa5e8063c96",
|
|
77
|
+
"SUI": "0x770f17817e809f22d3cf3ba5f452056622a31dd6a1db7c60c94c5a598aff9a29",
|
|
78
|
+
"TURBOS": "0x9fb8a445ba7ed37251f0ccd778b6cd7010174734562a18921d0684d4e01afe34",
|
|
79
|
+
"USDY": "0x604408004efddc03323cd6f6a72b98695dbdced57a630ca2622e6b96fc94a3f6",
|
|
80
|
+
"BTC": "0xaa72a2b370cf45a7b1363a2b9e3f0c57c05863375b984e2ca0928973574404f2",
|
|
81
|
+
"ETH": "0x0ac9f9275eb0ac33b7f59741b1df67a6783af2db6d2a4e5aba8ce350d5b6b260"
|
|
82
|
+
},
|
|
83
|
+
"TOKEN": {
|
|
84
|
+
"AFSUI": "0xd31923b6821fb7ba32d23e514b43d307da6ef991f9ef1af2cc4e26a0992ac87a::afsui::AFSUI",
|
|
85
|
+
"FUD": "0x461efa7ee5aa1b27e44450d79e2104e7fc0991461e9eb1c2a3fc1f44cd554856::fud::FUD",
|
|
86
|
+
"MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c::mfud::MFUD",
|
|
87
|
+
"SUI": "0x2::sui::SUI",
|
|
88
|
+
"TGLD": "0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277::tgld::TGLD",
|
|
89
|
+
"TLP": "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::tlp::TLP",
|
|
90
|
+
"USD": "0x01a05edb0e5e670196de98fbbf544180d129dd4ec11c3c57f742badf0304650d::trading::USD",
|
|
91
|
+
"USDT": "0xa38dad920880f81ea514de6db007d3a84e9116a29c60b3e69bbe418c2d9f553c::usdt::USDT"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -3,6 +3,7 @@ import { PublicKey } from "@solana/web3.js";
|
|
|
3
3
|
import { PriceData } from "@pythnetwork/client";
|
|
4
4
|
import { SuiClient } from "@mysten/sui.js/dist/cjs/client";
|
|
5
5
|
import BigNumber from "bignumber.js";
|
|
6
|
+
import { TypusConfig } from "src/utils";
|
|
6
7
|
export declare const ASSET_INFO: {
|
|
7
8
|
BTC: {
|
|
8
9
|
product: PublicKey;
|
|
@@ -114,7 +115,7 @@ export declare const parsePythOracleData: (data: PriceData[], decimals: {
|
|
|
114
115
|
}) => {
|
|
115
116
|
[key: string]: CoinInfo;
|
|
116
117
|
};
|
|
117
|
-
export declare const fetchPrices: (provider: SuiClient,
|
|
118
|
+
export declare const fetchPrices: (provider: SuiClient, config: TypusConfig) => Promise<{
|
|
118
119
|
[key: string]: CoinInfo;
|
|
119
120
|
}>;
|
|
120
121
|
export declare const calcIncentiveRate: (incentiveBp: any) => number;
|
|
@@ -129,7 +130,7 @@ export declare const parseBidReceipt: (vaults: Vault[], bidReceipts: {
|
|
|
129
130
|
bidVaultsInfo: BidVaultInfo[];
|
|
130
131
|
};
|
|
131
132
|
export declare const parseBid: (bidVaultInfo: BidVaultInfo, bidShare: BidShare, auction: Auction | null, oTokenPrice: string, isAutoBid: boolean) => Bid & OrderBy;
|
|
132
|
-
export declare const getUserBidReceipts: (provider: SuiClient,
|
|
133
|
+
export declare const getUserBidReceipts: (provider: SuiClient, originFramworkAddress: string, userAddress: string) => Promise<{
|
|
133
134
|
[key: string]: Receipt[];
|
|
134
135
|
}>;
|
|
135
136
|
/**
|
|
@@ -146,6 +147,6 @@ export declare const getUserBidReceipts: (provider: SuiClient, network: string,
|
|
|
146
147
|
* @param prices - tokens prices (usd pair on Pyth)
|
|
147
148
|
* @return User Bids.
|
|
148
149
|
*/
|
|
149
|
-
export declare const fetchUserBids: (provider: SuiClient,
|
|
150
|
+
export declare const fetchUserBids: (provider: SuiClient, config: TypusConfig, userAddress: string, prices?: {
|
|
150
151
|
[key: string]: CoinInfo;
|
|
151
152
|
}) => Promise<any>;
|
|
@@ -97,7 +97,6 @@ var client_1 = require("@pythnetwork/client");
|
|
|
97
97
|
var token_1 = require("./token");
|
|
98
98
|
var constants_1 = require("../../constants");
|
|
99
99
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
100
|
-
var config_json_1 = __importDefault(require("../../../config.json"));
|
|
101
100
|
var moment_1 = __importDefault(require("moment"));
|
|
102
101
|
var PriceDecimal = (0, bignumber_js_1.default)(10).pow(8);
|
|
103
102
|
exports.ASSET_INFO = {
|
|
@@ -253,13 +252,13 @@ var parsePythOracleData = function (data, decimals) {
|
|
|
253
252
|
return prices;
|
|
254
253
|
};
|
|
255
254
|
exports.parsePythOracleData = parsePythOracleData;
|
|
256
|
-
var fetchPrices = function (provider,
|
|
255
|
+
var fetchPrices = function (provider, config) { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
256
|
var coinObjects, oracleDecimal, PYTHNET_CLUSTER_NAME, connection, pythPublicKey, pythClient, priceData, prices, suiusd, suifud, fudusd, suiafsui, afsuiusd, suinavx, navxusd, suibuck, buckusd, usdyusdc, usdyusdcWithDecimal, scasui, scausd;
|
|
258
257
|
var _a, _b;
|
|
259
258
|
return __generator(this, function (_c) {
|
|
260
259
|
switch (_c.label) {
|
|
261
260
|
case 0: return [4 /*yield*/, provider.multiGetObjects({
|
|
262
|
-
ids: Object.values(
|
|
261
|
+
ids: Object.values(config.oracle),
|
|
263
262
|
options: { showContent: true },
|
|
264
263
|
})];
|
|
265
264
|
case 1:
|
|
@@ -579,7 +578,7 @@ var parseBid = function (bidVaultInfo, bidShare, auction, oTokenPrice, isAutoBid
|
|
|
579
578
|
};
|
|
580
579
|
};
|
|
581
580
|
exports.parseBid = parseBid;
|
|
582
|
-
var getUserBidReceipts = function (provider,
|
|
581
|
+
var getUserBidReceipts = function (provider, originFramworkAddress, userAddress) { return __awaiter(void 0, void 0, void 0, function () {
|
|
583
582
|
var bidReceipts, result, hasNextPage, data, nextCursor, data_1, data_1_1, object, content, typeStringComponents, subtype, typeComponents, type, typePackage, vaultIndex, receipt;
|
|
584
583
|
var e_1, _a;
|
|
585
584
|
return __generator(this, function (_b) {
|
|
@@ -669,15 +668,21 @@ exports.getUserBidReceipts = getUserBidReceipts;
|
|
|
669
668
|
* @param prices - tokens prices (usd pair on Pyth)
|
|
670
669
|
* @return User Bids.
|
|
671
670
|
*/
|
|
672
|
-
var fetchUserBids = function (provider,
|
|
673
|
-
var vaultsInfo, userReceipts, userStrategies, auctions, _a, sortedBidReceipts, bidVaultsInfo, bidShares, bidsFromBidShares, _loop_1, bidVaultsInfo_1, bidVaultsInfo_1_1, bidVaultInfo, autoBidsShares, vaultAutoBidReceipts, userStrategies_1, userStrategies_1_1, strategy, receipts, receipts_1, receipts_1_1, receiptItem, vaultIndex, receipt, autoBidVaultInfos, bidsFromStrategies, _loop_2, autoBidVaultInfos_1, autoBidVaultInfos_1_1, autoBidVaultInfo, byOrdered;
|
|
671
|
+
var fetchUserBids = function (provider, config, userAddress, prices) { return __awaiter(void 0, void 0, void 0, function () {
|
|
672
|
+
var packageAddress, registryAddress, originFramworkAddress, framworkAddress, strategyPoolAddress, vaultsInfo, userReceipts, userStrategies, auctions, _a, sortedBidReceipts, bidVaultsInfo, bidShares, bidsFromBidShares, _loop_1, bidVaultsInfo_1, bidVaultsInfo_1_1, bidVaultInfo, autoBidsShares, vaultAutoBidReceipts, userStrategies_1, userStrategies_1_1, strategy, receipts, receipts_1, receipts_1_1, receiptItem, vaultIndex, receipt, autoBidVaultInfos, bidsFromStrategies, _loop_2, autoBidVaultInfos_1, autoBidVaultInfos_1_1, autoBidVaultInfo, byOrdered;
|
|
674
673
|
var e_2, _b, e_3, _c, e_4, _d, e_5, _e;
|
|
675
674
|
return __generator(this, function (_f) {
|
|
676
675
|
switch (_f.label) {
|
|
677
|
-
case 0:
|
|
676
|
+
case 0:
|
|
677
|
+
packageAddress = config.package.dovSingle;
|
|
678
|
+
registryAddress = config.registry.dov.dovSingle;
|
|
679
|
+
originFramworkAddress = config.packageOrigin.framework;
|
|
680
|
+
framworkAddress = config.package.framework;
|
|
681
|
+
strategyPoolAddress = config.object.strategyPool;
|
|
682
|
+
return [4 /*yield*/, (0, view_function_1.getVaults)(provider, packageAddress, registryAddress, [])];
|
|
678
683
|
case 1:
|
|
679
684
|
vaultsInfo = _f.sent();
|
|
680
|
-
return [4 /*yield*/, (0, exports.getUserBidReceipts)(provider,
|
|
685
|
+
return [4 /*yield*/, (0, exports.getUserBidReceipts)(provider, originFramworkAddress, userAddress)];
|
|
681
686
|
case 2:
|
|
682
687
|
userReceipts = _f.sent();
|
|
683
688
|
return [4 /*yield*/, (0, auto_bid_1.getUserStrategies)(provider, packageAddress, registryAddress, strategyPoolAddress, userAddress)];
|
|
@@ -687,7 +692,7 @@ var fetchUserBids = function (provider, network, packageAddress, framworkAddress
|
|
|
687
692
|
case 4:
|
|
688
693
|
auctions = _f.sent();
|
|
689
694
|
if (!(typeof prices === "undefined")) return [3 /*break*/, 6];
|
|
690
|
-
return [4 /*yield*/, (0, exports.fetchPrices)(provider,
|
|
695
|
+
return [4 /*yield*/, (0, exports.fetchPrices)(provider, config)];
|
|
691
696
|
case 5:
|
|
692
697
|
prices = _f.sent();
|
|
693
698
|
_f.label = 6;
|
|
@@ -3,54 +3,15 @@ import { LiquidityPool } from "./lp-pool/structs";
|
|
|
3
3
|
import { Markets, SymbolMarket } from "./trading/structs";
|
|
4
4
|
import { TradingOrder, Position } from "./position/structs";
|
|
5
5
|
import { LpUserShare, StakePool } from "./stake-pool/structs";
|
|
6
|
-
import { PythClient } from "../utils";
|
|
7
|
-
export declare function getLpPools(provider: SuiClient, config:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
LIQUIDITY_POOL: string;
|
|
11
|
-
};
|
|
12
|
-
}): Promise<LiquidityPool[]>;
|
|
13
|
-
export declare function getStakePools(provider: SuiClient, config: {
|
|
14
|
-
REGISTRY: {
|
|
15
|
-
STAKE_POOL: string;
|
|
16
|
-
};
|
|
17
|
-
}): Promise<StakePool[]>;
|
|
18
|
-
export declare function getMarkets(provider: SuiClient, config: {
|
|
19
|
-
REGISTRY: {
|
|
20
|
-
MARKET: string;
|
|
21
|
-
};
|
|
22
|
-
}): Promise<Markets[]>;
|
|
6
|
+
import { PythClient, TypusConfig } from "../utils";
|
|
7
|
+
export declare function getLpPools(provider: SuiClient, config: TypusConfig): Promise<LiquidityPool[]>;
|
|
8
|
+
export declare function getStakePools(provider: SuiClient, config: TypusConfig): Promise<StakePool[]>;
|
|
9
|
+
export declare function getMarkets(provider: SuiClient, config: TypusConfig): Promise<Markets[]>;
|
|
23
10
|
export declare function getSymbolMarkets(provider: SuiClient, market: Markets): Promise<Map<string, SymbolMarket>>;
|
|
24
|
-
export declare function getUserOrders(provider: SuiClient, config:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
REGISTRY: {
|
|
29
|
-
MARKET: string;
|
|
30
|
-
};
|
|
31
|
-
}, user: string): Promise<TradingOrder[]>;
|
|
32
|
-
export declare function getUserPositions(provider: SuiClient, config: {
|
|
33
|
-
OBJECT: {
|
|
34
|
-
TYPUS_PERP_VERSION: string;
|
|
35
|
-
};
|
|
36
|
-
REGISTRY: {
|
|
37
|
-
MARKET: string;
|
|
38
|
-
};
|
|
39
|
-
}, user: string): Promise<Position[]>;
|
|
40
|
-
export declare function getUserStake(provider: SuiClient, config: {
|
|
41
|
-
REGISTRY: {
|
|
42
|
-
STAKE_POOL: string;
|
|
43
|
-
};
|
|
44
|
-
}, user: string): Promise<LpUserShare[]>;
|
|
45
|
-
export declare function getLiquidationPrice(provider: SuiClient, config: {
|
|
46
|
-
OBJECT: {
|
|
47
|
-
TYPUS_PERP_VERSION: string;
|
|
48
|
-
};
|
|
49
|
-
REGISTRY: {
|
|
50
|
-
LP_POOL: string;
|
|
51
|
-
MARKET: string;
|
|
52
|
-
};
|
|
53
|
-
}, input: {
|
|
11
|
+
export declare function getUserOrders(provider: SuiClient, config: TypusConfig, user: string): Promise<TradingOrder[]>;
|
|
12
|
+
export declare function getUserPositions(provider: SuiClient, config: TypusConfig, user: string): Promise<Position[]>;
|
|
13
|
+
export declare function getUserStake(provider: SuiClient, config: TypusConfig, user: string): Promise<LpUserShare[]>;
|
|
14
|
+
export declare function getLiquidationPrice(provider: SuiClient, config: TypusConfig, input: {
|
|
54
15
|
pythClient: PythClient;
|
|
55
16
|
positions: Position[];
|
|
56
17
|
user: string;
|
|
@@ -74,7 +74,7 @@ function getLpPools(provider, config) {
|
|
|
74
74
|
return __generator(this, function (_d) {
|
|
75
75
|
switch (_d.label) {
|
|
76
76
|
case 0: return [4 /*yield*/, provider.getDynamicFields({
|
|
77
|
-
parentId: config.
|
|
77
|
+
parentId: config.registry.perp.liquidityPool,
|
|
78
78
|
})];
|
|
79
79
|
case 1:
|
|
80
80
|
dynamicFields = _d.sent();
|
|
@@ -119,7 +119,7 @@ function getStakePools(provider, config) {
|
|
|
119
119
|
return __generator(this, function (_d) {
|
|
120
120
|
switch (_d.label) {
|
|
121
121
|
case 0: return [4 /*yield*/, provider.getDynamicFields({
|
|
122
|
-
parentId: config.
|
|
122
|
+
parentId: config.registry.perp.stakePool,
|
|
123
123
|
})];
|
|
124
124
|
case 1:
|
|
125
125
|
dynamicFields = _d.sent();
|
|
@@ -164,7 +164,7 @@ function getMarkets(provider, config) {
|
|
|
164
164
|
return __generator(this, function (_d) {
|
|
165
165
|
switch (_d.label) {
|
|
166
166
|
case 0: return [4 /*yield*/, provider.getDynamicFields({
|
|
167
|
-
parentId: config.
|
|
167
|
+
parentId: config.registry.perp.market,
|
|
168
168
|
})];
|
|
169
169
|
case 1:
|
|
170
170
|
dynamicFields = _d.sent();
|
|
@@ -258,8 +258,8 @@ function getUserOrders(provider, config, user) {
|
|
|
258
258
|
case 0:
|
|
259
259
|
tx = new transactions_1.TransactionBlock();
|
|
260
260
|
(0, functions_1.getUserOrders)(tx, {
|
|
261
|
-
version: config.
|
|
262
|
-
registry: config.
|
|
261
|
+
version: config.version.perp,
|
|
262
|
+
registry: config.registry.perp.market,
|
|
263
263
|
marketIndex: BigInt(0),
|
|
264
264
|
user: user,
|
|
265
265
|
});
|
|
@@ -282,8 +282,8 @@ function getUserPositions(provider, config, user) {
|
|
|
282
282
|
case 0:
|
|
283
283
|
tx = new transactions_1.TransactionBlock();
|
|
284
284
|
(0, functions_1.getUserPositions)(tx, {
|
|
285
|
-
version: config.
|
|
286
|
-
registry: config.
|
|
285
|
+
version: config.version.perp,
|
|
286
|
+
registry: config.registry.perp.market,
|
|
287
287
|
marketIndex: BigInt(0),
|
|
288
288
|
user: user,
|
|
289
289
|
});
|
|
@@ -306,7 +306,7 @@ function getUserStake(provider, config, user) {
|
|
|
306
306
|
case 0:
|
|
307
307
|
tx = new transactions_1.TransactionBlock();
|
|
308
308
|
(0, functions_2.getUserShares)(tx, {
|
|
309
|
-
registry: config.
|
|
309
|
+
registry: config.registry.perp.stakePool,
|
|
310
310
|
index: BigInt(0),
|
|
311
311
|
user: user,
|
|
312
312
|
});
|
|
@@ -367,9 +367,9 @@ function getLiquidationPrice(provider, config, input) {
|
|
|
367
367
|
cToken = constants_2.tokenType[_1.NETWORK][TOKEN];
|
|
368
368
|
baseToken = constants_2.tokenType[_1.NETWORK][BASE_TOKEN];
|
|
369
369
|
(0, functions_1.getEstimatedLiquidationPrice)(tx, [cToken, baseToken], {
|
|
370
|
-
version: config.
|
|
371
|
-
registry: config.
|
|
372
|
-
poolRegistry: config.
|
|
370
|
+
version: config.version.perp,
|
|
371
|
+
registry: config.registry.perp.market,
|
|
372
|
+
poolRegistry: config.registry.perp.lpPool,
|
|
373
373
|
marketIndex: BigInt(0),
|
|
374
374
|
poolIndex: BigInt(0),
|
|
375
375
|
pythState: utils_1.pythStateId[_1.NETWORK],
|
|
@@ -18,14 +18,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.installEcosystemManagerCapEntry = exports.PUBLISHED_AT = exports.PACKAGE_ID = exports.NETWORK = void 0;
|
|
21
|
-
var
|
|
21
|
+
var utils_1 = require("src/utils");
|
|
22
22
|
var path_1 = __importDefault(require("path"));
|
|
23
23
|
var dotenv_1 = __importDefault(require("dotenv"));
|
|
24
24
|
// import .env file if exists
|
|
25
25
|
dotenv_1.default.config({ path: path_1.default.resolve(__dirname, ".env") });
|
|
26
26
|
exports.NETWORK = process.env.CLUSTER == "mainnet" ? "MAINNET" : "TESTNET";
|
|
27
|
-
|
|
28
|
-
exports.
|
|
27
|
+
var config = utils_1.TypusConfig.default(exports.NETWORK);
|
|
28
|
+
exports.PACKAGE_ID = config.packageOrigin.perp;
|
|
29
|
+
exports.PUBLISHED_AT = config.package.perp;
|
|
29
30
|
var functions_1 = require("./admin/functions");
|
|
30
31
|
Object.defineProperty(exports, "installEcosystemManagerCapEntry", { enumerable: true, get: function () { return functions_1.installEcosystemManagerCapEntry; } });
|
|
31
32
|
__exportStar(require("./readVec"), exports);
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { Position, TradingOrder } from "../position/structs";
|
|
2
|
-
import { PythClient } from "../../utils";
|
|
2
|
+
import { PythClient, TypusConfig } from "../../utils";
|
|
3
3
|
import { TOKEN } from "../../constants";
|
|
4
4
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
5
|
-
export declare function createTradingOrder(config: {
|
|
6
|
-
REGISTRY: {
|
|
7
|
-
MARKET: string;
|
|
8
|
-
USER: string;
|
|
9
|
-
LEADERBOARD: string;
|
|
10
|
-
LP_POOL: string;
|
|
11
|
-
};
|
|
12
|
-
OBJECT: {
|
|
13
|
-
TYPUS_VERSION: string;
|
|
14
|
-
TYPUS_PERP_VERSION: string;
|
|
15
|
-
};
|
|
16
|
-
}, input: {
|
|
5
|
+
export declare function createTradingOrder(config: TypusConfig, input: {
|
|
17
6
|
pythClient: PythClient;
|
|
18
7
|
tx: TransactionBlock;
|
|
19
8
|
coins: string[];
|
|
@@ -27,42 +16,19 @@ export declare function createTradingOrder(config: {
|
|
|
27
16
|
reduceOnly: boolean;
|
|
28
17
|
linkedPositionId: string | null;
|
|
29
18
|
}): Promise<TransactionBlock>;
|
|
30
|
-
export declare function cancelTradingOrder(config: {
|
|
31
|
-
REGISTRY: {
|
|
32
|
-
MARKET: string;
|
|
33
|
-
};
|
|
34
|
-
OBJECT: {
|
|
35
|
-
TYPUS_PERP_VERSION: string;
|
|
36
|
-
};
|
|
37
|
-
}, input: {
|
|
19
|
+
export declare function cancelTradingOrder(config: TypusConfig, input: {
|
|
38
20
|
tx: TransactionBlock;
|
|
39
21
|
order: TradingOrder;
|
|
40
22
|
user: string;
|
|
41
23
|
}): Promise<TransactionBlock>;
|
|
42
|
-
export declare function increaseCollateral(config: {
|
|
43
|
-
REGISTRY: {
|
|
44
|
-
MARKET: string;
|
|
45
|
-
LP_POOL: string;
|
|
46
|
-
};
|
|
47
|
-
OBJECT: {
|
|
48
|
-
TYPUS_PERP_VERSION: string;
|
|
49
|
-
};
|
|
50
|
-
}, input: {
|
|
24
|
+
export declare function increaseCollateral(config: TypusConfig, input: {
|
|
51
25
|
pythClient: PythClient;
|
|
52
26
|
tx: TransactionBlock;
|
|
53
27
|
coins: string[];
|
|
54
28
|
amount: string;
|
|
55
29
|
position: Position;
|
|
56
30
|
}): Promise<TransactionBlock>;
|
|
57
|
-
export declare function releaseCollateral(config: {
|
|
58
|
-
REGISTRY: {
|
|
59
|
-
MARKET: string;
|
|
60
|
-
LP_POOL: string;
|
|
61
|
-
};
|
|
62
|
-
OBJECT: {
|
|
63
|
-
TYPUS_PERP_VERSION: string;
|
|
64
|
-
};
|
|
65
|
-
}, input: {
|
|
31
|
+
export declare function releaseCollateral(config: TypusConfig, input: {
|
|
66
32
|
pythClient: PythClient;
|
|
67
33
|
tx: TransactionBlock;
|
|
68
34
|
position: Position;
|
|
@@ -86,18 +86,18 @@ function createTradingOrder(config, input) {
|
|
|
86
86
|
_b = __read(input.tx.splitCoins(destination, [input.amount]), 1), coin = _b[0];
|
|
87
87
|
}
|
|
88
88
|
(0, functions_1.createTradingOrder)(input.tx, [cToken, baseToken], {
|
|
89
|
-
version: config.
|
|
90
|
-
registry: config.
|
|
91
|
-
poolRegistry: config.
|
|
89
|
+
version: config.version.perp,
|
|
90
|
+
registry: config.registry.perp.market,
|
|
91
|
+
poolRegistry: config.registry.perp.lpPool,
|
|
92
92
|
marketIndex: BigInt(0),
|
|
93
93
|
poolIndex: BigInt(0),
|
|
94
94
|
pythState: utils_1.pythStateId[__1.NETWORK],
|
|
95
95
|
oracleCToken: utils_1.priceInfoObjectIds[__1.NETWORK][TOKEN],
|
|
96
96
|
oracleTradingSymbol: utils_1.priceInfoObjectIds[__1.NETWORK][BASE_TOKEN],
|
|
97
97
|
clock: constants_1.CLOCK,
|
|
98
|
-
typusEcosystemVersion: config.
|
|
99
|
-
typusUserRegistry: config.
|
|
100
|
-
typusLeaderboardRegistry: config.
|
|
98
|
+
typusEcosystemVersion: config.version.typus,
|
|
99
|
+
typusUserRegistry: config.registry.typus.user,
|
|
100
|
+
typusLeaderboardRegistry: config.registry.typus.leaderboard,
|
|
101
101
|
collateral: coin,
|
|
102
102
|
size: BigInt(input.size),
|
|
103
103
|
triggerPrice: BigInt(input.triggerPrice),
|
|
@@ -118,8 +118,8 @@ function cancelTradingOrder(config, input) {
|
|
|
118
118
|
cToken = "0x" + input.order.collateralToken.name;
|
|
119
119
|
BASE_TOKEN = "0x" + input.order.symbol.baseToken.name;
|
|
120
120
|
coin = (0, functions_1.cancelTradingOrder)(input.tx, [cToken, BASE_TOKEN], {
|
|
121
|
-
version: config.
|
|
122
|
-
registry: config.
|
|
121
|
+
version: config.version.perp,
|
|
122
|
+
registry: config.registry.perp.market,
|
|
123
123
|
marketIndex: BigInt(0),
|
|
124
124
|
orderId: input.order.orderId,
|
|
125
125
|
triggerPrice: input.order.triggerPrice,
|
|
@@ -154,9 +154,9 @@ function increaseCollateral(config, input) {
|
|
|
154
154
|
_b = __read(input.tx.splitCoins(destination, [input.amount]), 1), coin = _b[0];
|
|
155
155
|
}
|
|
156
156
|
(0, functions_1.increaseCollateral)(input.tx, [cToken, baseToken], {
|
|
157
|
-
version: config.
|
|
158
|
-
registry: config.
|
|
159
|
-
poolRegistry: config.
|
|
157
|
+
version: config.version.perp,
|
|
158
|
+
registry: config.registry.perp.market,
|
|
159
|
+
poolRegistry: config.registry.perp.lpPool,
|
|
160
160
|
marketIndex: BigInt(0),
|
|
161
161
|
poolIndex: BigInt(0),
|
|
162
162
|
pythState: utils_1.pythStateId[__1.NETWORK],
|
|
@@ -185,9 +185,9 @@ function releaseCollateral(config, input) {
|
|
|
185
185
|
cToken = constants_2.tokenType[__1.NETWORK][TOKEN];
|
|
186
186
|
baseToken = constants_2.tokenType[__1.NETWORK][BASE_TOKEN];
|
|
187
187
|
coin = (0, functions_1.releaseCollateral)(input.tx, [cToken, baseToken], {
|
|
188
|
-
version: config.
|
|
189
|
-
registry: config.
|
|
190
|
-
poolRegistry: config.
|
|
188
|
+
version: config.version.perp,
|
|
189
|
+
registry: config.registry.perp.market,
|
|
190
|
+
poolRegistry: config.registry.perp.lpPool,
|
|
191
191
|
marketIndex: BigInt(0),
|
|
192
192
|
poolIndex: BigInt(0),
|
|
193
193
|
pythState: utils_1.pythStateId[__1.NETWORK],
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
-
import { PythClient } from "../../utils";
|
|
2
|
+
import { PythClient, TypusConfig } from "../../utils";
|
|
3
3
|
import { TOKEN } from "../../constants";
|
|
4
4
|
import { Position } from "../position/structs";
|
|
5
|
-
export declare function createTradingOrderWithBidReceipt(config: {
|
|
6
|
-
PACKAGE_ORIGIN: {
|
|
7
|
-
FRAMEWORK: string;
|
|
8
|
-
};
|
|
9
|
-
PACKAGE: {
|
|
10
|
-
DOV_SINGLE: string;
|
|
11
|
-
ORACLE: string;
|
|
12
|
-
};
|
|
13
|
-
REGISTRY: {
|
|
14
|
-
DOV_SINGLE: string;
|
|
15
|
-
MARKET: string;
|
|
16
|
-
USER: string;
|
|
17
|
-
LEADERBOARD: string;
|
|
18
|
-
LP_POOL: string;
|
|
19
|
-
};
|
|
20
|
-
OBJECT: {
|
|
21
|
-
TYPUS_VERSION: string;
|
|
22
|
-
TYPUS_PERP_VERSION: string;
|
|
23
|
-
};
|
|
24
|
-
ORACLE: {};
|
|
25
|
-
}, input: {
|
|
5
|
+
export declare function createTradingOrderWithBidReceipt(config: TypusConfig, input: {
|
|
26
6
|
pythClient: PythClient;
|
|
27
7
|
tx: TransactionBlock;
|
|
28
8
|
cToken: TOKEN;
|
|
@@ -34,27 +14,7 @@ export declare function createTradingOrderWithBidReceipt(config: {
|
|
|
34
14
|
bidReceipt: string;
|
|
35
15
|
share: string | null;
|
|
36
16
|
}): Promise<TransactionBlock>;
|
|
37
|
-
export declare function reduceOptionCollateralPositionSize(config: {
|
|
38
|
-
PACKAGE_ORIGIN: {
|
|
39
|
-
FRAMEWORK: string;
|
|
40
|
-
};
|
|
41
|
-
PACKAGE: {
|
|
42
|
-
DOV_SINGLE: string;
|
|
43
|
-
ORACLE: string;
|
|
44
|
-
};
|
|
45
|
-
REGISTRY: {
|
|
46
|
-
DOV_SINGLE: string;
|
|
47
|
-
MARKET: string;
|
|
48
|
-
USER: string;
|
|
49
|
-
LEADERBOARD: string;
|
|
50
|
-
LP_POOL: string;
|
|
51
|
-
};
|
|
52
|
-
OBJECT: {
|
|
53
|
-
TYPUS_VERSION: string;
|
|
54
|
-
TYPUS_PERP_VERSION: string;
|
|
55
|
-
};
|
|
56
|
-
ORACLE: {};
|
|
57
|
-
}, input: {
|
|
17
|
+
export declare function reduceOptionCollateralPositionSize(config: TypusConfig, input: {
|
|
58
18
|
pythClient: PythClient;
|
|
59
19
|
tx: TransactionBlock;
|
|
60
20
|
position: Position;
|