metaplex-foundation / Solana.Swift

This is a open source library on pure swift for Solana protocol.
MIT License
164 stars 75 forks source link

How to get Token Metadata on Devnet? #223

Open lreiner opened 1 year ago

lreiner commented 1 year ago

Hi how can i receive token metadata like symbol, icon and name from dev net: https://explorer.solana.com/address/Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr?cluster=devnet

the function i use is the following:

let accounts = try await connection!.action.getTokenWallets(account: account!.publicKey.description)

which gives me the balance yes but not metadata provided:

Solana.Wallet(pubkey: "5v1hgkjCSee7LqMmghNk4Rq6szmmzu78hPKfDNeprdnc", ammount: Optional(Solana.TokenAmount(amount: "2000000000", decimals: 6, uiAmount: 2000.0, uiAmountString: "2000")), token: Optional(Solana.Token(chainId: nil, address: "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", symbol: nil, name: nil, logoURI: nil, extensions: nil, tags: Optional([]), isNative: false)), liquidity: Optional(false))

so how can i get this information: symbol: nil, name: nil, logoURI: nil,

ajamaica commented 1 year ago

You need to provide the list on the initialize