Update js sdk transfer from solana

Change-Id: I1e81e5c068e00a2c02fea74df6c21603d44b9d74
This commit is contained in:
Joseph Lee 2021-10-15 14:11:55 +00:00 committed by Evan Gray
parent 08b4e8c7b3
commit fe2b0d4d07
1 changed files with 4 additions and 3 deletions

View File

@ -272,7 +272,8 @@ export async function transferFromSolana(
targetAddress: Uint8Array, targetAddress: Uint8Array,
targetChain: ChainId, targetChain: ChainId,
originAddress?: Uint8Array, originAddress?: Uint8Array,
originChain?: ChainId originChain?: ChainId,
fromOwnerAddress?: string
) { ) {
const nonce = createNonce().readUInt32LE(0); const nonce = createNonce().readUInt32LE(0);
const fee = BigInt(0); // for now, this won't do anything, we may add later const fee = BigInt(0); // for now, this won't do anything, we may add later
@ -290,7 +291,7 @@ export async function transferFromSolana(
TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID,
new PublicKey(fromAddress), new PublicKey(fromAddress),
new PublicKey(approval_authority_address(tokenBridgeAddress)), new PublicKey(approval_authority_address(tokenBridgeAddress)),
new PublicKey(payerAddress), new PublicKey(fromOwnerAddress || payerAddress),
[], [],
new u64(amount.toString(16), 16) new u64(amount.toString(16), 16)
); );
@ -321,7 +322,7 @@ export async function transferFromSolana(
payerAddress, payerAddress,
messageKey.publicKey.toString(), messageKey.publicKey.toString(),
fromAddress, fromAddress,
payerAddress, fromOwnerAddress || payerAddress,
originChain as number, // checked by isSolanaNative originChain as number, // checked by isSolanaNative
originAddress as Uint8Array, // checked by throw originAddress as Uint8Array, // checked by throw
nonce, nonce,