privacycash 1.1.6 → 1.1.7
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/deposit.js +1 -0
- package/dist/depositSPL.js +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +9 -6
- package/dist/withdraw.d.ts +2 -1
- package/dist/withdraw.js +5 -3
- package/dist/withdrawSPL.d.ts +2 -1
- package/dist/withdrawSPL.js +5 -3
- package/package.json +1 -1
- package/src/deposit.ts +1 -0
- package/src/depositSPL.ts +1 -0
- package/src/index.ts +15 -9
- package/src/withdraw.ts +7 -4
- package/src/withdrawSPL.ts +6 -4
package/dist/deposit.js
CHANGED
|
@@ -338,6 +338,7 @@ export async function deposit({ lightWasm, storage, keyBasePath, publicKey, conn
|
|
|
338
338
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex');
|
|
339
339
|
let start = Date.now();
|
|
340
340
|
while (true) {
|
|
341
|
+
logger.info('Confirming transaction..');
|
|
341
342
|
logger.debug(`retryTimes: ${retryTimes}`);
|
|
342
343
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
343
344
|
logger.debug('Fetching updated tree state...');
|
package/dist/depositSPL.js
CHANGED
|
@@ -396,6 +396,7 @@ export async function depositSPL({ lightWasm, storage, keyBasePath, publicKey, c
|
|
|
396
396
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex');
|
|
397
397
|
let start = Date.now();
|
|
398
398
|
while (true) {
|
|
399
|
+
logger.info('Confirming transaction..');
|
|
399
400
|
logger.debug(`retryTimes: ${retryTimes}`);
|
|
400
401
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
401
402
|
logger.debug('Fetching updated tree state...');
|
package/dist/index.d.ts
CHANGED
|
@@ -45,9 +45,10 @@ export declare class PrivacyCash {
|
|
|
45
45
|
*
|
|
46
46
|
* Lamports is the amount of SOL in lamports. e.g. if you want to withdraw 0.01 SOL (10000000 lamports), call withdraw({ lamports: 10000000 })
|
|
47
47
|
*/
|
|
48
|
-
withdraw({ lamports, recipientAddress }: {
|
|
48
|
+
withdraw({ lamports, recipientAddress, referrer }: {
|
|
49
49
|
lamports: number;
|
|
50
50
|
recipientAddress?: string;
|
|
51
|
+
referrer?: string;
|
|
51
52
|
}): Promise<{
|
|
52
53
|
isPartial: boolean;
|
|
53
54
|
tx: string;
|
|
@@ -60,9 +61,10 @@ export declare class PrivacyCash {
|
|
|
60
61
|
*
|
|
61
62
|
* base_units is the amount of USDC in base unit. e.g. if you want to withdraw 1 USDC (1,000,000 base unit), call withdraw({ base_units: 1000000, recipientAddress: 'some_address' })
|
|
62
63
|
*/
|
|
63
|
-
withdrawUSDC({ base_units, recipientAddress }: {
|
|
64
|
+
withdrawUSDC({ base_units, recipientAddress, referrer }: {
|
|
64
65
|
base_units: number;
|
|
65
66
|
recipientAddress?: string;
|
|
67
|
+
referrer?: string;
|
|
66
68
|
}): Promise<{
|
|
67
69
|
isPartial: boolean;
|
|
68
70
|
tx: string;
|
|
@@ -110,11 +112,12 @@ export declare class PrivacyCash {
|
|
|
110
112
|
/**
|
|
111
113
|
* Withdraw SPL from the Privacy Cash.
|
|
112
114
|
*/
|
|
113
|
-
withdrawSPL({ base_units, mintAddress, recipientAddress, amount }: {
|
|
115
|
+
withdrawSPL({ base_units, mintAddress, recipientAddress, amount, referrer }: {
|
|
114
116
|
base_units?: number;
|
|
115
117
|
amount?: number;
|
|
116
118
|
mintAddress: PublicKey | string;
|
|
117
119
|
recipientAddress?: string;
|
|
120
|
+
referrer?: string;
|
|
118
121
|
}): Promise<{
|
|
119
122
|
isPartial: boolean;
|
|
120
123
|
tx: string;
|
package/dist/index.js
CHANGED
|
@@ -123,7 +123,7 @@ export class PrivacyCash {
|
|
|
123
123
|
*
|
|
124
124
|
* Lamports is the amount of SOL in lamports. e.g. if you want to withdraw 0.01 SOL (10000000 lamports), call withdraw({ lamports: 10000000 })
|
|
125
125
|
*/
|
|
126
|
-
async withdraw({ lamports, recipientAddress }) {
|
|
126
|
+
async withdraw({ lamports, recipientAddress, referrer }) {
|
|
127
127
|
this.isRuning = true;
|
|
128
128
|
logger.info('start withdrawing');
|
|
129
129
|
let lightWasm = await WasmFactory.getInstance();
|
|
@@ -136,7 +136,8 @@ export class PrivacyCash {
|
|
|
136
136
|
publicKey: this.publicKey,
|
|
137
137
|
recipient,
|
|
138
138
|
keyBasePath: path.join(import.meta.dirname, '..', 'circuit2', 'transaction2'),
|
|
139
|
-
storage
|
|
139
|
+
storage,
|
|
140
|
+
referrer
|
|
140
141
|
});
|
|
141
142
|
logger.debug(`Withdraw successful. Recipient ${recipient} received ${res.amount_in_lamports / LAMPORTS_PER_SOL} SOL, with ${res.fee_in_lamports / LAMPORTS_PER_SOL} SOL relayers fees`);
|
|
142
143
|
this.isRuning = false;
|
|
@@ -147,7 +148,7 @@ export class PrivacyCash {
|
|
|
147
148
|
*
|
|
148
149
|
* base_units is the amount of USDC in base unit. e.g. if you want to withdraw 1 USDC (1,000,000 base unit), call withdraw({ base_units: 1000000, recipientAddress: 'some_address' })
|
|
149
150
|
*/
|
|
150
|
-
async withdrawUSDC({ base_units, recipientAddress }) {
|
|
151
|
+
async withdrawUSDC({ base_units, recipientAddress, referrer }) {
|
|
151
152
|
this.isRuning = true;
|
|
152
153
|
logger.info('start withdrawing');
|
|
153
154
|
let lightWasm = await WasmFactory.getInstance();
|
|
@@ -161,7 +162,8 @@ export class PrivacyCash {
|
|
|
161
162
|
publicKey: this.publicKey,
|
|
162
163
|
recipient,
|
|
163
164
|
keyBasePath: path.join(import.meta.dirname, '..', 'circuit2', 'transaction2'),
|
|
164
|
-
storage
|
|
165
|
+
storage,
|
|
166
|
+
referrer
|
|
165
167
|
});
|
|
166
168
|
logger.debug(`Withdraw successful. Recipient ${recipient} received ${base_units} USDC units`);
|
|
167
169
|
this.isRuning = false;
|
|
@@ -248,7 +250,7 @@ export class PrivacyCash {
|
|
|
248
250
|
/**
|
|
249
251
|
* Withdraw SPL from the Privacy Cash.
|
|
250
252
|
*/
|
|
251
|
-
async withdrawSPL({ base_units, mintAddress, recipientAddress, amount }) {
|
|
253
|
+
async withdrawSPL({ base_units, mintAddress, recipientAddress, amount, referrer }) {
|
|
252
254
|
this.isRuning = true;
|
|
253
255
|
logger.info('start withdrawing');
|
|
254
256
|
let lightWasm = await WasmFactory.getInstance();
|
|
@@ -263,7 +265,8 @@ export class PrivacyCash {
|
|
|
263
265
|
recipient,
|
|
264
266
|
keyBasePath: path.join(import.meta.dirname, '..', 'circuit2', 'transaction2'),
|
|
265
267
|
storage,
|
|
266
|
-
mintAddress
|
|
268
|
+
mintAddress,
|
|
269
|
+
referrer
|
|
267
270
|
});
|
|
268
271
|
logger.debug(`Withdraw successful. Recipient ${recipient} received ${base_units} USDC units`);
|
|
269
272
|
this.isRuning = false;
|
package/dist/withdraw.d.ts
CHANGED
|
@@ -10,8 +10,9 @@ type WithdrawParams = {
|
|
|
10
10
|
lightWasm: hasher.LightWasm;
|
|
11
11
|
recipient: PublicKey;
|
|
12
12
|
storage: Storage;
|
|
13
|
+
referrer?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function withdraw({ recipient, lightWasm, storage, publicKey, connection, amount_in_lamports, encryptionService, keyBasePath }: WithdrawParams): Promise<{
|
|
15
|
+
export declare function withdraw({ recipient, lightWasm, storage, publicKey, connection, amount_in_lamports, encryptionService, keyBasePath, referrer }: WithdrawParams): Promise<{
|
|
15
16
|
isPartial: boolean;
|
|
16
17
|
tx: string;
|
|
17
18
|
recipient: string;
|
package/dist/withdraw.js
CHANGED
|
@@ -35,7 +35,7 @@ async function submitWithdrawToIndexer(params) {
|
|
|
35
35
|
throw error;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
export async function withdraw({ recipient, lightWasm, storage, publicKey, connection, amount_in_lamports, encryptionService, keyBasePath }) {
|
|
38
|
+
export async function withdraw({ recipient, lightWasm, storage, publicKey, connection, amount_in_lamports, encryptionService, keyBasePath, referrer }) {
|
|
39
39
|
let fee_in_lamports = amount_in_lamports * (await getConfig('withdraw_fee_rate')) + LAMPORTS_PER_SOL * (await getConfig('withdraw_rent_fee'));
|
|
40
40
|
amount_in_lamports -= fee_in_lamports;
|
|
41
41
|
let isPartial = false;
|
|
@@ -240,7 +240,8 @@ export async function withdraw({ recipient, lightWasm, storage, publicKey, conne
|
|
|
240
240
|
encryptedOutput2: encryptedOutput2.toString('base64'),
|
|
241
241
|
fee: fee_in_lamports,
|
|
242
242
|
lookupTableAddress: ALT_ADDRESS.toString(),
|
|
243
|
-
senderAddress: publicKey.toString()
|
|
243
|
+
senderAddress: publicKey.toString(),
|
|
244
|
+
referralWalletAddress: referrer
|
|
244
245
|
};
|
|
245
246
|
logger.debug('Prepared withdraw parameters for indexer backend');
|
|
246
247
|
// Submit to indexer backend instead of directly to Solana
|
|
@@ -253,7 +254,8 @@ export async function withdraw({ recipient, lightWasm, storage, publicKey, conne
|
|
|
253
254
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex');
|
|
254
255
|
let start = Date.now();
|
|
255
256
|
while (true) {
|
|
256
|
-
logger.info(
|
|
257
|
+
logger.info('Confirming transaction..');
|
|
258
|
+
logger.debug(`retryTimes: ${retryTimes}`);
|
|
257
259
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
258
260
|
logger.info('Fetching updated tree state...');
|
|
259
261
|
let res = await fetch(RELAYER_API_URL + '/utxos/check/' + encryptedOutputStr);
|
package/dist/withdrawSPL.d.ts
CHANGED
|
@@ -12,8 +12,9 @@ type WithdrawParams = {
|
|
|
12
12
|
recipient: PublicKey;
|
|
13
13
|
mintAddress: PublicKey | string;
|
|
14
14
|
storage: Storage;
|
|
15
|
+
referrer?: string;
|
|
15
16
|
};
|
|
16
|
-
export declare function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress }: WithdrawParams): Promise<{
|
|
17
|
+
export declare function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress, referrer }: WithdrawParams): Promise<{
|
|
17
18
|
isPartial: boolean;
|
|
18
19
|
tx: string;
|
|
19
20
|
recipient: string;
|
package/dist/withdrawSPL.js
CHANGED
|
@@ -36,7 +36,7 @@ async function submitWithdrawToIndexer(params) {
|
|
|
36
36
|
throw error;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress }) {
|
|
39
|
+
export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress, referrer }) {
|
|
40
40
|
if (typeof mintAddress == 'string') {
|
|
41
41
|
mintAddress = new PublicKey(mintAddress);
|
|
42
42
|
}
|
|
@@ -276,7 +276,8 @@ export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, co
|
|
|
276
276
|
treeAta: treeAta.toString(),
|
|
277
277
|
recipientAta: recipient_ata.toString(),
|
|
278
278
|
mintAddress: token.pubkey.toString(),
|
|
279
|
-
feeRecipientTokenAccount: feeRecipientTokenAccount.toString()
|
|
279
|
+
feeRecipientTokenAccount: feeRecipientTokenAccount.toString(),
|
|
280
|
+
referralWalletAddress: referrer
|
|
280
281
|
};
|
|
281
282
|
logger.debug('Prepared withdraw parameters for indexer backend');
|
|
282
283
|
// Submit to indexer backend instead of directly to Solana
|
|
@@ -289,7 +290,8 @@ export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, co
|
|
|
289
290
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex');
|
|
290
291
|
let start = Date.now();
|
|
291
292
|
while (true) {
|
|
292
|
-
logger.info(
|
|
293
|
+
logger.info('Confirming transaction..');
|
|
294
|
+
logger.debug(`retryTimes: ${retryTimes}`);
|
|
293
295
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
294
296
|
logger.info('Fetching updated tree state...');
|
|
295
297
|
let res = await fetch(RELAYER_API_URL + '/utxos/check/' + encryptedOutputStr + '?token=' + token.name);
|
package/package.json
CHANGED
package/src/deposit.ts
CHANGED
|
@@ -420,6 +420,7 @@ export async function deposit({ lightWasm, storage, keyBasePath, publicKey, conn
|
|
|
420
420
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex')
|
|
421
421
|
let start = Date.now()
|
|
422
422
|
while (true) {
|
|
423
|
+
logger.info('Confirming transaction..')
|
|
423
424
|
logger.debug(`retryTimes: ${retryTimes}`)
|
|
424
425
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
425
426
|
logger.debug('Fetching updated tree state...');
|
package/src/depositSPL.ts
CHANGED
|
@@ -511,6 +511,7 @@ export async function depositSPL({ lightWasm, storage, keyBasePath, publicKey, c
|
|
|
511
511
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex')
|
|
512
512
|
let start = Date.now()
|
|
513
513
|
while (true) {
|
|
514
|
+
logger.info('Confirming transaction..')
|
|
514
515
|
logger.debug(`retryTimes: ${retryTimes}`)
|
|
515
516
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
516
517
|
logger.debug('Fetching updated tree state...');
|
package/src/index.ts
CHANGED
|
@@ -141,9 +141,10 @@ export class PrivacyCash {
|
|
|
141
141
|
*
|
|
142
142
|
* Lamports is the amount of SOL in lamports. e.g. if you want to withdraw 0.01 SOL (10000000 lamports), call withdraw({ lamports: 10000000 })
|
|
143
143
|
*/
|
|
144
|
-
async withdraw({ lamports, recipientAddress }: {
|
|
144
|
+
async withdraw({ lamports, recipientAddress, referrer }: {
|
|
145
145
|
lamports: number,
|
|
146
|
-
recipientAddress?: string
|
|
146
|
+
recipientAddress?: string,
|
|
147
|
+
referrer?: string
|
|
147
148
|
}) {
|
|
148
149
|
this.isRuning = true
|
|
149
150
|
logger.info('start withdrawing')
|
|
@@ -157,7 +158,8 @@ export class PrivacyCash {
|
|
|
157
158
|
publicKey: this.publicKey,
|
|
158
159
|
recipient,
|
|
159
160
|
keyBasePath: path.join(import.meta.dirname, '..', 'circuit2', 'transaction2'),
|
|
160
|
-
storage
|
|
161
|
+
storage,
|
|
162
|
+
referrer
|
|
161
163
|
})
|
|
162
164
|
logger.debug(`Withdraw successful. Recipient ${recipient} received ${res.amount_in_lamports / LAMPORTS_PER_SOL} SOL, with ${res.fee_in_lamports / LAMPORTS_PER_SOL} SOL relayers fees`)
|
|
163
165
|
this.isRuning = false
|
|
@@ -169,9 +171,10 @@ export class PrivacyCash {
|
|
|
169
171
|
*
|
|
170
172
|
* base_units is the amount of USDC in base unit. e.g. if you want to withdraw 1 USDC (1,000,000 base unit), call withdraw({ base_units: 1000000, recipientAddress: 'some_address' })
|
|
171
173
|
*/
|
|
172
|
-
async withdrawUSDC({ base_units, recipientAddress }: {
|
|
174
|
+
async withdrawUSDC({ base_units, recipientAddress, referrer }: {
|
|
173
175
|
base_units: number,
|
|
174
|
-
recipientAddress?: string
|
|
176
|
+
recipientAddress?: string,
|
|
177
|
+
referrer?: string
|
|
175
178
|
}) {
|
|
176
179
|
this.isRuning = true
|
|
177
180
|
logger.info('start withdrawing')
|
|
@@ -186,7 +189,8 @@ export class PrivacyCash {
|
|
|
186
189
|
publicKey: this.publicKey,
|
|
187
190
|
recipient,
|
|
188
191
|
keyBasePath: path.join(import.meta.dirname, '..', 'circuit2', 'transaction2'),
|
|
189
|
-
storage
|
|
192
|
+
storage,
|
|
193
|
+
referrer
|
|
190
194
|
})
|
|
191
195
|
logger.debug(`Withdraw successful. Recipient ${recipient} received ${base_units} USDC units`)
|
|
192
196
|
this.isRuning = false
|
|
@@ -284,11 +288,12 @@ export class PrivacyCash {
|
|
|
284
288
|
/**
|
|
285
289
|
* Withdraw SPL from the Privacy Cash.
|
|
286
290
|
*/
|
|
287
|
-
async withdrawSPL({ base_units, mintAddress, recipientAddress, amount }: {
|
|
291
|
+
async withdrawSPL({ base_units, mintAddress, recipientAddress, amount, referrer }: {
|
|
288
292
|
base_units?: number,
|
|
289
293
|
amount?: number,
|
|
290
294
|
mintAddress: PublicKey | string,
|
|
291
|
-
recipientAddress?: string
|
|
295
|
+
recipientAddress?: string,
|
|
296
|
+
referrer?: string
|
|
292
297
|
}) {
|
|
293
298
|
this.isRuning = true
|
|
294
299
|
logger.info('start withdrawing')
|
|
@@ -305,7 +310,8 @@ export class PrivacyCash {
|
|
|
305
310
|
recipient,
|
|
306
311
|
keyBasePath: path.join(import.meta.dirname, '..', 'circuit2', 'transaction2'),
|
|
307
312
|
storage,
|
|
308
|
-
mintAddress
|
|
313
|
+
mintAddress,
|
|
314
|
+
referrer
|
|
309
315
|
})
|
|
310
316
|
logger.debug(`Withdraw successful. Recipient ${recipient} received ${base_units} USDC units`)
|
|
311
317
|
this.isRuning = false
|
package/src/withdraw.ts
CHANGED
|
@@ -52,10 +52,11 @@ type WithdrawParams = {
|
|
|
52
52
|
encryptionService: EncryptionService,
|
|
53
53
|
lightWasm: hasher.LightWasm,
|
|
54
54
|
recipient: PublicKey,
|
|
55
|
-
storage: Storage
|
|
55
|
+
storage: Storage,
|
|
56
|
+
referrer?: string,
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
export async function withdraw({ recipient, lightWasm, storage, publicKey, connection, amount_in_lamports, encryptionService, keyBasePath }: WithdrawParams) {
|
|
59
|
+
export async function withdraw({ recipient, lightWasm, storage, publicKey, connection, amount_in_lamports, encryptionService, keyBasePath, referrer }: WithdrawParams) {
|
|
59
60
|
let fee_in_lamports = amount_in_lamports * (await getConfig('withdraw_fee_rate')) + LAMPORTS_PER_SOL * (await getConfig('withdraw_rent_fee'))
|
|
60
61
|
amount_in_lamports -= fee_in_lamports
|
|
61
62
|
let isPartial = false
|
|
@@ -298,7 +299,8 @@ export async function withdraw({ recipient, lightWasm, storage, publicKey, conne
|
|
|
298
299
|
encryptedOutput2: encryptedOutput2.toString('base64'),
|
|
299
300
|
fee: fee_in_lamports,
|
|
300
301
|
lookupTableAddress: ALT_ADDRESS.toString(),
|
|
301
|
-
senderAddress: publicKey.toString()
|
|
302
|
+
senderAddress: publicKey.toString(),
|
|
303
|
+
referralWalletAddress: referrer
|
|
302
304
|
};
|
|
303
305
|
|
|
304
306
|
|
|
@@ -314,7 +316,8 @@ export async function withdraw({ recipient, lightWasm, storage, publicKey, conne
|
|
|
314
316
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex')
|
|
315
317
|
let start = Date.now()
|
|
316
318
|
while (true) {
|
|
317
|
-
logger.info(
|
|
319
|
+
logger.info('Confirming transaction..')
|
|
320
|
+
logger.debug(`retryTimes: ${retryTimes}`)
|
|
318
321
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
319
322
|
logger.info('Fetching updated tree state...');
|
|
320
323
|
let res = await fetch(RELAYER_API_URL + '/utxos/check/' + encryptedOutputStr)
|
package/src/withdrawSPL.ts
CHANGED
|
@@ -55,9 +55,10 @@ type WithdrawParams = {
|
|
|
55
55
|
recipient: PublicKey,
|
|
56
56
|
mintAddress: PublicKey | string,
|
|
57
57
|
storage: Storage,
|
|
58
|
+
referrer?: string,
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress }: WithdrawParams) {
|
|
61
|
+
export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, connection, base_units, amount, encryptionService, keyBasePath, mintAddress, referrer }: WithdrawParams) {
|
|
61
62
|
if (typeof mintAddress == 'string') {
|
|
62
63
|
mintAddress = new PublicKey(mintAddress)
|
|
63
64
|
}
|
|
@@ -363,10 +364,10 @@ export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, co
|
|
|
363
364
|
treeAta: treeAta.toString(),
|
|
364
365
|
recipientAta: recipient_ata.toString(),
|
|
365
366
|
mintAddress: token.pubkey.toString(),
|
|
366
|
-
feeRecipientTokenAccount: feeRecipientTokenAccount.toString()
|
|
367
|
+
feeRecipientTokenAccount: feeRecipientTokenAccount.toString(),
|
|
368
|
+
referralWalletAddress: referrer
|
|
367
369
|
};
|
|
368
370
|
|
|
369
|
-
|
|
370
371
|
logger.debug('Prepared withdraw parameters for indexer backend');
|
|
371
372
|
|
|
372
373
|
// Submit to indexer backend instead of directly to Solana
|
|
@@ -379,7 +380,8 @@ export async function withdrawSPL({ recipient, lightWasm, storage, publicKey, co
|
|
|
379
380
|
const encryptedOutputStr = Buffer.from(encryptedOutput1).toString('hex')
|
|
380
381
|
let start = Date.now()
|
|
381
382
|
while (true) {
|
|
382
|
-
logger.info(
|
|
383
|
+
logger.info('Confirming transaction..')
|
|
384
|
+
logger.debug(`retryTimes: ${retryTimes}`)
|
|
383
385
|
await new Promise(resolve => setTimeout(resolve, itv * 1000));
|
|
384
386
|
logger.info('Fetching updated tree state...');
|
|
385
387
|
let res = await fetch(RELAYER_API_URL + '/utxos/check/' + encryptedOutputStr + '?token=' + token.name)
|