Skip to content

Commit

Permalink
fix: getting usdt transfer working
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Nov 10, 2023
1 parent 05f10ab commit db75a35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/transfer/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
if (TransferManagerClass) {
transferManager = new (TransferManagerClass as unknown as new (
...args: any[]
) => TransferManager)($activeSession!, $activeEvmSession)
) => TransferManager)($activeSession!, $activeEvmSession, transferManagerData)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/transfer/managers/eosEvmBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class EosEvmBridge extends TransferManager {
return this.nativeSession.transact({
action: {
authorization: [this.nativeSession.auth],
account: Name.from('eosio.token'),
account: Name.from(this.transferData.tokenContract || 'eosio.token'),
name: Name.from('transfer'),
data: action,
},
Expand Down
6 changes: 5 additions & 1 deletion src/pages/transfer/managers/transferManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {EvmSession} from '~/lib/evm'
import {valueInFiat} from '~/lib/fiat'
import {activePriceTicker, waitForStoreValue} from '~/store'
import { systemToken } from '~/stores/tokens'
import type { TransferType } from './index'

export abstract class TransferManager {
self: typeof TransferManager
Expand All @@ -14,10 +15,13 @@ export abstract class TransferManager {

readonly nativeSession: LinkSession
readonly evmSession: EvmSession
readonly transferData: TransferType

constructor(nativeSession: LinkSession, evmSession: EvmSession) {
constructor(nativeSession: LinkSession, evmSession: EvmSession, transferData: TransferType) {
this.nativeSession = nativeSession
this.evmSession = evmSession
this.transferData = transferData

this.self = this.constructor as typeof TransferManager
}

Expand Down

0 comments on commit db75a35

Please sign in to comment.