This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
1,772 additions
and
615 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ module.exports = { | |
}, | ||
plugins: [ | ||
'babel', | ||
'hbs', | ||
'ember', | ||
'hbs', | ||
], | ||
extends: [ | ||
'airbnb-base', | ||
|
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 |
---|---|---|
|
@@ -20,3 +20,7 @@ env: | |
|
||
before_install: | ||
- npm config set spin false | ||
|
||
script: | ||
- npm run lint:js | ||
- npm test |
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,7 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
classNames: ['text-truncate'], | ||
|
||
value: null, | ||
}); |
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 @@ | ||
{{format-amount value}} |
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,8 +1,7 @@ | ||
{{#each columns as |column|}} | ||
{{component (concat 'light-table/cells/' column.cellType) column row | ||
table=table | ||
rawValue=(get row column.valuePath) | ||
tableActions=tableActions | ||
extra=extra | ||
}} | ||
table=table | ||
rawValue=(get row column.valuePath) | ||
tableActions=tableActions | ||
extra=extra}} | ||
{{/each}} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
account: null, | ||
}); |
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,32 @@ | ||
<div class="card-group"> | ||
<div class="card"> | ||
<h5 class="card-header text-center text-truncate"> | ||
{{account.id}} | ||
</h5> | ||
|
||
<div class="card-body"> | ||
<div class="d-flex justify-content-center"> | ||
{{qr-code content=account.id}} | ||
</div> | ||
|
||
<dl class="row justify-content-md-center"> | ||
<dt class="col-md-3">{{t 'account'}}</dt> | ||
<dd class="col-md-9 text-truncate">{{account.id}}</dd> | ||
|
||
<dt class="col-md-3">{{t 'balance'}}</dt> | ||
<dd class="col-md-9 text-truncate">{{format-amount account.balance}}</dd> | ||
|
||
<dt class="col-md-3">{{t 'pending'}}</dt> | ||
<dd class="col-md-9 text-truncate">{{format-amount account.pending}}</dd> | ||
</dl> | ||
|
||
{{#link-to 'wallets.accounts.send' class="card-link"}} | ||
{{t 'send'}} | ||
{{/link-to}} | ||
|
||
{{#link-to 'wallets.accounts.history' class="card-link"}} | ||
{{t 'history'}} | ||
{{/link-to}} | ||
</div> | ||
</div> | ||
</div> |
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,17 +1,17 @@ | ||
{{#bs-form model=changeset onSubmit=onSubmit as |form|}} | ||
{{#form.element class="form-control-lg" controlType="power-select" label="Source Account" property="source" required=true options=accounts onChange=onChange as |el|}} | ||
{{#el.control searchField="id" searchPlaceholder="Search for account" as |item|}} | ||
{{#form.element class="form-control-lg" controlType="power-select" label=(t 'wallets.accounts.send.source') property="source" required=true options=accounts onChange=onChange as |el|}} | ||
{{#el.control searchField="id" searchPlaceholder=(t 'wallets.accounts.send.search') as |item|}} | ||
<b>{{item.id}}</b> | ||
{{/el.control}} | ||
{{/form.element}} | ||
|
||
{{form.element class="form-control-lg" controlType="text" label="Destination Account" property="destination" autocomplete='on' minlength=64 maxlength=64 required=true pattern="^xrb_[a-z0-9]{60}$" placeholder="e.g. xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpiij4txtdo"}} | ||
{{form.element class="form-control-lg" controlType="text" label=(t 'wallets.accounts.send.destination') property="destination" autocomplete='on' minlength=64 maxlength=64 required=true pattern="^xrb_[a-z0-9]{60}$" placeholder=(t 'wallets.accounts.send.placeholder')}} | ||
|
||
{{form.element class="form-control-lg" controlType="text" label="Amount (XRB)" model=(changeset (hash amount=amount) ChangeAmountValidations) property='amount' required=true minlength=1 pattern="^\d*\.?\d+$" onChange=(action 'changeAmount')}} | ||
{{form.element class="form-control-lg" controlType="text" label=(t 'wallets.accounts.send.amount') model=(changeset (hash amount=amount) ChangeAmountValidations) property='amount' required=true minlength=1 pattern="^\d*\.?\d+$" onChange=(action 'changeAmount')}} | ||
|
||
<div role="group" class="d-flex justify-content-center"> | ||
{{#bs-button size="lg" type="primary" icon="fa fa-paper-plane" buttonType="submit"}} | ||
Send | ||
{{t 'send'}} | ||
{{/bs-button}} | ||
</div> | ||
{{/bs-form}} |
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,45 @@ | ||
import Component from '@ember/component'; | ||
import { reject } from 'rsvp'; | ||
|
||
import { action } from 'ember-decorators/object'; | ||
|
||
import downloadjs from 'npm:downloadjs'; | ||
|
||
export default Component.extend({ | ||
wallet: null, | ||
seed: null, | ||
mnemonic: null, | ||
|
||
onCancel: null, | ||
onDone: null, | ||
|
||
needsConfirm: false, | ||
hasConfirmed: false, | ||
|
||
@action | ||
copySeed() { | ||
this.get('flashMessages').success('Seed copied to clipboard!'); | ||
}, | ||
|
||
@action | ||
downloadMnemonic(mnemonic) { | ||
const fileName = String(mnemonic).split(' ').slice(0, 2).join('-'); | ||
downloadjs(mnemonic, fileName, 'text/plain'); | ||
}, | ||
|
||
@action | ||
confirmDone() { | ||
const needsConfirm = this.get('needsConfirm'); | ||
if (needsConfirm) { | ||
this.toggleProperty('hasConfirmed'); | ||
} | ||
|
||
const hasConfirmed = this.get('hasConfirmed'); | ||
if (!hasConfirmed) { | ||
this.toggleProperty('needsConfirm'); | ||
return reject(); | ||
} | ||
|
||
return true; | ||
}, | ||
}); |
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,37 @@ | ||
{{#bs-modal onHide=(action onCancel) onSubmit=(action (queue (action 'confirmDone') (action onDone)) wallet seed) as |modal|}} | ||
{{#modal.header}} | ||
<h4 class="modal-title">{{t 'wallets.backup.title'}}</h4> | ||
{{/modal.header}} | ||
{{#modal.body}} | ||
{{#each flashMessages.arrangedQueue as |flash|}} | ||
{{flash-message class="d-flex w-100" flash=flash}} | ||
{{/each}} | ||
<p class="lead">{{t 'wallets.backup.lead'}}</p> | ||
<p><code>{{mnemonic}}</code></p> | ||
<p> | ||
{{#copy-button class="btn btn-sm btn-outline-danger" clipboardText=seed success=(action 'copySeed')}} | ||
{{fa-icon 'copy'}} {{t 'wallets.backup.copy'}} | ||
{{/copy-button}} | ||
{{#bs-button size='sm' type='outline-primary' class="ml-1" onClick=(action 'downloadMnemonic' mnemonic)}} | ||
{{fa-icon 'download'}} {{t 'wallets.backup.download'}} | ||
{{/bs-button}} | ||
</p> | ||
<small class="text-muted">{{t 'wallets.backup.help'}}</small> | ||
{{/modal.body}} | ||
{{#modal.footer}} | ||
{{#bs-button onClick=(action modal.close) type="secondary"}} | ||
{{t 'cancel'}} | ||
{{/bs-button}} | ||
{{#bs-button onClick=(action modal.submit) type="primary"}} | ||
{{#bs-popover triggerElement="parentView"}} | ||
{{t 'wallets.backup.confirm'}} | ||
{{/bs-popover}} | ||
{{#if needsConfirm}} | ||
{{fa-icon 'question-circle-o'}} | ||
{{else}} | ||
{{fa-icon 'check'}} | ||
{{/if}} | ||
{{t 'done'}} | ||
{{/bs-button}} | ||
{{/modal.footer}} | ||
{{/bs-modal}} |
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,22 +1,43 @@ | ||
{{#bs-form model=(changeset (hash type=type seed=seed mnemonic=mnemonic) ImportWalletValidations) onSubmit=(action (queue (action 'convertMnemonic') (action onSubmit)) wallet) as |form|}} | ||
{{#form.group}} | ||
{{#bs-button-group type="radio" value=type onChange=(action (mut type)) as |bg|}} | ||
{{#bg.button type="secondary" value='seed'}}{{t 'seed'}}{{/bg.button}} | ||
{{#bg.button type="secondary" value='mnemonic'}}{{t 'mnemonic'}}{{/bg.button}} | ||
{{/bs-button-group}} | ||
{{/form.group}} | ||
{{#bs-modal onHide=(action onCancel) as |modal|}} | ||
{{#modal.header}} | ||
<h4 class="modal-title">{{t 'wallets.import.title'}}</h4> | ||
{{/modal.header}} | ||
{{#modal.body}} | ||
{{#bs-form model=(changeset (hash type=type seed=seed mnemonic=mnemonic) ImportWalletValidations) | ||
onSubmit=(action (queue (action 'convertMnemonic') (action onSubmit)) wallet) as |form|}} | ||
{{#form.group}} | ||
{{#bs-button-group type="radio" value=type onChange=(action (mut type)) as |bg|}} | ||
{{#bg.button type="secondary" value='seed'}} | ||
{{t 'seed'}} | ||
{{/bg.button}} | ||
{{#bg.button type="secondary" value='mnemonic'}} | ||
{{t 'mnemonic'}} | ||
{{/bg.button}} | ||
{{/bs-button-group}} | ||
{{/form.group}} | ||
|
||
{{#form.group}} | ||
{{#if (eq type 'seed')}} | ||
{{form.element size='lg' controlType="text" property="seed" autocomplete='off' minlength=64 maxlength=64 required=true pattern="^[a-fA-F0-9]{64}$"}} | ||
<small class="form-text text-muted">Your wallet's 64 character hex seed.</small> | ||
{{/if}} | ||
{{#form.group}} | ||
{{#if (eq type 'seed')}} | ||
{{form.element size='lg' controlType="text" property="seed" autocomplete='off' minlength=64 maxlength=64 required=true pattern="^[a-fA-F0-9]{64}$"}} | ||
<small class="form-text text-muted">{{t 'wallets.import.help.seed'}}</small> | ||
{{/if}} | ||
|
||
{{#if (eq type 'mnemonic')}} | ||
{{#form.element rows=4 controlType="textarea" property="mnemonic" autocomplete='off' required=true as |el|}} | ||
{{el.control class="text-monospace"}} | ||
{{/form.element}} | ||
<small class="form-text text-muted">Your wallet's easy to remember seed mnemonic.</small> | ||
{{/if}} | ||
{{/form.group}} | ||
{{/bs-form}} | ||
{{#if (eq type 'mnemonic')}} | ||
{{#form.element rows=4 controlType="textarea" property="mnemonic" autocomplete='off' required=true as |el|}} | ||
{{el.control class="text-monospace"}} | ||
{{/form.element}} | ||
<small class="form-text text-muted">{{t 'wallets.import.help.mnemonic'}}</small> | ||
{{/if}} | ||
{{/form.group}} | ||
{{/bs-form}} | ||
{{/modal.body}} | ||
{{#modal.footer}} | ||
{{#bs-button onClick=(action modal.close) type="secondary"}} | ||
{{t 'cancel'}} | ||
{{/bs-button}} | ||
{{#bs-button onClick=(action modal.submit) type="primary"}} | ||
{{fa-icon 'upload'}} | ||
{{t 'import'}} | ||
{{/bs-button}} | ||
{{/modal.footer}} | ||
{{/bs-modal}} |
Oops, something went wrong.