Update js sdk transfer from solana
Change-Id: I1e81e5c068e00a2c02fea74df6c21603d44b9d74
This commit is contained in:
parent
08b4e8c7b3
commit
fe2b0d4d07
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue