@kasufinance/kasu-sdk 1.0.1 → 1.0.2
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/.github/workflows/ci.yml +39 -0
- package/.github/workflows/main.yml +17 -13
- package/README.md +146 -0
- package/package.json +1 -1
- package/src/contracts/IClearingCoordinatorAbi.ts +0 -406
- package/src/contracts/IERC20MetadataAbi.ts +0 -364
- package/src/contracts/IFeeManagerAbi.ts +0 -182
- package/src/contracts/IKSULockingAbi.ts +0 -965
- package/src/contracts/IKasuAllowListAbi.ts +0 -605
- package/src/contracts/IKasuControllerAbi.ts +0 -703
- package/src/contracts/IKasuNFTsAbi.ts +0 -2744
- package/src/contracts/IKsuPriceAbi.ts +0 -87
- package/src/contracts/ILendingPoolAbi.ts +0 -2081
- package/src/contracts/ILendingPoolFactoryAbi.ts +0 -161
- package/src/contracts/ILendingPoolManagerAbi.ts +0 -1917
- package/src/contracts/ILendingPoolTrancheAbi.ts +0 -1911
- package/src/contracts/ISystemVariablesAbi.ts +0 -908
- package/src/contracts/IUserLoyaltyRewardsAbi.ts +0 -544
- package/src/contracts/IUserManagerAbi.ts +0 -612
- package/src/contracts/KSULockBonusAbi.ts +0 -124
- package/src/contracts/KasuPoolExternalTVLAbi.ts +0 -1071
- package/src/contracts/SwapperAbi.ts +0 -266
- package/src/contracts/common.ts +0 -44
- package/src/contracts/factories/IClearingCoordinatorAbi__factory.ts +0 -438
- package/src/contracts/factories/IERC20MetadataAbi__factory.ts +0 -248
- package/src/contracts/factories/IFeeManagerAbi__factory.ts +0 -90
- package/src/contracts/factories/IKSULockingAbi__factory.ts +0 -778
- package/src/contracts/factories/IKasuAllowListAbi__factory.ts +0 -479
- package/src/contracts/factories/IKasuControllerAbi__factory.ts +0 -447
- package/src/contracts/factories/IKasuNFTsAbi__factory.ts +0 -2116
- package/src/contracts/factories/IKsuPriceAbi__factory.ts +0 -36
- package/src/contracts/factories/ILendingPoolAbi__factory.ts +0 -1455
- package/src/contracts/factories/ILendingPoolFactoryAbi__factory.ts +0 -125
- package/src/contracts/factories/ILendingPoolManagerAbi__factory.ts +0 -1375
- package/src/contracts/factories/ILendingPoolTrancheAbi__factory.ts +0 -1345
- package/src/contracts/factories/ISystemVariablesAbi__factory.ts +0 -455
- package/src/contracts/factories/IUserLoyaltyRewardsAbi__factory.ts +0 -316
- package/src/contracts/factories/IUserManagerAbi__factory.ts +0 -345
- package/src/contracts/factories/KSULockBonusAbi__factory.ts +0 -115
- package/src/contracts/factories/KasuPoolExternalTVLAbi__factory.ts +0 -840
- package/src/contracts/factories/SwapperAbi__factory.ts +0 -167
- package/src/contracts/factories/index.ts +0 -21
- package/src/contracts/index.ts +0 -40
- package/tsconfig.tsbuildinfo +0 -1
- package/versioner.sh +0 -6
package/.github/workflows/ci.yml
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- develop
|
|
8
|
+
pull_request:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
- develop
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
quality-checks:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout repository
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: 20
|
|
27
|
+
cache: npm
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: npm ci
|
|
31
|
+
|
|
32
|
+
- name: Generate contract typings
|
|
33
|
+
run: npm run build-tc
|
|
34
|
+
|
|
35
|
+
- name: Lint & type-check
|
|
36
|
+
run: npm run build
|
|
37
|
+
|
|
38
|
+
- name: Bundle library
|
|
39
|
+
run: npm run rollup-build
|
|
@@ -16,28 +16,32 @@ jobs:
|
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v3
|
|
19
|
-
- name: Get the version
|
|
20
|
-
id: get_version
|
|
21
|
-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
22
19
|
|
|
23
|
-
- name:
|
|
24
|
-
id:
|
|
25
|
-
env:
|
|
26
|
-
IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }}
|
|
20
|
+
- name: Get tag version
|
|
21
|
+
id: tag_version
|
|
27
22
|
run: |
|
|
28
|
-
|
|
29
|
-
echo "
|
|
23
|
+
RAW_TAG="${GITHUB_REF#refs/tags/}"
|
|
24
|
+
echo "TAG_VERSION=${RAW_TAG#v}" >> "$GITHUB_OUTPUT"
|
|
30
25
|
|
|
31
|
-
- name:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
- name: Read package version
|
|
27
|
+
id: package_version
|
|
28
|
+
run: |
|
|
29
|
+
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
30
|
+
echo "PACKAGE_VERSION=$PKG_VERSION" >> "$GITHUB_OUTPUT"
|
|
31
|
+
|
|
32
|
+
- name: Ensure tag matches package.json
|
|
33
|
+
run: |
|
|
34
|
+
if [ "${{ steps.tag_version.outputs.TAG_VERSION }}" != "${{ steps.package_version.outputs.PACKAGE_VERSION }}" ]; then
|
|
35
|
+
echo "Tag version ${{ steps.tag_version.outputs.TAG_VERSION }} does not match package.json version ${{ steps.package_version.outputs.PACKAGE_VERSION }}."
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
35
38
|
|
|
36
39
|
- uses: actions/setup-node@v3
|
|
37
40
|
with:
|
|
38
41
|
node-version: 18
|
|
39
42
|
registry-url: https://registry.npmjs.org/
|
|
40
43
|
scope: '@kasufinance'
|
|
44
|
+
|
|
41
45
|
- run: npm install && npm run build-tc && npm run build && npm run rollup-build && npm publish
|
|
42
46
|
env:
|
|
43
47
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Kasu SDK
|
|
2
|
+
|
|
3
|
+
`@kasufinance/kasu-sdk` is the shared TypeScript/JavaScript toolkit used by Kasu
|
|
4
|
+
frontends to interact with the Kasu protocol. It wraps the core smart
|
|
5
|
+
contracts, subgraphs, and Directus CMS in a single object so that dapps can
|
|
6
|
+
query pool data, compute portfolio statistics, and submit locking or lending
|
|
7
|
+
transactions without re-implementing the plumbing.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @kasufinance/kasu-sdk
|
|
13
|
+
# or
|
|
14
|
+
yarn add @kasufinance/kasu-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The SDK is built against `ethers@5`, so make sure your project already depends
|
|
18
|
+
on it (or install it alongside the SDK).
|
|
19
|
+
|
|
20
|
+
## Runtime requirements
|
|
21
|
+
|
|
22
|
+
- **Node or browser environment with fetch/XHR** – when using the SDK on the
|
|
23
|
+
server (Next.js `app` router actions, serverless functions, etc.) you must
|
|
24
|
+
provide an XHR implementation because Directus uses it under the hood:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
// server.ts
|
|
28
|
+
import { XMLHttpRequest } from 'xhr2';
|
|
29
|
+
global.XMLHttpRequest = XMLHttpRequest;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- **Provider/Signer** – pass an `ethers` `Signer` for write actions or a
|
|
33
|
+
`Provider` for read-only usage. The SDK does not create its own provider,
|
|
34
|
+
so you are free to reuse whatever the dapp already uses.
|
|
35
|
+
|
|
36
|
+
## Configuring the SDK
|
|
37
|
+
|
|
38
|
+
The `SdkConfig` object wires the SDK to the right contracts and backends:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
42
|
+
import { KasuSdk, SdkConfig } from '@kasufinance/kasu-sdk';
|
|
43
|
+
import { XMLHttpRequest } from 'xhr2';
|
|
44
|
+
|
|
45
|
+
global.XMLHttpRequest = XMLHttpRequest; // required on Node runtimes
|
|
46
|
+
|
|
47
|
+
const provider = new JsonRpcProvider(process.env.RPC_URL!, { skipFetchSetup: true });
|
|
48
|
+
|
|
49
|
+
const config: SdkConfig = {
|
|
50
|
+
contracts: {
|
|
51
|
+
KSUToken: '0x…',
|
|
52
|
+
IKSULocking: '0x…',
|
|
53
|
+
IKSULockBonus: '0x…',
|
|
54
|
+
UserManager: '0x…',
|
|
55
|
+
LendingPoolManager: '0x…',
|
|
56
|
+
KasuAllowList: '0x…',
|
|
57
|
+
SystemVariables: '0x…',
|
|
58
|
+
UserLoyaltyRewards: '0x…',
|
|
59
|
+
KsuPrice: '0x…',
|
|
60
|
+
ClearingCoordinator: '0x…',
|
|
61
|
+
KasuNFTs: '0x…',
|
|
62
|
+
ExternalTVL: '0x…',
|
|
63
|
+
},
|
|
64
|
+
// If certain pools should be hidden from users, provide their ids. Empty string
|
|
65
|
+
// keeps the Graph queries happy when nothing is filtered out.
|
|
66
|
+
UNUSED_LENDING_POOL_IDS: [''],
|
|
67
|
+
directusUrl: 'https://kasu-finance.directus.app/',
|
|
68
|
+
subgraphUrl: 'https://subgraph.satsuma-prod.com/.../api',
|
|
69
|
+
plumeSubgraphUrl: 'https://api.goldsky.com/.../kasu-plume/prod/gn',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const kasuSdk = new KasuSdk(config, provider);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
See `kasu-fe-next/src/config/sdk` in the Kasu frontend repository for full
|
|
76
|
+
mainnet and testnet examples, including how Kasu fetches unused pool ids before
|
|
77
|
+
instantiating the SDK.
|
|
78
|
+
|
|
79
|
+
## Quick start
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
83
|
+
import { KasuSdk } from '@kasufinance/kasu-sdk';
|
|
84
|
+
|
|
85
|
+
const provider = new JsonRpcProvider(RPC_URL);
|
|
86
|
+
const sdk = new KasuSdk(config, provider);
|
|
87
|
+
|
|
88
|
+
const pools = await sdk.DataService.getPoolOverview(currentEpochId);
|
|
89
|
+
const lockingPeriods = await sdk.Locking.getLockPeriods();
|
|
90
|
+
const userSummary = await sdk.Portfolio.getPortfolioSummary(userAddress);
|
|
91
|
+
await sdk.Locking.lockKSUTokens(amountBn, lockPeriodBn); // signer required
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The SDK exposes services as properties on `KasuSdk`. Each service contains the
|
|
95
|
+
methods for a single protocol facet:
|
|
96
|
+
|
|
97
|
+
| Service | Purpose |
|
|
98
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
99
|
+
| `DataService` | Aggregates on-chain data (subgraphs/external TVL) and off-chain content from Directus (pool descriptions, KPIs). |
|
|
100
|
+
| `Locking` | High-level helpers for KSU locking: read locking periods, calculate projected rewards, lock/unlock, claim fees. |
|
|
101
|
+
| `UserLending` | User-centric lending utilities (deposit/withdraw requests, transaction history, CSV builders). |
|
|
102
|
+
| `Portfolio` | Portfolio snapshots: balances, rewards, lending totals, APY calculations. |
|
|
103
|
+
| `Swapper` | Helpers for contract calls through the on-chain swapper. |
|
|
104
|
+
|
|
105
|
+
Every method is fully typed, so your editor can discover the shape of responses
|
|
106
|
+
(`PoolOverview`, `LockPeriod`, `PortfolioRewards`, etc.) without digging into
|
|
107
|
+
the implementation.
|
|
108
|
+
|
|
109
|
+
### Working with pool filters
|
|
110
|
+
|
|
111
|
+
Many queries accept a list of pool ids to ignore (see `UNUSED_LENDING_POOL_IDS`
|
|
112
|
+
in the config). In the Kasu frontend we load this list from Directus before
|
|
113
|
+
creating the SDK:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
const unusedPools = await getUnusedPools(); // fetches Directus list
|
|
117
|
+
const sdk = new KasuSdk(
|
|
118
|
+
{ ...config, UNUSED_LENDING_POOL_IDS: unusedPools.length ? unusedPools : [''] },
|
|
119
|
+
provider,
|
|
120
|
+
);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Mirroring this pattern keeps your subgraph requests aligned with the official
|
|
124
|
+
UI and prevents deprecated pools from leaking into calculations.
|
|
125
|
+
|
|
126
|
+
## Building & testing locally
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm install
|
|
130
|
+
npm run build-tc # regenerate typechain factories
|
|
131
|
+
npm run build # type-check + compile
|
|
132
|
+
npm run rollup-build
|
|
133
|
+
npm test
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
These are the same steps executed by the release workflow before publishing to
|
|
137
|
+
npm.
|
|
138
|
+
|
|
139
|
+
## Support
|
|
140
|
+
For questions, issues, or contributions:
|
|
141
|
+
- GitHub Issues: [Create an issue](https://github.com/kasufinance/kasu-sdk/issues)
|
|
142
|
+
- Documentation: [View full docs](https://docs.kasu.finance)
|
|
143
|
+
- Discord: [Join our community](https://discord.gg/kasufinance)
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
package/package.json
CHANGED
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
/* Autogenerated file. Do not edit manually. */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
import type {
|
|
5
|
-
BaseContract,
|
|
6
|
-
BigNumber,
|
|
7
|
-
BigNumberish,
|
|
8
|
-
BytesLike,
|
|
9
|
-
CallOverrides,
|
|
10
|
-
ContractTransaction,
|
|
11
|
-
Overrides,
|
|
12
|
-
PopulatedTransaction,
|
|
13
|
-
Signer,
|
|
14
|
-
utils,
|
|
15
|
-
} from "ethers";
|
|
16
|
-
import type {
|
|
17
|
-
FunctionFragment,
|
|
18
|
-
Result,
|
|
19
|
-
EventFragment,
|
|
20
|
-
} from "@ethersproject/abi";
|
|
21
|
-
import type { Listener, Provider } from "@ethersproject/providers";
|
|
22
|
-
import type {
|
|
23
|
-
TypedEventFilter,
|
|
24
|
-
TypedEvent,
|
|
25
|
-
TypedListener,
|
|
26
|
-
OnEvent,
|
|
27
|
-
} from "./common";
|
|
28
|
-
|
|
29
|
-
export type ClearingConfigurationStruct = {
|
|
30
|
-
drawAmount: BigNumberish;
|
|
31
|
-
trancheDesiredRatios: BigNumberish[];
|
|
32
|
-
maxExcessPercentage: BigNumberish;
|
|
33
|
-
minExcessPercentage: BigNumberish;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type ClearingConfigurationStructOutput = [
|
|
37
|
-
BigNumber,
|
|
38
|
-
BigNumber[],
|
|
39
|
-
BigNumber,
|
|
40
|
-
BigNumber
|
|
41
|
-
] & {
|
|
42
|
-
drawAmount: BigNumber;
|
|
43
|
-
trancheDesiredRatios: BigNumber[];
|
|
44
|
-
maxExcessPercentage: BigNumber;
|
|
45
|
-
minExcessPercentage: BigNumber;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export interface IClearingCoordinatorAbiInterface extends utils.Interface {
|
|
49
|
-
functions: {
|
|
50
|
-
"doClearing(address,uint256,uint256,uint256,(uint256,uint256[],uint256,uint256),bool)": FunctionFragment;
|
|
51
|
-
"initializeLendingPool(address)": FunctionFragment;
|
|
52
|
-
"isLendingPoolClearingPending(address)": FunctionFragment;
|
|
53
|
-
"lendingPoolClearingStatus(address,uint256)": FunctionFragment;
|
|
54
|
-
"lendingPoolMaxDrawAmount(address)": FunctionFragment;
|
|
55
|
-
"nextLendingPoolClearingEpoch(address)": FunctionFragment;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
getFunction(
|
|
59
|
-
nameOrSignatureOrTopic:
|
|
60
|
-
| "doClearing"
|
|
61
|
-
| "initializeLendingPool"
|
|
62
|
-
| "isLendingPoolClearingPending"
|
|
63
|
-
| "lendingPoolClearingStatus"
|
|
64
|
-
| "lendingPoolMaxDrawAmount"
|
|
65
|
-
| "nextLendingPoolClearingEpoch"
|
|
66
|
-
): FunctionFragment;
|
|
67
|
-
|
|
68
|
-
encodeFunctionData(
|
|
69
|
-
functionFragment: "doClearing",
|
|
70
|
-
values: [
|
|
71
|
-
string,
|
|
72
|
-
BigNumberish,
|
|
73
|
-
BigNumberish,
|
|
74
|
-
BigNumberish,
|
|
75
|
-
ClearingConfigurationStruct,
|
|
76
|
-
boolean
|
|
77
|
-
]
|
|
78
|
-
): string;
|
|
79
|
-
encodeFunctionData(
|
|
80
|
-
functionFragment: "initializeLendingPool",
|
|
81
|
-
values: [string]
|
|
82
|
-
): string;
|
|
83
|
-
encodeFunctionData(
|
|
84
|
-
functionFragment: "isLendingPoolClearingPending",
|
|
85
|
-
values: [string]
|
|
86
|
-
): string;
|
|
87
|
-
encodeFunctionData(
|
|
88
|
-
functionFragment: "lendingPoolClearingStatus",
|
|
89
|
-
values: [string, BigNumberish]
|
|
90
|
-
): string;
|
|
91
|
-
encodeFunctionData(
|
|
92
|
-
functionFragment: "lendingPoolMaxDrawAmount",
|
|
93
|
-
values: [string]
|
|
94
|
-
): string;
|
|
95
|
-
encodeFunctionData(
|
|
96
|
-
functionFragment: "nextLendingPoolClearingEpoch",
|
|
97
|
-
values: [string]
|
|
98
|
-
): string;
|
|
99
|
-
|
|
100
|
-
decodeFunctionResult(functionFragment: "doClearing", data: BytesLike): Result;
|
|
101
|
-
decodeFunctionResult(
|
|
102
|
-
functionFragment: "initializeLendingPool",
|
|
103
|
-
data: BytesLike
|
|
104
|
-
): Result;
|
|
105
|
-
decodeFunctionResult(
|
|
106
|
-
functionFragment: "isLendingPoolClearingPending",
|
|
107
|
-
data: BytesLike
|
|
108
|
-
): Result;
|
|
109
|
-
decodeFunctionResult(
|
|
110
|
-
functionFragment: "lendingPoolClearingStatus",
|
|
111
|
-
data: BytesLike
|
|
112
|
-
): Result;
|
|
113
|
-
decodeFunctionResult(
|
|
114
|
-
functionFragment: "lendingPoolMaxDrawAmount",
|
|
115
|
-
data: BytesLike
|
|
116
|
-
): Result;
|
|
117
|
-
decodeFunctionResult(
|
|
118
|
-
functionFragment: "nextLendingPoolClearingEpoch",
|
|
119
|
-
data: BytesLike
|
|
120
|
-
): Result;
|
|
121
|
-
|
|
122
|
-
events: {
|
|
123
|
-
"ClearingConfigSet(address,uint256,(uint256,uint256[],uint256,uint256))": EventFragment;
|
|
124
|
-
"ClearingExecuted(address,uint256,uint8)": EventFragment;
|
|
125
|
-
"Initialized(uint64)": EventFragment;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
getEvent(nameOrSignatureOrTopic: "ClearingConfigSet"): EventFragment;
|
|
129
|
-
getEvent(nameOrSignatureOrTopic: "ClearingExecuted"): EventFragment;
|
|
130
|
-
getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface ClearingConfigSetEventObject {
|
|
134
|
-
lendingPool: string;
|
|
135
|
-
epoch: BigNumber;
|
|
136
|
-
clearingConfig: ClearingConfigurationStructOutput;
|
|
137
|
-
}
|
|
138
|
-
export type ClearingConfigSetEvent = TypedEvent<
|
|
139
|
-
[string, BigNumber, ClearingConfigurationStructOutput],
|
|
140
|
-
ClearingConfigSetEventObject
|
|
141
|
-
>;
|
|
142
|
-
|
|
143
|
-
export type ClearingConfigSetEventFilter =
|
|
144
|
-
TypedEventFilter<ClearingConfigSetEvent>;
|
|
145
|
-
|
|
146
|
-
export interface ClearingExecutedEventObject {
|
|
147
|
-
lendingPool: string;
|
|
148
|
-
epoch: BigNumber;
|
|
149
|
-
clearingStatus: number;
|
|
150
|
-
}
|
|
151
|
-
export type ClearingExecutedEvent = TypedEvent<
|
|
152
|
-
[string, BigNumber, number],
|
|
153
|
-
ClearingExecutedEventObject
|
|
154
|
-
>;
|
|
155
|
-
|
|
156
|
-
export type ClearingExecutedEventFilter =
|
|
157
|
-
TypedEventFilter<ClearingExecutedEvent>;
|
|
158
|
-
|
|
159
|
-
export interface InitializedEventObject {
|
|
160
|
-
version: BigNumber;
|
|
161
|
-
}
|
|
162
|
-
export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>;
|
|
163
|
-
|
|
164
|
-
export type InitializedEventFilter = TypedEventFilter<InitializedEvent>;
|
|
165
|
-
|
|
166
|
-
export interface IClearingCoordinatorAbi extends BaseContract {
|
|
167
|
-
connect(signerOrProvider: Signer | Provider | string): this;
|
|
168
|
-
attach(addressOrName: string): this;
|
|
169
|
-
deployed(): Promise<this>;
|
|
170
|
-
|
|
171
|
-
interface: IClearingCoordinatorAbiInterface;
|
|
172
|
-
|
|
173
|
-
queryFilter<TEvent extends TypedEvent>(
|
|
174
|
-
event: TypedEventFilter<TEvent>,
|
|
175
|
-
fromBlockOrBlockhash?: string | number | undefined,
|
|
176
|
-
toBlock?: string | number | undefined
|
|
177
|
-
): Promise<Array<TEvent>>;
|
|
178
|
-
|
|
179
|
-
listeners<TEvent extends TypedEvent>(
|
|
180
|
-
eventFilter?: TypedEventFilter<TEvent>
|
|
181
|
-
): Array<TypedListener<TEvent>>;
|
|
182
|
-
listeners(eventName?: string): Array<Listener>;
|
|
183
|
-
removeAllListeners<TEvent extends TypedEvent>(
|
|
184
|
-
eventFilter: TypedEventFilter<TEvent>
|
|
185
|
-
): this;
|
|
186
|
-
removeAllListeners(eventName?: string): this;
|
|
187
|
-
off: OnEvent<this>;
|
|
188
|
-
on: OnEvent<this>;
|
|
189
|
-
once: OnEvent<this>;
|
|
190
|
-
removeListener: OnEvent<this>;
|
|
191
|
-
|
|
192
|
-
functions: {
|
|
193
|
-
doClearing(
|
|
194
|
-
lendingPool: string,
|
|
195
|
-
targetEpoch: BigNumberish,
|
|
196
|
-
priorityCalculationBatchSize: BigNumberish,
|
|
197
|
-
acceptRequestsBatchSize: BigNumberish,
|
|
198
|
-
clearingConfig: ClearingConfigurationStruct,
|
|
199
|
-
isConfigOverridden: boolean,
|
|
200
|
-
overrides?: Overrides & { from?: string }
|
|
201
|
-
): Promise<ContractTransaction>;
|
|
202
|
-
|
|
203
|
-
initializeLendingPool(
|
|
204
|
-
lendingPool: string,
|
|
205
|
-
overrides?: Overrides & { from?: string }
|
|
206
|
-
): Promise<ContractTransaction>;
|
|
207
|
-
|
|
208
|
-
isLendingPoolClearingPending(
|
|
209
|
-
lendingPool: string,
|
|
210
|
-
overrides?: CallOverrides
|
|
211
|
-
): Promise<[boolean] & { isPending: boolean }>;
|
|
212
|
-
|
|
213
|
-
lendingPoolClearingStatus(
|
|
214
|
-
lendingPool: string,
|
|
215
|
-
epoch: BigNumberish,
|
|
216
|
-
overrides?: CallOverrides
|
|
217
|
-
): Promise<[number] & { status: number }>;
|
|
218
|
-
|
|
219
|
-
lendingPoolMaxDrawAmount(
|
|
220
|
-
lendingPool: string,
|
|
221
|
-
overrides?: CallOverrides
|
|
222
|
-
): Promise<[BigNumber]>;
|
|
223
|
-
|
|
224
|
-
nextLendingPoolClearingEpoch(
|
|
225
|
-
lendingPool: string,
|
|
226
|
-
overrides?: CallOverrides
|
|
227
|
-
): Promise<[BigNumber] & { nextClearingEpoch: BigNumber }>;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
doClearing(
|
|
231
|
-
lendingPool: string,
|
|
232
|
-
targetEpoch: BigNumberish,
|
|
233
|
-
priorityCalculationBatchSize: BigNumberish,
|
|
234
|
-
acceptRequestsBatchSize: BigNumberish,
|
|
235
|
-
clearingConfig: ClearingConfigurationStruct,
|
|
236
|
-
isConfigOverridden: boolean,
|
|
237
|
-
overrides?: Overrides & { from?: string }
|
|
238
|
-
): Promise<ContractTransaction>;
|
|
239
|
-
|
|
240
|
-
initializeLendingPool(
|
|
241
|
-
lendingPool: string,
|
|
242
|
-
overrides?: Overrides & { from?: string }
|
|
243
|
-
): Promise<ContractTransaction>;
|
|
244
|
-
|
|
245
|
-
isLendingPoolClearingPending(
|
|
246
|
-
lendingPool: string,
|
|
247
|
-
overrides?: CallOverrides
|
|
248
|
-
): Promise<boolean>;
|
|
249
|
-
|
|
250
|
-
lendingPoolClearingStatus(
|
|
251
|
-
lendingPool: string,
|
|
252
|
-
epoch: BigNumberish,
|
|
253
|
-
overrides?: CallOverrides
|
|
254
|
-
): Promise<number>;
|
|
255
|
-
|
|
256
|
-
lendingPoolMaxDrawAmount(
|
|
257
|
-
lendingPool: string,
|
|
258
|
-
overrides?: CallOverrides
|
|
259
|
-
): Promise<BigNumber>;
|
|
260
|
-
|
|
261
|
-
nextLendingPoolClearingEpoch(
|
|
262
|
-
lendingPool: string,
|
|
263
|
-
overrides?: CallOverrides
|
|
264
|
-
): Promise<BigNumber>;
|
|
265
|
-
|
|
266
|
-
callStatic: {
|
|
267
|
-
doClearing(
|
|
268
|
-
lendingPool: string,
|
|
269
|
-
targetEpoch: BigNumberish,
|
|
270
|
-
priorityCalculationBatchSize: BigNumberish,
|
|
271
|
-
acceptRequestsBatchSize: BigNumberish,
|
|
272
|
-
clearingConfig: ClearingConfigurationStruct,
|
|
273
|
-
isConfigOverridden: boolean,
|
|
274
|
-
overrides?: CallOverrides
|
|
275
|
-
): Promise<void>;
|
|
276
|
-
|
|
277
|
-
initializeLendingPool(
|
|
278
|
-
lendingPool: string,
|
|
279
|
-
overrides?: CallOverrides
|
|
280
|
-
): Promise<void>;
|
|
281
|
-
|
|
282
|
-
isLendingPoolClearingPending(
|
|
283
|
-
lendingPool: string,
|
|
284
|
-
overrides?: CallOverrides
|
|
285
|
-
): Promise<boolean>;
|
|
286
|
-
|
|
287
|
-
lendingPoolClearingStatus(
|
|
288
|
-
lendingPool: string,
|
|
289
|
-
epoch: BigNumberish,
|
|
290
|
-
overrides?: CallOverrides
|
|
291
|
-
): Promise<number>;
|
|
292
|
-
|
|
293
|
-
lendingPoolMaxDrawAmount(
|
|
294
|
-
lendingPool: string,
|
|
295
|
-
overrides?: CallOverrides
|
|
296
|
-
): Promise<BigNumber>;
|
|
297
|
-
|
|
298
|
-
nextLendingPoolClearingEpoch(
|
|
299
|
-
lendingPool: string,
|
|
300
|
-
overrides?: CallOverrides
|
|
301
|
-
): Promise<BigNumber>;
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
filters: {
|
|
305
|
-
"ClearingConfigSet(address,uint256,(uint256,uint256[],uint256,uint256))"(
|
|
306
|
-
lendingPool?: string | null,
|
|
307
|
-
epoch?: BigNumberish | null,
|
|
308
|
-
clearingConfig?: null
|
|
309
|
-
): ClearingConfigSetEventFilter;
|
|
310
|
-
ClearingConfigSet(
|
|
311
|
-
lendingPool?: string | null,
|
|
312
|
-
epoch?: BigNumberish | null,
|
|
313
|
-
clearingConfig?: null
|
|
314
|
-
): ClearingConfigSetEventFilter;
|
|
315
|
-
|
|
316
|
-
"ClearingExecuted(address,uint256,uint8)"(
|
|
317
|
-
lendingPool?: string | null,
|
|
318
|
-
epoch?: BigNumberish | null,
|
|
319
|
-
clearingStatus?: null
|
|
320
|
-
): ClearingExecutedEventFilter;
|
|
321
|
-
ClearingExecuted(
|
|
322
|
-
lendingPool?: string | null,
|
|
323
|
-
epoch?: BigNumberish | null,
|
|
324
|
-
clearingStatus?: null
|
|
325
|
-
): ClearingExecutedEventFilter;
|
|
326
|
-
|
|
327
|
-
"Initialized(uint64)"(version?: null): InitializedEventFilter;
|
|
328
|
-
Initialized(version?: null): InitializedEventFilter;
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
estimateGas: {
|
|
332
|
-
doClearing(
|
|
333
|
-
lendingPool: string,
|
|
334
|
-
targetEpoch: BigNumberish,
|
|
335
|
-
priorityCalculationBatchSize: BigNumberish,
|
|
336
|
-
acceptRequestsBatchSize: BigNumberish,
|
|
337
|
-
clearingConfig: ClearingConfigurationStruct,
|
|
338
|
-
isConfigOverridden: boolean,
|
|
339
|
-
overrides?: Overrides & { from?: string }
|
|
340
|
-
): Promise<BigNumber>;
|
|
341
|
-
|
|
342
|
-
initializeLendingPool(
|
|
343
|
-
lendingPool: string,
|
|
344
|
-
overrides?: Overrides & { from?: string }
|
|
345
|
-
): Promise<BigNumber>;
|
|
346
|
-
|
|
347
|
-
isLendingPoolClearingPending(
|
|
348
|
-
lendingPool: string,
|
|
349
|
-
overrides?: CallOverrides
|
|
350
|
-
): Promise<BigNumber>;
|
|
351
|
-
|
|
352
|
-
lendingPoolClearingStatus(
|
|
353
|
-
lendingPool: string,
|
|
354
|
-
epoch: BigNumberish,
|
|
355
|
-
overrides?: CallOverrides
|
|
356
|
-
): Promise<BigNumber>;
|
|
357
|
-
|
|
358
|
-
lendingPoolMaxDrawAmount(
|
|
359
|
-
lendingPool: string,
|
|
360
|
-
overrides?: CallOverrides
|
|
361
|
-
): Promise<BigNumber>;
|
|
362
|
-
|
|
363
|
-
nextLendingPoolClearingEpoch(
|
|
364
|
-
lendingPool: string,
|
|
365
|
-
overrides?: CallOverrides
|
|
366
|
-
): Promise<BigNumber>;
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
populateTransaction: {
|
|
370
|
-
doClearing(
|
|
371
|
-
lendingPool: string,
|
|
372
|
-
targetEpoch: BigNumberish,
|
|
373
|
-
priorityCalculationBatchSize: BigNumberish,
|
|
374
|
-
acceptRequestsBatchSize: BigNumberish,
|
|
375
|
-
clearingConfig: ClearingConfigurationStruct,
|
|
376
|
-
isConfigOverridden: boolean,
|
|
377
|
-
overrides?: Overrides & { from?: string }
|
|
378
|
-
): Promise<PopulatedTransaction>;
|
|
379
|
-
|
|
380
|
-
initializeLendingPool(
|
|
381
|
-
lendingPool: string,
|
|
382
|
-
overrides?: Overrides & { from?: string }
|
|
383
|
-
): Promise<PopulatedTransaction>;
|
|
384
|
-
|
|
385
|
-
isLendingPoolClearingPending(
|
|
386
|
-
lendingPool: string,
|
|
387
|
-
overrides?: CallOverrides
|
|
388
|
-
): Promise<PopulatedTransaction>;
|
|
389
|
-
|
|
390
|
-
lendingPoolClearingStatus(
|
|
391
|
-
lendingPool: string,
|
|
392
|
-
epoch: BigNumberish,
|
|
393
|
-
overrides?: CallOverrides
|
|
394
|
-
): Promise<PopulatedTransaction>;
|
|
395
|
-
|
|
396
|
-
lendingPoolMaxDrawAmount(
|
|
397
|
-
lendingPool: string,
|
|
398
|
-
overrides?: CallOverrides
|
|
399
|
-
): Promise<PopulatedTransaction>;
|
|
400
|
-
|
|
401
|
-
nextLendingPoolClearingEpoch(
|
|
402
|
-
lendingPool: string,
|
|
403
|
-
overrides?: CallOverrides
|
|
404
|
-
): Promise<PopulatedTransaction>;
|
|
405
|
-
};
|
|
406
|
-
}
|