Skip to content

Commit

Permalink
fix: updated the SEOS, BOX and USN precision and transfer fees
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Nov 29, 2023
1 parent 76a29da commit e786be6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/lib/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ export const evmChainConfigs: {[key: string]: EvmChainConfig} = {
{
name: 'SEOS',
symbol: '4,SEOS',
decimals: 18,
decimals: 6,
address: '0xbfb10f85b889328e4a42507e31a07977ae00eec6',
},
{
name: 'BOX',
symbol: '4,BOX',
decimals: 18,
decimals: 6,
address: '0x9b3754f036de42846e60c8d8c89b18764f168367',
},
{
name: 'USN',
symbol: '4,USN',
decimals: 18,
decimals: 6,
address: '0x8d0258d6ccfb0ce394dc542c545566936b7974f9',
},
],
Expand Down
2 changes: 0 additions & 2 deletions src/pages/transfer/form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
let generatingOptions = false
$: console.log({balances: $balances})
$: balance = $balances.find((balance) => balance.tokenKey === from?.key)
async function generateOptions(evmSession?: EvmSession) {
Expand Down
12 changes: 12 additions & 0 deletions src/pages/transfer/managers/eosEvmBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import {Transfer} from '~/abi-types'
import {getClient} from '~/api-client'
import {TransferManager} from './transferManager'

const bridgeFees: Record<string, number> = {
USDT: 0.01,
SEOS: 0.1,
BOX: 0.1,
USN: 0.1,
}

export class EosEvmBridge extends TransferManager {
static supportedChains = ['eos']
static evmRequired = true
Expand All @@ -17,6 +24,11 @@ export class EosEvmBridge extends TransferManager {
}

async transferFee(_amount: string, tokenSymbol: Asset.SymbolType = '4,EOS') {
const symbolCode = String(Asset.Symbol.from(tokenSymbol).code)
if (bridgeFees[symbolCode]) {
return Asset.from(bridgeFees[symbolCode], tokenSymbol)
}

const apiClient = getClient(this.nativeSession.chainId)

let apiResponse
Expand Down

0 comments on commit e786be6

Please sign in to comment.