diff --git a/package.json b/package.json index 625ec2273..320958817 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@avalabs/avalanche-wallet-sdk": "0.20.0-alpha.11", - "@avalabs/glacier-sdk": "2.8.0-alpha.92", + "@avalabs/glacier-sdk": "2.8.0-alpha.108", "@avalabs/vue_components": "0.10.0", "@ethereumjs/common": "2.0.0", "@ethereumjs/tx": "3.0.0", @@ -28,7 +28,7 @@ "@ledgerhq/hw-transport-u2f": "5.36.0-deprecated", "@ledgerhq/hw-transport-webhid": "5.51.1", "@ledgerhq/hw-transport-webusb": "5.51.1", - "@openzeppelin/contracts": "4.9.0", + "@openzeppelin/contracts": "4.9.2", "avalanche": "3.15.2", "axios": "0.21.2", "big.js": "5.2.2", diff --git a/src/components/SidePanels/History/ViewTypes/BaseTx.vue b/src/components/SidePanels/History/ViewTypes/BaseTx.vue index 36f3dfcbe..84d40c03e 100644 --- a/src/components/SidePanels/History/ViewTypes/BaseTx.vue +++ b/src/components/SidePanels/History/ViewTypes/BaseTx.vue @@ -181,230 +181,6 @@ export default class BaseTx extends Vue { get type() { return this.transaction.txType as TransactionTypeName } - - // What did I lose? - // get inValues() { - // let addrs: string[] = this.addresses - // - // this.transaction.consumedUtxos.map((utxo) => { - // utxo.addresses - // utxo.addresses.in - // }) - // let ins = this.transaction.inputs - // let res: TransactionValueDict = {} // asset id -> value dict - // - // // if empty - // if (!ins) { - // return res - // } - // - // ins.forEach((inputUtxo) => { - // const include = this.includeUtxo(inputUtxo.output, true) - // const assetId = inputUtxo.output.assetID - // const amt = inputUtxo.output.amount - // - // if (include) { - // if (res[assetId]) { - // res[assetId] += parseInt(amt) - // } else { - // res[assetId] = parseInt(amt) - // } - // } - // }) - // - // return res - // } - - /** - * - * @param utxo The UTXO object - * @param isInput is it an input UTXO? - */ - // includeUtxo(utxo: Utxo, isInput?: boolean) { - // // Does this wallet own this utxo - // const isOwner = utxo.addresses.filter((value) => this.addrsRaw.includes(value)).length > 0 - // - // switch (this.transaction.txType) { - // case 'export': - // return utxo.consumedOnChainId === avm.getBlockchainID() - // case 'pvm_export': - // return utxo.consumedOnChainId === pChain.getBlockchainID() - // case 'pvm_import': - // case 'import': - // if (isInput) return false - // return isOwner - // case 'add_validator': - // case 'add_delegator': - // return !isInput && utxo.stake - // case 'operation': - // // if no payload it is avax - // // check if it is from wallet - // if (!utxo.payload && !isOwner) return false - // return true - // // default just return original logic - // // might need to be changed in the future as - // // more tx types are added - // case 'BaseTx': - // default: - // return isOwner - // } - // - // return false - // } - - // get tokensReceived() { - // let tokens = this.summary.tokens - // let res = {} - // for (var assetId in tokens) { - // let asset = tokens[assetId] - // if (asset.amount.gte(new BN(0))) { - // //@ts-ignore - // res[assetId] = asset - // } - // } - // return res - // } - - // get tokensSent() { - // let tokens = this.summary.tokens - // let res = {} - // for (var assetId in tokens) { - // let asset = tokens[assetId] - // if (asset.amount.lt(new BN(0))) { - // //@ts-ignore - // res[assetId] = asset - // } - // } - // return res - // } - - // what did I gain? - // get outValues() { - // let addrs: string[] = this.addresses - // let addrsRaw = addrs.map((addr) => addr.split('-')[1]) - // let outs = this.transaction.outputs - // let res: TransactionValueDict = {} // asset id -> value dict - // - // // if empty - // if (!outs) { - // return res - // } - // - // outs.forEach((utxoOut) => { - // let utxoAddrs = utxoOut.addresses - // let assetId = utxoOut.assetID - // let amt = utxoOut.amount - // - // const include = this.includeUtxo(utxoOut) - // - // if (include) { - // if (res[assetId]) { - // res[assetId] += parseInt(amt) - // } else { - // res[assetId] = parseInt(amt) - // } - // } - // }) - // - // return res - // } - - // get valList() { - // let ins = this.inValues - // let outs = this.outValues - // let res = JSON.parse(JSON.stringify(outs)) - // - // for (var assetId in ins) { - // let inAmount = ins[assetId] || 0 - // if (res[assetId]) { - // res[assetId] -= inAmount - // } else { - // res[assetId] = -1 * inAmount - // } - // } - // - // return res - // } - - // get nftGroups() { - // let addrs: string[] = this.addresses - // let addrsRaw = addrs.map((addr) => addr.split('-')[1]) - // - // let ins = this.transaction.inputs - // let outs = this.transaction.outputs - // let res: { [key in string]: { [key in string]: PayloadBase[] } } = {} - // - // // res = { - // // 'asset id': { ['group id']: 'payload' }, - // // } - // - // const pushPayload = (rawPayload: string, assetID: string, groupID: number) => { - // let payload = Buffer.from(rawPayload, 'base64') - // payload = Buffer.concat([new Buffer(4).fill(payload.length), payload]) - // - // try { - // let typeId = payloadtypes.getTypeID(payload) - // let pl: Buffer = payloadtypes.getContent(payload) - // let payloadbase: PayloadBase = payloadtypes.select(typeId, pl) - // - // if (res[assetID]) { - // if (res[assetID][groupID]) { - // res[assetID][groupID].push(payloadbase) - // } else { - // res[assetID] = { - // [groupID]: [payloadbase], - // } - // } - // } else { - // res[assetID] = { - // [groupID]: [payloadbase], - // } - // } - // } catch (e) { - // // console.error(e) - // } - // } - // - // if (ins) { - // ins.forEach((inputUtxo) => { - // const groupID = inputUtxo.output.groupID - // const assetID = inputUtxo.output.assetID - // - // if (inputUtxo.output.payload) { - // pushPayload(inputUtxo.output.payload, assetID, groupID) - // } - // }) - // } - // - // if (outs) { - // outs.forEach((utxoOut) => { - // let groupID = utxoOut.groupID - // let assetID = utxoOut.assetID - // - // if (utxoOut.payload) { - // pushPayload(utxoOut.payload, assetID, groupID) - // } - // }) - // } - // - // return res - // } - - // get operationDirection() { - // if (this.type !== 'operation') return 'N/A' - // - // let addrs: string[] = this.addresses - // let addrsRaw = addrs.map((addr) => addr.split('-')[1]) - // - // let ins = this.transaction.inputs || [] - // const isFromWallet = ins.find((input) => { - // return input.output.addresses.find((value) => { - // return addrsRaw.includes(value) - // }) - // }) - // - // return isFromWallet ? 'Sent' : 'Received' - // } } diff --git a/src/components/misc/RadioButtons.vue b/src/components/misc/RadioButtons.vue index a8bdc8cc6..4f9cfd152 100644 --- a/src/components/misc/RadioButtons.vue +++ b/src/components/misc/RadioButtons.vue @@ -6,6 +6,7 @@ @click="select(key)" :active="selection === key" class="hover_border" + :disabled="disabled" > {{ labels[i] }} @@ -18,6 +19,7 @@ import { Vue, Component, Prop, Model } from 'vue-property-decorator' export default class RadioButtons extends Vue { @Prop() labels!: string[] @Prop() keys!: string[] + @Prop({ default: false }) disabled!: boolean @Model('change', { type: String }) readonly selection!: string @@ -56,6 +58,10 @@ button { //border-color: #285599; background-color: var(--primary-color); } + + &[disabled] { + opacity: 0.4; + } } @include main.medium-device { diff --git a/src/components/modals/ExportGlacierHistoryModal.vue b/src/components/modals/ExportGlacierHistoryModal.vue new file mode 100644 index 000000000..4e22bb68e --- /dev/null +++ b/src/components/modals/ExportGlacierHistoryModal.vue @@ -0,0 +1,312 @@ + + + + + Include Chains + + Date Range + + + + From + + + + Until + + + + + + Generate + + + + {{ error }} + Your file is ready to download. + + + + Download + + + Start Over + + + + + + + diff --git a/src/components/wallet/TopCards/AddressCard/AddressCard.vue b/src/components/wallet/TopCards/AddressCard/AddressCard.vue index 60be64510..26166ed7f 100644 --- a/src/components/wallet/TopCards/AddressCard/AddressCard.vue +++ b/src/components/wallet/TopCards/AddressCard/AddressCard.vue @@ -196,7 +196,7 @@ export default class AddressCard extends Vue { return '-' } - return '0x' + wallet.getEvmAddress() + return wallet.getEvmChecksumAddress() } get addressEVMBech32() { diff --git a/src/components/wallet/activity/TxRow.vue b/src/components/wallet/activity/TxRow.vue index 9803eda3c..8565c77d1 100644 --- a/src/components/wallet/activity/TxRow.vue +++ b/src/components/wallet/activity/TxRow.vue @@ -34,7 +34,7 @@
{{ error }}
Your file is ready to download.