Compare commits
5 Commits
e724211f91
...
proposal-2
| Author | SHA1 | Date | |
|---|---|---|---|
| b5afb8d558 | |||
| c3bef6af31 | |||
| 0f44e768fe | |||
| b2270836e4 | |||
| e4b7ced4d3 |
2
.env.example
Normal file
2
.env.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PINATA_API_KEY=
|
||||||
|
PINATA_SECRET_API_KEY=
|
||||||
1
.npmrc
Normal file
1
.npmrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@tornado:registry=https://git.tornado.ws/api/packages/tornado-packages/npm/
|
||||||
6
.prettierrc
Normal file
6
.prettierrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 2,
|
||||||
|
"singleQuote": true,
|
||||||
|
"semi": false,
|
||||||
|
"printWidth": 140
|
||||||
|
}
|
||||||
@@ -74,7 +74,7 @@ export const BRIDGE_FEE_MANAGER: { [chainId in ChainId]: string } = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const FOREIGN_OMNIBRIDGE = {
|
export const FOREIGN_OMNIBRIDGE = {
|
||||||
[ChainId.MAINNET]: '0x88ad09518695c6c3712ac10a214be5109a655671',
|
[ChainId.MAINNET]: '0x88ad09518695c6c3712AC10a214bE5109a655671',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const OMNIBRIDGE = {
|
export const OMNIBRIDGE = {
|
||||||
|
|||||||
@@ -5,11 +5,7 @@
|
|||||||
<p :class="$style.confirm__text">Processing...</p>
|
<p :class="$style.confirm__text">Processing...</p>
|
||||||
|
|
||||||
<ul :class="$style.confirm__list">
|
<ul :class="$style.confirm__list">
|
||||||
<li
|
<li v-for="{ name, text, progress } in stepsData" :key="name" :class="[$style.confirm__listItem, $style[processingStatuses[name]]]">
|
||||||
v-for="{ name, text, progress } in stepsData"
|
|
||||||
:key="name"
|
|
||||||
:class="[$style.confirm__listItem, $style[processingStatuses[name]]]"
|
|
||||||
>
|
|
||||||
<span :class="$style.confirm__listItemStatus">
|
<span :class="$style.confirm__listItemStatus">
|
||||||
<base-icon v-if="processingStatuses[name] === 'success'" name="tick" size="medium" />
|
<base-icon v-if="processingStatuses[name] === 'success'" name="tick" size="medium" />
|
||||||
<base-icon v-if="processingStatuses[name] === 'fail'" name="cross" size="medium" />
|
<base-icon v-if="processingStatuses[name] === 'fail'" name="cross" size="medium" />
|
||||||
@@ -27,13 +23,7 @@
|
|||||||
<span v-if="transactionOptions.from" :class="$style.confirm__linksItemTitle">
|
<span v-if="transactionOptions.from" :class="$style.confirm__linksItemTitle">
|
||||||
{{ transactionOptions.from }} transaction:
|
{{ transactionOptions.from }} transaction:
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a v-if="!!txHash" :class="$style.confirm__linksItemValue" :href="explorerLink" target="_blank" rel="noopener noreferrer">
|
||||||
v-if="!!txHash"
|
|
||||||
:class="$style.confirm__linksItemValue"
|
|
||||||
:href="explorerLink"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
{{ shortenLink }}
|
{{ shortenLink }}
|
||||||
</a>
|
</a>
|
||||||
<span v-else :class="$style.confirm__linksItemValue_none">—</span>
|
<span v-else :class="$style.confirm__linksItemValue_none">—</span>
|
||||||
@@ -58,9 +48,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapMutations, mapState } from 'vuex'
|
import { mapGetters, mapMutations, mapState } from 'vuex'
|
||||||
|
|
||||||
import { ApplicationMutation } from '@/types'
|
import { ApplicationMutation, ChainId } from '@/types'
|
||||||
import { SuccessModal } from '@/modals'
|
import { SuccessModal } from '@/modals'
|
||||||
import { createModalArgs, getEtherscanLink } from '@/utilities'
|
import { createModalArgs, getEtherscanLink, getAmbBridgeTxLink } from '@/utilities'
|
||||||
import { numbers, confirmationStatus, confirmationStep, transactionMethods, CHAINS } from '@/constants'
|
import { numbers, confirmationStatus, confirmationStep, transactionMethods, CHAINS } from '@/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -136,14 +126,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
l2Link() {
|
l2Link() {
|
||||||
return getEtherscanLink(this.modal.chainId, this.txHash, 'transaction')
|
return getAmbBridgeTxLink(this.modal.chainId, this.txHash)
|
||||||
},
|
},
|
||||||
explorerLink() {
|
explorerLink() {
|
||||||
return getEtherscanLink(this.modal.chainId, this.txHash, 'transaction')
|
return getEtherscanLink(this.modal.chainId, this.txHash, 'transaction')
|
||||||
},
|
},
|
||||||
shortenLink() {
|
shortenLink() {
|
||||||
return `${this.txHash.substring(numbers.ZERO, Number('8') + numbers.OX_LENGTH)}...${this.txHash.substring(
|
return `${this.txHash.substring(numbers.ZERO, Number('8') + numbers.OX_LENGTH)}...${this.txHash.substring(
|
||||||
Number('60') - Number('8'),
|
Number('60') - Number('8')
|
||||||
)}`
|
)}`
|
||||||
},
|
},
|
||||||
symbol() {
|
symbol() {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"find-replacement-tx": "^1.2.1",
|
"find-replacement-tx": "^1.2.1",
|
||||||
"fixed-merkle-tree": "0.5.1",
|
"fixed-merkle-tree": "0.5.1",
|
||||||
"gas-price-oracle": "0.4.4",
|
"@tornado/gas-price-oracle": "^0.5.3",
|
||||||
"graphql": "^15.6.1",
|
"graphql": "^15.6.1",
|
||||||
"idb": "6.0.0",
|
"idb": "6.0.0",
|
||||||
"jszip": "^3.7.1",
|
"jszip": "^3.7.1",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { GasPriceOracle } from 'gas-price-oracle'
|
import { GasPriceOracle } from '@tornado/gas-price-oracle'
|
||||||
import { GasPrice } from 'gas-price-oracle/lib/types'
|
import { GasPrice } from '@/types'
|
||||||
|
|
||||||
import { ChainId } from '@/types'
|
import { ChainId } from '@/types'
|
||||||
import { numbers, RPC_LIST } from '@/constants'
|
import { numbers, RPC_LIST } from '@/constants'
|
||||||
@@ -26,7 +26,7 @@ const getGasPrice = async (chainId: ChainId): Promise<GasPrice> => {
|
|||||||
timeout: TEN_SECOND,
|
timeout: TEN_SECOND,
|
||||||
defaultRpc: RPC_LIST[chainId],
|
defaultRpc: RPC_LIST[chainId],
|
||||||
})
|
})
|
||||||
const result = await instance.gasPrices()
|
const result = (await instance.gasPrices({ isLegacy: true })) as GasPrice
|
||||||
|
|
||||||
if (chainId === ChainId.XDAI || chainId === ChainId.MAINNET) {
|
if (chainId === ChainId.XDAI || chainId === ChainId.MAINNET) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -70,6 +70,16 @@ const ETHERSCAN_PREFIXES: { [chainId in ChainId]: string } = {
|
|||||||
100: '',
|
100: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AMB_EXPLORER_SUFFIXES: { [chainId in ChainId]: string } = {
|
||||||
|
1: 'xdai',
|
||||||
|
56: 'bsc',
|
||||||
|
100: 'xdai',
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getAmbBridgeTxLink(chainId: ChainId, data: string): string {
|
||||||
|
return `https://alm-${AMB_EXPLORER_SUFFIXES[chainId]}.tornado.ws/${chainId}/${data}`
|
||||||
|
}
|
||||||
|
|
||||||
export function getEtherscanLink(chainId: ChainId, data: string, type: 'transaction' | 'token' | 'address' | 'block'): string {
|
export function getEtherscanLink(chainId: ChainId, data: string, type: 'transaction' | 'token' | 'address' | 'block'): string {
|
||||||
let prefix = `https://${ETHERSCAN_PREFIXES[chainId]}etherscan.io`
|
let prefix = `https://${ETHERSCAN_PREFIXES[chainId]}etherscan.io`
|
||||||
|
|
||||||
@@ -215,7 +225,7 @@ export function encodeTransactData({ args, extData }: { args: ArgsProof; extData
|
|||||||
'tuple(bytes proof,bytes32 root,bytes32[] inputNullifiers,bytes32[2] outputCommitments,uint256 publicAmount,bytes32 extDataHash)',
|
'tuple(bytes proof,bytes32 root,bytes32[] inputNullifiers,bytes32[2] outputCommitments,uint256 publicAmount,bytes32 extDataHash)',
|
||||||
'tuple(address recipient,int256 extAmount,address relayer,uint256 fee,bytes encryptedOutput1,bytes encryptedOutput2,bool isL1Withdrawal,uint256 l1Fee)',
|
'tuple(address recipient,int256 extAmount,address relayer,uint256 fee,bytes encryptedOutput1,bytes encryptedOutput2,bool isL1Withdrawal,uint256 l1Fee)',
|
||||||
],
|
],
|
||||||
[args, extData],
|
[args, extData]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +278,7 @@ export const getMessageIdFromTransaction = (type: 'withdrawal' | 'deposit', rece
|
|||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
export const onStaticMulticall = async <C extends BaseContract, A extends any[]>(
|
export const onStaticMulticall = async <C extends BaseContract, A extends any[]>(
|
||||||
chainId: ChainId,
|
chainId: ChainId,
|
||||||
calls: Array<{ contract: C; methodName: string; args: A }>,
|
calls: Array<{ contract: C; methodName: string; args: A }>
|
||||||
) => {
|
) => {
|
||||||
const multicall = getMulticall(chainId)
|
const multicall = getMulticall(chainId)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user