|
1 | 1 | import {
|
| 2 | + addComputeBudget, |
2 | 3 | ChainId,
|
3 | 4 | ChainName,
|
4 | 5 | TokenId,
|
5 | 6 | } from '@wormhole-foundation/wormhole-connect-sdk';
|
6 | 7 | import { InboundQueuedTransfer } from '../../types';
|
7 |
| -import { solanaContext, toChainId } from 'utils/sdk'; |
| 8 | +import { solanaContext, toChainId, toChainName } from 'utils/sdk'; |
8 | 9 | import { TransferWallet, postVaa, signAndSendTransaction } from 'utils/wallet';
|
9 | 10 | import {
|
10 | 11 | Connection,
|
@@ -62,7 +63,7 @@ export class NttManagerSolana {
|
62 | 63 | readonly wormholeId: string;
|
63 | 64 |
|
64 | 65 | constructor(readonly nttId: string) {
|
65 |
| - const connection = solanaContext().connection; |
| 66 | + const { connection } = solanaContext(); |
66 | 67 | if (!connection) throw new Error('Connection not found');
|
67 | 68 | this.connection = connection;
|
68 | 69 | this.program = new Program(IDL, nttId, { connection });
|
@@ -91,7 +92,7 @@ export class NttManagerSolana {
|
91 | 92 | payer,
|
92 | 93 | from: tokenAccount,
|
93 | 94 | amount: new BN(amount.toString()),
|
94 |
| - recipientChain: CONFIG.wh.toChainName(toChain), |
| 95 | + recipientChain: toChainName(toChain), |
95 | 96 | recipientAddress: destContext.formatAddress(recipient),
|
96 | 97 | fromAuthority: payer,
|
97 | 98 | outboxItem: outboxItem.publicKey,
|
@@ -141,6 +142,7 @@ export class NttManagerSolana {
|
141 | 142 | tx.feePayer = payer;
|
142 | 143 | const { blockhash } = await this.connection.getLatestBlockhash('finalized');
|
143 | 144 | tx.recentBlockhash = blockhash;
|
| 145 | + await addComputeBudget(this.connection, tx); |
144 | 146 | tx.partialSign(outboxItem);
|
145 | 147 | const txId = await signAndSendTransaction(
|
146 | 148 | 'solana',
|
@@ -217,6 +219,7 @@ export class NttManagerSolana {
|
217 | 219 | tx.feePayer = payerPublicKey;
|
218 | 220 | const { blockhash } = await this.connection.getLatestBlockhash('finalized');
|
219 | 221 | tx.recentBlockhash = blockhash;
|
| 222 | + await addComputeBudget(this.connection, tx); |
220 | 223 | const txId = await signAndSendTransaction(
|
221 | 224 | 'solana',
|
222 | 225 | tx,
|
@@ -332,6 +335,7 @@ export class NttManagerSolana {
|
332 | 335 | tx.feePayer = payerPublicKey;
|
333 | 336 | const { blockhash } = await this.connection.getLatestBlockhash('finalized');
|
334 | 337 | tx.recentBlockhash = blockhash;
|
| 338 | + await addComputeBudget(this.connection, tx); |
335 | 339 | const txId = await signAndSendTransaction(
|
336 | 340 | 'solana',
|
337 | 341 | tx,
|
@@ -434,7 +438,7 @@ export class NttManagerSolana {
|
434 | 438 | }
|
435 | 439 |
|
436 | 440 | transceiverPeerAccountAddress(chain: ChainName | ChainId): PublicKey {
|
437 |
| - const chainId = CONFIG.wh.toChainId(chain); |
| 441 | + const chainId = toChainId(chain); |
438 | 442 | return this.derivePda([
|
439 | 443 | Buffer.from('transceiver_peer'),
|
440 | 444 | new BN(chainId).toBuffer('be', 2),
|
|
0 commit comments