Skip to content

Commit

Permalink
Update SolanaRPCProvider.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
xueyuejie committed Jan 18, 2022
1 parent d6c079b commit 0660d3b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/SolanaSwift/Provider/SolanaRPCProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ extension SolanaRPCProvider {
let amount = Int(value.account!.data!.parsed!.info!.tokenAmount!.amount!)!
let decimals = value.account!.data!.parsed!.info!.tokenAmount!.decimals!
if amount > 0 && decimals == 0 {
let FDAAdddress = SolanaPublicKey.createProgramAddress( mint:SolanaPublicKey(base58String:value.account!.data!.parsed!.info!.mint!)!)
let result = SolanaNFTTokenResult(pubkey: value.pubkey!, mint: value.account!.data!.parsed!.info!.mint!, owner: value.account!.data!.parsed!.info!.owner!, FDAAddress: FDAAdddress!.address,amount: amount)
guard let mint = SolanaPublicKey(base58String:value.account!.data!.parsed!.info!.mint!),let FDAAdddress = SolanaPublicKey.createProgramAddress( mint:mint) else {
failure(SolanaRpcProviderError.unknown)
return
}
let result = SolanaNFTTokenResult(pubkey: value.pubkey!, mint: value.account!.data!.parsed!.info!.mint!, owner: value.account!.data!.parsed!.info!.owner!, FDAAddress: FDAAdddress.address,amount: amount)
tokenArray.append(result)
}
}
Expand Down

0 comments on commit 0660d3b

Please sign in to comment.