@gainsnetwork/sdk 0.0.0-me-rc1
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/LICENSE +21 -0
- package/README.md +11 -0
- package/lib/backend/globalTrades/index.d.ts +11 -0
- package/lib/backend/globalTrades/index.js +69 -0
- package/lib/backend/index.d.ts +3 -0
- package/lib/backend/index.js +28 -0
- package/lib/backend/tradingVariables/backend.types.d.ts +337 -0
- package/lib/backend/tradingVariables/backend.types.js +2 -0
- package/lib/backend/tradingVariables/converter.d.ts +38 -0
- package/lib/backend/tradingVariables/converter.js +359 -0
- package/lib/backend/tradingVariables/index.d.ts +5 -0
- package/lib/backend/tradingVariables/index.js +98 -0
- package/lib/backend/tradingVariables/types.d.ts +115 -0
- package/lib/backend/tradingVariables/types.js +14 -0
- package/lib/constants.d.ts +483 -0
- package/lib/constants.js +516 -0
- package/lib/contracts/addresses.d.ts +3 -0
- package/lib/contracts/addresses.js +35 -0
- package/lib/contracts/addresses.json +266 -0
- package/lib/contracts/index.d.ts +14 -0
- package/lib/contracts/index.js +92 -0
- package/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +9327 -0
- package/lib/contracts/types/generated/GNSMultiCollatDiamond.js +2 -0
- package/lib/contracts/types/generated/GToken.d.ts +1917 -0
- package/lib/contracts/types/generated/GToken.js +2 -0
- package/lib/contracts/types/generated/GTokenOpenPnlFeed.d.ts +557 -0
- package/lib/contracts/types/generated/GTokenOpenPnlFeed.js +2 -0
- package/lib/contracts/types/generated/common.d.ts +22 -0
- package/lib/contracts/types/generated/common.js +2 -0
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.d.ts +276 -0
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +21557 -0
- package/lib/contracts/types/generated/factories/GTokenOpenPnlFeed__factory.d.ts +59 -0
- package/lib/contracts/types/generated/factories/GTokenOpenPnlFeed__factory.js +765 -0
- package/lib/contracts/types/generated/factories/GToken__factory.d.ts +121 -0
- package/lib/contracts/types/generated/factories/GToken__factory.js +2867 -0
- package/lib/contracts/types/generated/factories/index.d.ts +3 -0
- package/lib/contracts/types/generated/factories/index.js +12 -0
- package/lib/contracts/types/generated/index.d.ts +7 -0
- package/lib/contracts/types/generated/index.js +33 -0
- package/lib/contracts/types/index.d.ts +37 -0
- package/lib/contracts/types/index.js +30 -0
- package/lib/contracts/utils/borrowingFees.d.ts +9 -0
- package/lib/contracts/utils/borrowingFees.js +43 -0
- package/lib/contracts/utils/index.d.ts +3 -0
- package/lib/contracts/utils/index.js +19 -0
- package/lib/contracts/utils/openTrades.d.ts +12 -0
- package/lib/contracts/utils/openTrades.js +172 -0
- package/lib/contracts/utils/pairs.d.ts +18 -0
- package/lib/contracts/utils/pairs.js +602 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +30 -0
- package/lib/markets/collateral/converter.d.ts +5 -0
- package/lib/markets/collateral/converter.js +11 -0
- package/lib/markets/collateral/index.d.ts +1 -0
- package/lib/markets/collateral/index.js +17 -0
- package/lib/markets/collateral/types.d.ts +7 -0
- package/lib/markets/collateral/types.js +2 -0
- package/lib/markets/commodities.d.ts +1 -0
- package/lib/markets/commodities.js +7 -0
- package/lib/markets/crypto.d.ts +1 -0
- package/lib/markets/crypto.js +6 -0
- package/lib/markets/forex.d.ts +3 -0
- package/lib/markets/forex.js +8 -0
- package/lib/markets/holdingFees/index.d.ts +46 -0
- package/lib/markets/holdingFees/index.js +104 -0
- package/lib/markets/holdingFees/types.d.ts +23 -0
- package/lib/markets/holdingFees/types.js +5 -0
- package/lib/markets/index.d.ts +11 -0
- package/lib/markets/index.js +27 -0
- package/lib/markets/indices.d.ts +1 -0
- package/lib/markets/indices.js +6 -0
- package/lib/markets/leverage/builder.d.ts +12 -0
- package/lib/markets/leverage/builder.js +25 -0
- package/lib/markets/leverage/getMarketLeverageRestrictions.d.ts +7 -0
- package/lib/markets/leverage/getMarketLeverageRestrictions.js +38 -0
- package/lib/markets/leverage/index.d.ts +3 -0
- package/lib/markets/leverage/index.js +19 -0
- package/lib/markets/leverage/types.d.ts +15 -0
- package/lib/markets/leverage/types.js +2 -0
- package/lib/markets/oi/converter.d.ts +62 -0
- package/lib/markets/oi/converter.js +111 -0
- package/lib/markets/oi/index.d.ts +49 -0
- package/lib/markets/oi/index.js +77 -0
- package/lib/markets/oi/types.d.ts +89 -0
- package/lib/markets/oi/types.js +6 -0
- package/lib/markets/price/builder.d.ts +25 -0
- package/lib/markets/price/builder.js +69 -0
- package/lib/markets/price/index.d.ts +7 -0
- package/lib/markets/price/index.js +23 -0
- package/lib/markets/price/marketPrice.d.ts +13 -0
- package/lib/markets/price/marketPrice.js +35 -0
- package/lib/markets/price/signedPrices.d.ts +36 -0
- package/lib/markets/price/signedPrices.js +181 -0
- package/lib/markets/price/types.d.ts +50 -0
- package/lib/markets/price/types.js +5 -0
- package/lib/markets/schedules/builders.d.ts +7 -0
- package/lib/markets/schedules/builders.js +81 -0
- package/lib/markets/schedules/checkers.d.ts +7 -0
- package/lib/markets/schedules/checkers.js +36 -0
- package/lib/markets/schedules/holidays.d.ts +4 -0
- package/lib/markets/schedules/holidays.js +77 -0
- package/lib/markets/schedules/index.d.ts +9 -0
- package/lib/markets/schedules/index.js +45 -0
- package/lib/markets/schedules/types.d.ts +43 -0
- package/lib/markets/schedules/types.js +37 -0
- package/lib/markets/stocks.d.ts +3 -0
- package/lib/markets/stocks.js +15 -0
- package/lib/pricing/depthBands.d.ts +39 -0
- package/lib/pricing/depthBands.js +94 -0
- package/lib/pricing/index.d.ts +4 -0
- package/lib/pricing/index.js +20 -0
- package/lib/trade/counterTrade/index.d.ts +2 -0
- package/lib/trade/counterTrade/index.js +18 -0
- package/lib/trade/counterTrade/types.d.ts +7 -0
- package/lib/trade/counterTrade/types.js +2 -0
- package/lib/trade/counterTrade/validateCounterTrade.d.ts +10 -0
- package/lib/trade/counterTrade/validateCounterTrade.js +29 -0
- package/lib/trade/effectiveLeverage/getTradeNewEffectiveLeverage.d.ts +20 -0
- package/lib/trade/effectiveLeverage/getTradeNewEffectiveLeverage.js +42 -0
- package/lib/trade/effectiveLeverage/index.d.ts +2 -0
- package/lib/trade/effectiveLeverage/index.js +21 -0
- package/lib/trade/effectiveLeverage/types.d.ts +30 -0
- package/lib/trade/effectiveLeverage/types.js +2 -0
- package/lib/trade/fees/borrowing/builder.d.ts +14 -0
- package/lib/trade/fees/borrowing/builder.js +33 -0
- package/lib/trade/fees/borrowing/converter.d.ts +17 -0
- package/lib/trade/fees/borrowing/converter.js +46 -0
- package/lib/trade/fees/borrowing/index.d.ts +81 -0
- package/lib/trade/fees/borrowing/index.js +259 -0
- package/lib/trade/fees/borrowing/types.d.ts +36 -0
- package/lib/trade/fees/borrowing/types.js +2 -0
- package/lib/trade/fees/borrowingV2/builder.d.ts +6 -0
- package/lib/trade/fees/borrowingV2/builder.js +23 -0
- package/lib/trade/fees/borrowingV2/converter.d.ts +75 -0
- package/lib/trade/fees/borrowingV2/converter.js +132 -0
- package/lib/trade/fees/borrowingV2/fetcher.d.ts +76 -0
- package/lib/trade/fees/borrowingV2/fetcher.js +179 -0
- package/lib/trade/fees/borrowingV2/index.d.ts +48 -0
- package/lib/trade/fees/borrowingV2/index.js +112 -0
- package/lib/trade/fees/borrowingV2/types.d.ts +95 -0
- package/lib/trade/fees/borrowingV2/types.js +5 -0
- package/lib/trade/fees/converter.d.ts +48 -0
- package/lib/trade/fees/converter.js +114 -0
- package/lib/trade/fees/fundingFees/builder.d.ts +9 -0
- package/lib/trade/fees/fundingFees/builder.js +38 -0
- package/lib/trade/fees/fundingFees/converter.d.ts +102 -0
- package/lib/trade/fees/fundingFees/converter.js +196 -0
- package/lib/trade/fees/fundingFees/fetcher.d.ts +66 -0
- package/lib/trade/fees/fundingFees/fetcher.js +141 -0
- package/lib/trade/fees/fundingFees/index.d.ts +124 -0
- package/lib/trade/fees/fundingFees/index.js +309 -0
- package/lib/trade/fees/fundingFees/pairContext.d.ts +33 -0
- package/lib/trade/fees/fundingFees/pairContext.js +17 -0
- package/lib/trade/fees/fundingFees/types.d.ts +77 -0
- package/lib/trade/fees/fundingFees/types.js +5 -0
- package/lib/trade/fees/index.d.ts +11 -0
- package/lib/trade/fees/index.js +87 -0
- package/lib/trade/fees/tiers/converter.d.ts +64 -0
- package/lib/trade/fees/tiers/converter.js +100 -0
- package/lib/trade/fees/tiers/index.d.ts +46 -0
- package/lib/trade/fees/tiers/index.js +135 -0
- package/lib/trade/fees/tiers/types.d.ts +22 -0
- package/lib/trade/fees/tiers/types.js +8 -0
- package/lib/trade/fees/trading/builder.d.ts +19 -0
- package/lib/trade/fees/trading/builder.js +21 -0
- package/lib/trade/fees/trading/converter.d.ts +32 -0
- package/lib/trade/fees/trading/converter.js +47 -0
- package/lib/trade/fees/trading/index.d.ts +62 -0
- package/lib/trade/fees/trading/index.js +157 -0
- package/lib/trade/fees/trading/types.d.ts +46 -0
- package/lib/trade/fees/trading/types.js +5 -0
- package/lib/trade/index.d.ts +10 -0
- package/lib/trade/index.js +26 -0
- package/lib/trade/liquidation/builder.d.ts +25 -0
- package/lib/trade/liquidation/builder.js +58 -0
- package/lib/trade/liquidation/converter.d.ts +23 -0
- package/lib/trade/liquidation/converter.js +46 -0
- package/lib/trade/liquidation/index.d.ts +29 -0
- package/lib/trade/liquidation/index.js +216 -0
- package/lib/trade/liquidation/types.d.ts +38 -0
- package/lib/trade/liquidation/types.js +2 -0
- package/lib/trade/oiWindows.d.ts +3 -0
- package/lib/trade/oiWindows.js +19 -0
- package/lib/trade/pnl/builder.d.ts +16 -0
- package/lib/trade/pnl/builder.js +43 -0
- package/lib/trade/pnl/converter.d.ts +47 -0
- package/lib/trade/pnl/converter.js +72 -0
- package/lib/trade/pnl/index.d.ts +91 -0
- package/lib/trade/pnl/index.js +301 -0
- package/lib/trade/pnl/types.d.ts +79 -0
- package/lib/trade/pnl/types.js +5 -0
- package/lib/trade/priceImpact/close/builder.d.ts +23 -0
- package/lib/trade/priceImpact/close/builder.js +44 -0
- package/lib/trade/priceImpact/close/index.d.ts +22 -0
- package/lib/trade/priceImpact/close/index.js +137 -0
- package/lib/trade/priceImpact/close/types.d.ts +47 -0
- package/lib/trade/priceImpact/close/types.js +5 -0
- package/lib/trade/priceImpact/cumulVol/builder.d.ts +22 -0
- package/lib/trade/priceImpact/cumulVol/builder.js +53 -0
- package/lib/trade/priceImpact/cumulVol/converter.d.ts +94 -0
- package/lib/trade/priceImpact/cumulVol/converter.js +155 -0
- package/lib/trade/priceImpact/cumulVol/index.d.ts +109 -0
- package/lib/trade/priceImpact/cumulVol/index.js +316 -0
- package/lib/trade/priceImpact/cumulVol/types.d.ts +11 -0
- package/lib/trade/priceImpact/cumulVol/types.js +2 -0
- package/lib/trade/priceImpact/index.d.ts +21 -0
- package/lib/trade/priceImpact/index.js +79 -0
- package/lib/trade/priceImpact/open/builder.d.ts +21 -0
- package/lib/trade/priceImpact/open/builder.js +42 -0
- package/lib/trade/priceImpact/open/index.d.ts +23 -0
- package/lib/trade/priceImpact/open/index.js +82 -0
- package/lib/trade/priceImpact/open/types.d.ts +45 -0
- package/lib/trade/priceImpact/open/types.js +5 -0
- package/lib/trade/priceImpact/skew/builder.d.ts +12 -0
- package/lib/trade/priceImpact/skew/builder.js +27 -0
- package/lib/trade/priceImpact/skew/converter.d.ts +46 -0
- package/lib/trade/priceImpact/skew/converter.js +81 -0
- package/lib/trade/priceImpact/skew/fetcher.d.ts +60 -0
- package/lib/trade/priceImpact/skew/fetcher.js +160 -0
- package/lib/trade/priceImpact/skew/index.d.ts +53 -0
- package/lib/trade/priceImpact/skew/index.js +148 -0
- package/lib/trade/priceImpact/skew/types.d.ts +44 -0
- package/lib/trade/priceImpact/skew/types.js +5 -0
- package/lib/trade/spread.d.ts +5 -0
- package/lib/trade/spread.js +19 -0
- package/lib/trade/types.d.ts +777 -0
- package/lib/trade/types.js +478 -0
- package/lib/trade/utils.d.ts +18 -0
- package/lib/trade/utils.js +30 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +17 -0
- package/lib/utils/packing.d.ts +2 -0
- package/lib/utils/packing.js +39 -0
- package/lib/vault/index.d.ts +10 -0
- package/lib/vault/index.js +10 -0
- package/package.json +106 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
{
|
|
2
|
+
"137": {
|
|
3
|
+
"global": {
|
|
4
|
+
"gnsMultiCollatDiamond": "0x209A9A01980377916851af2cA075C2b170452018"
|
|
5
|
+
},
|
|
6
|
+
"DAI": {
|
|
7
|
+
"gTokenOpenPnlFeed": "0x8d687276543b92819F2f2B5C3faad4AD27F4440c",
|
|
8
|
+
"gToken": "0x91993f2101cc758D0dEB7279d41e880F7dEFe827"
|
|
9
|
+
},
|
|
10
|
+
"ETH": {
|
|
11
|
+
"gTokenOpenPnlFeed": "0xF07f4507DD6A057Aea509cB9b218B7C4D1894473",
|
|
12
|
+
"gToken": "0x1544E1fF1a6f6Bdbfb901622C12bb352a43464Fb"
|
|
13
|
+
},
|
|
14
|
+
"USDC": {
|
|
15
|
+
"gTokenOpenPnlFeed": "0xFF84e736A15F80E7E104e153d7f7D6c9bd6fE822",
|
|
16
|
+
"gToken": "0x29019Fe2e72E8d4D2118E8D0318BeF389ffe2C81"
|
|
17
|
+
},
|
|
18
|
+
"APE": {
|
|
19
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
20
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
21
|
+
},
|
|
22
|
+
"GNS": {
|
|
23
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
24
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
25
|
+
},
|
|
26
|
+
"BTCUSD": {
|
|
27
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
28
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
29
|
+
},
|
|
30
|
+
"USDM": {
|
|
31
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
32
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"42161": {
|
|
36
|
+
"global": {
|
|
37
|
+
"gnsMultiCollatDiamond": "0xFF162c694eAA571f685030649814282eA457f169"
|
|
38
|
+
},
|
|
39
|
+
"DAI": {
|
|
40
|
+
"gTokenOpenPnlFeed": "0x990BA9Edd8a9615A23E4c452E63A80e519A4a23D",
|
|
41
|
+
"gToken": "0xd85E038593d7A098614721EaE955EC2022B9B91B"
|
|
42
|
+
},
|
|
43
|
+
"ETH": {
|
|
44
|
+
"gTokenOpenPnlFeed": "0x018D9A3F0D06cCb7C305B7C9219a4307e1f9f27e",
|
|
45
|
+
"gToken": "0x5977A9682D7AF81D347CFc338c61692163a2784C"
|
|
46
|
+
},
|
|
47
|
+
"USDC": {
|
|
48
|
+
"gTokenOpenPnlFeed": "0xBF55C78132ab06a2B217040b7A7F20B5cBD47982",
|
|
49
|
+
"gToken": "0xd3443ee1e91aF28e5FB858Fbd0D72A63bA8046E0"
|
|
50
|
+
},
|
|
51
|
+
"APE": {
|
|
52
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
53
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
54
|
+
},
|
|
55
|
+
"GNS": {
|
|
56
|
+
"gTokenOpenPnlFeed": "0x4ca1638754Be8060E544Aca4A4F43702Be30E0D1",
|
|
57
|
+
"gToken": "0x4BeeF1113F968326905224D2Ca272f3032A9a9F4"
|
|
58
|
+
},
|
|
59
|
+
"BTCUSD": {
|
|
60
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
61
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
62
|
+
},
|
|
63
|
+
"USDM": {
|
|
64
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
65
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"421614": {
|
|
69
|
+
"global": {
|
|
70
|
+
"gnsMultiCollatDiamond": "0xd659a15812064C79E189fd950A189b15c75d3186"
|
|
71
|
+
},
|
|
72
|
+
"DAI": {
|
|
73
|
+
"gTokenOpenPnlFeed": "0x371a924C2DC433D0C83b67Ff71A4CBd2013b5046",
|
|
74
|
+
"gToken": "0xD6e33C7560009D60052d7A5E0476A8Db295bF8C7"
|
|
75
|
+
},
|
|
76
|
+
"ETH": {
|
|
77
|
+
"gTokenOpenPnlFeed": "0xab1042C2767461D59ABC9547b3B717ccae3Eb7C9",
|
|
78
|
+
"gToken": "0xfd7E69042812f3416C18261673b55eD005F67E01"
|
|
79
|
+
},
|
|
80
|
+
"USDC": {
|
|
81
|
+
"gTokenOpenPnlFeed": "0x38e6cEFcE96bdB65D64Fce8f4736b3763A5F9eD2",
|
|
82
|
+
"gToken": "0xb0C25646774Ad985B4f9ccD262623bA6D6F64677"
|
|
83
|
+
},
|
|
84
|
+
"APE": {
|
|
85
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
86
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
87
|
+
},
|
|
88
|
+
"GNS": {
|
|
89
|
+
"gTokenOpenPnlFeed": "0x68F8D4ec2EF23a15e61e1642E730b6f69fB9A5De",
|
|
90
|
+
"gToken": "0x5ed4bEA869300DB39bE2a92a8B42e53453742a43"
|
|
91
|
+
},
|
|
92
|
+
"BTCUSD": {
|
|
93
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
94
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
95
|
+
},
|
|
96
|
+
"USDM": {
|
|
97
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
98
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"8453": {
|
|
102
|
+
"global": {
|
|
103
|
+
"gnsMultiCollatDiamond": "0x6cD5aC19a07518A8092eEFfDA4f1174C72704eeb"
|
|
104
|
+
},
|
|
105
|
+
"DAI": {
|
|
106
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
107
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
108
|
+
},
|
|
109
|
+
"ETH": {
|
|
110
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
111
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
112
|
+
},
|
|
113
|
+
"USDC": {
|
|
114
|
+
"gTokenOpenPnlFeed": "0xefA1C2753daD877Bb6531bBa9D9c589B5433Be37",
|
|
115
|
+
"gToken": "0xad20523A7dC37bAbc1CC74897E4977232b3D02e5"
|
|
116
|
+
},
|
|
117
|
+
"APE": {
|
|
118
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
119
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
120
|
+
},
|
|
121
|
+
"GNS": {
|
|
122
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
123
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
124
|
+
},
|
|
125
|
+
"BTCUSD": {
|
|
126
|
+
"gTokenOpenPnlFeed": "0xcEc10C66d711250db67945254F79628457365CC8",
|
|
127
|
+
"gToken": "0xB7Cb7cB7C3cD96e251c9bF8800B9631134BbAdc6"
|
|
128
|
+
},
|
|
129
|
+
"USDM": {
|
|
130
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
131
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"33139": {
|
|
135
|
+
"global": {
|
|
136
|
+
"gnsMultiCollatDiamond": "0x2BE5D7058AdBa14Bc38E4A83E94A81f7491b0163"
|
|
137
|
+
},
|
|
138
|
+
"DAI": {
|
|
139
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
140
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
141
|
+
},
|
|
142
|
+
"ETH": {
|
|
143
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
144
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
145
|
+
},
|
|
146
|
+
"USDC": {
|
|
147
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
148
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
149
|
+
},
|
|
150
|
+
"APE": {
|
|
151
|
+
"gTokenOpenPnlFeed": "0x33FE6f374C4a44C50F4362c93372f0EB09d968F5",
|
|
152
|
+
"gToken": "0xDd9C98e5022AF88B9c991ab24F02B4A8Be81D860"
|
|
153
|
+
},
|
|
154
|
+
"GNS": {
|
|
155
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
156
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
157
|
+
},
|
|
158
|
+
"BTCUSD": {
|
|
159
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
160
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
161
|
+
},
|
|
162
|
+
"USDM": {
|
|
163
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
164
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"421614-release": {
|
|
168
|
+
"global": {
|
|
169
|
+
"gnsMultiCollatDiamond": "0xB4F1B18b5679B42F2956dCBff3D7823A61F347C9"
|
|
170
|
+
},
|
|
171
|
+
"DAI": {
|
|
172
|
+
"gTokenOpenPnlFeed": "0xFcF76e2620eB6C32786e32620187A0FbF2844d68",
|
|
173
|
+
"gToken": "0x47CA7Fa22086CD63DBa92Dce23a75aEA9227a9DC"
|
|
174
|
+
},
|
|
175
|
+
"ETH": {
|
|
176
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
177
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
178
|
+
},
|
|
179
|
+
"USDC": {
|
|
180
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
181
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
182
|
+
},
|
|
183
|
+
"APE": {
|
|
184
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
185
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
186
|
+
},
|
|
187
|
+
"GNS": {
|
|
188
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
189
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
190
|
+
},
|
|
191
|
+
"BTCUSD": {
|
|
192
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
193
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
194
|
+
},
|
|
195
|
+
"USDM": {
|
|
196
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
197
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"6343": {
|
|
201
|
+
"global": {
|
|
202
|
+
"gnsMultiCollatDiamond": "0xc4DaF6E8A8484ed88c963Cd3b62023ec48685051"
|
|
203
|
+
},
|
|
204
|
+
"DAI": {
|
|
205
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
206
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
207
|
+
},
|
|
208
|
+
"ETH": {
|
|
209
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
210
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
211
|
+
},
|
|
212
|
+
"USDC": {
|
|
213
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
214
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
215
|
+
},
|
|
216
|
+
"APE": {
|
|
217
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
218
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
219
|
+
},
|
|
220
|
+
"GNS": {
|
|
221
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
222
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
223
|
+
},
|
|
224
|
+
"BTCUSD": {
|
|
225
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
226
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
227
|
+
},
|
|
228
|
+
"USDM": {
|
|
229
|
+
"gTokenOpenPnlFeed": "0x949D41d8C498f8A3537af608634A64084C2Deb00",
|
|
230
|
+
"gToken": "0x422fAd2E37761a6635Db6042E8330EC5E8A2e7aF"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"4326": {
|
|
234
|
+
"global": {
|
|
235
|
+
"gnsMultiCollatDiamond": "0x0000000000000000000000000000000000000000"
|
|
236
|
+
},
|
|
237
|
+
"DAI": {
|
|
238
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
239
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
240
|
+
},
|
|
241
|
+
"ETH": {
|
|
242
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
243
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
244
|
+
},
|
|
245
|
+
"USDC": {
|
|
246
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
247
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
248
|
+
},
|
|
249
|
+
"APE": {
|
|
250
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
251
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
252
|
+
},
|
|
253
|
+
"GNS": {
|
|
254
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
255
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
256
|
+
},
|
|
257
|
+
"BTCUSD": {
|
|
258
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
259
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
260
|
+
},
|
|
261
|
+
"USDM": {
|
|
262
|
+
"gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
|
|
263
|
+
"gToken": "0x0000000000000000000000000000000000000000"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Signer } from "ethers";
|
|
2
|
+
import type { Provider } from "@ethersproject/providers";
|
|
3
|
+
import { ChainId, CollateralTypes, Contracts } from "./types";
|
|
4
|
+
export declare const getContractsForChain: (chainId: number, signerOrProvider?: Signer | Provider, collateral?: CollateralTypes) => Contracts;
|
|
5
|
+
export declare const getContractsForChainByRequester: (chainId: number, requester: string, signerOrProvider?: Signer | Provider) => Contracts;
|
|
6
|
+
export declare const getCollateralIndexAndContractsForChainByRequester: (chainId: number, requester: string, signerOrProvider?: Signer | Provider) => {
|
|
7
|
+
contracts: Contracts;
|
|
8
|
+
collateralIndex: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const COLLATERAL_TO_CHAIN_COLLATERAL_INDEX: Record<ChainId, Partial<Record<CollateralTypes, number>>>;
|
|
11
|
+
export declare const COLLATERAL_TO_COLLATERAL_INDEX: Record<CollateralTypes, number>;
|
|
12
|
+
export * from "./utils";
|
|
13
|
+
export * from "./addresses";
|
|
14
|
+
export { CollateralTypes, ChainId } from "./types";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ChainId = exports.CollateralTypes = exports.COLLATERAL_TO_COLLATERAL_INDEX = exports.COLLATERAL_TO_CHAIN_COLLATERAL_INDEX = exports.getCollateralIndexAndContractsForChainByRequester = exports.getContractsForChainByRequester = exports.getContractsForChain = void 0;
|
|
18
|
+
const addresses_1 = require("./addresses");
|
|
19
|
+
const factories_1 = require("./types/generated/factories");
|
|
20
|
+
const types_1 = require("./types");
|
|
21
|
+
// @todo rework this to return all
|
|
22
|
+
const getContractsForChain = (chainId, signerOrProvider, collateral) => {
|
|
23
|
+
const addresses = (0, addresses_1.getContractAddressesForChain)(chainId, collateral);
|
|
24
|
+
return {
|
|
25
|
+
gnsMultiCollatDiamond: factories_1.GNSMultiCollatDiamond__factory.connect(addresses.gnsMultiCollatDiamond, signerOrProvider),
|
|
26
|
+
gTokenOpenPnlFeed: factories_1.GTokenOpenPnlFeed__factory.connect(addresses.gTokenOpenPnlFeed, signerOrProvider),
|
|
27
|
+
gToken: factories_1.GToken__factory.connect(addresses.gToken, signerOrProvider),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.getContractsForChain = getContractsForChain;
|
|
31
|
+
const getContractsForChainByRequester = (chainId, requester, signerOrProvider) => {
|
|
32
|
+
const { contracts } = (0, exports.getCollateralIndexAndContractsForChainByRequester)(chainId, requester, signerOrProvider);
|
|
33
|
+
return contracts;
|
|
34
|
+
};
|
|
35
|
+
exports.getContractsForChainByRequester = getContractsForChainByRequester;
|
|
36
|
+
const getCollateralIndexAndContractsForChainByRequester = (chainId, requester, signerOrProvider) => {
|
|
37
|
+
const collateral = (0, addresses_1.getCollateralByAddressForChain)(chainId, requester);
|
|
38
|
+
return {
|
|
39
|
+
contracts: (0, exports.getContractsForChain)(chainId, signerOrProvider, collateral),
|
|
40
|
+
collateralIndex: exports.COLLATERAL_TO_CHAIN_COLLATERAL_INDEX[chainId]?.[collateral] ||
|
|
41
|
+
0,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
exports.getCollateralIndexAndContractsForChainByRequester = getCollateralIndexAndContractsForChainByRequester;
|
|
45
|
+
exports.COLLATERAL_TO_CHAIN_COLLATERAL_INDEX = {
|
|
46
|
+
[types_1.ChainId.POLYGON]: {
|
|
47
|
+
[types_1.CollateralTypes.DAI]: 1,
|
|
48
|
+
[types_1.CollateralTypes.ETH]: 2,
|
|
49
|
+
[types_1.CollateralTypes.USDC]: 3,
|
|
50
|
+
},
|
|
51
|
+
[types_1.ChainId.ARBITRUM]: {
|
|
52
|
+
[types_1.CollateralTypes.DAI]: 1,
|
|
53
|
+
[types_1.CollateralTypes.ETH]: 2,
|
|
54
|
+
[types_1.CollateralTypes.USDC]: 3,
|
|
55
|
+
[types_1.CollateralTypes.GNS]: 4,
|
|
56
|
+
},
|
|
57
|
+
[types_1.ChainId.ARBITRUM_SEPOLIA]: {
|
|
58
|
+
[types_1.CollateralTypes.DAI]: 1,
|
|
59
|
+
[types_1.CollateralTypes.ETH]: 2,
|
|
60
|
+
[types_1.CollateralTypes.USDC]: 3,
|
|
61
|
+
[types_1.CollateralTypes.GNS]: 4,
|
|
62
|
+
},
|
|
63
|
+
[types_1.ChainId.BASE]: {
|
|
64
|
+
[types_1.CollateralTypes.USDC]: 1,
|
|
65
|
+
[types_1.CollateralTypes.BTCUSD]: 2,
|
|
66
|
+
},
|
|
67
|
+
[types_1.ChainId.APECHAIN]: {
|
|
68
|
+
[types_1.CollateralTypes.APE]: 1,
|
|
69
|
+
},
|
|
70
|
+
[types_1.ChainId.MEGAETH]: {
|
|
71
|
+
[types_1.CollateralTypes.USDM]: 1,
|
|
72
|
+
},
|
|
73
|
+
[types_1.ChainId.MEGAETH_TESTNET]: {
|
|
74
|
+
[types_1.CollateralTypes.USDM]: 1,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
// @deprecated use `COLLATERAL_TO_CHAIN_COLLATERAL_INDEX` instead
|
|
78
|
+
exports.COLLATERAL_TO_COLLATERAL_INDEX = {
|
|
79
|
+
[types_1.CollateralTypes.DAI]: 1,
|
|
80
|
+
[types_1.CollateralTypes.ETH]: 2,
|
|
81
|
+
[types_1.CollateralTypes.USDC]: 3,
|
|
82
|
+
[types_1.CollateralTypes.ARB]: 0,
|
|
83
|
+
[types_1.CollateralTypes.APE]: 0,
|
|
84
|
+
[types_1.CollateralTypes.GNS]: 0,
|
|
85
|
+
[types_1.CollateralTypes.BTCUSD]: 0,
|
|
86
|
+
[types_1.CollateralTypes.USDM]: 0,
|
|
87
|
+
};
|
|
88
|
+
__exportStar(require("./utils"), exports);
|
|
89
|
+
__exportStar(require("./addresses"), exports);
|
|
90
|
+
var types_2 = require("./types");
|
|
91
|
+
Object.defineProperty(exports, "CollateralTypes", { enumerable: true, get: function () { return types_2.CollateralTypes; } });
|
|
92
|
+
Object.defineProperty(exports, "ChainId", { enumerable: true, get: function () { return types_2.ChainId; } });
|