Skip to content

Commit

Permalink
fix: pubkey for solana
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Nov 14, 2022
1 parent 794bda1 commit bb20b9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/bridge-ts/src/wormhole/WormholeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,13 @@ export class WormholeClient {
const { network, solanaHostUrl, wormholeRpcUrl } = this
const { amount, recipient, signerPubKey } = args
const endpoints = getEndpointsForNetwork(network)
const pubKey = provider.publicKey || signerPubKey

if (!solanaHostUrl) {
throw new GeneralException(new Error(`Please provide solanaHostUrl`))
}

if (!signerPubKey) {
if (!pubKey) {
throw new GeneralException(new Error(`Please provide signerPubKey`))
}

Expand Down Expand Up @@ -341,7 +342,7 @@ export class WormholeClient {

const connection = new Connection(solanaHostUrl, 'confirmed')
const solanaMintKey = new SolanaPublicKey(foreignAsset)
const ownerKey = new SolanaPublicKey(signerPubKey.toBytes())
const ownerKey = new SolanaPublicKey(pubKey.toBytes())
const recipientAddress = await getAssociatedTokenAddress(
solanaMintKey,
ownerKey,
Expand Down

0 comments on commit bb20b9f

Please sign in to comment.