|
|
@@ -51,7 +51,11 @@ export class Web3Service {
|
|
|
tokenAddress: '0x0faF6df7054946141266420b43783387A78d82A9',
|
|
|
quoterAddress: '0xE93D1d35a63f7C6b51ef46a27434375761a7Db28',
|
|
|
swapAddress: '0x3040EE148D09e5B92956a64CDC78b49f48C0cDdc',
|
|
|
- mintAddress: '0x74E6d686F70fD5829f00dB0F95EC0f153970baD3'
|
|
|
+ mintAddress: '0x74E6d686F70fD5829f00dB0F95EC0f153970baD3',
|
|
|
+ orbiterEthAddress: '0x0043d60e87c5dd08C86C3123340705a1556C4719',
|
|
|
+ orbiterEthId: 9514,
|
|
|
+ orbiterZkAddress: '0x0043d60e87c5dd08C86C3123340705a1556C4719',
|
|
|
+ orbiterZkId: 9005
|
|
|
},
|
|
|
mainnet: {
|
|
|
ethereumNetwork: 'mainnet',
|
|
|
@@ -64,13 +68,15 @@ export class Web3Service {
|
|
|
tokenAddress: '0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4',
|
|
|
quoterAddress: '0x377EC7c9ae5a0787F384668788a1654249059dD6',
|
|
|
swapAddress: '0x9606eC131EeC0F84c95D82c9a63959F2331cF2aC',
|
|
|
- mintAddress: '0x53eC17BD635F7A54B3551E76Fd53Db8881028fC3'
|
|
|
+ mintAddress: '0x53eC17BD635F7A54B3551E76Fd53Db8881028fC3',
|
|
|
+ orbiterEthAddress: '0xE4eDb277e41dc89aB076a1F049f4a3EfA700bCE8',
|
|
|
+ orbiterEthId: 9014,
|
|
|
+ orbiterZkAddress: '0xE4eDb277e41dc89aB076a1F049f4a3EfA700bCE8',
|
|
|
+ orbiterZkId: 9005
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- constructor(
|
|
|
- private readonly accountService: AccountsService
|
|
|
- ) {}
|
|
|
+ constructor(private readonly accountService: AccountsService) {}
|
|
|
|
|
|
async zkDeposit(accountId, amount, network: Network) {
|
|
|
const account = await this.accountService.findById(accountId)
|
|
|
@@ -103,7 +109,7 @@ export class Web3Service {
|
|
|
// Logger.log('finalizedEthBalance', ethers.utils.formatEther(finalizedEthBalance))
|
|
|
}
|
|
|
|
|
|
- async zkWidthdraw(accountId, amount, network: Network) {
|
|
|
+ async zkWithdraw(accountId, amount, network: Network) {
|
|
|
const account = await this.accountService.findById(accountId)
|
|
|
const provider = new Provider(this.config[network].zksyncRpcUrl)
|
|
|
const ethProvider = new ethers.providers.InfuraProvider(
|
|
|
@@ -134,6 +140,28 @@ export class Web3Service {
|
|
|
// Logger.log('finalizedEthBalance', ethers.utils.formatEther(finalizedEthBalance))
|
|
|
}
|
|
|
|
|
|
+ async orbiterDeposit(accountId, amount, network: Network) {
|
|
|
+ const account = await this.accountService.findById(accountId)
|
|
|
+ const provider = new ethers.providers.InfuraProvider(
|
|
|
+ this.config[network].ethereumNetwork,
|
|
|
+ this.config[network].infuraApiKey
|
|
|
+ )
|
|
|
+ const wallet = new ethers.Wallet(account.privateKey, provider)
|
|
|
+ const tx = await wallet.sendTransaction({
|
|
|
+ from: wallet.address,
|
|
|
+ to: this.config[network].orbiterEthAddress,
|
|
|
+ value: ethers.utils.parseEther(amount).add(this.config[network].orbiterEthId)
|
|
|
+ })
|
|
|
+ console.log('Mining transaction...')
|
|
|
+ // Waiting for the transaction to be mined
|
|
|
+ const receipt = await tx.wait()
|
|
|
+ console.log('Transaction mined!', receipt)
|
|
|
+ }
|
|
|
+
|
|
|
+ async orbiterWithdraw(accountId, amount, network: Network) {
|
|
|
+ throw new Error('Method not implemented.')
|
|
|
+ }
|
|
|
+
|
|
|
async addLiquidity(accountId, amount, network: Network) {
|
|
|
const chainId = this.config[network].ethereumNetwork == 'goerli' ? ChainId.ZkSyncAlphaTest : ChainId.ZkSyncEra
|
|
|
const account = await this.accountService.findById(accountId)
|