Skip to content

Commit

Permalink
Merge pull request #93 from autonomys/feat/addTokenSymbol
Browse files Browse the repository at this point in the history
Add default token details
  • Loading branch information
marc-aurele-besner authored Aug 2, 2024
2 parents 90d188e + f16e3f2 commit afc9bef
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/auto-utils/src/constants/network.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// file: src/constants/network.ts

import type { Network } from '../types/network'
import { TESTNET_TOKEN } from './token'

export enum NetworkId {
GEMINI_3H = 'gemini-3h',
Expand Down Expand Up @@ -45,6 +46,7 @@ export const networks: Network[] = [
rpcUrls: ['https://nova-0.gemini-3h.subspace.network/ws'],
},
],
token: TESTNET_TOKEN,
isTestnet: true,
},
{
Expand All @@ -69,6 +71,7 @@ export const networks: Network[] = [
rpcUrls: ['https:///nova.devnet.subspace.network/ws'],
},
],
token: TESTNET_TOKEN,
isTestnet: true,
isLocalhost: false,
},
Expand All @@ -94,6 +97,7 @@ export const networks: Network[] = [
rpcUrls: ['https:///127.0.0.1:9946/ws'],
},
],
token: TESTNET_TOKEN,
isTestnet: true,
isLocalhost: true,
},
Expand Down
16 changes: 16 additions & 0 deletions packages/auto-utils/src/constants/token.ts
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
export const DEFAULT_TOKEN_DECIMALS = 18

export const DEFAULT_TOKEN_SYMBOL = 'ATC'

export const DEFAULT_TOKEN_NAME = 'Auto Token'

export const DEFAULT_TOKEN = {
decimals: DEFAULT_TOKEN_DECIMALS,
symbol: DEFAULT_TOKEN_SYMBOL,
name: DEFAULT_TOKEN_NAME,
}

export const TESTNET_TOKEN = {
...DEFAULT_TOKEN,
symbol: 't' + DEFAULT_TOKEN.symbol,
name: 'Testnet ' + DEFAULT_TOKEN,
}
1 change: 1 addition & 0 deletions packages/auto-utils/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from './event'
export * from './extrinsic'
export * from './network'
export * from './query'
export * from './token'
export * from './transaction'
export * from './wallet'

Expand Down
2 changes: 2 additions & 0 deletions packages/auto-utils/src/types/network.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// file: src/types/network.ts
import type { ApiOptions } from '@polkadot/api/types'
import { Token } from './token'

export type Explorer = {
name: string
Expand All @@ -18,6 +19,7 @@ export type Network = {
rpcUrls: string[]
explorer: Explorer[]
domains: Domain[]
token: Token
isTestnet?: boolean
isLocalhost?: boolean
}
Expand Down
5 changes: 5 additions & 0 deletions packages/auto-utils/src/types/token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type Token = {
decimals: number
symbol: string
name: string
}

0 comments on commit afc9bef

Please sign in to comment.