@defisaver/ethena-sdk 0.0.5 → 0.0.6
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/cjs/config/contracts.d.ts +181 -0
- package/cjs/config/contracts.js +72 -0
- package/cjs/constants/index.d.ts +3 -0
- package/cjs/constants/index.js +4 -1
- package/cjs/contracts.d.ts +696 -0
- package/cjs/contracts.js +80 -0
- package/cjs/execution/index.d.ts +2 -0
- package/cjs/execution/index.js +15 -0
- package/cjs/execution/morpho.d.ts +2 -0
- package/cjs/execution/morpho.js +56 -0
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +5 -1
- package/cjs/safe/index.d.ts +6 -0
- package/cjs/safe/index.js +80 -0
- package/cjs/services/viem.d.ts +31 -31
- package/cjs/types/execution.d.ts +9 -0
- package/cjs/types/execution.js +8 -0
- package/cjs/types/index.d.ts +2 -0
- package/cjs/types/index.js +2 -0
- package/cjs/types/safe.d.ts +5 -0
- package/cjs/types/safe.js +2 -0
- package/esm/config/contracts.d.ts +181 -0
- package/esm/config/contracts.js +69 -0
- package/esm/constants/index.d.ts +3 -0
- package/esm/constants/index.js +3 -0
- package/esm/contracts.d.ts +696 -0
- package/esm/contracts.js +37 -0
- package/esm/execution/index.d.ts +2 -0
- package/esm/execution/index.js +11 -0
- package/esm/execution/morpho.d.ts +2 -0
- package/esm/execution/morpho.js +52 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +3 -1
- package/esm/safe/index.d.ts +6 -0
- package/esm/safe/index.js +75 -0
- package/esm/services/viem.d.ts +31 -31
- package/esm/types/execution.d.ts +9 -0
- package/esm/types/execution.js +5 -0
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +2 -0
- package/esm/types/safe.d.ts +5 -0
- package/esm/types/safe.js +1 -0
- package/package.json +2 -1
- package/src/config/contracts.ts +72 -0
- package/src/constants/index.ts +4 -1
- package/src/contracts.ts +57 -0
- package/src/execution/index.ts +12 -0
- package/src/execution/morpho.ts +47 -0
- package/src/index.ts +4 -0
- package/src/safe/index.ts +99 -0
- package/src/types/execution.ts +11 -0
- package/src/types/index.ts +3 -1
- package/src/types/safe.ts +5 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export declare const Safe130: {
|
|
2
|
+
readonly abi: readonly [{
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly internalType: "address[]";
|
|
5
|
+
readonly name: "_owners";
|
|
6
|
+
readonly type: "address[]";
|
|
7
|
+
}, {
|
|
8
|
+
readonly internalType: "uint256";
|
|
9
|
+
readonly name: "_threshold";
|
|
10
|
+
readonly type: "uint256";
|
|
11
|
+
}, {
|
|
12
|
+
readonly internalType: "address";
|
|
13
|
+
readonly name: "to";
|
|
14
|
+
readonly type: "address";
|
|
15
|
+
}, {
|
|
16
|
+
readonly internalType: "bytes";
|
|
17
|
+
readonly name: "data";
|
|
18
|
+
readonly type: "bytes";
|
|
19
|
+
}, {
|
|
20
|
+
readonly internalType: "address";
|
|
21
|
+
readonly name: "fallbackHandler";
|
|
22
|
+
readonly type: "address";
|
|
23
|
+
}, {
|
|
24
|
+
readonly internalType: "address";
|
|
25
|
+
readonly name: "paymentToken";
|
|
26
|
+
readonly type: "address";
|
|
27
|
+
}, {
|
|
28
|
+
readonly internalType: "uint256";
|
|
29
|
+
readonly name: "payment";
|
|
30
|
+
readonly type: "uint256";
|
|
31
|
+
}, {
|
|
32
|
+
readonly internalType: "address payable";
|
|
33
|
+
readonly name: "paymentReceiver";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}];
|
|
36
|
+
readonly name: "setup";
|
|
37
|
+
readonly outputs: readonly [];
|
|
38
|
+
readonly stateMutability: "pure";
|
|
39
|
+
readonly type: "function";
|
|
40
|
+
}];
|
|
41
|
+
readonly networks: {
|
|
42
|
+
readonly 1: {
|
|
43
|
+
readonly address: "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552";
|
|
44
|
+
};
|
|
45
|
+
readonly 10: {
|
|
46
|
+
readonly address: "0xfb1bffC9d739B8D520DaF37dF666da4C687191EA";
|
|
47
|
+
};
|
|
48
|
+
readonly 8453: {
|
|
49
|
+
readonly address: "0xfb1bffC9d739B8D520DaF37dF666da4C687191EA";
|
|
50
|
+
};
|
|
51
|
+
readonly 42161: {
|
|
52
|
+
readonly address: "0x3E5c63644E683549055b9Be8653de26E0B4CD36E";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare const SafeFallbackHandler130: {
|
|
57
|
+
readonly abi: readonly [{
|
|
58
|
+
readonly inputs: readonly [];
|
|
59
|
+
readonly stateMutability: "nonpayable";
|
|
60
|
+
readonly type: "constructor";
|
|
61
|
+
}, {
|
|
62
|
+
readonly inputs: readonly [{
|
|
63
|
+
readonly internalType: "address";
|
|
64
|
+
readonly name: "to";
|
|
65
|
+
readonly type: "address";
|
|
66
|
+
}, {
|
|
67
|
+
readonly internalType: "uint256";
|
|
68
|
+
readonly name: "value";
|
|
69
|
+
readonly type: "uint256";
|
|
70
|
+
}, {
|
|
71
|
+
readonly internalType: "bytes";
|
|
72
|
+
readonly name: "data";
|
|
73
|
+
readonly type: "bytes";
|
|
74
|
+
}, {
|
|
75
|
+
readonly internalType: "enum Enum.Operation";
|
|
76
|
+
readonly name: "operation";
|
|
77
|
+
readonly type: "uint8";
|
|
78
|
+
}];
|
|
79
|
+
readonly name: "simulate";
|
|
80
|
+
readonly outputs: readonly [{
|
|
81
|
+
readonly internalType: "uint256";
|
|
82
|
+
readonly name: "estimate";
|
|
83
|
+
readonly type: "uint256";
|
|
84
|
+
}, {
|
|
85
|
+
readonly internalType: "bool";
|
|
86
|
+
readonly name: "success";
|
|
87
|
+
readonly type: "bool";
|
|
88
|
+
}, {
|
|
89
|
+
readonly internalType: "bytes";
|
|
90
|
+
readonly name: "returnData";
|
|
91
|
+
readonly type: "bytes";
|
|
92
|
+
}];
|
|
93
|
+
readonly stateMutability: "nonpayable";
|
|
94
|
+
readonly type: "function";
|
|
95
|
+
}];
|
|
96
|
+
readonly networks: {
|
|
97
|
+
readonly 1: {
|
|
98
|
+
readonly address: "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4";
|
|
99
|
+
};
|
|
100
|
+
readonly 10: {
|
|
101
|
+
readonly address: "0x017062a1dE2FE6b99BE3d9d37841FeD19F573804";
|
|
102
|
+
};
|
|
103
|
+
readonly 8453: {
|
|
104
|
+
readonly address: "0x017062a1dE2FE6b99BE3d9d37841FeD19F573804";
|
|
105
|
+
};
|
|
106
|
+
readonly 42161: {
|
|
107
|
+
readonly address: "0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4";
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export declare const SafeProxyFactory130: {
|
|
112
|
+
readonly abi: readonly [{
|
|
113
|
+
readonly inputs: readonly [{
|
|
114
|
+
readonly internalType: "address";
|
|
115
|
+
readonly name: "_singleton";
|
|
116
|
+
readonly type: "address";
|
|
117
|
+
}, {
|
|
118
|
+
readonly internalType: "bytes";
|
|
119
|
+
readonly name: "initializer";
|
|
120
|
+
readonly type: "bytes";
|
|
121
|
+
}, {
|
|
122
|
+
readonly internalType: "uint256";
|
|
123
|
+
readonly name: "saltNonce";
|
|
124
|
+
readonly type: "uint256";
|
|
125
|
+
}];
|
|
126
|
+
readonly name: "createProxyWithNonce";
|
|
127
|
+
readonly outputs: readonly [{
|
|
128
|
+
readonly internalType: "contract GnosisSafeProxy";
|
|
129
|
+
readonly name: "proxy";
|
|
130
|
+
readonly type: "address";
|
|
131
|
+
}];
|
|
132
|
+
readonly stateMutability: "nonpayable";
|
|
133
|
+
readonly type: "function";
|
|
134
|
+
}, {
|
|
135
|
+
readonly inputs: readonly [];
|
|
136
|
+
readonly name: "proxyCreationCode";
|
|
137
|
+
readonly outputs: readonly [{
|
|
138
|
+
readonly internalType: "bytes";
|
|
139
|
+
readonly name: "";
|
|
140
|
+
readonly type: "bytes";
|
|
141
|
+
}];
|
|
142
|
+
readonly stateMutability: "pure";
|
|
143
|
+
readonly type: "function";
|
|
144
|
+
}];
|
|
145
|
+
readonly networks: {
|
|
146
|
+
readonly 1: {
|
|
147
|
+
readonly address: "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2";
|
|
148
|
+
};
|
|
149
|
+
readonly 10: {
|
|
150
|
+
readonly address: "0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC";
|
|
151
|
+
};
|
|
152
|
+
readonly 8453: {
|
|
153
|
+
readonly address: "0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC";
|
|
154
|
+
};
|
|
155
|
+
readonly 42161: {
|
|
156
|
+
readonly address: "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2";
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export declare const MorphoManager: {
|
|
161
|
+
readonly abi: readonly [{
|
|
162
|
+
readonly inputs: readonly [{
|
|
163
|
+
readonly internalType: "address";
|
|
164
|
+
readonly name: "";
|
|
165
|
+
readonly type: "address";
|
|
166
|
+
}];
|
|
167
|
+
readonly name: "nonce";
|
|
168
|
+
readonly outputs: readonly [{
|
|
169
|
+
readonly internalType: "uint256";
|
|
170
|
+
readonly name: "";
|
|
171
|
+
readonly type: "uint256";
|
|
172
|
+
}];
|
|
173
|
+
readonly stateMutability: "view";
|
|
174
|
+
readonly type: "function";
|
|
175
|
+
}];
|
|
176
|
+
readonly networks: {
|
|
177
|
+
readonly 1: {
|
|
178
|
+
readonly address: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MorphoManager = exports.SafeProxyFactory130 = exports.SafeFallbackHandler130 = exports.Safe130 = void 0;
|
|
4
|
+
exports.Safe130 = {
|
|
5
|
+
abi: [{
|
|
6
|
+
inputs: [{ internalType: 'address[]', name: '_owners', type: 'address[]' }, { internalType: 'uint256', name: '_threshold', type: 'uint256' }, { internalType: 'address', name: 'to', type: 'address' }, { internalType: 'bytes', name: 'data', type: 'bytes' }, { internalType: 'address', name: 'fallbackHandler', type: 'address' }, { internalType: 'address', name: 'paymentToken', type: 'address' }, { internalType: 'uint256', name: 'payment', type: 'uint256' }, { internalType: 'address payable', name: 'paymentReceiver', type: 'address' }], name: 'setup', outputs: [], stateMutability: 'pure', type: 'function',
|
|
7
|
+
}],
|
|
8
|
+
networks: {
|
|
9
|
+
1: {
|
|
10
|
+
address: '0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552',
|
|
11
|
+
},
|
|
12
|
+
10: {
|
|
13
|
+
address: '0xfb1bffC9d739B8D520DaF37dF666da4C687191EA',
|
|
14
|
+
},
|
|
15
|
+
8453: {
|
|
16
|
+
address: '0xfb1bffC9d739B8D520DaF37dF666da4C687191EA',
|
|
17
|
+
},
|
|
18
|
+
42161: {
|
|
19
|
+
address: '0x3E5c63644E683549055b9Be8653de26E0B4CD36E',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.SafeFallbackHandler130 = {
|
|
24
|
+
abi: [{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' }, {
|
|
25
|
+
inputs: [{ internalType: 'address', name: 'to', type: 'address' }, { internalType: 'uint256', name: 'value', type: 'uint256' }, { internalType: 'bytes', name: 'data', type: 'bytes' }, { internalType: 'enum Enum.Operation', name: 'operation', type: 'uint8' }], name: 'simulate', outputs: [{ internalType: 'uint256', name: 'estimate', type: 'uint256' }, { internalType: 'bool', name: 'success', type: 'bool' }, { internalType: 'bytes', name: 'returnData', type: 'bytes' }], stateMutability: 'nonpayable', type: 'function',
|
|
26
|
+
}],
|
|
27
|
+
networks: {
|
|
28
|
+
1: {
|
|
29
|
+
address: '0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4',
|
|
30
|
+
},
|
|
31
|
+
10: {
|
|
32
|
+
address: '0x017062a1dE2FE6b99BE3d9d37841FeD19F573804',
|
|
33
|
+
},
|
|
34
|
+
8453: {
|
|
35
|
+
address: '0x017062a1dE2FE6b99BE3d9d37841FeD19F573804',
|
|
36
|
+
},
|
|
37
|
+
42161: {
|
|
38
|
+
address: '0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
exports.SafeProxyFactory130 = {
|
|
43
|
+
abi: [{
|
|
44
|
+
inputs: [{ internalType: 'address', name: '_singleton', type: 'address' }, { internalType: 'bytes', name: 'initializer', type: 'bytes' }, { internalType: 'uint256', name: 'saltNonce', type: 'uint256' }], name: 'createProxyWithNonce', outputs: [{ internalType: 'contract GnosisSafeProxy', name: 'proxy', type: 'address' }], stateMutability: 'nonpayable', type: 'function',
|
|
45
|
+
}, {
|
|
46
|
+
inputs: [], name: 'proxyCreationCode', outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], stateMutability: 'pure', type: 'function',
|
|
47
|
+
}],
|
|
48
|
+
networks: {
|
|
49
|
+
1: {
|
|
50
|
+
address: '0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2',
|
|
51
|
+
},
|
|
52
|
+
10: {
|
|
53
|
+
address: '0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC',
|
|
54
|
+
},
|
|
55
|
+
8453: {
|
|
56
|
+
address: '0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC',
|
|
57
|
+
},
|
|
58
|
+
42161: {
|
|
59
|
+
address: '0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
exports.MorphoManager = {
|
|
64
|
+
abi: [{
|
|
65
|
+
inputs: [{ internalType: 'address', name: '', type: 'address' }], name: 'nonce', outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function',
|
|
66
|
+
}],
|
|
67
|
+
networks: {
|
|
68
|
+
1: {
|
|
69
|
+
address: '0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
package/cjs/constants/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const STABLE_PAIR_FEE_DIVIDER = "10000";
|
|
2
2
|
export declare const DFS_API_URL = "https://fe.defisaver.com";
|
|
3
|
+
export declare const SAFE_API_URL = "https://fe.defisaver.com";
|
|
3
4
|
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
4
5
|
export declare const SLIPPAGE_PERCENT = 0.05;
|
|
6
|
+
export declare const SAFE_REFUND_RECEIVER = "0x25aa0f9a42eE4Ea2Dc7f3c9fF02F558dcb0445a3";
|
|
7
|
+
export declare const SALT_PREFIX = "44654669205361766572";
|
package/cjs/constants/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SLIPPAGE_PERCENT = exports.ZERO_ADDRESS = exports.DFS_API_URL = exports.STABLE_PAIR_FEE_DIVIDER = void 0;
|
|
3
|
+
exports.SALT_PREFIX = exports.SAFE_REFUND_RECEIVER = exports.SLIPPAGE_PERCENT = exports.ZERO_ADDRESS = exports.SAFE_API_URL = exports.DFS_API_URL = exports.STABLE_PAIR_FEE_DIVIDER = void 0;
|
|
4
4
|
exports.STABLE_PAIR_FEE_DIVIDER = '10000';
|
|
5
5
|
exports.DFS_API_URL = 'https://fe.defisaver.com';
|
|
6
|
+
exports.SAFE_API_URL = 'https://fe.defisaver.com';
|
|
6
7
|
exports.ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
7
8
|
exports.SLIPPAGE_PERCENT = 0.05;
|
|
9
|
+
exports.SAFE_REFUND_RECEIVER = '0x25aa0f9a42eE4Ea2Dc7f3c9fF02F558dcb0445a3';
|
|
10
|
+
exports.SALT_PREFIX = '44654669205361766572'; // 'DeFi Saver' in hex
|