Skip to content

Commit

Permalink
revert: changes to Solana getTokenAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
anondev2323 committed Oct 18, 2023
1 parent 4b52ea0 commit be40518
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions platforms/solana/src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@ import {
ChainContext,
NativeAddress,
UniversalAddress,
UniversalOrNative,
toNative,
} from '@wormhole-foundation/connect-sdk';
import { getAssociatedTokenAddress } from '@solana/spl-token';
import { SolanaPlatform } from './platform';
import { AnySolanaAddress } from './types';
import { SolanaAddress } from './address';

export class SolanaChain extends ChainContext<'Solana'> {
// @ts-ignore
readonly platform = SolanaPlatform;

async getTokenAccount(
token: AnySolanaAddress | 'native',
token: UniversalOrNative<'Solana'> | 'native',
address: UniversalAddress,
): Promise<NativeAddress<'Solana'>> {
const tb = await this.getTokenBridge();

const mintAddress =
const mintAddress: UniversalOrNative<'Solana'> =
token === 'native'
? await tb.getWrappedNative()
: new SolanaAddress(token);
: token.toUniversalAddress();

const mint = new PublicKey(mintAddress.toUint8Array());
const owner = new PublicKey(address.toUint8Array());
Expand Down

0 comments on commit be40518

Please sign in to comment.