@kasufinance/kasu-sdk 1.0.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/.eslintignore +3 -0
- package/.eslintrc.json +90 -0
- package/.github/workflows/ci.yml +0 -0
- package/.github/workflows/main.yml +43 -0
- package/.prettierignore +3 -0
- package/.prettierrc +28 -0
- package/abis/IClearingCoordinator.abi.json +410 -0
- package/abis/IERC20Metadata.abi.json +224 -0
- package/abis/IFeeManager.abi.json +66 -0
- package/abis/IKSULocking.abi.json +754 -0
- package/abis/IKasuAllowList.abi.json +455 -0
- package/abis/IKasuController.abi.json +423 -0
- package/abis/IKasuNFTs.abi.json +1523 -0
- package/abis/IKsuPrice.abi.json +15 -0
- package/abis/ILendingPool.abi.json +1431 -0
- package/abis/ILendingPoolFactory.abi.json +97 -0
- package/abis/ILendingPoolManager.abi.json +1347 -0
- package/abis/ILendingPoolTranche.abi.json +1317 -0
- package/abis/IPriceFeed.abi.json +1 -0
- package/abis/ISystemVariables.abi.json +431 -0
- package/abis/IUserLoyaltyRewards.abi.json +288 -0
- package/abis/IUserManager.abi.json +321 -0
- package/abis/KSULockBonus.abi.json +91 -0
- package/abis/KasuPoolExternalTVL.abi.json +812 -0
- package/abis/Swapper.abi.json +146 -0
- package/copy-abi.ps1 +15 -0
- package/dist/bundle.cjs.js +21646 -0
- package/dist/bundle.esm.js +21644 -0
- package/dist/contracts/IClearingCoordinatorAbi.d.ts +169 -0
- package/dist/contracts/IClearingCoordinatorAbi.js +1 -0
- package/dist/contracts/IERC20MetadataAbi.d.ts +162 -0
- package/dist/contracts/IERC20MetadataAbi.js +1 -0
- package/dist/contracts/IFeeManagerAbi.d.ts +96 -0
- package/dist/contracts/IFeeManagerAbi.js +1 -0
- package/dist/contracts/IKSULockingAbi.d.ts +466 -0
- package/dist/contracts/IKSULockingAbi.js +1 -0
- package/dist/contracts/IKasuAllowListAbi.d.ts +304 -0
- package/dist/contracts/IKasuAllowListAbi.js +1 -0
- package/dist/contracts/IKasuControllerAbi.d.ts +309 -0
- package/dist/contracts/IKasuControllerAbi.js +1 -0
- package/dist/contracts/IKasuNFTsAbi.d.ts +1121 -0
- package/dist/contracts/IKasuNFTsAbi.js +1 -0
- package/dist/contracts/IKsuPriceAbi.d.ts +42 -0
- package/dist/contracts/IKsuPriceAbi.js +1 -0
- package/dist/contracts/ILendingPoolAbi.d.ts +968 -0
- package/dist/contracts/ILendingPoolAbi.js +1 -0
- package/dist/contracts/ILendingPoolFactoryAbi.d.ts +103 -0
- package/dist/contracts/ILendingPoolFactoryAbi.js +1 -0
- package/dist/contracts/ILendingPoolManagerAbi.d.ts +779 -0
- package/dist/contracts/ILendingPoolManagerAbi.js +1 -0
- package/dist/contracts/ILendingPoolTrancheAbi.d.ts +752 -0
- package/dist/contracts/ILendingPoolTrancheAbi.js +1 -0
- package/dist/contracts/ISystemVariablesAbi.d.ts +378 -0
- package/dist/contracts/ISystemVariablesAbi.js +1 -0
- package/dist/contracts/IUserLoyaltyRewardsAbi.d.ts +248 -0
- package/dist/contracts/IUserLoyaltyRewardsAbi.js +1 -0
- package/dist/contracts/IUserManagerAbi.d.ts +270 -0
- package/dist/contracts/IUserManagerAbi.js +1 -0
- package/dist/contracts/KSULockBonusAbi.d.ts +61 -0
- package/dist/contracts/KSULockBonusAbi.js +1 -0
- package/dist/contracts/KasuPoolExternalTVLAbi.d.ts +411 -0
- package/dist/contracts/KasuPoolExternalTVLAbi.js +1 -0
- package/dist/contracts/SwapperAbi.d.ts +120 -0
- package/dist/contracts/SwapperAbi.js +1 -0
- package/dist/contracts/common.d.ts +21 -0
- package/dist/contracts/common.js +1 -0
- package/dist/contracts/factories/IClearingCoordinatorAbi__factory.d.ts +320 -0
- package/dist/contracts/factories/IClearingCoordinatorAbi__factory.js +423 -0
- package/dist/contracts/factories/IERC20MetadataAbi__factory.d.ts +178 -0
- package/dist/contracts/factories/IERC20MetadataAbi__factory.js +237 -0
- package/dist/contracts/factories/IFeeManagerAbi__factory.d.ts +59 -0
- package/dist/contracts/factories/IFeeManagerAbi__factory.js +79 -0
- package/dist/contracts/factories/IKSULockingAbi__factory.d.ts +588 -0
- package/dist/contracts/factories/IKSULockingAbi__factory.js +767 -0
- package/dist/contracts/factories/IKasuAllowListAbi__factory.d.ts +354 -0
- package/dist/contracts/factories/IKasuAllowListAbi__factory.js +468 -0
- package/dist/contracts/factories/IKasuControllerAbi__factory.d.ts +339 -0
- package/dist/contracts/factories/IKasuControllerAbi__factory.js +436 -0
- package/dist/contracts/factories/IKasuNFTsAbi__factory.d.ts +1629 -0
- package/dist/contracts/factories/IKasuNFTsAbi__factory.js +2108 -0
- package/dist/contracts/factories/IKsuPriceAbi__factory.d.ts +18 -0
- package/dist/contracts/factories/IKsuPriceAbi__factory.js +28 -0
- package/dist/contracts/factories/ILendingPoolAbi__factory.d.ts +1109 -0
- package/dist/contracts/factories/ILendingPoolAbi__factory.js +1444 -0
- package/dist/contracts/factories/ILendingPoolFactoryAbi__factory.d.ts +81 -0
- package/dist/contracts/factories/ILendingPoolFactoryAbi__factory.js +110 -0
- package/dist/contracts/factories/ILendingPoolManagerAbi__factory.d.ts +1045 -0
- package/dist/contracts/factories/ILendingPoolManagerAbi__factory.js +1360 -0
- package/dist/contracts/factories/ILendingPoolTrancheAbi__factory.d.ts +1015 -0
- package/dist/contracts/factories/ILendingPoolTrancheAbi__factory.js +1330 -0
- package/dist/contracts/factories/ISystemVariablesAbi__factory.d.ts +338 -0
- package/dist/contracts/factories/ISystemVariablesAbi__factory.js +444 -0
- package/dist/contracts/factories/IUserLoyaltyRewardsAbi__factory.d.ts +230 -0
- package/dist/contracts/factories/IUserLoyaltyRewardsAbi__factory.js +301 -0
- package/dist/contracts/factories/IUserManagerAbi__factory.d.ts +250 -0
- package/dist/contracts/factories/IUserManagerAbi__factory.js +334 -0
- package/dist/contracts/factories/KSULockBonusAbi__factory.d.ts +76 -0
- package/dist/contracts/factories/KSULockBonusAbi__factory.js +104 -0
- package/dist/contracts/factories/KasuPoolExternalTVLAbi__factory.d.ts +631 -0
- package/dist/contracts/factories/KasuPoolExternalTVLAbi__factory.js +825 -0
- package/dist/contracts/factories/SwapperAbi__factory.d.ts +120 -0
- package/dist/contracts/factories/SwapperAbi__factory.js +159 -0
- package/dist/contracts/factories/index.d.ts +18 -0
- package/dist/contracts/factories/index.js +21 -0
- package/dist/contracts/index.d.ts +37 -0
- package/dist/contracts/index.js +19 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +16 -0
- package/dist/sdk-config.d.ts +22 -0
- package/dist/sdk-config.js +9 -0
- package/dist/services/DataService/data-service.d.ts +37 -0
- package/dist/services/DataService/data-service.js +586 -0
- package/dist/services/DataService/directus-types.d.ts +187 -0
- package/dist/services/DataService/directus-types.js +1 -0
- package/dist/services/DataService/queries.d.ts +7 -0
- package/dist/services/DataService/queries.js +158 -0
- package/dist/services/DataService/subgraph-types.d.ts +95 -0
- package/dist/services/DataService/subgraph-types.js +1 -0
- package/dist/services/DataService/types.d.ts +169 -0
- package/dist/services/DataService/types.js +1 -0
- package/dist/services/Locking/locking.d.ts +61 -0
- package/dist/services/Locking/locking.js +344 -0
- package/dist/services/Locking/queries.d.ts +10 -0
- package/dist/services/Locking/queries.js +108 -0
- package/dist/services/Locking/types.d.ts +117 -0
- package/dist/services/Locking/types.js +1 -0
- package/dist/services/Portfolio/portfolio.d.ts +22 -0
- package/dist/services/Portfolio/portfolio.js +325 -0
- package/dist/services/Portfolio/queries.d.ts +2 -0
- package/dist/services/Portfolio/queries.js +164 -0
- package/dist/services/Portfolio/types.d.ts +206 -0
- package/dist/services/Portfolio/types.js +1 -0
- package/dist/services/Swapper/swapper.d.ts +11 -0
- package/dist/services/Swapper/swapper.js +97 -0
- package/dist/services/Swapper/types.d.ts +51 -0
- package/dist/services/Swapper/types.js +1 -0
- package/dist/services/UserLending/helper.d.ts +2 -0
- package/dist/services/UserLending/helper.js +16 -0
- package/dist/services/UserLending/queries.d.ts +8 -0
- package/dist/services/UserLending/queries.js +188 -0
- package/dist/services/UserLending/subgraph-types.d.ts +147 -0
- package/dist/services/UserLending/subgraph-types.js +6 -0
- package/dist/services/UserLending/types.d.ts +102 -0
- package/dist/services/UserLending/types.js +13 -0
- package/dist/services/UserLending/user-lending.d.ts +55 -0
- package/dist/services/UserLending/user-lending.js +490 -0
- package/dist/services/shared.d.ts +1 -0
- package/dist/services/shared.js +11 -0
- package/dist/tests/sample.test.d.ts +1 -0
- package/dist/tests/sample.test.js +32 -0
- package/index.ts +2 -0
- package/jest-config.ts +9 -0
- package/jest.config.js +8 -0
- package/package.json +49 -0
- package/rollup.config.js +45 -0
- package/src/contracts/IClearingCoordinatorAbi.ts +406 -0
- package/src/contracts/IERC20MetadataAbi.ts +364 -0
- package/src/contracts/IFeeManagerAbi.ts +182 -0
- package/src/contracts/IKSULockingAbi.ts +965 -0
- package/src/contracts/IKasuAllowListAbi.ts +605 -0
- package/src/contracts/IKasuControllerAbi.ts +703 -0
- package/src/contracts/IKasuNFTsAbi.ts +2744 -0
- package/src/contracts/IKsuPriceAbi.ts +87 -0
- package/src/contracts/ILendingPoolAbi.ts +2081 -0
- package/src/contracts/ILendingPoolFactoryAbi.ts +161 -0
- package/src/contracts/ILendingPoolManagerAbi.ts +1917 -0
- package/src/contracts/ILendingPoolTrancheAbi.ts +1911 -0
- package/src/contracts/ISystemVariablesAbi.ts +908 -0
- package/src/contracts/IUserLoyaltyRewardsAbi.ts +544 -0
- package/src/contracts/IUserManagerAbi.ts +612 -0
- package/src/contracts/KSULockBonusAbi.ts +124 -0
- package/src/contracts/KasuPoolExternalTVLAbi.ts +1071 -0
- package/src/contracts/SwapperAbi.ts +266 -0
- package/src/contracts/common.ts +44 -0
- package/src/contracts/factories/IClearingCoordinatorAbi__factory.ts +438 -0
- package/src/contracts/factories/IERC20MetadataAbi__factory.ts +248 -0
- package/src/contracts/factories/IFeeManagerAbi__factory.ts +90 -0
- package/src/contracts/factories/IKSULockingAbi__factory.ts +778 -0
- package/src/contracts/factories/IKasuAllowListAbi__factory.ts +479 -0
- package/src/contracts/factories/IKasuControllerAbi__factory.ts +447 -0
- package/src/contracts/factories/IKasuNFTsAbi__factory.ts +2116 -0
- package/src/contracts/factories/IKsuPriceAbi__factory.ts +36 -0
- package/src/contracts/factories/ILendingPoolAbi__factory.ts +1455 -0
- package/src/contracts/factories/ILendingPoolFactoryAbi__factory.ts +125 -0
- package/src/contracts/factories/ILendingPoolManagerAbi__factory.ts +1375 -0
- package/src/contracts/factories/ILendingPoolTrancheAbi__factory.ts +1345 -0
- package/src/contracts/factories/ISystemVariablesAbi__factory.ts +455 -0
- package/src/contracts/factories/IUserLoyaltyRewardsAbi__factory.ts +316 -0
- package/src/contracts/factories/IUserManagerAbi__factory.ts +345 -0
- package/src/contracts/factories/KSULockBonusAbi__factory.ts +115 -0
- package/src/contracts/factories/KasuPoolExternalTVLAbi__factory.ts +840 -0
- package/src/contracts/factories/SwapperAbi__factory.ts +167 -0
- package/src/contracts/factories/index.ts +21 -0
- package/src/contracts/index.ts +40 -0
- package/src/index.ts +27 -0
- package/src/sdk-config.ts +35 -0
- package/src/services/DataService/data-service.ts +1017 -0
- package/src/services/DataService/directus-types.ts +199 -0
- package/src/services/DataService/queries.ts +165 -0
- package/src/services/DataService/subgraph-types.ts +104 -0
- package/src/services/DataService/types.ts +184 -0
- package/src/services/Locking/locking.ts +541 -0
- package/src/services/Locking/queries.ts +118 -0
- package/src/services/Locking/types.ts +141 -0
- package/src/services/Portfolio/portfolio.ts +593 -0
- package/src/services/Portfolio/queries.ts +166 -0
- package/src/services/Portfolio/types.ts +220 -0
- package/src/services/Swapper/swapper.ts +158 -0
- package/src/services/Swapper/types.ts +54 -0
- package/src/services/UserLending/helper.ts +28 -0
- package/src/services/UserLending/queries.ts +196 -0
- package/src/services/UserLending/subgraph-types.ts +173 -0
- package/src/services/UserLending/types.ts +123 -0
- package/src/services/UserLending/user-lending.ts +933 -0
- package/src/services/shared.ts +11 -0
- package/src/tests/sample.test.ts +44 -0
- package/tsconfig.json +27 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/versioner.sh +6 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import type { Provider } from "@ethersproject/providers";
|
|
3
|
+
import type { SwapperAbi, SwapperAbiInterface } from "../SwapperAbi";
|
|
4
|
+
export declare class SwapperAbi__factory {
|
|
5
|
+
static readonly abi: readonly [{
|
|
6
|
+
readonly anonymous: false;
|
|
7
|
+
readonly inputs: readonly [{
|
|
8
|
+
readonly indexed: true;
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "exchange";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}, {
|
|
13
|
+
readonly indexed: false;
|
|
14
|
+
readonly internalType: "bool";
|
|
15
|
+
readonly name: "isAllowed";
|
|
16
|
+
readonly type: "bool";
|
|
17
|
+
}];
|
|
18
|
+
readonly name: "ExchangeAllowlistUpdated";
|
|
19
|
+
readonly type: "event";
|
|
20
|
+
}, {
|
|
21
|
+
readonly anonymous: false;
|
|
22
|
+
readonly inputs: readonly [{
|
|
23
|
+
readonly indexed: true;
|
|
24
|
+
readonly internalType: "address";
|
|
25
|
+
readonly name: "receiver";
|
|
26
|
+
readonly type: "address";
|
|
27
|
+
}, {
|
|
28
|
+
readonly indexed: false;
|
|
29
|
+
readonly internalType: "address[]";
|
|
30
|
+
readonly name: "tokensIn";
|
|
31
|
+
readonly type: "address[]";
|
|
32
|
+
}, {
|
|
33
|
+
readonly indexed: false;
|
|
34
|
+
readonly internalType: "address";
|
|
35
|
+
readonly name: "tokenOut";
|
|
36
|
+
readonly type: "address";
|
|
37
|
+
}, {
|
|
38
|
+
readonly indexed: false;
|
|
39
|
+
readonly internalType: "uint256[]";
|
|
40
|
+
readonly name: "amountsIn";
|
|
41
|
+
readonly type: "uint256[]";
|
|
42
|
+
}, {
|
|
43
|
+
readonly indexed: false;
|
|
44
|
+
readonly internalType: "uint256";
|
|
45
|
+
readonly name: "amountOut";
|
|
46
|
+
readonly type: "uint256";
|
|
47
|
+
}];
|
|
48
|
+
readonly name: "Swapped";
|
|
49
|
+
readonly type: "event";
|
|
50
|
+
}, {
|
|
51
|
+
readonly inputs: readonly [{
|
|
52
|
+
readonly internalType: "address";
|
|
53
|
+
readonly name: "exchange";
|
|
54
|
+
readonly type: "address";
|
|
55
|
+
}];
|
|
56
|
+
readonly name: "isExchangeAllowed";
|
|
57
|
+
readonly outputs: readonly [{
|
|
58
|
+
readonly internalType: "bool";
|
|
59
|
+
readonly name: "isAllowed";
|
|
60
|
+
readonly type: "bool";
|
|
61
|
+
}];
|
|
62
|
+
readonly stateMutability: "view";
|
|
63
|
+
readonly type: "function";
|
|
64
|
+
}, {
|
|
65
|
+
readonly inputs: readonly [{
|
|
66
|
+
readonly internalType: "address[]";
|
|
67
|
+
readonly name: "tokensIn";
|
|
68
|
+
readonly type: "address[]";
|
|
69
|
+
}, {
|
|
70
|
+
readonly components: readonly [{
|
|
71
|
+
readonly internalType: "address";
|
|
72
|
+
readonly name: "swapTarget";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly internalType: "address";
|
|
76
|
+
readonly name: "token";
|
|
77
|
+
readonly type: "address";
|
|
78
|
+
}, {
|
|
79
|
+
readonly internalType: "bytes";
|
|
80
|
+
readonly name: "swapCallData";
|
|
81
|
+
readonly type: "bytes";
|
|
82
|
+
}];
|
|
83
|
+
readonly internalType: "struct SwapInfo[]";
|
|
84
|
+
readonly name: "swapInfo";
|
|
85
|
+
readonly type: "tuple[]";
|
|
86
|
+
}, {
|
|
87
|
+
readonly internalType: "address";
|
|
88
|
+
readonly name: "tokenOut";
|
|
89
|
+
readonly type: "address";
|
|
90
|
+
}, {
|
|
91
|
+
readonly internalType: "address";
|
|
92
|
+
readonly name: "receiver";
|
|
93
|
+
readonly type: "address";
|
|
94
|
+
}];
|
|
95
|
+
readonly name: "swap";
|
|
96
|
+
readonly outputs: readonly [{
|
|
97
|
+
readonly internalType: "uint256";
|
|
98
|
+
readonly name: "amountOut";
|
|
99
|
+
readonly type: "uint256";
|
|
100
|
+
}];
|
|
101
|
+
readonly stateMutability: "nonpayable";
|
|
102
|
+
readonly type: "function";
|
|
103
|
+
}, {
|
|
104
|
+
readonly inputs: readonly [{
|
|
105
|
+
readonly internalType: "address[]";
|
|
106
|
+
readonly name: "exchanges";
|
|
107
|
+
readonly type: "address[]";
|
|
108
|
+
}, {
|
|
109
|
+
readonly internalType: "bool[]";
|
|
110
|
+
readonly name: "allowed";
|
|
111
|
+
readonly type: "bool[]";
|
|
112
|
+
}];
|
|
113
|
+
readonly name: "updateExchangeAllowlist";
|
|
114
|
+
readonly outputs: readonly [];
|
|
115
|
+
readonly stateMutability: "nonpayable";
|
|
116
|
+
readonly type: "function";
|
|
117
|
+
}];
|
|
118
|
+
static createInterface(): SwapperAbiInterface;
|
|
119
|
+
static connect(address: string, signerOrProvider: Signer | Provider): SwapperAbi;
|
|
120
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { Contract, utils } from "ethers";
|
|
5
|
+
const _abi = [
|
|
6
|
+
{
|
|
7
|
+
anonymous: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
indexed: true,
|
|
11
|
+
internalType: "address",
|
|
12
|
+
name: "exchange",
|
|
13
|
+
type: "address",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
indexed: false,
|
|
17
|
+
internalType: "bool",
|
|
18
|
+
name: "isAllowed",
|
|
19
|
+
type: "bool",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
name: "ExchangeAllowlistUpdated",
|
|
23
|
+
type: "event",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
anonymous: false,
|
|
27
|
+
inputs: [
|
|
28
|
+
{
|
|
29
|
+
indexed: true,
|
|
30
|
+
internalType: "address",
|
|
31
|
+
name: "receiver",
|
|
32
|
+
type: "address",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
indexed: false,
|
|
36
|
+
internalType: "address[]",
|
|
37
|
+
name: "tokensIn",
|
|
38
|
+
type: "address[]",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
indexed: false,
|
|
42
|
+
internalType: "address",
|
|
43
|
+
name: "tokenOut",
|
|
44
|
+
type: "address",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
indexed: false,
|
|
48
|
+
internalType: "uint256[]",
|
|
49
|
+
name: "amountsIn",
|
|
50
|
+
type: "uint256[]",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
indexed: false,
|
|
54
|
+
internalType: "uint256",
|
|
55
|
+
name: "amountOut",
|
|
56
|
+
type: "uint256",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
name: "Swapped",
|
|
60
|
+
type: "event",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
inputs: [
|
|
64
|
+
{
|
|
65
|
+
internalType: "address",
|
|
66
|
+
name: "exchange",
|
|
67
|
+
type: "address",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
name: "isExchangeAllowed",
|
|
71
|
+
outputs: [
|
|
72
|
+
{
|
|
73
|
+
internalType: "bool",
|
|
74
|
+
name: "isAllowed",
|
|
75
|
+
type: "bool",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
stateMutability: "view",
|
|
79
|
+
type: "function",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
inputs: [
|
|
83
|
+
{
|
|
84
|
+
internalType: "address[]",
|
|
85
|
+
name: "tokensIn",
|
|
86
|
+
type: "address[]",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
components: [
|
|
90
|
+
{
|
|
91
|
+
internalType: "address",
|
|
92
|
+
name: "swapTarget",
|
|
93
|
+
type: "address",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
internalType: "address",
|
|
97
|
+
name: "token",
|
|
98
|
+
type: "address",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
internalType: "bytes",
|
|
102
|
+
name: "swapCallData",
|
|
103
|
+
type: "bytes",
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
internalType: "struct SwapInfo[]",
|
|
107
|
+
name: "swapInfo",
|
|
108
|
+
type: "tuple[]",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
internalType: "address",
|
|
112
|
+
name: "tokenOut",
|
|
113
|
+
type: "address",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
internalType: "address",
|
|
117
|
+
name: "receiver",
|
|
118
|
+
type: "address",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
name: "swap",
|
|
122
|
+
outputs: [
|
|
123
|
+
{
|
|
124
|
+
internalType: "uint256",
|
|
125
|
+
name: "amountOut",
|
|
126
|
+
type: "uint256",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
stateMutability: "nonpayable",
|
|
130
|
+
type: "function",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
inputs: [
|
|
134
|
+
{
|
|
135
|
+
internalType: "address[]",
|
|
136
|
+
name: "exchanges",
|
|
137
|
+
type: "address[]",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
internalType: "bool[]",
|
|
141
|
+
name: "allowed",
|
|
142
|
+
type: "bool[]",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
name: "updateExchangeAllowlist",
|
|
146
|
+
outputs: [],
|
|
147
|
+
stateMutability: "nonpayable",
|
|
148
|
+
type: "function",
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
export class SwapperAbi__factory {
|
|
152
|
+
static createInterface() {
|
|
153
|
+
return new utils.Interface(_abi);
|
|
154
|
+
}
|
|
155
|
+
static connect(address, signerOrProvider) {
|
|
156
|
+
return new Contract(address, _abi, signerOrProvider);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
SwapperAbi__factory.abi = _abi;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { IClearingCoordinatorAbi__factory } from "./IClearingCoordinatorAbi__factory";
|
|
2
|
+
export { IERC20MetadataAbi__factory } from "./IERC20MetadataAbi__factory";
|
|
3
|
+
export { IFeeManagerAbi__factory } from "./IFeeManagerAbi__factory";
|
|
4
|
+
export { IKSULockingAbi__factory } from "./IKSULockingAbi__factory";
|
|
5
|
+
export { IKasuAllowListAbi__factory } from "./IKasuAllowListAbi__factory";
|
|
6
|
+
export { IKasuControllerAbi__factory } from "./IKasuControllerAbi__factory";
|
|
7
|
+
export { IKasuNFTsAbi__factory } from "./IKasuNFTsAbi__factory";
|
|
8
|
+
export { IKsuPriceAbi__factory } from "./IKsuPriceAbi__factory";
|
|
9
|
+
export { ILendingPoolAbi__factory } from "./ILendingPoolAbi__factory";
|
|
10
|
+
export { ILendingPoolFactoryAbi__factory } from "./ILendingPoolFactoryAbi__factory";
|
|
11
|
+
export { ILendingPoolManagerAbi__factory } from "./ILendingPoolManagerAbi__factory";
|
|
12
|
+
export { ILendingPoolTrancheAbi__factory } from "./ILendingPoolTrancheAbi__factory";
|
|
13
|
+
export { ISystemVariablesAbi__factory } from "./ISystemVariablesAbi__factory";
|
|
14
|
+
export { IUserLoyaltyRewardsAbi__factory } from "./IUserLoyaltyRewardsAbi__factory";
|
|
15
|
+
export { IUserManagerAbi__factory } from "./IUserManagerAbi__factory";
|
|
16
|
+
export { KSULockBonusAbi__factory } from "./KSULockBonusAbi__factory";
|
|
17
|
+
export { KasuPoolExternalTVLAbi__factory } from "./KasuPoolExternalTVLAbi__factory";
|
|
18
|
+
export { SwapperAbi__factory } from "./SwapperAbi__factory";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
export { IClearingCoordinatorAbi__factory } from "./IClearingCoordinatorAbi__factory";
|
|
5
|
+
export { IERC20MetadataAbi__factory } from "./IERC20MetadataAbi__factory";
|
|
6
|
+
export { IFeeManagerAbi__factory } from "./IFeeManagerAbi__factory";
|
|
7
|
+
export { IKSULockingAbi__factory } from "./IKSULockingAbi__factory";
|
|
8
|
+
export { IKasuAllowListAbi__factory } from "./IKasuAllowListAbi__factory";
|
|
9
|
+
export { IKasuControllerAbi__factory } from "./IKasuControllerAbi__factory";
|
|
10
|
+
export { IKasuNFTsAbi__factory } from "./IKasuNFTsAbi__factory";
|
|
11
|
+
export { IKsuPriceAbi__factory } from "./IKsuPriceAbi__factory";
|
|
12
|
+
export { ILendingPoolAbi__factory } from "./ILendingPoolAbi__factory";
|
|
13
|
+
export { ILendingPoolFactoryAbi__factory } from "./ILendingPoolFactoryAbi__factory";
|
|
14
|
+
export { ILendingPoolManagerAbi__factory } from "./ILendingPoolManagerAbi__factory";
|
|
15
|
+
export { ILendingPoolTrancheAbi__factory } from "./ILendingPoolTrancheAbi__factory";
|
|
16
|
+
export { ISystemVariablesAbi__factory } from "./ISystemVariablesAbi__factory";
|
|
17
|
+
export { IUserLoyaltyRewardsAbi__factory } from "./IUserLoyaltyRewardsAbi__factory";
|
|
18
|
+
export { IUserManagerAbi__factory } from "./IUserManagerAbi__factory";
|
|
19
|
+
export { KSULockBonusAbi__factory } from "./KSULockBonusAbi__factory";
|
|
20
|
+
export { KasuPoolExternalTVLAbi__factory } from "./KasuPoolExternalTVLAbi__factory";
|
|
21
|
+
export { SwapperAbi__factory } from "./SwapperAbi__factory";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type { IClearingCoordinatorAbi } from "./IClearingCoordinatorAbi";
|
|
2
|
+
export type { IERC20MetadataAbi } from "./IERC20MetadataAbi";
|
|
3
|
+
export type { IFeeManagerAbi } from "./IFeeManagerAbi";
|
|
4
|
+
export type { IKSULockingAbi } from "./IKSULockingAbi";
|
|
5
|
+
export type { IKasuAllowListAbi } from "./IKasuAllowListAbi";
|
|
6
|
+
export type { IKasuControllerAbi } from "./IKasuControllerAbi";
|
|
7
|
+
export type { IKasuNFTsAbi } from "./IKasuNFTsAbi";
|
|
8
|
+
export type { IKsuPriceAbi } from "./IKsuPriceAbi";
|
|
9
|
+
export type { ILendingPoolAbi } from "./ILendingPoolAbi";
|
|
10
|
+
export type { ILendingPoolFactoryAbi } from "./ILendingPoolFactoryAbi";
|
|
11
|
+
export type { ILendingPoolManagerAbi } from "./ILendingPoolManagerAbi";
|
|
12
|
+
export type { ILendingPoolTrancheAbi } from "./ILendingPoolTrancheAbi";
|
|
13
|
+
export type { ISystemVariablesAbi } from "./ISystemVariablesAbi";
|
|
14
|
+
export type { IUserLoyaltyRewardsAbi } from "./IUserLoyaltyRewardsAbi";
|
|
15
|
+
export type { IUserManagerAbi } from "./IUserManagerAbi";
|
|
16
|
+
export type { KSULockBonusAbi } from "./KSULockBonusAbi";
|
|
17
|
+
export type { KasuPoolExternalTVLAbi } from "./KasuPoolExternalTVLAbi";
|
|
18
|
+
export type { SwapperAbi } from "./SwapperAbi";
|
|
19
|
+
export * as factories from "./factories";
|
|
20
|
+
export { IClearingCoordinatorAbi__factory } from "./factories/IClearingCoordinatorAbi__factory";
|
|
21
|
+
export { IERC20MetadataAbi__factory } from "./factories/IERC20MetadataAbi__factory";
|
|
22
|
+
export { IFeeManagerAbi__factory } from "./factories/IFeeManagerAbi__factory";
|
|
23
|
+
export { IKasuAllowListAbi__factory } from "./factories/IKasuAllowListAbi__factory";
|
|
24
|
+
export { IKasuControllerAbi__factory } from "./factories/IKasuControllerAbi__factory";
|
|
25
|
+
export { IKasuNFTsAbi__factory } from "./factories/IKasuNFTsAbi__factory";
|
|
26
|
+
export { IKSULockingAbi__factory } from "./factories/IKSULockingAbi__factory";
|
|
27
|
+
export { IKsuPriceAbi__factory } from "./factories/IKsuPriceAbi__factory";
|
|
28
|
+
export { ILendingPoolAbi__factory } from "./factories/ILendingPoolAbi__factory";
|
|
29
|
+
export { ILendingPoolFactoryAbi__factory } from "./factories/ILendingPoolFactoryAbi__factory";
|
|
30
|
+
export { ILendingPoolManagerAbi__factory } from "./factories/ILendingPoolManagerAbi__factory";
|
|
31
|
+
export { ILendingPoolTrancheAbi__factory } from "./factories/ILendingPoolTrancheAbi__factory";
|
|
32
|
+
export { ISystemVariablesAbi__factory } from "./factories/ISystemVariablesAbi__factory";
|
|
33
|
+
export { IUserLoyaltyRewardsAbi__factory } from "./factories/IUserLoyaltyRewardsAbi__factory";
|
|
34
|
+
export { IUserManagerAbi__factory } from "./factories/IUserManagerAbi__factory";
|
|
35
|
+
export { KasuPoolExternalTVLAbi__factory } from "./factories/KasuPoolExternalTVLAbi__factory";
|
|
36
|
+
export { KSULockBonusAbi__factory } from "./factories/KSULockBonusAbi__factory";
|
|
37
|
+
export { SwapperAbi__factory } from "./factories/SwapperAbi__factory";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * as factories from "./factories";
|
|
2
|
+
export { IClearingCoordinatorAbi__factory } from "./factories/IClearingCoordinatorAbi__factory";
|
|
3
|
+
export { IERC20MetadataAbi__factory } from "./factories/IERC20MetadataAbi__factory";
|
|
4
|
+
export { IFeeManagerAbi__factory } from "./factories/IFeeManagerAbi__factory";
|
|
5
|
+
export { IKasuAllowListAbi__factory } from "./factories/IKasuAllowListAbi__factory";
|
|
6
|
+
export { IKasuControllerAbi__factory } from "./factories/IKasuControllerAbi__factory";
|
|
7
|
+
export { IKasuNFTsAbi__factory } from "./factories/IKasuNFTsAbi__factory";
|
|
8
|
+
export { IKSULockingAbi__factory } from "./factories/IKSULockingAbi__factory";
|
|
9
|
+
export { IKsuPriceAbi__factory } from "./factories/IKsuPriceAbi__factory";
|
|
10
|
+
export { ILendingPoolAbi__factory } from "./factories/ILendingPoolAbi__factory";
|
|
11
|
+
export { ILendingPoolFactoryAbi__factory } from "./factories/ILendingPoolFactoryAbi__factory";
|
|
12
|
+
export { ILendingPoolManagerAbi__factory } from "./factories/ILendingPoolManagerAbi__factory";
|
|
13
|
+
export { ILendingPoolTrancheAbi__factory } from "./factories/ILendingPoolTrancheAbi__factory";
|
|
14
|
+
export { ISystemVariablesAbi__factory } from "./factories/ISystemVariablesAbi__factory";
|
|
15
|
+
export { IUserLoyaltyRewardsAbi__factory } from "./factories/IUserLoyaltyRewardsAbi__factory";
|
|
16
|
+
export { IUserManagerAbi__factory } from "./factories/IUserManagerAbi__factory";
|
|
17
|
+
export { KasuPoolExternalTVLAbi__factory } from "./factories/KasuPoolExternalTVLAbi__factory";
|
|
18
|
+
export { KSULockBonusAbi__factory } from "./factories/KSULockBonusAbi__factory";
|
|
19
|
+
export { SwapperAbi__factory } from "./factories/SwapperAbi__factory";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Provider } from '@ethersproject/providers';
|
|
2
|
+
import { Signer } from 'ethers';
|
|
3
|
+
import { SdkConfig } from './sdk-config';
|
|
4
|
+
import { DataService } from './services/DataService/data-service';
|
|
5
|
+
import { KSULocking } from './services/Locking/locking';
|
|
6
|
+
import { Portfolio } from './services/Portfolio/portfolio';
|
|
7
|
+
import { Swapper } from './services/Swapper/swapper';
|
|
8
|
+
import { UserLending } from './services/UserLending/user-lending';
|
|
9
|
+
export declare class KasuSdk {
|
|
10
|
+
private readonly _graphClient;
|
|
11
|
+
readonly Locking: KSULocking;
|
|
12
|
+
readonly DataService: DataService;
|
|
13
|
+
readonly UserLending: UserLending;
|
|
14
|
+
readonly Portfolio: Portfolio;
|
|
15
|
+
readonly Swapper: Swapper;
|
|
16
|
+
constructor(config: SdkConfig, signerOrProvider: Provider | Signer);
|
|
17
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GraphQLClient } from 'graphql-request';
|
|
2
|
+
import { DataService } from './services/DataService/data-service';
|
|
3
|
+
import { KSULocking } from './services/Locking/locking';
|
|
4
|
+
import { Portfolio } from './services/Portfolio/portfolio';
|
|
5
|
+
import { Swapper } from './services/Swapper/swapper';
|
|
6
|
+
import { UserLending } from './services/UserLending/user-lending';
|
|
7
|
+
export class KasuSdk {
|
|
8
|
+
constructor(config, signerOrProvider) {
|
|
9
|
+
this._graphClient = new GraphQLClient(config.subgraphUrl);
|
|
10
|
+
this.Locking = new KSULocking(config, signerOrProvider);
|
|
11
|
+
this.UserLending = new UserLending(config, signerOrProvider);
|
|
12
|
+
this.DataService = new DataService(config, signerOrProvider);
|
|
13
|
+
this.Portfolio = new Portfolio(config, signerOrProvider);
|
|
14
|
+
this.Swapper = new Swapper();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ContractAddresses {
|
|
2
|
+
KSUToken: string;
|
|
3
|
+
IKSULocking: string;
|
|
4
|
+
IKSULockBonus: string;
|
|
5
|
+
UserManager: string;
|
|
6
|
+
LendingPoolManager: string;
|
|
7
|
+
KasuAllowList: string;
|
|
8
|
+
SystemVariables: string;
|
|
9
|
+
UserLoyaltyRewards: string;
|
|
10
|
+
KsuPrice: string;
|
|
11
|
+
ClearingCoordinator: string;
|
|
12
|
+
KasuNFTs: string;
|
|
13
|
+
ExternalTVL: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class SdkConfig {
|
|
16
|
+
subgraphUrl: string;
|
|
17
|
+
plumeSubgraphUrl: string;
|
|
18
|
+
contracts: ContractAddresses;
|
|
19
|
+
directusUrl: string;
|
|
20
|
+
UNUSED_LENDING_POOL_IDS: string[];
|
|
21
|
+
constructor(subgraphUrl: string, plumeSubgraphUrl: string, contracts: ContractAddresses, directusUrl: string, UNUSED_LENDING_POOL_IDS: string[]);
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class SdkConfig {
|
|
2
|
+
constructor(subgraphUrl, plumeSubgraphUrl, contracts, directusUrl, UNUSED_LENDING_POOL_IDS) {
|
|
3
|
+
this.subgraphUrl = subgraphUrl;
|
|
4
|
+
this.plumeSubgraphUrl = plumeSubgraphUrl;
|
|
5
|
+
this.contracts = contracts;
|
|
6
|
+
this.directusUrl = directusUrl;
|
|
7
|
+
this.UNUSED_LENDING_POOL_IDS = UNUSED_LENDING_POOL_IDS;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Provider } from '@ethersproject/abstract-provider';
|
|
2
|
+
import { Signer } from 'ethers';
|
|
3
|
+
import { SdkConfig } from '../../sdk-config';
|
|
4
|
+
import { NftBoostDirectus, PlatformOverviewDirectus } from './directus-types';
|
|
5
|
+
import { LendingPoolConfigurationSubgraph, LendingPoolSubgraph } from './subgraph-types';
|
|
6
|
+
import { BadAndDoubtfulDebts, FinancialReportingDocuments, LendingTotals, PoolCreditMetrics, PoolDelegateProfileAndHistory, PoolOverview, PoolRepayment, PoolTranche, RiskManagement } from './types';
|
|
7
|
+
export declare class DataService {
|
|
8
|
+
private _kasuConfig;
|
|
9
|
+
private readonly _graph;
|
|
10
|
+
private readonly _plumeGraph;
|
|
11
|
+
private readonly _externalTvlAbi;
|
|
12
|
+
private readonly _directus;
|
|
13
|
+
private _directusPoolOverview;
|
|
14
|
+
private _plumeTvl;
|
|
15
|
+
constructor(_kasuConfig: SdkConfig, signerOrProvider: Signer | Provider);
|
|
16
|
+
private getUrlFromFile;
|
|
17
|
+
calculatePoolCapacity(poolCapacities: number[], poolCapacityPercentages: number[], index: number, spillOver: number, lendingPoolSubgraph: LendingPoolSubgraph, lendingPoolConfig: LendingPoolConfigurationSubgraph): {
|
|
18
|
+
poolCapacity: number[];
|
|
19
|
+
poolCapacityPercentage: number[];
|
|
20
|
+
};
|
|
21
|
+
calculateApyForTranche(interestRate: string): number;
|
|
22
|
+
getPlatformOverview(): Promise<PlatformOverviewDirectus>;
|
|
23
|
+
getNftBoost(): Promise<Omit<NftBoostDirectus, 'id'>>;
|
|
24
|
+
getOffChainTvl(poolIds: string[]): Promise<Map<string, string>>;
|
|
25
|
+
getPoolOverview(epochId: string, id_in?: string[]): Promise<PoolOverview[]>;
|
|
26
|
+
getPerformanceFee(): Promise<number>;
|
|
27
|
+
getRiskManagement(id_in?: string[]): Promise<RiskManagement[]>;
|
|
28
|
+
getPoolDelegateProfileAndHistory(id_in?: string[]): Promise<PoolDelegateProfileAndHistory[]>;
|
|
29
|
+
getPoolTranches(epochId: string, id_in?: string[]): Promise<PoolTranche[]>;
|
|
30
|
+
getBadAndDoubtfulDebts(id_in?: string[]): Promise<BadAndDoubtfulDebts[]>;
|
|
31
|
+
getPoolCreditMetrics(id_in?: string[]): Promise<PoolCreditMetrics[]>;
|
|
32
|
+
getFinancialReportingDocuments(id_in?: string[]): Promise<FinancialReportingDocuments[]>;
|
|
33
|
+
getRepayments(id_in?: string[]): Promise<PoolRepayment[]>;
|
|
34
|
+
getLendingTotals(poolOverviews: PoolOverview[]): Promise<LendingTotals>;
|
|
35
|
+
calculateCompounding(amount: number, epochInterestRate: number, daysInvested: number, interestFee: number): number[];
|
|
36
|
+
calculateBonusInterestEarnings(earnedAmounts: number[], amount: number, bonusEpochInterest: number): number[];
|
|
37
|
+
}
|