@0xmonaco/core 0.2.1 → 0.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.
- package/dist/api/vault/api.d.ts +25 -25
- package/dist/api/vault/api.d.ts.map +1 -1
- package/dist/api/vault/api.js +65 -172
- package/dist/api/vault/api.js.map +1 -1
- package/package.json +5 -5
package/dist/api/vault/api.d.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* console.log(`Deposit transaction: ${result.hash}`);
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
import type {
|
|
30
|
+
import type { ApplicationsAPI, Balance, MarketAPI, TransactionResult, VaultAPI } from "@0xmonaco/types";
|
|
31
31
|
import { type Address, type Chain, type PublicClient, type WalletClient } from "viem";
|
|
32
32
|
import { BaseAPI } from "../base";
|
|
33
33
|
export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
@@ -79,7 +79,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
79
79
|
* to transfer tokens from the user's wallet. Approval is required before any
|
|
80
80
|
* deposit operations can be performed.
|
|
81
81
|
*
|
|
82
|
-
* @param
|
|
82
|
+
* @param tokenAddress - The token address to approve
|
|
83
83
|
* @param amount - The maximum amount of tokens the vault can spend (as bigint)
|
|
84
84
|
* @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true)
|
|
85
85
|
* @returns Promise resolving to TransactionResult with transaction details
|
|
@@ -91,7 +91,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
91
91
|
* ```typescript
|
|
92
92
|
* // Approve vault to spend up to 1000 USDC (auto-waits by default)
|
|
93
93
|
* const result = await vaultAPI.approve(
|
|
94
|
-
* "
|
|
94
|
+
* "0x6A86dA986797D59A839D136dB490292Cd560C131",
|
|
95
95
|
* parseUnits("1000", 6)
|
|
96
96
|
* );
|
|
97
97
|
* console.log(`Approval transaction: ${result.hash}`);
|
|
@@ -99,7 +99,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
99
99
|
*
|
|
100
100
|
* // Or skip auto-waiting
|
|
101
101
|
* const result = await vaultAPI.approve(
|
|
102
|
-
* "
|
|
102
|
+
* "0x6A86dA986797D59A839D136dB490292Cd560C131",
|
|
103
103
|
* parseUnits("1000", 6),
|
|
104
104
|
* false
|
|
105
105
|
* );
|
|
@@ -107,7 +107,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
107
107
|
* const receipt = await sdk.waitForTransaction(result.hash);
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
|
-
approve(
|
|
110
|
+
approve(tokenAddress: Address, amount: bigint, autoWait?: boolean): Promise<TransactionResult>;
|
|
111
111
|
/**
|
|
112
112
|
* Deposits tokens into the Monaco vault.
|
|
113
113
|
*
|
|
@@ -117,7 +117,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
117
117
|
*
|
|
118
118
|
* Note: This method requires prior approval via the approve() method.
|
|
119
119
|
*
|
|
120
|
-
* @param
|
|
120
|
+
* @param tokenAddress - The token address to deposit
|
|
121
121
|
* @param amount - The amount of tokens to deposit (as bigint)
|
|
122
122
|
* @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true)
|
|
123
123
|
* @returns Promise resolving to TransactionResult with transaction details
|
|
@@ -129,7 +129,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
129
129
|
* ```typescript
|
|
130
130
|
* // Deposit 100 USDC into the vault (auto-waits by default)
|
|
131
131
|
* const result = await vaultAPI.deposit(
|
|
132
|
-
* "
|
|
132
|
+
* "0x123...456",
|
|
133
133
|
* parseUnits("100", 6)
|
|
134
134
|
* );
|
|
135
135
|
* console.log(`Deposit transaction: ${result.hash}`);
|
|
@@ -137,7 +137,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
137
137
|
*
|
|
138
138
|
* // Or skip auto-waiting
|
|
139
139
|
* const result = await vaultAPI.deposit(
|
|
140
|
-
* "
|
|
140
|
+
* "0x123...456",
|
|
141
141
|
* parseUnits("100", 6),
|
|
142
142
|
* false
|
|
143
143
|
* );
|
|
@@ -145,7 +145,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
145
145
|
* const receipt = await sdk.waitForTransaction(result.hash);
|
|
146
146
|
* ```
|
|
147
147
|
*/
|
|
148
|
-
deposit(
|
|
148
|
+
deposit(tokenAddress: Address, amount: bigint, autoWait?: boolean): Promise<TransactionResult>;
|
|
149
149
|
/**
|
|
150
150
|
* Withdraws tokens from the Monaco vault.
|
|
151
151
|
*
|
|
@@ -153,7 +153,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
153
153
|
* user's wallet. The method obtains a signature from the API Gateway and then
|
|
154
154
|
* executes the withdrawal transaction on-chain.
|
|
155
155
|
*
|
|
156
|
-
* @param
|
|
156
|
+
* @param tokenAddress - The token address to withdraw
|
|
157
157
|
* @param amount - The amount of tokens to withdraw (as bigint)
|
|
158
158
|
* @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true)
|
|
159
159
|
* @returns Promise resolving to TransactionResult with transaction details
|
|
@@ -166,7 +166,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
166
166
|
* ```typescript
|
|
167
167
|
* // Withdraw 50 USDC from the vault (auto-waits by default)
|
|
168
168
|
* const result = await vaultAPI.withdraw(
|
|
169
|
-
* "
|
|
169
|
+
* "0x123...456",
|
|
170
170
|
* parseUnits("50", 6)
|
|
171
171
|
* );
|
|
172
172
|
* console.log(`Withdrawal transaction: ${result.hash}`);
|
|
@@ -174,7 +174,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
174
174
|
*
|
|
175
175
|
* // Or skip auto-waiting
|
|
176
176
|
* const result = await vaultAPI.withdraw(
|
|
177
|
-
* "
|
|
177
|
+
* "0x123...456",
|
|
178
178
|
* parseUnits("50", 6),
|
|
179
179
|
* false
|
|
180
180
|
* );
|
|
@@ -182,49 +182,49 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
182
182
|
* const receipt = await sdk.waitForTransaction(result.hash);
|
|
183
183
|
* ```
|
|
184
184
|
*/
|
|
185
|
-
withdraw(
|
|
185
|
+
withdraw(tokenAddress: Address, amount: bigint, autoWait?: boolean): Promise<TransactionResult>;
|
|
186
186
|
/**
|
|
187
187
|
* Retrieves the user's token balance in the vault.
|
|
188
188
|
*
|
|
189
189
|
* Queries the vault contract to get the current balance of a specific token
|
|
190
190
|
* for the connected wallet. Returns both raw amount and formatted display values.
|
|
191
191
|
*
|
|
192
|
-
* @param
|
|
192
|
+
* @param tokenAddress - The token address to check balance for
|
|
193
193
|
* @returns Promise resolving to Balance with token balance details
|
|
194
194
|
* @throws {ContractError} When balance retrieval fails
|
|
195
195
|
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```typescript
|
|
198
|
-
* const balance = await vaultAPI.getBalance("
|
|
198
|
+
* const balance = await vaultAPI.getBalance("0x123...456");
|
|
199
199
|
* console.log(`Vault balance: ${balance.formatted} ${balance.symbol}`);
|
|
200
200
|
* console.log(`Raw amount: ${balance.amount}`);
|
|
201
201
|
* ```
|
|
202
202
|
*/
|
|
203
|
-
getBalance(
|
|
203
|
+
getBalance(tokenAddress: Address): Promise<Balance>;
|
|
204
204
|
/**
|
|
205
205
|
* Retrieves the current allowance for a token.
|
|
206
206
|
*
|
|
207
207
|
* Queries the ERC20 token contract to get the current allowance granted to the
|
|
208
208
|
* vault contract for spending tokens on behalf of the user.
|
|
209
209
|
*
|
|
210
|
-
* @param
|
|
210
|
+
* @param tokenAddress - The token address to check allowance for
|
|
211
211
|
* @returns Promise resolving to the current allowance amount as bigint
|
|
212
212
|
* @throws {ContractError} When allowance retrieval fails
|
|
213
213
|
*
|
|
214
214
|
* @example
|
|
215
215
|
* ```typescript
|
|
216
|
-
* const allowance = await vaultAPI.getAllowance("
|
|
216
|
+
* const allowance = await vaultAPI.getAllowance("0x123...456");
|
|
217
217
|
* console.log(`Current allowance: ${formatUnits(allowance, 6)} USDC`);
|
|
218
218
|
* ```
|
|
219
219
|
*/
|
|
220
|
-
getAllowance(
|
|
220
|
+
getAllowance(tokenAddress: Address): Promise<bigint>;
|
|
221
221
|
/**
|
|
222
222
|
* Checks if approval is needed for a specific amount.
|
|
223
223
|
*
|
|
224
224
|
* Compares the current allowance with the requested amount to determine if
|
|
225
225
|
* the user needs to approve more tokens before performing operations.
|
|
226
226
|
*
|
|
227
|
-
* @param
|
|
227
|
+
* @param tokenAddress - The token address to check for
|
|
228
228
|
* @param amount - The amount to check approval for (as bigint)
|
|
229
229
|
* @returns Promise resolving to true if approval is needed, false otherwise
|
|
230
230
|
* @throws {ContractError} When approval check fails
|
|
@@ -232,17 +232,17 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
232
232
|
* @example
|
|
233
233
|
* ```typescript
|
|
234
234
|
* const needsApproval = await vaultAPI.needsApproval(
|
|
235
|
-
* "
|
|
235
|
+
* "0x123...456",
|
|
236
236
|
* parseUnits("100", 6)
|
|
237
237
|
* );
|
|
238
238
|
*
|
|
239
239
|
* if (needsApproval) {
|
|
240
240
|
* console.log("Approval required before deposit");
|
|
241
|
-
* await vaultAPI.approve("
|
|
241
|
+
* await vaultAPI.approve("0x123...456", parseUnits("100", 6));
|
|
242
242
|
* }
|
|
243
243
|
* ```
|
|
244
244
|
*/
|
|
245
|
-
needsApproval(
|
|
245
|
+
needsApproval(tokenAddress: Address, amount: bigint): Promise<boolean>;
|
|
246
246
|
/**
|
|
247
247
|
* Retrieves a deposit signature from the API Gateway.
|
|
248
248
|
*
|
|
@@ -250,7 +250,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
250
250
|
* the cryptographic signature required for deposit transactions. The signature
|
|
251
251
|
* validates the deposit request and ensures proper authorization.
|
|
252
252
|
*
|
|
253
|
-
* @param
|
|
253
|
+
* @param tokenAddress - The token address to deposit
|
|
254
254
|
* @param amount - The amount to deposit (as bigint)
|
|
255
255
|
* @param userAddress - The user's wallet address
|
|
256
256
|
* @returns Promise resolving to object containing seed and signature
|
|
@@ -265,7 +265,7 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
|
|
|
265
265
|
* the cryptographic signature required for withdrawal transactions. The signature
|
|
266
266
|
* validates the withdrawal request and ensures proper authorization.
|
|
267
267
|
*
|
|
268
|
-
* @param
|
|
268
|
+
* @param tokenAddress - The token address to withdraw
|
|
269
269
|
* @param amount - The amount to withdraw (as bigint)
|
|
270
270
|
* @param userAddress - The user's wallet address
|
|
271
271
|
* @returns Promise resolving to object containing seed and signature
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/api/vault/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/api/vault/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,EAAC,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACtG,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,YAAY,EACjB,KAAK,YAAY,EACpB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAa,SAAQ,OAAQ,YAAW,QAAQ;IAe3D,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAhBvB,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,eAAe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hC"}
|
package/dist/api/vault/api.js
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
import { CONTRACT_ABIS } from "@0xmonaco/contracts";
|
|
31
|
-
import {
|
|
32
|
-
import { APIError, ContractError, InvalidConfigError
|
|
31
|
+
import { erc20Abi, formatUnits, getContract, } from "viem";
|
|
32
|
+
import { APIError, ContractError, InvalidConfigError } from "../../errors";
|
|
33
33
|
import { BaseAPI } from "../base";
|
|
34
34
|
export class VaultAPIImpl extends BaseAPI {
|
|
35
35
|
/**
|
|
@@ -112,7 +112,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
112
112
|
* to transfer tokens from the user's wallet. Approval is required before any
|
|
113
113
|
* deposit operations can be performed.
|
|
114
114
|
*
|
|
115
|
-
* @param
|
|
115
|
+
* @param tokenAddress - The token address to approve
|
|
116
116
|
* @param amount - The maximum amount of tokens the vault can spend (as bigint)
|
|
117
117
|
* @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true)
|
|
118
118
|
* @returns Promise resolving to TransactionResult with transaction details
|
|
@@ -124,7 +124,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
124
124
|
* ```typescript
|
|
125
125
|
* // Approve vault to spend up to 1000 USDC (auto-waits by default)
|
|
126
126
|
* const result = await vaultAPI.approve(
|
|
127
|
-
* "
|
|
127
|
+
* "0x6A86dA986797D59A839D136dB490292Cd560C131",
|
|
128
128
|
* parseUnits("1000", 6)
|
|
129
129
|
* );
|
|
130
130
|
* console.log(`Approval transaction: ${result.hash}`);
|
|
@@ -132,7 +132,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
132
132
|
*
|
|
133
133
|
* // Or skip auto-waiting
|
|
134
134
|
* const result = await vaultAPI.approve(
|
|
135
|
-
* "
|
|
135
|
+
* "0x6A86dA986797D59A839D136dB490292Cd560C131",
|
|
136
136
|
* parseUnits("1000", 6),
|
|
137
137
|
* false
|
|
138
138
|
* );
|
|
@@ -140,63 +140,33 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
140
140
|
* const receipt = await sdk.waitForTransaction(result.hash);
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
|
-
async approve(
|
|
143
|
+
async approve(tokenAddress, amount, autoWait = true) {
|
|
144
144
|
try {
|
|
145
|
-
const
|
|
146
|
-
this.getVaultAddress(),
|
|
147
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
148
|
-
]);
|
|
145
|
+
const vaultAddress = await this.getVaultAddress();
|
|
149
146
|
const account = this.walletClient.account;
|
|
150
147
|
if (!account) {
|
|
151
148
|
throw new InvalidConfigError("No account available in wallet client", "account");
|
|
152
149
|
}
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
const nonce = account.getNonce ? await account.getNonce() : 0n;
|
|
151
|
+
// Use writeContract - handles nonce, gas estimation, signing, and sending automatically
|
|
152
|
+
const hash = await this.walletClient.writeContract({
|
|
153
|
+
address: tokenAddress,
|
|
155
154
|
abi: erc20Abi,
|
|
156
155
|
functionName: "approve",
|
|
157
156
|
args: [vaultAddress, amount],
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const [nonce, gasPrice] = await Promise.all([
|
|
161
|
-
this.publicClient.getTransactionCount({ address: account.address }),
|
|
162
|
-
this.publicClient.getGasPrice(),
|
|
163
|
-
]);
|
|
164
|
-
// 3) Gas limit
|
|
165
|
-
const gasLimit = await this.publicClient.estimateGas({
|
|
166
|
-
account: account.address,
|
|
167
|
-
to: tokenAddress,
|
|
168
|
-
data,
|
|
169
|
-
});
|
|
170
|
-
// 4) Use the most basic raw transaction approach
|
|
171
|
-
const transaction = {
|
|
172
|
-
chainId: this.chain.id,
|
|
173
|
-
nonce,
|
|
174
|
-
gasPrice,
|
|
175
|
-
gas: gasLimit,
|
|
176
|
-
to: tokenAddress,
|
|
177
|
-
value: 0n,
|
|
178
|
-
data,
|
|
179
|
-
type: "legacy",
|
|
180
|
-
};
|
|
181
|
-
// 5) Sign transaction with account
|
|
182
|
-
const signature = await account.signTransaction?.(transaction);
|
|
183
|
-
if (!signature) {
|
|
184
|
-
throw new TransactionError("Failed to sign transaction", undefined);
|
|
185
|
-
}
|
|
186
|
-
// 6) Send raw transaction
|
|
187
|
-
const hash = await this.publicClient.sendRawTransaction({
|
|
188
|
-
serializedTransaction: signature,
|
|
157
|
+
chain: this.chain,
|
|
158
|
+
account
|
|
189
159
|
});
|
|
190
160
|
const txResult = {
|
|
161
|
+
nonce,
|
|
191
162
|
hash,
|
|
192
|
-
status: "pending"
|
|
193
|
-
nonce: BigInt(nonce),
|
|
163
|
+
status: "pending"
|
|
194
164
|
};
|
|
195
165
|
// Handle auto-waiting for transaction confirmation
|
|
196
166
|
return await this.waitForTransaction(txResult, autoWait);
|
|
197
167
|
}
|
|
198
168
|
catch (error) {
|
|
199
|
-
throw new ContractError(`Failed to approve token ${
|
|
169
|
+
throw new ContractError(`Failed to approve token ${tokenAddress}`, error instanceof Error ? error.message : "Unknown error", undefined);
|
|
200
170
|
}
|
|
201
171
|
}
|
|
202
172
|
/**
|
|
@@ -208,7 +178,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
208
178
|
*
|
|
209
179
|
* Note: This method requires prior approval via the approve() method.
|
|
210
180
|
*
|
|
211
|
-
* @param
|
|
181
|
+
* @param tokenAddress - The token address to deposit
|
|
212
182
|
* @param amount - The amount of tokens to deposit (as bigint)
|
|
213
183
|
* @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true)
|
|
214
184
|
* @returns Promise resolving to TransactionResult with transaction details
|
|
@@ -220,7 +190,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
220
190
|
* ```typescript
|
|
221
191
|
* // Deposit 100 USDC into the vault (auto-waits by default)
|
|
222
192
|
* const result = await vaultAPI.deposit(
|
|
223
|
-
* "
|
|
193
|
+
* "0x123...456",
|
|
224
194
|
* parseUnits("100", 6)
|
|
225
195
|
* );
|
|
226
196
|
* console.log(`Deposit transaction: ${result.hash}`);
|
|
@@ -228,7 +198,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
228
198
|
*
|
|
229
199
|
* // Or skip auto-waiting
|
|
230
200
|
* const result = await vaultAPI.deposit(
|
|
231
|
-
* "
|
|
201
|
+
* "0x123...456",
|
|
232
202
|
* parseUnits("100", 6),
|
|
233
203
|
* false
|
|
234
204
|
* );
|
|
@@ -236,73 +206,40 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
236
206
|
* const receipt = await sdk.waitForTransaction(result.hash);
|
|
237
207
|
* ```
|
|
238
208
|
*/
|
|
239
|
-
async deposit(
|
|
209
|
+
async deposit(tokenAddress, amount, autoWait = true) {
|
|
240
210
|
try {
|
|
241
|
-
const
|
|
242
|
-
this.getVaultAddress(),
|
|
243
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
244
|
-
]);
|
|
211
|
+
const vaultAddress = await this.getVaultAddress();
|
|
245
212
|
// Check if approval is needed before proceeding
|
|
246
213
|
const needsApproval = await this.needsApproval(tokenAddress, amount);
|
|
247
214
|
if (needsApproval) {
|
|
248
|
-
throw new ContractError(`Approval required before deposit. Please invoke approve() first for token ${
|
|
215
|
+
throw new ContractError(`Approval required before deposit. Please invoke approve() first for token ${tokenAddress}`, "APPROVAL_REQUIRED", undefined);
|
|
249
216
|
}
|
|
250
217
|
// Get account address
|
|
251
218
|
const [account] = await this.walletClient.getAddresses();
|
|
252
219
|
// Get signature from backend API
|
|
253
220
|
const { seed, signature } = await this.getDepositSignature(tokenAddress, amount, account);
|
|
254
|
-
// Use raw transaction approach like we did for approval
|
|
255
221
|
const walletAccount = this.walletClient.account;
|
|
256
222
|
if (!walletAccount) {
|
|
257
223
|
throw new InvalidConfigError("No account available in wallet client", "account");
|
|
258
224
|
}
|
|
259
|
-
|
|
260
|
-
|
|
225
|
+
const hash = await this.walletClient.writeContract({
|
|
226
|
+
address: vaultAddress,
|
|
261
227
|
abi: CONTRACT_ABIS.vault,
|
|
262
228
|
functionName: "deposit",
|
|
263
229
|
args: [tokenAddress, amount, seed, signature],
|
|
230
|
+
account: walletAccount,
|
|
231
|
+
chain: this.chain
|
|
264
232
|
});
|
|
265
|
-
|
|
266
|
-
const [nonce, gasPrice] = await Promise.all([
|
|
267
|
-
this.publicClient.getTransactionCount({
|
|
268
|
-
address: walletAccount.address,
|
|
269
|
-
}),
|
|
270
|
-
this.publicClient.getGasPrice(),
|
|
271
|
-
]);
|
|
272
|
-
// Estimate gas
|
|
273
|
-
const gasLimit = await this.publicClient.estimateGas({
|
|
274
|
-
account: walletAccount.address,
|
|
275
|
-
to: vaultAddress,
|
|
276
|
-
data,
|
|
277
|
-
});
|
|
278
|
-
// Sign transaction
|
|
279
|
-
const signed = await walletAccount.signTransaction?.({
|
|
280
|
-
chain: this.chain,
|
|
281
|
-
nonce,
|
|
282
|
-
gas: gasLimit,
|
|
283
|
-
gasPrice,
|
|
284
|
-
to: vaultAddress,
|
|
285
|
-
value: 0n,
|
|
286
|
-
data,
|
|
287
|
-
type: "legacy",
|
|
288
|
-
});
|
|
289
|
-
if (!signed) {
|
|
290
|
-
throw new TransactionError("Failed to sign transaction", undefined);
|
|
291
|
-
}
|
|
292
|
-
// Send raw transaction
|
|
293
|
-
const hash = await this.publicClient.sendRawTransaction({
|
|
294
|
-
serializedTransaction: signed,
|
|
295
|
-
});
|
|
233
|
+
const nonce = walletAccount.getNonce ? await walletAccount.getNonce() : 0n;
|
|
296
234
|
const txResult = {
|
|
297
235
|
hash,
|
|
298
236
|
status: "pending",
|
|
299
|
-
nonce
|
|
237
|
+
nonce,
|
|
300
238
|
};
|
|
301
|
-
// Handle auto-waiting for transaction confirmation
|
|
302
239
|
return await this.waitForTransaction(txResult, autoWait);
|
|
303
240
|
}
|
|
304
241
|
catch (error) {
|
|
305
|
-
throw new ContractError(`Failed to deposit ${amount} of token ${
|
|
242
|
+
throw new ContractError(`Failed to deposit ${amount} of token ${tokenAddress}`, error instanceof Error ? error.message : "Unknown error", undefined);
|
|
306
243
|
}
|
|
307
244
|
}
|
|
308
245
|
/**
|
|
@@ -312,7 +249,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
312
249
|
* user's wallet. The method obtains a signature from the API Gateway and then
|
|
313
250
|
* executes the withdrawal transaction on-chain.
|
|
314
251
|
*
|
|
315
|
-
* @param
|
|
252
|
+
* @param tokenAddress - The token address to withdraw
|
|
316
253
|
* @param amount - The amount of tokens to withdraw (as bigint)
|
|
317
254
|
* @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true)
|
|
318
255
|
* @returns Promise resolving to TransactionResult with transaction details
|
|
@@ -325,7 +262,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
325
262
|
* ```typescript
|
|
326
263
|
* // Withdraw 50 USDC from the vault (auto-waits by default)
|
|
327
264
|
* const result = await vaultAPI.withdraw(
|
|
328
|
-
* "
|
|
265
|
+
* "0x123...456",
|
|
329
266
|
* parseUnits("50", 6)
|
|
330
267
|
* );
|
|
331
268
|
* console.log(`Withdrawal transaction: ${result.hash}`);
|
|
@@ -333,7 +270,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
333
270
|
*
|
|
334
271
|
* // Or skip auto-waiting
|
|
335
272
|
* const result = await vaultAPI.withdraw(
|
|
336
|
-
* "
|
|
273
|
+
* "0x123...456",
|
|
337
274
|
* parseUnits("50", 6),
|
|
338
275
|
* false
|
|
339
276
|
* );
|
|
@@ -341,67 +278,36 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
341
278
|
* const receipt = await sdk.waitForTransaction(result.hash);
|
|
342
279
|
* ```
|
|
343
280
|
*/
|
|
344
|
-
async withdraw(
|
|
281
|
+
async withdraw(tokenAddress, amount, autoWait = true) {
|
|
345
282
|
try {
|
|
346
|
-
const
|
|
347
|
-
this.getVaultAddress(),
|
|
348
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
349
|
-
]);
|
|
283
|
+
const vaultAddress = await this.getVaultAddress();
|
|
350
284
|
const [account] = await this.walletClient.getAddresses();
|
|
351
285
|
// Get signature from backend API
|
|
352
286
|
const { seed, signature } = await this.getWithdrawSignature(tokenAddress, amount, account);
|
|
353
|
-
// Use raw transaction approach like we did for deposit
|
|
354
287
|
const walletAccount = this.walletClient.account;
|
|
355
288
|
if (!walletAccount) {
|
|
356
289
|
throw new InvalidConfigError("No account available in wallet client", "account");
|
|
357
290
|
}
|
|
358
|
-
//
|
|
359
|
-
const
|
|
291
|
+
// Use writeContract - handles nonce, gas estimation, signing, and sending automatically
|
|
292
|
+
const hash = await this.walletClient.writeContract({
|
|
293
|
+
address: vaultAddress,
|
|
360
294
|
abi: CONTRACT_ABIS.vault,
|
|
361
295
|
functionName: "withdraw",
|
|
362
296
|
args: [tokenAddress, amount, seed, signature],
|
|
297
|
+
account: walletAccount,
|
|
298
|
+
chain: this.chain
|
|
363
299
|
});
|
|
364
|
-
|
|
365
|
-
const [nonce, gasPrice] = await Promise.all([
|
|
366
|
-
this.publicClient.getTransactionCount({
|
|
367
|
-
address: walletAccount.address,
|
|
368
|
-
}),
|
|
369
|
-
this.publicClient.getGasPrice(),
|
|
370
|
-
]);
|
|
371
|
-
// Estimate gas
|
|
372
|
-
const gasLimit = await this.publicClient.estimateGas({
|
|
373
|
-
account: walletAccount.address,
|
|
374
|
-
to: vaultAddress,
|
|
375
|
-
data,
|
|
376
|
-
});
|
|
377
|
-
// Sign transaction
|
|
378
|
-
const signed = await walletAccount.signTransaction?.({
|
|
379
|
-
chain: this.chain,
|
|
380
|
-
nonce,
|
|
381
|
-
gas: gasLimit,
|
|
382
|
-
gasPrice,
|
|
383
|
-
to: vaultAddress,
|
|
384
|
-
value: 0n,
|
|
385
|
-
data,
|
|
386
|
-
type: "legacy",
|
|
387
|
-
});
|
|
388
|
-
if (!signed) {
|
|
389
|
-
throw new TransactionError("Failed to sign transaction", undefined);
|
|
390
|
-
}
|
|
391
|
-
// Send raw transaction
|
|
392
|
-
const hash = await this.publicClient.sendRawTransaction({
|
|
393
|
-
serializedTransaction: signed,
|
|
394
|
-
});
|
|
300
|
+
const nonce = walletAccount.getNonce ? await walletAccount.getNonce() : 0n;
|
|
395
301
|
const txResult = {
|
|
396
302
|
hash,
|
|
397
303
|
status: "pending",
|
|
398
|
-
nonce
|
|
304
|
+
nonce,
|
|
399
305
|
};
|
|
400
306
|
// Handle auto-waiting for transaction confirmation
|
|
401
307
|
return await this.waitForTransaction(txResult, autoWait);
|
|
402
308
|
}
|
|
403
309
|
catch (error) {
|
|
404
|
-
throw new ContractError(`Failed to withdraw ${amount} of token ${
|
|
310
|
+
throw new ContractError(`Failed to withdraw ${amount} of token ${tokenAddress}`, error instanceof Error ? error.message : "Unknown error", undefined);
|
|
405
311
|
}
|
|
406
312
|
}
|
|
407
313
|
/**
|
|
@@ -410,23 +316,20 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
410
316
|
* Queries the vault contract to get the current balance of a specific token
|
|
411
317
|
* for the connected wallet. Returns both raw amount and formatted display values.
|
|
412
318
|
*
|
|
413
|
-
* @param
|
|
319
|
+
* @param tokenAddress - The token address to check balance for
|
|
414
320
|
* @returns Promise resolving to Balance with token balance details
|
|
415
321
|
* @throws {ContractError} When balance retrieval fails
|
|
416
322
|
*
|
|
417
323
|
* @example
|
|
418
324
|
* ```typescript
|
|
419
|
-
* const balance = await vaultAPI.getBalance("
|
|
325
|
+
* const balance = await vaultAPI.getBalance("0x123...456");
|
|
420
326
|
* console.log(`Vault balance: ${balance.formatted} ${balance.symbol}`);
|
|
421
327
|
* console.log(`Raw amount: ${balance.amount}`);
|
|
422
328
|
* ```
|
|
423
329
|
*/
|
|
424
|
-
async getBalance(
|
|
330
|
+
async getBalance(tokenAddress) {
|
|
425
331
|
try {
|
|
426
|
-
const
|
|
427
|
-
this.getVaultAddress(),
|
|
428
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
429
|
-
]);
|
|
332
|
+
const vaultAddress = await this.getVaultAddress();
|
|
430
333
|
const [account] = await this.walletClient.getAddresses();
|
|
431
334
|
// Get balance from vault contract
|
|
432
335
|
const balance = (await this.publicClient.readContract({
|
|
@@ -454,7 +357,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
454
357
|
};
|
|
455
358
|
}
|
|
456
359
|
catch (error) {
|
|
457
|
-
throw new ContractError(`Failed to get balance for token ${
|
|
360
|
+
throw new ContractError(`Failed to get balance for token ${tokenAddress}`, error instanceof Error ? error.message : "Unknown error", undefined);
|
|
458
361
|
}
|
|
459
362
|
}
|
|
460
363
|
/**
|
|
@@ -463,33 +366,29 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
463
366
|
* Queries the ERC20 token contract to get the current allowance granted to the
|
|
464
367
|
* vault contract for spending tokens on behalf of the user.
|
|
465
368
|
*
|
|
466
|
-
* @param
|
|
369
|
+
* @param tokenAddress - The token address to check allowance for
|
|
467
370
|
* @returns Promise resolving to the current allowance amount as bigint
|
|
468
371
|
* @throws {ContractError} When allowance retrieval fails
|
|
469
372
|
*
|
|
470
373
|
* @example
|
|
471
374
|
* ```typescript
|
|
472
|
-
* const allowance = await vaultAPI.getAllowance("
|
|
375
|
+
* const allowance = await vaultAPI.getAllowance("0x123...456");
|
|
473
376
|
* console.log(`Current allowance: ${formatUnits(allowance, 6)} USDC`);
|
|
474
377
|
* ```
|
|
475
378
|
*/
|
|
476
|
-
async getAllowance(
|
|
379
|
+
async getAllowance(tokenAddress) {
|
|
477
380
|
try {
|
|
478
|
-
const
|
|
479
|
-
this.getVaultAddress(),
|
|
480
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
481
|
-
]);
|
|
381
|
+
const vaultAddress = await this.getVaultAddress();
|
|
482
382
|
const [account] = await this.walletClient.getAddresses();
|
|
483
|
-
|
|
383
|
+
return (await this.publicClient.readContract({
|
|
484
384
|
address: tokenAddress,
|
|
485
385
|
abi: erc20Abi,
|
|
486
386
|
functionName: "allowance",
|
|
487
387
|
args: [account, vaultAddress],
|
|
488
388
|
}));
|
|
489
|
-
return allowance;
|
|
490
389
|
}
|
|
491
390
|
catch (error) {
|
|
492
|
-
throw new ContractError(`Failed to get allowance for token ${
|
|
391
|
+
throw new ContractError(`Failed to get allowance for token ${tokenAddress}`, error instanceof Error ? error.message : "Unknown error", undefined);
|
|
493
392
|
}
|
|
494
393
|
}
|
|
495
394
|
/**
|
|
@@ -498,7 +397,7 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
498
397
|
* Compares the current allowance with the requested amount to determine if
|
|
499
398
|
* the user needs to approve more tokens before performing operations.
|
|
500
399
|
*
|
|
501
|
-
* @param
|
|
400
|
+
* @param tokenAddress - The token address to check for
|
|
502
401
|
* @param amount - The amount to check approval for (as bigint)
|
|
503
402
|
* @returns Promise resolving to true if approval is needed, false otherwise
|
|
504
403
|
* @throws {ContractError} When approval check fails
|
|
@@ -506,23 +405,23 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
506
405
|
* @example
|
|
507
406
|
* ```typescript
|
|
508
407
|
* const needsApproval = await vaultAPI.needsApproval(
|
|
509
|
-
* "
|
|
408
|
+
* "0x123...456",
|
|
510
409
|
* parseUnits("100", 6)
|
|
511
410
|
* );
|
|
512
411
|
*
|
|
513
412
|
* if (needsApproval) {
|
|
514
413
|
* console.log("Approval required before deposit");
|
|
515
|
-
* await vaultAPI.approve("
|
|
414
|
+
* await vaultAPI.approve("0x123...456", parseUnits("100", 6));
|
|
516
415
|
* }
|
|
517
416
|
* ```
|
|
518
417
|
*/
|
|
519
|
-
async needsApproval(
|
|
418
|
+
async needsApproval(tokenAddress, amount) {
|
|
520
419
|
try {
|
|
521
|
-
const allowance = await this.getAllowance(
|
|
420
|
+
const allowance = await this.getAllowance(tokenAddress);
|
|
522
421
|
return allowance < amount;
|
|
523
422
|
}
|
|
524
423
|
catch (error) {
|
|
525
|
-
throw new ContractError(`Failed to check approval for token ${
|
|
424
|
+
throw new ContractError(`Failed to check approval for token ${tokenAddress}`, error instanceof Error ? error.message : "Unknown error", undefined);
|
|
526
425
|
}
|
|
527
426
|
}
|
|
528
427
|
/**
|
|
@@ -532,19 +431,16 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
532
431
|
* the cryptographic signature required for deposit transactions. The signature
|
|
533
432
|
* validates the deposit request and ensures proper authorization.
|
|
534
433
|
*
|
|
535
|
-
* @param
|
|
434
|
+
* @param tokenAddress - The token address to deposit
|
|
536
435
|
* @param amount - The amount to deposit (as bigint)
|
|
537
436
|
* @param userAddress - The user's wallet address
|
|
538
437
|
* @returns Promise resolving to object containing seed and signature
|
|
539
438
|
* @throws {APIError} When signature retrieval fails
|
|
540
439
|
* @private
|
|
541
440
|
*/
|
|
542
|
-
async getDepositSignature(
|
|
441
|
+
async getDepositSignature(tokenAddress, amount, userAddress) {
|
|
543
442
|
try {
|
|
544
|
-
const
|
|
545
|
-
this.getVaultAddress(),
|
|
546
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
547
|
-
]);
|
|
443
|
+
const vaultAddress = await this.getVaultAddress();
|
|
548
444
|
// Generate a unique nonce and expiry for this transaction
|
|
549
445
|
const nonce = Math.floor(Date.now() / 1000); // Current timestamp as nonce
|
|
550
446
|
const expiry = Math.floor(Date.now() / 1000) + 3600; // 1 hour from now
|
|
@@ -576,19 +472,16 @@ export class VaultAPIImpl extends BaseAPI {
|
|
|
576
472
|
* the cryptographic signature required for withdrawal transactions. The signature
|
|
577
473
|
* validates the withdrawal request and ensures proper authorization.
|
|
578
474
|
*
|
|
579
|
-
* @param
|
|
475
|
+
* @param tokenAddress - The token address to withdraw
|
|
580
476
|
* @param amount - The amount to withdraw (as bigint)
|
|
581
477
|
* @param userAddress - The user's wallet address
|
|
582
478
|
* @returns Promise resolving to object containing seed and signature
|
|
583
479
|
* @throws {APIError} When signature retrieval fails
|
|
584
480
|
* @private
|
|
585
481
|
*/
|
|
586
|
-
async getWithdrawSignature(
|
|
482
|
+
async getWithdrawSignature(tokenAddress, amount, userAddress) {
|
|
587
483
|
try {
|
|
588
|
-
const
|
|
589
|
-
this.getVaultAddress(),
|
|
590
|
-
this.mapTokenSymbolToAddress(tokenSymbol),
|
|
591
|
-
]);
|
|
484
|
+
const vaultAddress = await this.getVaultAddress();
|
|
592
485
|
const data = await this.makeAuthenticatedRequest("/api/v1/withdraw/signature", {
|
|
593
486
|
method: "POST",
|
|
594
487
|
body: JSON.stringify({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/api/vault/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAGN,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,WAAW,GAIX,MAAM,MAAM,CAAC;AACd,OAAO,EACN,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,OAAO,YAAa,SAAQ,OAAO;IAIxC;;;;;;;;;OASG;IACH,YACkB,YAA0B,EAC1B,YAA0B,EAC1B,KAAY,EAC7B,SAAoB,EACpB,eAAgC,EAChC,MAAc;QAEd,KAAK,CAAC,MAAM,CAAC,CAAC;QAPG,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,UAAK,GAAL,KAAK,CAAO;QAM7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,eAAe;QACpB,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,EAAE,CAAC;YACjE,OAAO,MAAM,CAAC,oBAA+B,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,QAAQ,CACjB,4DAA4D,EAC5D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;gBACX,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ;gBAC7D,OAAO;aACP,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO;gBACN,GAAG,QAAQ;gBACX,MAAM,EAAE,QAAQ;aAChB,CAAC;QACH,CAAC;IACF,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"viem": "2.
|
|
12
|
+
"viem": "^2.31.7"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@0xmonaco/contracts": "0.1.
|
|
16
|
-
"@0xmonaco/types": "0.2.
|
|
15
|
+
"@0xmonaco/contracts": "0.1.8",
|
|
16
|
+
"@0xmonaco/types": "0.2.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^20.11.30",
|
|
20
20
|
"@types/ws": "^8.18.1",
|
|
21
21
|
"@vitest/coverage-v8": "^1.3.1",
|
|
22
22
|
"dotenv": "^17.1.0",
|
|
23
|
-
"typescript": "5.
|
|
23
|
+
"typescript": "5.9.2",
|
|
24
24
|
"vitest": "^1.3.1",
|
|
25
25
|
"ws": "^8.18.3"
|
|
26
26
|
},
|