@gearbox-protocol/sdk 13.3.0-next.3 → 13.3.1
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/cjs/common-utils/charts/credit-manager-payload.js +16 -0
- package/dist/cjs/common-utils/charts/credit-manager.js +134 -0
- package/dist/cjs/common-utils/charts/credit-session.js +257 -0
- package/dist/cjs/common-utils/charts/credit-sessions-payload.js +16 -0
- package/dist/cjs/common-utils/charts/graph-payload.js +16 -0
- package/dist/cjs/common-utils/charts/index.js +36 -0
- package/dist/cjs/common-utils/charts/pool-payload.js +16 -0
- package/dist/cjs/common-utils/charts/pool.js +199 -0
- package/dist/cjs/common-utils/charts/token-data.js +91 -0
- package/dist/cjs/common-utils/index.js +4 -0
- package/dist/cjs/common-utils/static/index.js +28 -0
- package/dist/cjs/common-utils/static/migration-config.js +16 -0
- package/dist/cjs/common-utils/static/pool-config.js +16 -0
- package/dist/cjs/common-utils/static/strategy.js +16 -0
- package/dist/cjs/common-utils/static/trading-pair.js +16 -0
- package/dist/cjs/common-utils/utils/{assetsMath.js → assets-math.js} +13 -13
- package/dist/cjs/common-utils/utils/{bigintMath.js → bigint-math.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +9 -9
- package/dist/cjs/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +8 -8
- package/dist/cjs/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/debt.js +4 -4
- package/dist/cjs/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/index.js +16 -16
- package/dist/cjs/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +8 -8
- package/dist/cjs/common-utils/utils/creditAccount/sort.js +3 -3
- package/dist/cjs/common-utils/utils/index.js +6 -8
- package/dist/cjs/common-utils/utils/{priceMath.js → price-math.js} +3 -3
- package/dist/cjs/dev/AccountOpener.js +5 -45
- package/dist/cjs/plugins/zappers/ZappersPlugin.js +144 -0
- package/dist/cjs/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +6 -110
- package/dist/cjs/plugins/zappers/index.js +26 -0
- package/dist/cjs/plugins/zappers/package.json +1 -0
- package/dist/cjs/rewards/apy/index.js +24 -0
- package/dist/cjs/rewards/apy/output-details.js +16 -0
- package/dist/cjs/rewards/apy/output.js +16 -0
- package/dist/cjs/rewards/index.js +24 -0
- package/dist/cjs/rewards/package.json +1 -0
- package/dist/cjs/rewards/rewards/api.js +226 -0
- package/dist/cjs/rewards/rewards/apy.js +177 -0
- package/dist/cjs/rewards/rewards/common.js +16 -0
- package/dist/cjs/rewards/rewards/extra-apy.js +132 -0
- package/dist/cjs/rewards/rewards/index.js +28 -0
- package/dist/cjs/rewards/rewards/merkl-api.js +52 -0
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +104 -462
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +5 -16
- package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/cjs/sdk/base/TokensMeta.js +32 -255
- package/dist/cjs/sdk/base/index.js +0 -2
- package/dist/cjs/sdk/chain/chains.js +1 -2
- package/dist/cjs/sdk/constants/index.js +2 -0
- package/dist/cjs/sdk/{base/token-types.js → constants/phantom-tokens.js} +3 -9
- package/dist/cjs/sdk/market/MarketRegister.js +2 -2
- package/dist/cjs/sdk/market/MarketSuite.js +0 -6
- package/dist/cjs/sdk/market/index.js +1 -3
- package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/cjs/sdk/market/pool/index.js +0 -4
- package/dist/cjs/sdk/pools/AbstractPoolService.js +137 -0
- package/dist/cjs/{abi/iStateSerializer.js → sdk/pools/PoolServiceV310.js} +8 -14
- package/dist/cjs/sdk/pools/createPoolService.js +35 -0
- package/dist/cjs/sdk/pools/index.js +4 -2
- package/dist/cjs/sdk/utils/AddressMap.js +1 -1
- package/dist/cjs/sdk/utils/viem/sendRawTx.js +0 -16
- package/dist/esm/common-utils/charts/credit-manager.js +115 -0
- package/dist/esm/common-utils/charts/credit-session.js +233 -0
- package/dist/esm/common-utils/charts/credit-sessions-payload.js +0 -0
- package/dist/esm/common-utils/charts/graph-payload.js +0 -0
- package/dist/esm/common-utils/charts/index.js +8 -0
- package/dist/esm/common-utils/charts/pool-payload.js +0 -0
- package/dist/esm/common-utils/charts/pool.js +179 -0
- package/dist/esm/common-utils/charts/token-data.js +67 -0
- package/dist/esm/common-utils/index.js +2 -0
- package/dist/esm/common-utils/static/index.js +4 -0
- package/dist/esm/common-utils/static/migration-config.js +0 -0
- package/dist/esm/common-utils/static/pool-config.js +0 -0
- package/dist/esm/common-utils/static/strategy.js +0 -0
- package/dist/esm/common-utils/static/trading-pair.js +0 -0
- package/dist/esm/common-utils/utils/{assetsMath.js → assets-math.js} +2 -2
- package/dist/esm/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +2 -2
- package/dist/esm/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +1 -1
- package/dist/esm/common-utils/utils/creditAccount/debt.js +2 -2
- package/dist/esm/common-utils/utils/creditAccount/index.js +8 -8
- package/dist/esm/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +1 -1
- package/dist/esm/common-utils/utils/creditAccount/sort.js +1 -1
- package/dist/esm/common-utils/utils/index.js +3 -4
- package/dist/esm/dev/AccountOpener.js +6 -47
- package/dist/esm/plugins/zappers/ZappersPlugin.js +126 -0
- package/dist/esm/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +2 -109
- package/dist/esm/plugins/zappers/index.js +3 -0
- package/dist/esm/plugins/zappers/package.json +1 -0
- package/dist/esm/plugins/zappers/types.js +0 -0
- package/dist/esm/rewards/apy/index.js +2 -0
- package/dist/esm/rewards/apy/output-details.js +0 -0
- package/dist/esm/rewards/apy/output.js +0 -0
- package/dist/esm/rewards/index.js +2 -0
- package/dist/esm/rewards/package.json +1 -0
- package/dist/esm/rewards/rewards/api.js +204 -0
- package/dist/esm/rewards/rewards/apy.js +160 -0
- package/dist/esm/rewards/rewards/common.js +0 -0
- package/dist/esm/rewards/rewards/extra-apy.js +101 -0
- package/dist/esm/rewards/rewards/index.js +4 -0
- package/dist/esm/rewards/rewards/merkl-api.js +18 -0
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +104 -462
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +5 -16
- package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +32 -261
- package/dist/esm/sdk/base/index.js +0 -1
- package/dist/esm/sdk/chain/chains.js +1 -2
- package/dist/esm/sdk/constants/index.js +1 -0
- package/dist/esm/sdk/{base/token-types.js → constants/phantom-tokens.js} +0 -4
- package/dist/esm/sdk/market/MarketRegister.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +0 -6
- package/dist/esm/sdk/market/index.js +0 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/esm/sdk/market/pool/index.js +0 -2
- package/dist/esm/sdk/pools/AbstractPoolService.js +113 -0
- package/dist/esm/sdk/pools/PoolServiceV310.js +6 -0
- package/dist/esm/sdk/pools/createPoolService.js +11 -0
- package/dist/esm/sdk/pools/index.js +2 -1
- package/dist/esm/sdk/utils/AddressMap.js +1 -1
- package/dist/esm/sdk/utils/viem/sendRawTx.js +1 -19
- package/dist/types/common-utils/charts/credit-manager-payload.d.ts +50 -0
- package/dist/types/common-utils/charts/credit-manager.d.ts +48 -0
- package/dist/types/common-utils/charts/credit-session.d.ts +111 -0
- package/dist/types/common-utils/charts/credit-sessions-payload.d.ts +111 -0
- package/dist/types/common-utils/charts/graph-payload.d.ts +10 -0
- package/dist/types/common-utils/charts/index.d.ts +8 -0
- package/dist/types/common-utils/charts/pool-payload.d.ts +111 -0
- package/dist/types/common-utils/charts/pool.d.ts +91 -0
- package/dist/types/common-utils/charts/token-data.d.ts +20 -0
- package/dist/types/common-utils/index.d.ts +2 -0
- package/dist/types/common-utils/static/index.d.ts +4 -0
- package/dist/types/common-utils/static/migration-config.d.ts +10 -0
- package/dist/types/common-utils/static/pool-config.d.ts +11 -0
- package/dist/types/common-utils/static/strategy.d.ts +78 -0
- package/dist/types/common-utils/static/trading-pair.d.ts +15 -0
- package/dist/types/common-utils/utils/creditAccount/index.d.ts +8 -8
- package/dist/types/common-utils/utils/index.d.ts +3 -4
- package/dist/types/plugins/zappers/ZappersPlugin.d.ts +18 -0
- package/dist/types/plugins/zappers/extraZappers.d.ts +6 -0
- package/dist/types/plugins/zappers/index.d.ts +3 -0
- package/dist/types/plugins/zappers/types.d.ts +12 -0
- package/dist/types/rewards/apy/index.d.ts +2 -0
- package/dist/types/rewards/apy/output-details.d.ts +96 -0
- package/dist/types/rewards/apy/output.d.ts +22 -0
- package/dist/types/rewards/index.d.ts +2 -0
- package/dist/types/rewards/rewards/api.d.ts +49 -0
- package/dist/types/rewards/rewards/apy.d.ts +41 -0
- package/dist/types/rewards/rewards/common.d.ts +16 -0
- package/dist/types/rewards/rewards/extra-apy.d.ts +30 -0
- package/dist/types/rewards/rewards/index.d.ts +4 -0
- package/dist/types/rewards/rewards/merkl-api.d.ts +45 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +27 -123
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +8 -108
- package/dist/types/sdk/base/TokensMeta.d.ts +18 -34
- package/dist/types/sdk/base/index.d.ts +0 -1
- package/dist/types/sdk/base/types.d.ts +1 -0
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/constants/index.d.ts +1 -0
- package/dist/types/sdk/constants/phantom-tokens.d.ts +2 -0
- package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
- package/dist/types/sdk/market/MarketSuite.d.ts +0 -3
- package/dist/types/sdk/market/index.d.ts +0 -1
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
- package/dist/types/sdk/market/pool/index.d.ts +0 -2
- package/dist/types/sdk/pools/AbstractPoolService.d.ts +9 -0
- package/dist/types/sdk/pools/PoolServiceV310.d.ts +4 -0
- package/dist/types/sdk/pools/createPoolService.d.ts +3 -0
- package/dist/types/sdk/pools/index.d.ts +2 -1
- package/dist/types/sdk/pools/types.d.ts +63 -84
- package/dist/types/sdk/utils/AddressMap.d.ts +1 -1
- package/dist/types/sdk/utils/viem/sendRawTx.d.ts +1 -5
- package/package.json +6 -1
- package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
- package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
- package/dist/cjs/common-utils/utils/endpoints.js +0 -65
- package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
- package/dist/cjs/sdk/pools/PoolService.js +0 -391
- package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
- package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
- package/dist/esm/abi/iStateSerializer.js +0 -12
- package/dist/esm/common-utils/utils/endpoints.js +0 -41
- package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
- package/dist/esm/sdk/pools/PoolService.js +0 -371
- package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
- package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
- package/dist/types/abi/iStateSerializer.d.ts +0 -11
- package/dist/types/common-utils/utils/endpoints.d.ts +0 -27
- package/dist/types/sdk/base/token-types.d.ts +0 -33
- package/dist/types/sdk/market/ZapperRegister.d.ts +0 -17
- package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
- package/dist/types/sdk/market/types.d.ts +0 -10
- package/dist/types/sdk/pools/PoolService.d.ts +0 -14
- /package/dist/cjs/{sdk/market → plugins/zappers}/types.js +0 -0
- /package/dist/esm/{sdk/market/types.js → common-utils/charts/credit-manager-payload.js} +0 -0
- /package/dist/esm/common-utils/utils/{bigintMath.js → bigint-math.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +0 -0
- /package/dist/esm/common-utils/utils/{priceMath.js → price-math.js} +0 -0
- /package/dist/types/common-utils/utils/{assetsMath.d.ts → assets-math.d.ts} +0 -0
- /package/dist/types/common-utils/utils/{bigintMath.d.ts → bigint-math.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcHealthFactor.d.ts → calc-health-factor.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcOverallAPY.d.ts → calc-overall-apy.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcQuotaBorrowRate.d.ts → calc-quota-borrow-rate.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.d.ts → calc-relative-base-borrow-rate.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{getTimeToLiquidation.d.ts → get-time-to-liquidation.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{liquidationPrice.d.ts → liquidation-price.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{quotaUtils.d.ts → quota-utils.d.ts} +0 -0
- /package/dist/types/common-utils/utils/{priceMath.d.ts → price-math.d.ts} +0 -0
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
const iSecuritizeKYCFactoryAbi = [
|
|
2
|
-
{
|
|
3
|
-
type: "function",
|
|
4
|
-
name: "contractType",
|
|
5
|
-
inputs: [],
|
|
6
|
-
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
7
|
-
stateMutability: "view"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
type: "function",
|
|
11
|
-
name: "getCreditAccounts",
|
|
12
|
-
inputs: [{ name: "investor", type: "address", internalType: "address" }],
|
|
13
|
-
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
|
|
14
|
-
stateMutability: "view"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
type: "function",
|
|
18
|
-
name: "getDegenNFT",
|
|
19
|
-
inputs: [],
|
|
20
|
-
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
21
|
-
stateMutability: "view"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
type: "function",
|
|
25
|
-
name: "getInvestor",
|
|
26
|
-
inputs: [
|
|
27
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
28
|
-
],
|
|
29
|
-
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
30
|
-
stateMutability: "view"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
type: "function",
|
|
34
|
-
name: "getWallet",
|
|
35
|
-
inputs: [
|
|
36
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
37
|
-
],
|
|
38
|
-
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
39
|
-
stateMutability: "view"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
type: "function",
|
|
43
|
-
name: "isCreditAccount",
|
|
44
|
-
inputs: [
|
|
45
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
46
|
-
],
|
|
47
|
-
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
48
|
-
stateMutability: "view"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: "function",
|
|
52
|
-
name: "isFrozen",
|
|
53
|
-
inputs: [
|
|
54
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
55
|
-
],
|
|
56
|
-
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
57
|
-
stateMutability: "view"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
type: "function",
|
|
61
|
-
name: "multicall",
|
|
62
|
-
inputs: [
|
|
63
|
-
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
64
|
-
{
|
|
65
|
-
name: "calls",
|
|
66
|
-
type: "tuple[]",
|
|
67
|
-
internalType: "struct MultiCall[]",
|
|
68
|
-
components: [
|
|
69
|
-
{ name: "target", type: "address", internalType: "address" },
|
|
70
|
-
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: "tokensToRegister",
|
|
75
|
-
type: "address[]",
|
|
76
|
-
internalType: "address[]"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
outputs: [],
|
|
80
|
-
stateMutability: "nonpayable"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
type: "function",
|
|
84
|
-
name: "openCreditAccount",
|
|
85
|
-
inputs: [
|
|
86
|
-
{ name: "creditManager", type: "address", internalType: "address" },
|
|
87
|
-
{
|
|
88
|
-
name: "calls",
|
|
89
|
-
type: "tuple[]",
|
|
90
|
-
internalType: "struct MultiCall[]",
|
|
91
|
-
components: [
|
|
92
|
-
{ name: "target", type: "address", internalType: "address" },
|
|
93
|
-
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: "tokensToRegister",
|
|
98
|
-
type: "address[]",
|
|
99
|
-
internalType: "address[]"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
outputs: [
|
|
103
|
-
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
104
|
-
{ name: "wallet", type: "address", internalType: "address" }
|
|
105
|
-
],
|
|
106
|
-
stateMutability: "nonpayable"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
type: "function",
|
|
110
|
-
name: "precomputeWalletAddress",
|
|
111
|
-
inputs: [
|
|
112
|
-
{ name: "creditManager", type: "address", internalType: "address" },
|
|
113
|
-
{ name: "investor", type: "address", internalType: "address" }
|
|
114
|
-
],
|
|
115
|
-
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
116
|
-
stateMutability: "view"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
type: "function",
|
|
120
|
-
name: "serialize",
|
|
121
|
-
inputs: [],
|
|
122
|
-
outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
|
|
123
|
-
stateMutability: "view"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
type: "function",
|
|
127
|
-
name: "setFrozenStatus",
|
|
128
|
-
inputs: [
|
|
129
|
-
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
130
|
-
{ name: "frozen", type: "bool", internalType: "bool" }
|
|
131
|
-
],
|
|
132
|
-
outputs: [],
|
|
133
|
-
stateMutability: "nonpayable"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
type: "function",
|
|
137
|
-
name: "setInvestor",
|
|
138
|
-
inputs: [
|
|
139
|
-
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
140
|
-
{ name: "investor", type: "address", internalType: "address" }
|
|
141
|
-
],
|
|
142
|
-
outputs: [],
|
|
143
|
-
stateMutability: "nonpayable"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
type: "function",
|
|
147
|
-
name: "version",
|
|
148
|
-
inputs: [],
|
|
149
|
-
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
150
|
-
stateMutability: "view"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
type: "event",
|
|
154
|
-
name: "CreateWallet",
|
|
155
|
-
inputs: [
|
|
156
|
-
{
|
|
157
|
-
name: "creditAccount",
|
|
158
|
-
type: "address",
|
|
159
|
-
indexed: true,
|
|
160
|
-
internalType: "address"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: "wallet",
|
|
164
|
-
type: "address",
|
|
165
|
-
indexed: true,
|
|
166
|
-
internalType: "address"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: "investor",
|
|
170
|
-
type: "address",
|
|
171
|
-
indexed: true,
|
|
172
|
-
internalType: "address"
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
anonymous: false
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
type: "event",
|
|
179
|
-
name: "SetFrozenStatus",
|
|
180
|
-
inputs: [
|
|
181
|
-
{
|
|
182
|
-
name: "creditAccount",
|
|
183
|
-
type: "address",
|
|
184
|
-
indexed: true,
|
|
185
|
-
internalType: "address"
|
|
186
|
-
},
|
|
187
|
-
{ name: "frozen", type: "bool", indexed: false, internalType: "bool" }
|
|
188
|
-
],
|
|
189
|
-
anonymous: false
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: "event",
|
|
193
|
-
name: "SetInvestor",
|
|
194
|
-
inputs: [
|
|
195
|
-
{
|
|
196
|
-
name: "creditAccount",
|
|
197
|
-
type: "address",
|
|
198
|
-
indexed: true,
|
|
199
|
-
internalType: "address"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
name: "oldInvestor",
|
|
203
|
-
type: "address",
|
|
204
|
-
indexed: true,
|
|
205
|
-
internalType: "address"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
name: "newInvestor",
|
|
209
|
-
type: "address",
|
|
210
|
-
indexed: true,
|
|
211
|
-
internalType: "address"
|
|
212
|
-
}
|
|
213
|
-
],
|
|
214
|
-
anonymous: false
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
type: "error",
|
|
218
|
-
name: "CallerIsNotInvestorException",
|
|
219
|
-
inputs: [
|
|
220
|
-
{ name: "caller", type: "address", internalType: "address" },
|
|
221
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
222
|
-
]
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
type: "error",
|
|
226
|
-
name: "FrozenCreditAccountException",
|
|
227
|
-
inputs: [
|
|
228
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
229
|
-
]
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
type: "error",
|
|
233
|
-
name: "InvalidCreditManagerException",
|
|
234
|
-
inputs: [
|
|
235
|
-
{ name: "creditManager", type: "address", internalType: "address" }
|
|
236
|
-
]
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
type: "error",
|
|
240
|
-
name: "InvalidUnderlyingTokenException",
|
|
241
|
-
inputs: [{ name: "underlying", type: "address", internalType: "address" }]
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
type: "error",
|
|
245
|
-
name: "UnknownCreditAccountException",
|
|
246
|
-
inputs: [
|
|
247
|
-
{ name: "creditAccount", type: "address", internalType: "address" }
|
|
248
|
-
]
|
|
249
|
-
},
|
|
250
|
-
{ type: "error", name: "ZeroAddressException", inputs: [] }
|
|
251
|
-
];
|
|
252
|
-
export {
|
|
253
|
-
iSecuritizeKYCFactoryAbi
|
|
254
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { isSupportedNetwork } from "../../sdk/index.js";
|
|
2
|
-
const CHARTS_BACKEND_ADDRESS = "https://charts-server.fly.dev";
|
|
3
|
-
const STATIC_TOKEN = "https://static.gearbox.finance/tokens/";
|
|
4
|
-
class GearboxBackendApi {
|
|
5
|
-
constructor() {
|
|
6
|
-
}
|
|
7
|
-
static getChartsUrl = (url, chainId, options = { params: {} }, priceSource) => {
|
|
8
|
-
const domain = CHARTS_BACKEND_ADDRESS;
|
|
9
|
-
const priceSourceArr = priceSource ? [priceSource] : [];
|
|
10
|
-
const isMain = isSupportedNetwork(chainId);
|
|
11
|
-
const relativePath = getRelativeUrl(
|
|
12
|
-
url,
|
|
13
|
-
isMain ? {
|
|
14
|
-
...options,
|
|
15
|
-
params: { ...options.params, chainId }
|
|
16
|
-
} : options
|
|
17
|
-
);
|
|
18
|
-
return [domain, "api", ...priceSourceArr, relativePath].join("/");
|
|
19
|
-
};
|
|
20
|
-
static getStaticTokenUrl = () => STATIC_TOKEN;
|
|
21
|
-
static getRewardsMerkleUrl = (network, root, account) => {
|
|
22
|
-
const path = `${network}_${root.slice(2)}/${account.slice(2, 4)}`;
|
|
23
|
-
const url = `https://am.gearbox.finance/${path.toLowerCase()}.json`;
|
|
24
|
-
return url;
|
|
25
|
-
};
|
|
26
|
-
static getNFTMerkleUrl = (network, root) => {
|
|
27
|
-
const url = `https://dm.gearbox.finance/${network.toLowerCase()}_${root}.json`;
|
|
28
|
-
return url;
|
|
29
|
-
};
|
|
30
|
-
static apyAllRewards = () => getRelativeUrl(
|
|
31
|
-
"https://state-cache.gearbox.foundation/apy-server/latest.json"
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
const getRelativeUrl = (url, options) => {
|
|
35
|
-
const { params = {} } = options || {};
|
|
36
|
-
const paramsString = Object.entries(params).map(([key, value]) => `${key}=${value}`).join("&");
|
|
37
|
-
return [url, ...paramsString ? [paramsString] : []].join("?");
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
GearboxBackendApi
|
|
41
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { iSecuritizeDegenNFTAbi } from "../../../abi/310/iSecuritizeDegenNFT.js";
|
|
2
|
-
import { iSecuritizeKYCFactoryAbi } from "../../../abi/310/iSecuritizeKYCFactory.js";
|
|
3
|
-
import { BaseContract } from "../../base/index.js";
|
|
4
|
-
import { AddressMap } from "../../index.js";
|
|
5
|
-
const abi = iSecuritizeKYCFactoryAbi;
|
|
6
|
-
class SecuritizeKYCFactory extends BaseContract {
|
|
7
|
-
investorCache;
|
|
8
|
-
#degenNFT;
|
|
9
|
-
constructor(options, address) {
|
|
10
|
-
super(options, {
|
|
11
|
-
addr: address,
|
|
12
|
-
name: "SecuritizeKYCFactory",
|
|
13
|
-
abi
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async precomputeWalletAddress(creditManager, investor) {
|
|
17
|
-
return this.contract.read.precomputeWalletAddress([
|
|
18
|
-
creditManager,
|
|
19
|
-
investor
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
22
|
-
async getWallet(creditAccount) {
|
|
23
|
-
return this.contract.read.getWallet([creditAccount]);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Returns the investor address for a credit account.
|
|
27
|
-
* @param creditAccount - Credit account address
|
|
28
|
-
* @param fromCache - If true, use and update an in-memory cache (creditAccount -> investor). On cache miss, loads from contract and stores the result for future calls.
|
|
29
|
-
*/
|
|
30
|
-
async getInvestor(creditAccount, fromCache) {
|
|
31
|
-
if (fromCache && this.investorCache?.has(creditAccount)) {
|
|
32
|
-
return this.investorCache.get(creditAccount);
|
|
33
|
-
}
|
|
34
|
-
const investor = await this.contract.read.getInvestor([creditAccount]);
|
|
35
|
-
if (fromCache) {
|
|
36
|
-
if (!this.investorCache) {
|
|
37
|
-
this.investorCache = new AddressMap();
|
|
38
|
-
}
|
|
39
|
-
this.investorCache.upsert(creditAccount, investor);
|
|
40
|
-
}
|
|
41
|
-
return investor;
|
|
42
|
-
}
|
|
43
|
-
async getDSTokens() {
|
|
44
|
-
const degenNFT = await this.getDegenNFT();
|
|
45
|
-
const tokens = await this.client.readContract({
|
|
46
|
-
address: degenNFT,
|
|
47
|
-
abi: iSecuritizeDegenNFTAbi,
|
|
48
|
-
functionName: "getDSTokens"
|
|
49
|
-
});
|
|
50
|
-
return [...tokens];
|
|
51
|
-
}
|
|
52
|
-
multicall(creditAccount, calls, tokensToRegister) {
|
|
53
|
-
return this.createRawTx({
|
|
54
|
-
functionName: "multicall",
|
|
55
|
-
args: [creditAccount, calls, tokensToRegister]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
openCreditAccount(creditManager, calls, tokensToRegister) {
|
|
59
|
-
return this.createRawTx({
|
|
60
|
-
functionName: "openCreditAccount",
|
|
61
|
-
args: [creditManager, calls, tokensToRegister]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async getDegenNFT() {
|
|
65
|
-
if (!this.#degenNFT) {
|
|
66
|
-
this.#degenNFT = await this.contract.read.getDegenNFT();
|
|
67
|
-
}
|
|
68
|
-
return this.#degenNFT;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
SecuritizeKYCFactory
|
|
73
|
-
};
|