@underscore-finance/sdk 1.2.1 → 1.2.3
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/index.d.ts +64 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,11 +5,41 @@ import { SDK } from './contracts/sdk.js';
|
|
|
5
5
|
export * from './contracts/index.js';
|
|
6
6
|
export type Contracts = SDK;
|
|
7
7
|
export type ContractsNames = keyof typeof CONTRACTS;
|
|
8
|
-
|
|
8
|
+
export declare const DEPARTMENT_IDS: {
|
|
9
|
+
LEDGER: bigint;
|
|
10
|
+
MISSION_CONTROL: bigint;
|
|
11
|
+
LEGO_BOOK: bigint;
|
|
12
|
+
SWITCHBOARD: bigint;
|
|
13
|
+
HATCHERY: bigint;
|
|
14
|
+
LOOT_DISTRIBUTOR: bigint;
|
|
15
|
+
APPRAISER: bigint;
|
|
16
|
+
WALLET_BACKPACK: bigint;
|
|
17
|
+
BILLING: bigint;
|
|
18
|
+
VAULT_REGISTRY: bigint;
|
|
19
|
+
};
|
|
20
|
+
export declare const LEGOS_IDS: {
|
|
21
|
+
RIPE: bigint;
|
|
22
|
+
AAVE_V3: bigint;
|
|
23
|
+
COMPOUND_V3: bigint;
|
|
24
|
+
EULER: bigint;
|
|
25
|
+
FLUID: bigint;
|
|
26
|
+
MOONWELL: bigint;
|
|
27
|
+
MORPHO: bigint;
|
|
28
|
+
AERO_CLASSIC: bigint;
|
|
29
|
+
AERO_SLIPSTREAM: bigint;
|
|
30
|
+
CURVE: bigint;
|
|
31
|
+
UNISWAP_V2: bigint;
|
|
32
|
+
UNISWAP_V3: bigint;
|
|
33
|
+
UNDERSCORE: bigint;
|
|
34
|
+
FORTY_ACRES: bigint;
|
|
35
|
+
WASABI: bigint;
|
|
36
|
+
AVANTIS: bigint;
|
|
37
|
+
};
|
|
38
|
+
export type UnderscoreConfig = {
|
|
9
39
|
rpcUrl?: string;
|
|
10
40
|
publicClient?: PublicClient;
|
|
11
41
|
walletClient?: WalletClient;
|
|
12
|
-
}
|
|
42
|
+
};
|
|
13
43
|
declare class Underscore {
|
|
14
44
|
publicClient: PublicClient;
|
|
15
45
|
walletClient: WalletClient | undefined;
|
|
@@ -17,10 +47,10 @@ declare class Underscore {
|
|
|
17
47
|
constructor(config?: UnderscoreConfig);
|
|
18
48
|
setWalletClient(walletClient: WalletClient): void;
|
|
19
49
|
setPublicClient(publicClient: PublicClient): void;
|
|
20
|
-
multicall<T extends RequestCollection>(cb: (contracts:
|
|
50
|
+
multicall<T extends RequestCollection>(cb: (contracts: typeof CONTRACTS) => T, options?: {
|
|
21
51
|
blockNumber?: bigint;
|
|
22
52
|
}): Promise<{ [K in keyof T]: NonNullable<T[K]["defaultValue"]>; }>;
|
|
23
|
-
iterate<T>(cb: (contracts:
|
|
53
|
+
iterate<T>(cb: (contracts: typeof CONTRACTS) => {
|
|
24
54
|
total: bigint;
|
|
25
55
|
getItem: GetItemCallFunction<T>;
|
|
26
56
|
}, options?: {
|
|
@@ -57,6 +87,36 @@ declare class Underscore {
|
|
|
57
87
|
tokenPath: `0x${string}`[];
|
|
58
88
|
poolPath: `0x${string}`[];
|
|
59
89
|
}[]>;
|
|
90
|
+
DEPARTMENT_IDS: {
|
|
91
|
+
LEDGER: bigint;
|
|
92
|
+
MISSION_CONTROL: bigint;
|
|
93
|
+
LEGO_BOOK: bigint;
|
|
94
|
+
SWITCHBOARD: bigint;
|
|
95
|
+
HATCHERY: bigint;
|
|
96
|
+
LOOT_DISTRIBUTOR: bigint;
|
|
97
|
+
APPRAISER: bigint;
|
|
98
|
+
WALLET_BACKPACK: bigint;
|
|
99
|
+
BILLING: bigint;
|
|
100
|
+
VAULT_REGISTRY: bigint;
|
|
101
|
+
};
|
|
102
|
+
LEGOS_IDS: {
|
|
103
|
+
RIPE: bigint;
|
|
104
|
+
AAVE_V3: bigint;
|
|
105
|
+
COMPOUND_V3: bigint;
|
|
106
|
+
EULER: bigint;
|
|
107
|
+
FLUID: bigint;
|
|
108
|
+
MOONWELL: bigint;
|
|
109
|
+
MORPHO: bigint;
|
|
110
|
+
AERO_CLASSIC: bigint;
|
|
111
|
+
AERO_SLIPSTREAM: bigint;
|
|
112
|
+
CURVE: bigint;
|
|
113
|
+
UNISWAP_V2: bigint;
|
|
114
|
+
UNISWAP_V3: bigint;
|
|
115
|
+
UNDERSCORE: bigint;
|
|
116
|
+
FORTY_ACRES: bigint;
|
|
117
|
+
WASABI: bigint;
|
|
118
|
+
AVANTIS: bigint;
|
|
119
|
+
};
|
|
60
120
|
}
|
|
61
121
|
export default Underscore;
|
|
62
122
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAwB,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC5F,OAAO,EAAE,OAAO,EAA4B,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGpF,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAkB,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAEnD,cAAc,sBAAsB,CAAA;AAEpC,MAAM,MAAM,SAAS,GAAG,GAAG,CAAA;AAC3B,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,SAAS,CAAA;AAEnD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAwB,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC5F,OAAO,EAAE,OAAO,EAA4B,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGpF,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAkB,EAAE,GAAG,E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C,EAAE,MAAM,EAAE,CAAA;KAC1B;;;;;;;IAIK,2BAA2B,CAAC,OAAO,EAAE;QACzC,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,OAAO,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,iBAAiB,EAAE,MAAM,CAAA;QACzB,QAAQ,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAC1B;;;;;;;IAID,cAAc;;;;;;;;;;;MAAiB;IAE/B,SAAS;;;;;;;;;;;;;;;;;MAAY;CACtB;AAED,eAAe,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,44 @@
|
|
|
1
1
|
import { iteratorQuery, query } from '@dappql/async';
|
|
2
2
|
import { createPublicClient, http } from 'viem';
|
|
3
3
|
import { base } from 'viem/chains';
|
|
4
|
+
import * as CONTRACTS from './contracts/index.js';
|
|
4
5
|
import createSdk from './contracts/sdk.js';
|
|
5
6
|
import { getSwapInstructionsAmountIn, getSwapInstructionsAmountOut } from './getSwapInstructions.js';
|
|
6
7
|
export * from './contracts/index.js';
|
|
8
|
+
export const DEPARTMENT_IDS = {
|
|
9
|
+
LEDGER: 1n,
|
|
10
|
+
MISSION_CONTROL: 2n,
|
|
11
|
+
LEGO_BOOK: 3n,
|
|
12
|
+
SWITCHBOARD: 4n,
|
|
13
|
+
HATCHERY: 5n,
|
|
14
|
+
LOOT_DISTRIBUTOR: 6n,
|
|
15
|
+
APPRAISER: 7n,
|
|
16
|
+
WALLET_BACKPACK: 8n,
|
|
17
|
+
BILLING: 9n,
|
|
18
|
+
VAULT_REGISTRY: 10n,
|
|
19
|
+
};
|
|
20
|
+
export const LEGOS_IDS = {
|
|
21
|
+
RIPE: 1n,
|
|
22
|
+
AAVE_V3: 2n,
|
|
23
|
+
COMPOUND_V3: 3n,
|
|
24
|
+
EULER: 4n,
|
|
25
|
+
FLUID: 5n,
|
|
26
|
+
MOONWELL: 6n,
|
|
27
|
+
MORPHO: 7n,
|
|
28
|
+
AERO_CLASSIC: 8n,
|
|
29
|
+
AERO_SLIPSTREAM: 9n,
|
|
30
|
+
CURVE: 10n,
|
|
31
|
+
UNISWAP_V2: 11n,
|
|
32
|
+
UNISWAP_V3: 12n,
|
|
33
|
+
UNDERSCORE: 13n,
|
|
34
|
+
FORTY_ACRES: 14n,
|
|
35
|
+
WASABI: 15n,
|
|
36
|
+
AVANTIS: 16n,
|
|
37
|
+
};
|
|
7
38
|
class Underscore {
|
|
8
39
|
constructor(config) {
|
|
40
|
+
this.DEPARTMENT_IDS = DEPARTMENT_IDS;
|
|
41
|
+
this.LEGOS_IDS = LEGOS_IDS;
|
|
9
42
|
this.publicClient =
|
|
10
43
|
config?.publicClient ||
|
|
11
44
|
createPublicClient({
|
|
@@ -24,11 +57,11 @@ class Underscore {
|
|
|
24
57
|
this.contracts = createSdk(this.publicClient, this.walletClient);
|
|
25
58
|
}
|
|
26
59
|
async multicall(cb, options = {}) {
|
|
27
|
-
const request = cb(
|
|
60
|
+
const request = cb(CONTRACTS);
|
|
28
61
|
return query(this.publicClient, request, options);
|
|
29
62
|
}
|
|
30
63
|
async iterate(cb, options = {}) {
|
|
31
|
-
const { total, getItem } = cb(
|
|
64
|
+
const { total, getItem } = cb(CONTRACTS);
|
|
32
65
|
return iteratorQuery(this.publicClient, total, getItem, options);
|
|
33
66
|
}
|
|
34
67
|
async getSwapInstructionsAmountOut(payload) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@underscore-finance/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "SDK for interacting with Underscore Finance Smart Contracts with TypeScript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
12
|
"codegen": "dappql && prettier --write .",
|
|
13
|
-
"ship": "npm run build &&
|
|
13
|
+
"ship": "npm run build && npm publish --access public && bump patch --commit --push",
|
|
14
14
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [],
|