-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from planethouki/cow
Cow
- Loading branch information
Showing
53 changed files
with
15,395 additions
and
12,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# ASSETS | ||
|
||
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. | ||
|
||
More information about the usage of this directory in the documentation: | ||
https://nuxtjs.org/guide/assets#webpacked | ||
|
||
**This directory is not required, you can delete it if you don't want to use it.** | ||
|
||
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. | ||
|
||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Import Vuetify styling | ||
@require '~vuetify/src/stylus/app.styl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@require '~vuetify/src/stylus/settings/_variables.styl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template lang="pug"> | ||
v-flex(mb-5 v-if="wallet.address" v-bind:id="navTargetId") | ||
v-card | ||
v-card-title | ||
div.title Account Link (Not yet) | ||
v-card-text | ||
v-radio-group(label="Link Type" row) | ||
v-radio(label="Link") | ||
v-radio(label="Unlink") | ||
v-text-field( | ||
label="Remote Account Public Key" | ||
v-model="remoteAccountKey") | ||
v-text-field( | ||
label="Max Fee" | ||
v-model="fee") | ||
v-card-text | ||
tx-history(v-bind:history="history") | ||
</template> | ||
|
||
<script> | ||
import { Account } from 'nem2-sdk' | ||
import TxHistory from './TxHistory.vue' | ||
export default { | ||
name: 'AccountLink', | ||
components: { | ||
TxHistory | ||
}, | ||
props: [ | ||
'endpoint', | ||
'wallet', | ||
'walletPassword', | ||
'navTargetId' | ||
], | ||
data() { | ||
return { | ||
remoteAccountKey: '', | ||
fee: 0, | ||
history: [] | ||
} | ||
}, | ||
mounted: function () { | ||
this.remoteAccountKey = Account.generateNewAccount(this.wallet.network).publicKey | ||
}, | ||
methods: { | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<template lang="pug"> | ||
v-flex(mb-5 v-if="wallet.address" v-bind:id="navTargetId") | ||
v-card | ||
v-card-title | ||
div.title Account Property Address | ||
v-card-text | ||
v-radio-group(label="Property Type" v-model="propertyType" row) | ||
v-radio( | ||
v-for="pt in propertyTypes" | ||
:key="pt.type" | ||
:label="pt.label" | ||
:value="pt.type") | ||
v-flex.pt-4 | ||
v-layout(v-for="(modification, index) in modifications" v-bind:key="modification.rawAddress" row wrap) | ||
v-flex | ||
v-layout(align-baseline) | ||
span.grey--text.mr-1.pr-1 {{ modification.isAdd ? 'Add' : 'Remove' }} | ||
v-flex | ||
v-text-field( | ||
v-bind:label="`${modification.isAdd ? 'Add' : 'Remove'}` + ' Modification Address: ' + (index + 1)" | ||
v-bind:value="modification.rawAddress" | ||
disabled) | ||
v-btn( | ||
fab | ||
small | ||
flat | ||
v-on:click="deleteModification(index)") | ||
v-icon delete_forever | ||
v-flex | ||
v-layout(align-baseline) | ||
div.mr-1.pr-1 | ||
v-checkbox( | ||
v-bind:label="`${additionalModification.isAdd ? 'Add' : 'Remove'}`" | ||
hide-details | ||
off-icon="remove_circle" | ||
on-icon="add_circle" | ||
v-model="additionalModification.isAdd") | ||
v-flex | ||
v-text-field( | ||
v-bind:label="`Address Modification: ${additionalModification.isAdd ? 'Add' : 'Remove'}`" | ||
v-model="additionalModification.rawAddress" | ||
placeholder="ex). SCCVQQ-3N3AOW-DOL6FD-TLSQZY-UHL4SH-XKJEJX-2URE") | ||
v-btn( | ||
fab | ||
small | ||
flat | ||
v-on:click="addModification") | ||
v-icon add_box | ||
v-text-field( | ||
label="Max Fee" | ||
v-model="fee") | ||
v-card-actions | ||
v-btn( | ||
color="blue" | ||
class="white--text" | ||
@click="announceHandler") announce | ||
v-card-text | ||
tx-history(v-bind:history="history") | ||
</template> | ||
|
||
<script> | ||
import { Address, Account, Deadline, UInt64, PropertyType, TransactionHttp, | ||
PropertyModificationType, AccountPropertyTransaction, ModifyAccountPropertyAddressTransaction } from 'nem2-sdk' | ||
import TxHistory from './TxHistory.vue' | ||
export default { | ||
name: 'AccountPropertyAddress', | ||
components: { | ||
TxHistory | ||
}, | ||
props: [ | ||
'endpoint', | ||
'wallet', | ||
'walletPassword', | ||
'navTargetId' | ||
], | ||
data() { | ||
return { | ||
propertyType: PropertyType.AllowAddress, | ||
propertyTypes: [ | ||
{ type: PropertyType.AllowAddress, label: 'Allow' }, | ||
{ type: PropertyType.BlockAddress, label: 'Block' } | ||
], | ||
modifications: [ | ||
{ | ||
isAdd: true, | ||
rawAddress: '' | ||
} | ||
], | ||
additionalModification: { | ||
isAdd: true, | ||
rawAddress: '' | ||
}, | ||
fee: 0, | ||
history: [] | ||
} | ||
}, | ||
mounted: function () { | ||
this.additionalModification.rawAddress = Account.generateNewAccount(this.wallet.network).address.pretty() | ||
this.modifications[0].rawAddress = Account.generateNewAccount(this.wallet.network).address.pretty() | ||
}, | ||
methods: { | ||
deleteModification: function (index) { | ||
this.modifications.splice(index, 1) | ||
}, | ||
addModification: function () { | ||
this.modifications.push({ | ||
rawAddress: this.additionalModification.rawAddress, | ||
isAdd: this.additionalModification.isAdd | ||
}) | ||
this.additionalModification.rawAddress = 'SCCVQQ-3N3AOW-DOL6FD-TLSQZY-UHL4SH-XKJEJX-2URE' | ||
}, | ||
announceHandler: function (event) { | ||
const account = this.wallet.open(this.walletPassword) | ||
const endpoint = this.endpoint | ||
const modifyAccountPropertyAddressTransaction = new ModifyAccountPropertyAddressTransaction( | ||
this.wallet.network, | ||
this.$TransactionVersion.MODIFY_ACCOUNT_PROPERTY_ADDRESS, | ||
Deadline.create(), | ||
UInt64.fromUint(this.fee), | ||
this.propertyType, | ||
this.modifications.map((modification) => { | ||
return AccountPropertyTransaction.createAddressFilter( | ||
modification.isAdd ? PropertyModificationType.Add : PropertyModificationType.Remove, | ||
Address.createFromRawAddress(modification.rawAddress) | ||
) | ||
}) | ||
) | ||
const signedTx = account.sign(modifyAccountPropertyAddressTransaction) | ||
const txHttp = new TransactionHttp(endpoint) | ||
txHttp.announce(signedTx) | ||
const historyData = { | ||
hash: signedTx.hash, | ||
apiStatusUrl: `${endpoint}/transaction/${signedTx.hash}/status` | ||
} | ||
this.history.push(historyData) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
Oops, something went wrong.