-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstants.ts
More file actions
42 lines (32 loc) · 1.52 KB
/
constants.ts
File metadata and controls
42 lines (32 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// constants.ts - App-wide constants
export const WARTHOG_NODES = [
'https://warthognode.duckdns.org',
'http://217.182.64.43:3001',
] as const;
export type NodeUrl = typeof WARTHOG_NODES[number];
export const DERIVATION_PATHS = {
hardened: "m/44'/2070'/0'/0/0",
normal: "m/44'/2070'/0/0/0",
} as const;
export const SECURE_STORE_KEYS = {
wallet: (name: string) => `warthogWallet_${name}`,
walletNames: 'warthogWalletNames',
nonce: (address: string) => `warthogNextNonce_${address}`,
} as const;
export const WORD_COUNTS = [12, 24] as const;
export const API_ENDPOINTS = {
chainHead: (node: string) => `${node}/chain/head`,
accountBalance: (node: string, address: string) => `${node}/account/${address}/balance`,
accountHistory: (node: string, address: string) => `${node}/account/${address}/history/4294967295`,
transactionLookup: (node: string, txid: string) => `${node}/transaction/lookup/${txid}`,
chainBlock: (node: string, height: number) => `${node}/chain/block/${height}`,
transactionAdd: (node: string) => `${node}/transaction/add`,
encode16bit: (node: string, value: string) => `${node}/tools/encode16bit/from_string/${value}`,
coingeckoPrice: 'https://api.coingecko.com/api/v3/simple/price?ids=warthog&vs_currencies=usd',
} as const;
export const ADDRESS_LENGTH = 48;
export const PRIVATE_KEY_LENGTH = 64;
export const DEFAULT_FEE = '0.01';
export const SATOSHI_MULTIPLIER = 100000000; // 1 WART = 100,000,000 satoshis
export const TRANSACTION_HISTORY_PAGE_SIZE = 7;
export const REFRESH_TIMEOUT = 800; // ms