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.
feat(overview): Flesh out overview and send functionality
- Loading branch information
Showing
39 changed files
with
297 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import DS from 'ember-data'; | ||
|
||
import BigNumber from 'npm:bignumber.js'; | ||
|
||
export default DS.Transform.extend({ | ||
deserialize(serialized = 0) { | ||
return BigNumber(serialized); | ||
}, | ||
|
||
serialize(deserialized = 0) { | ||
return BigNumber(deserialized); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
import DS from 'ember-data'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default DS.Adapter.extend({ | ||
rpc: service(), | ||
|
||
createRecord(store, type, snapshot) { | ||
const { | ||
wallet, | ||
source, | ||
destination, | ||
amount, | ||
} = this.serialize(snapshot, { includeId: true }); | ||
|
||
return this.get('rpc').send(wallet, source, destination, amount); | ||
}, | ||
}); |
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,9 @@ | ||
import DS from 'ember-data'; | ||
|
||
export default DS.Model.extend({ | ||
wallet: DS.belongsTo('wallet', { inverse: null }), | ||
source: DS.belongsTo('account', { inverse: 'blocks' }), | ||
|
||
destination: DS.attr('string'), | ||
amount: DS.attr('big-number'), | ||
}); |
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 DS from 'ember-data'; | ||
|
||
export default DS.JSONSerializer.extend({ | ||
primaryKey: 'block', | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
import BigNumber from 'npm:bignumber.js'; | ||
|
||
const base10 = BigNumber(10); | ||
|
||
const PREFIXES = { | ||
Gxrb: base10.pow(33), | ||
Mxrb: base10.pow(30), | ||
kxrb: base10.pow(27), | ||
xrb: base10.pow(24), | ||
mxrb: base10.pow(21), | ||
uxrb: base10.pow(18), | ||
}; | ||
|
||
export function formatAmount([value = 0], { prefix = 'Mxrb' }) { | ||
const divisor = PREFIXES[prefix] || PREFIXES['Mxrb']; | ||
return BigNumber(value).dividedBy(divisor).toFormat(); | ||
} | ||
|
||
export default helper(formatAmount); |
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,10 +1,15 @@ | ||
@import "ember-bootstrap/bootstrap"; | ||
|
||
@import "ember-power-select/themes/bootstrap"; | ||
|
||
@import "ember-power-select"; | ||
|
||
main { | ||
margin-top: 1em; | ||
} | ||
|
||
|
||
@import "ember-power-select/themes/bootstrap"; | ||
|
||
@import "ember-power-select"; | ||
h1 { | ||
margin-bottom: 20px; | ||
padding-bottom: 9px; | ||
border-bottom: 1px solid #eee; | ||
} |
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,29 +1,32 @@ | ||
{{!-- Total Balance: {{model.balance}} | ||
{{qr-code content=model.id}} --}} | ||
|
||
<div class="card-group"> | ||
<div class="card"> | ||
{{qr-code class="card-img-top" content=model.id}} | ||
<div class="card-body"> | ||
<h4 class="card-title">{{model.id}}</h4> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> | ||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
<div class="card"> | ||
{{qr-code class="card-img-top" content=model.id}} | ||
<div class="card-body"> | ||
<h4 class="card-title">{{model.id}}</h4> | ||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p> | ||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> | ||
</div> | ||
</div> | ||
<div class="card"> | ||
<{{qr-code class="card-img-top" content=model.id}} | ||
<h5 class="card-header text-center text-truncate" title="{{model.id}}"> | ||
{{model.id}} | ||
</h5> | ||
|
||
<div class="card-body"> | ||
<h4 class="card-title">{{model.id}}</h4> | ||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p> | ||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p> | ||
<div class="d-flex justify-content-center"> | ||
{{qr-code content=model.id}} | ||
</div> | ||
|
||
<dl class="row justify-content-md-center"> | ||
<dt class="col-md-3">Account</dt> | ||
<dd class="col-md-9 text-truncate" title="{{model.id}}">{{model.id}}</dd> | ||
|
||
<dt class="col-md-3">Balance</dt> | ||
<dd class="col-md-9 text-truncate" title="{{model.balance}}">{{model.balance}}</dd> | ||
|
||
<dt class="col-md-3">Pending</dt> | ||
<dd class="col-md-9 text-truncate" title="{{model.pending}}">{{model.pending}}</dd> | ||
</dl> | ||
|
||
{{#link-to 'wallets.send' model.wallet class="card-link"}} | ||
Send | ||
{{/link-to}} | ||
|
||
{{#link-to 'wallets.send' model.wallet class="card-link"}} | ||
Receive | ||
{{/link-to}} | ||
</div> | ||
</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 +1,3 @@ | ||
<h1>Overview</h1> | ||
|
||
{{wallet-overview wallet=model createAccount=(route-action 'createAccount')}} |
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,8 +1,3 @@ | ||
<div class="jumbotron jumbotron-fluid"> | ||
<div class="container"> | ||
<h1 class="display-3">Send</h1> | ||
<p class="lead">Send XRB from one of your accounts to another account.</p> | ||
</div> | ||
</div> | ||
<h1>Send</h1> | ||
|
||
{{account-send accounts=model.accounts sendAmount=(route-action 'sendAmount')}} |
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
Oops, something went wrong.