Skip to content

Commit 48f2df5

Browse files
committed
Update token-wrap escrow docs
1 parent d47d589 commit 48f2df5

File tree

1 file changed

+34
-41
lines changed

1 file changed

+34
-41
lines changed

docs/content/docs/token-wrap.mdx

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ address of the original *unwrapped* token mint. This allows anyone to easily det
3131
corresponding to a wrapped token, facilitating unwrapping.
3232

3333
2. **`Wrap`:** This operation accepts deposits of unwrapped tokens and mints wrapped tokens.
34-
* Unwrapped tokens are transferred from the user's account to an escrow account owned by the wrapped mint authority (different for every mint). Any unwrapped token account whose owner is a PDA controlled by the Token Wrap program can be used.
34+
* Unwrapped tokens are transferred from the user's account to a specific escrow Associated Token Account (ATA). This ATA is for the unwrapped mint, and its authority is a Program Derived Address (PDA) controlled by the Token Wrap program (unique for each wrapped mint).
3535
* An equivalent amount of wrapped tokens is minted to the user's wrapped token account.
3636

3737
3. **`Unwrap`:** This operation burns wrapped tokens and releases unwrapped token deposits.
@@ -199,6 +199,7 @@ To interact with wrapped tokens, you need to know the PDAs (Program Derived Addr
199199
Wrapped mint address: B8HbxGU4npjgjMX5xJFR2FYkgvAHdZqyVb8MyFvdsuNM
200200
Wrapped mint authority: 8WdYPmtq8c6ZfmHMZUwCQL2E8qVHEV8rG9MXkyax3joR
201201
Wrapped backpointer address: CNjr898vsBdzWxrJApMSAQac4A7o7qLRcSseTb56X7C9
202+
Unwrapped escrow address: QrzXtFZedQmg8AGu6AnUkPgmsLnR9ErsjNRLdCrRVWw
202203
```
203204
</Tab>
204205

@@ -210,7 +211,8 @@ To interact with wrapped tokens, you need to know the PDAs (Program Derived Addr
210211
findWrappedMintAuthorityPda,
211212
findWrappedMintPda,
212213
} from '@solana-program/token-wrap';
213-
import { TOKEN_2022_PROGRAM_ADDRESS } from '@solana-program/token-2022';
214+
import { findAssociatedTokenPda, TOKEN_2022_PROGRAM_ADDRESS } from '@solana-program/token-2022';
215+
import { TOKEN_PROGRAM_ADDRESS } from '@solana-program/token';
214216

215217
const UNWRAPPED_MINT_ADDRESS = address('5StBUZ2w8ShDN9iF7NkGpDNNH2wv9jK7zhArmVRpwrCt');
216218

@@ -222,19 +224,28 @@ To interact with wrapped tokens, you need to know the PDAs (Program Derived Addr
222224
const [backpointer] = await findBackpointerPda({ wrappedMint });
223225
const [wrappedMintAuthority] = await findWrappedMintAuthorityPda({ wrappedMint });
224226

227+
const [escrowAccount] = await findAssociatedTokenPda({
228+
owner: wrappedMintAuthority,
229+
mint: UNWRAPPED_MINT_ADDRESS,
230+
tokenProgram: TOKEN_PROGRAM_ADDRESS, // unwrapped token program address
231+
});
232+
225233
console.log('WRAPPED_MINT_ADDRESS', wrappedMint);
226234
console.log('BACKPOINTER', backpointer);
227235
console.log('WRAPPED_MINT_AUTHORITY', wrappedMintAuthority);
236+
console.log('ESCROW_ACCOUNT', escrowAccount);
228237
}
229238

230239
void main();
240+
231241
```
232242
</Tab>
233243
</Tabs>
234244

235245
### Create escrow account
236246

237-
Before wrapping tokens, you need to create an account to hold the unwrapped tokens. The escrow account's owner must be the correct PDA (see `find-pdas` command above). There is also a helper to create this account:
247+
Before wrapping tokens, if you are the first to do so for this wrapped mint, you may need to initialize the escrow account to custody the unwrapped tokens.
248+
The account must be an ATA whose owner is the mint authority PDA (see `find-pdas` command above). There is also a helper to initialize this account:
238249

239250
<Tabs groupId="language" items={['CLI', 'JS']}>
240251
<Tab value="CLI">
@@ -284,10 +295,12 @@ Before wrapping tokens, you need to create an account to hold the unwrapped toke
284295
unwrappedMint: UNWRAPPED_MINT_ADDRESS,
285296
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
286297
});
287-
const signedCreateEscrowTx = await signTransactionMessageWithSigners(createEscrowMessage.tx);
288-
await sendAndConfirm(signedCreateEscrowTx, { commitment: 'confirmed' });
298+
if (!createEscrowMessage.exists) {
299+
const signedCreateEscrowTx = await signTransactionMessageWithSigners(createEscrowMessage.tx);
300+
await sendAndConfirm(signedCreateEscrowTx, { commitment: 'confirmed' });
301+
}
289302

290-
console.log('ESCROW_ADDRESS', createEscrowMessage.keyPair.address);
303+
console.log('ESCROW_ADDRESS', createEscrowMessage.address);
291304
}
292305

293306
void main();
@@ -304,10 +317,9 @@ Escrows unwrapped tokens and mints wrapped tokens to recipient account.
304317
<Tab value="CLI">
305318
```console
306319
$ UNWRAPPED_TOKEN_ACCOUNT=DKFjYKEFS4tkXjamwkuiGf555Lww3eRSWwNTbue9x14
307-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
308320
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
309321

310-
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $WRAPPED_TOKEN_PROGRAM 100
322+
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $WRAPPED_TOKEN_PROGRAM 100
311323

312324
Wrapping 100 tokens from mint BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
313325
Unwrapped mint address: BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
@@ -323,7 +335,7 @@ Escrows unwrapped tokens and mints wrapped tokens to recipient account.
323335
You can specify a recipient token account with the `--recipient-token-account` option. If not provided, the associated token account of the fee payer will be used or created if it doesn't exist.
324336

325337
```console
326-
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $WRAPPED_TOKEN_PROGRAM 100 \
338+
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $WRAPPED_TOKEN_PROGRAM 100 \
327339
--recipient-token-account $RECIPIENT_WRAPPED_TOKEN_ACCOUNT
328340
```
329341
</Tab>
@@ -344,7 +356,6 @@ Escrows unwrapped tokens and mints wrapped tokens to recipient account.
344356

345357
// Replace these consts with your own
346358
const PRIVATE_KEY_PAIR = new Uint8Array([242, 30, 38, 177, 152, 71, ... ]);
347-
const ESCROW_ACCOUNT = address('4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3');
348359
const UNWRAPPED_TOKEN_ACCOUNT = address('CbuRmvG3frMoPFnsKfC2t8jTUHFjtnrKZBt2aqdqH4PG');
349360
const RECIPIENT = address('HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt');
350361
const AMOUNT_TO_WRAP = 100n;
@@ -362,7 +373,6 @@ Escrows unwrapped tokens and mints wrapped tokens to recipient account.
362373
blockhash,
363374
payer,
364375
unwrappedTokenAccount: UNWRAPPED_TOKEN_ACCOUNT,
365-
escrowAccount: ESCROW_ACCOUNT,
366376
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
367377
recipientWrappedTokenAccount: RECIPIENT,
368378
amount: AMOUNT_TO_WRAP,
@@ -416,11 +426,10 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
416426
$ MULTISIG_ADDRESS=mgnqjedikMKaRtS5wrhVttuA12JaPXiqY619Gfef5eh
417427
$ RECIPIENT_ACCOUNT=HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt
418428
$ UNWRAPPED_MINT=BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
419-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
420429
$ UNWRAPPED_TOKEN_PROGRAM=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
421430
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
422431

423-
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $WRAPPED_TOKEN_PROGRAM 23 \
432+
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $WRAPPED_TOKEN_PROGRAM 23 \
424433
--transfer-authority $MULTISIG_ADDRESS \
425434
--recipient-token-account $RECIPIENT_ACCOUNT \
426435
--unwrapped-mint $UNWRAPPED_MINT \
@@ -451,11 +460,10 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
451460
$ MULTISIG_ADDRESS=mgnqjedikMKaRtS5wrhVttuA12JaPXiqY619Gfef5eh
452461
$ RECIPIENT_ACCOUNT=HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt
453462
$ UNWRAPPED_MINT=BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
454-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
455463
$ UNWRAPPED_TOKEN_PROGRAM=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
456464
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
457465

458-
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $WRAPPED_TOKEN_PROGRAM 23 \
466+
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $WRAPPED_TOKEN_PROGRAM 23 \
459467
--transfer-authority $MULTISIG_ADDRESS \
460468
--recipient-token-account $RECIPIENT_ACCOUNT \
461469
--unwrapped-mint $UNWRAPPED_MINT \
@@ -487,11 +495,10 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
487495
$ MULTISIG_ADDRESS=mgnqjedikMKaRtS5wrhVttuA12JaPXiqY619Gfef5eh
488496
$ RECIPIENT_ACCOUNT=HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt
489497
$ UNWRAPPED_MINT=BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
490-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
491498
$ UNWRAPPED_TOKEN_PROGRAM=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
492499
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
493500

494-
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $WRAPPED_TOKEN_PROGRAM 23 \
501+
$ spl-token-wrap wrap $UNWRAPPED_TOKEN_ACCOUNT $WRAPPED_TOKEN_PROGRAM 23 \
495502
--transfer-authority $MULTISIG_ADDRESS \
496503
--recipient-token-account $RECIPIENT_ACCOUNT \
497504
--unwrapped-mint $UNWRAPPED_MINT \
@@ -547,7 +554,6 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
547554
const UNWRAPPED_MINT_ADDRESS = address('E8r9ixwg7QYr6xCh4tSdHErZ6CUxQhVGHqF5bRoZXyyV');
548555
const UNWRAPPED_TOKEN_ACCOUNT = address('DGNyuKAWP3susy6XMbVsYHy2AMrrKmh8pXM3WpQUeyL2'); // Must be owned by multisig account
549556
const UNWRAPPED_TOKEN_PROGRAM = address('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');
550-
const ESCROW = address('4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3');
551557
const RECIPIENT = address('HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt');
552558
const AMOUNT_TO_WRAP = 100n;
553559

@@ -566,10 +572,9 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
566572

567573
// Two signers and the payer sign the transaction independently
568574

569-
const wrapTxA = multisigOfflineSignWrapTx({
575+
const wrapTxA = await multisigOfflineSignWrapTx({
570576
payer: createNoopSigner(payer.address),
571577
unwrappedTokenAccount: UNWRAPPED_TOKEN_ACCOUNT,
572-
escrowAccount: ESCROW,
573578
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
574579
amount: AMOUNT_TO_WRAP,
575580
unwrappedMint: UNWRAPPED_MINT_ADDRESS,
@@ -583,10 +588,9 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
583588
});
584589
const signedWrapTxA = await partiallySignTransactionMessageWithSigners(wrapTxA);
585590

586-
const wrapTxB = multisigOfflineSignWrapTx({
591+
const wrapTxB = await multisigOfflineSignWrapTx({
587592
payer: createNoopSigner(payer.address),
588593
unwrappedTokenAccount: UNWRAPPED_TOKEN_ACCOUNT,
589-
escrowAccount: ESCROW,
590594
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
591595
amount: AMOUNT_TO_WRAP,
592596
unwrappedMint: UNWRAPPED_MINT_ADDRESS,
@@ -600,10 +604,9 @@ An example wrapping tokens whose origin is a token account owned by an SPL Token
600604
});
601605
const signedWrapTxB = await partiallySignTransactionMessageWithSigners(wrapTxB);
602606

603-
const wrapTxC = multisigOfflineSignWrapTx({
607+
const wrapTxC = await multisigOfflineSignWrapTx({
604608
payer,
605609
unwrappedTokenAccount: UNWRAPPED_TOKEN_ACCOUNT,
606-
escrowAccount: ESCROW,
607610
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
608611
amount: AMOUNT_TO_WRAP,
609612
unwrappedMint: UNWRAPPED_MINT_ADDRESS,
@@ -647,11 +650,10 @@ Burns wrapped tokens and releases unwrapped tokens from escrow.
647650
<Tabs groupId="language" items={['CLI', 'JS']}>
648651
<Tab value="CLI">
649652
```console
650-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
651653
$ WRAPPED_TOKEN_ACCOUNT=HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt
652654
$ UNWRAPPED_TOKEN_RECIPIENT=DKFjYKEFS4tkXjamwkuiGf555Lww3eRSWwNTbue9x14
653655

654-
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 50
656+
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 50
655657

656658
Unwrapping 50 tokens from mint BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
657659
Unwrapped token program: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
@@ -679,7 +681,6 @@ Burns wrapped tokens and releases unwrapped tokens from escrow.
679681
// Replace these consts with your own
680682
const PRIVATE_KEY_PAIR = new Uint8Array([242, 30, 38, 177, 152, 71, ... ]);
681683
const WRAPPED_TOKEN_ACCOUNT = address('HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt');
682-
const ESCROW = address('4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3');
683684
const RECIPIENT = address('DKFjYKEFS4tkXjamwkuiGf555Lww3eRSWwNTbue9x14');
684685
const AMOUNT_TO_WRAP = 100n;
685686

@@ -696,7 +697,6 @@ Burns wrapped tokens and releases unwrapped tokens from escrow.
696697
blockhash,
697698
payer,
698699
wrappedTokenAccount: WRAPPED_TOKEN_ACCOUNT,
699-
unwrappedEscrow: ESCROW,
700700
amount: AMOUNT_TO_WRAP,
701701
recipientUnwrappedToken: RECIPIENT,
702702
});
@@ -748,11 +748,10 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
748748
$ MULTISIG_ADDRESS=FFQvYvhaWnHeGsCMfixccUMdnXPgDrkG3KkGzpfBHFPb # note this should have the same program-id as wrapped token account
749749
$ UNWRAPPED_TOKEN_RECIPIENT=DKFjYKEFS4tkXjamwkuiGf555Lww3eRSWwNTbue9x14
750750
$ UNWRAPPED_MINT=BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
751-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
752751
$ UNWRAPPED_TOKEN_PROGRAM=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
753752
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
754753

755-
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 5 \
754+
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 5 \
756755
--transfer-authority $MULTISIG_ADDRESS \
757756
--fee-payer $FEE_PAYER \
758757
--unwrapped-mint $UNWRAPPED_MINT \
@@ -777,11 +776,10 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
777776
$ MULTISIG_ADDRESS=FFQvYvhaWnHeGsCMfixccUMdnXPgDrkG3KkGzpfBHFPb
778777
$ UNWRAPPED_TOKEN_RECIPIENT=DKFjYKEFS4tkXjamwkuiGf555Lww3eRSWwNTbue9x14
779778
$ UNWRAPPED_MINT=BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
780-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
781779
$ UNWRAPPED_TOKEN_PROGRAM=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
782780
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
783781

784-
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 5 \
782+
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 5 \
785783
--transfer-authority $MULTISIG_ADDRESS \
786784
--fee-payer $FEE_PAYER \
787785
--unwrapped-mint $UNWRAPPED_MINT \
@@ -807,11 +805,10 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
807805
$ MULTISIG_ADDRESS=FFQvYvhaWnHeGsCMfixccUMdnXPgDrkG3KkGzpfBHFPb
808806
$ UNWRAPPED_TOKEN_RECIPIENT=DKFjYKEFS4tkXjamwkuiGf555Lww3eRSWwNTbue9x14
809807
$ UNWRAPPED_MINT=BVpjjYmSgSPZbFGTXe52NYXApsDNQJRe2qQF1hQft85e
810-
$ ESCROW_ACCOUNT=4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3
811808
$ UNWRAPPED_TOKEN_PROGRAM=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
812809
$ WRAPPED_TOKEN_PROGRAM=TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
813810

814-
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $ESCROW_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 5 \
811+
$ spl-token-wrap unwrap $WRAPPED_TOKEN_ACCOUNT $UNWRAPPED_TOKEN_RECIPIENT 5 \
815812
--transfer-authority $MULTISIG_ADDRESS \
816813
--fee-payer $FEE_PAYER \
817814
--unwrapped-mint $UNWRAPPED_MINT \
@@ -865,7 +862,6 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
865862
const UNWRAPPED_MINT_ADDRESS = address('E8r9ixwg7QYr6xCh4tSdHErZ6CUxQhVGHqF5bRoZXyyV');
866863
const UNWRAPPED_TOKEN_ACCOUNT = address('DGNyuKAWP3susy6XMbVsYHy2AMrrKmh8pXM3WpQUeyL2'); // Must be owned by multisig account
867864
const UNWRAPPED_TOKEN_PROGRAM = address('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');
868-
const ESCROW = address('4NoeQJKuH8fu1Pqk5k8BJpNu4wA7T8K6QABJxjTWoHs3');
869865
const RECIPIENT = address('HKHfad5Rx7Vv1iWzPiQhx3cnXpbVfDonYRRo1e16x5Bt');
870866
const AMOUNT_TO_WRAP = 100n;
871867

@@ -884,9 +880,8 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
884880

885881
const { value: unwrapBlockhash } = await rpc.getLatestBlockhash().send();
886882

887-
const unwrapTxA = multisigOfflineSignUnwrap({
883+
const unwrapTxA = await multisigOfflineSignUnwrap({
888884
payer: createNoopSigner(payer.address),
889-
unwrappedEscrow: ESCROW,
890885
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
891886
amount: AMOUNT_TO_WRAP,
892887
unwrappedMint: UNWRAPPED_MINT_ADDRESS,
@@ -901,9 +896,8 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
901896
});
902897
const signedUnwrapTxA = await partiallySignTransactionMessageWithSigners(unwrapTxA);
903898

904-
const unwrapTxB = multisigOfflineSignUnwrap({
899+
const unwrapTxB = await multisigOfflineSignUnwrap({
905900
payer: createNoopSigner(payer.address),
906-
unwrappedEscrow: ESCROW,
907901
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
908902
amount: AMOUNT_TO_WRAP,
909903
unwrappedMint: UNWRAPPED_MINT_ADDRESS,
@@ -918,9 +912,8 @@ An example unwrapping tokens whose origin is a token account owned by an SPL Tok
918912
});
919913
const signedUnwrapTxB = await partiallySignTransactionMessageWithSigners(unwrapTxB);
920914

921-
const unwrapTxC = multisigOfflineSignUnwrap({
915+
const unwrapTxC = await multisigOfflineSignUnwrap({
922916
payer: payer,
923-
unwrappedEscrow: ESCROW,
924917
wrappedTokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
925918
amount: AMOUNT_TO_WRAP,
926919
unwrappedMint: UNWRAPPED_MINT_ADDRESS,

0 commit comments

Comments
 (0)