@ember-finance/sdk 1.2.0 → 1.2.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.
|
@@ -29,7 +29,7 @@ export interface VaultDetail {
|
|
|
29
29
|
*/
|
|
30
30
|
id: string;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Short name/symbol of the vault
|
|
33
33
|
* @type {string}
|
|
34
34
|
* @memberof VaultDetail
|
|
35
35
|
*/
|
|
@@ -133,17 +133,17 @@ export interface VaultDetail {
|
|
|
133
133
|
*/
|
|
134
134
|
weeklyPerformanceFeeBpsE9: string;
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* The management fee percentage of the vault in e18 form
|
|
137
137
|
* @type {string}
|
|
138
138
|
* @memberof VaultDetail
|
|
139
139
|
*/
|
|
140
140
|
managementFeePercentE18: string;
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
142
|
+
* The rate of the vault in e18 form
|
|
143
143
|
* @type {string}
|
|
144
144
|
* @memberof VaultDetail
|
|
145
145
|
*/
|
|
146
|
-
rateE18
|
|
146
|
+
rateE18: string;
|
|
147
147
|
/**
|
|
148
148
|
* The maximum deposits allowed of the vault in e18 form
|
|
149
149
|
* @type {string}
|
|
@@ -151,7 +151,7 @@ export interface VaultDetail {
|
|
|
151
151
|
*/
|
|
152
152
|
maxDepositsAllowedE18?: string;
|
|
153
153
|
/**
|
|
154
|
-
*
|
|
154
|
+
* The withdrawal period in days
|
|
155
155
|
* @type {number}
|
|
156
156
|
* @memberof VaultDetail
|
|
157
157
|
*/
|
|
@@ -169,13 +169,13 @@ export interface VaultDetail {
|
|
|
169
169
|
*/
|
|
170
170
|
rewards: Array<RewardToken>;
|
|
171
171
|
/**
|
|
172
|
-
* The
|
|
172
|
+
* The aggregated total deposits of the vault equivalent to USD in e9
|
|
173
173
|
* @type {string}
|
|
174
174
|
* @memberof VaultDetail
|
|
175
175
|
*/
|
|
176
176
|
totalDepositsInUsdE9: string;
|
|
177
177
|
/**
|
|
178
|
-
* The aggregated total deposits of the vault in
|
|
178
|
+
* The aggregated total deposits of the vault in e9 form
|
|
179
179
|
* @type {string}
|
|
180
180
|
* @memberof VaultDetail
|
|
181
181
|
*/
|
|
@@ -57,6 +57,28 @@ export declare function signPermit(signer: Signer, tokenAddress: string, tokenNa
|
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
59
|
export declare function getPermitVersion(tokenAddress: string, provider: import("ethers").Provider): Promise<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function to check if a token supports EIP-5267
|
|
62
|
+
*
|
|
63
|
+
* EIP-5267 defines a standard way to retrieve EIP-712 domain information
|
|
64
|
+
* via the eip712Domain() method. This is useful for tokens that want to
|
|
65
|
+
* expose their domain separator parameters in a standardized way.
|
|
66
|
+
*
|
|
67
|
+
* @param tokenAddress The address of the ERC20 token
|
|
68
|
+
* @param provider An ethers.js provider
|
|
69
|
+
* @returns True if the token supports EIP-5267, false otherwise
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* import { supportsEIP5267 } from "@ember-finance/sdk";
|
|
74
|
+
*
|
|
75
|
+
* const supports = await supportsEIP5267(tokenAddress, provider);
|
|
76
|
+
* if (supports) {
|
|
77
|
+
* console.log("Token supports EIP-5267");
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function supportsEIP5267(tokenAddress: string, provider: import("ethers").Provider): Promise<boolean>;
|
|
60
82
|
/**
|
|
61
83
|
* Helper function to get the current nonce for a user from an EIP-2612 token
|
|
62
84
|
*
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.signPermit = signPermit;
|
|
37
37
|
exports.getPermitVersion = getPermitVersion;
|
|
38
|
+
exports.supportsEIP5267 = supportsEIP5267;
|
|
38
39
|
exports.getPermitNonce = getPermitNonce;
|
|
39
40
|
exports.signPermitSimple = signPermitSimple;
|
|
40
41
|
/**
|
|
@@ -153,6 +154,42 @@ async function getPermitVersion(tokenAddress, provider) {
|
|
|
153
154
|
return "2";
|
|
154
155
|
}
|
|
155
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Helper function to check if a token supports EIP-5267
|
|
159
|
+
*
|
|
160
|
+
* EIP-5267 defines a standard way to retrieve EIP-712 domain information
|
|
161
|
+
* via the eip712Domain() method. This is useful for tokens that want to
|
|
162
|
+
* expose their domain separator parameters in a standardized way.
|
|
163
|
+
*
|
|
164
|
+
* @param tokenAddress The address of the ERC20 token
|
|
165
|
+
* @param provider An ethers.js provider
|
|
166
|
+
* @returns True if the token supports EIP-5267, false otherwise
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* import { supportsEIP5267 } from "@ember-finance/sdk";
|
|
171
|
+
*
|
|
172
|
+
* const supports = await supportsEIP5267(tokenAddress, provider);
|
|
173
|
+
* if (supports) {
|
|
174
|
+
* console.log("Token supports EIP-5267");
|
|
175
|
+
* }
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
async function supportsEIP5267(tokenAddress, provider) {
|
|
179
|
+
try {
|
|
180
|
+
const { Contract } = await Promise.resolve().then(() => __importStar(require("ethers")));
|
|
181
|
+
const tokenContract = new Contract(tokenAddress, [
|
|
182
|
+
"function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)"
|
|
183
|
+
], provider);
|
|
184
|
+
// Try to call the method - if it succeeds, the token supports EIP-5267
|
|
185
|
+
await tokenContract.eip712Domain();
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
// If the call fails, the token does not support EIP-5267
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
156
193
|
/**
|
|
157
194
|
* Helper function to get the current nonce for a user from an EIP-2612 token
|
|
158
195
|
*
|