Skip to content

Commit

Permalink
fix: Add name to nep141 metadata type.
Browse files Browse the repository at this point in the history
  • Loading branch information
paouvrard committed Dec 21, 2021
1 parent b805415 commit 983e538
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/aurora-nep141/src/natural-nep141/getMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Account } from 'near-api-js'
import { nep141 } from '@near-eth/utils'
import { getNearAccount } from '@near-eth/client/dist/utils'

const tokenMetadata: {[key: string]: {symbol: string, decimals: number, icon: string}} = {}
const tokenMetadata: {[key: string]: {symbol: string, decimals: number, name: string, icon: string}} = {}

export default async function getMetadata (
{ nep141Address, options }: {
Expand All @@ -11,7 +11,7 @@ export default async function getMetadata (
nearAccount?: Account
}
}
): Promise<{symbol: string, decimals: number}> {
): Promise<{symbol: string, decimals: number, name: string}> {
options = options ?? {}
const nearAccount = options.nearAccount ?? await getNearAccount()
if (tokenMetadata[nep141Address]) return tokenMetadata[nep141Address]!
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/nep141.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function getMetadata (
nep141Address: string
nearAccount: Account
}
): Promise<{symbol: string, decimals: number, icon: string}> {
): Promise<{symbol: string, decimals: number, name: string, icon: string}> {
const metadata = await nearAccount.viewFunction(
nep141Address,
'ft_metadata'
Expand Down

0 comments on commit 983e538

Please sign in to comment.