Skip to content

Commit

Permalink
add tooltip for transaction param inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
qftgtr committed Oct 24, 2020
1 parent 6b74e72 commit b56c77e
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 87 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"editor.insertSpaces": false,
"tslint.enable": true,
"typescript.tsc.autoDetect": "off",
"typescript.preferences.quoteStyle": "single",
Expand Down
6 changes: 3 additions & 3 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
},
"dependencies": {
"@fortawesome/fontawesome-pro": "^5.14.0",
"@obsidians/ui-components": "^0.2.1",
"@obsidians/ui-components": "^0.2.2",
"algosdk": "^1.7.2",
"bootstrap": "^4.5.2",
"classnames": "^2.2.6",
"lodash": "^4.17.20",
"moment": "^2.28.0",
"node-fetch": "^2.6.1",
"path-browserify": "^1.0.1",
Expand Down
37 changes: 11 additions & 26 deletions client/src/view/AlgoSdk/AlgoTransaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export default class AlgoTransaction {
}

parseSingleTxn (txn) {
const { type, params, ...rest } = txn
const { type, params, ...rest } = txn
rest.lease = this.getLease(rest.lease)
let algoTxn
switch (type) {
case 'pay':
Expand All @@ -83,64 +84,54 @@ export default class AlgoTransaction {
to: this.getAddress(params.to),
amount,
closeRemainderTo: this.getAddress(params.closeRemainderTo),
note: params.note || undefined,
lease: this.getLease(params.lease),
...rest,
}
break;
case 'asset-create':
algoTxn = {
type: 'acfg',
from: this.getAddress(params.from || params.manager),
note: params.note || undefined,
from: this.getAddress(params.from),
assetTotal: params.total,
assetDecimals: params.decimals,
assetName: params.name,
assetUnitName: params.unit,
assetURL: params.url,
assetMetadataHash: params.meta,
assetManager: this.getAddress(params.manager),
assetReserve: this.getAddress(params.reserve || params.manager),
assetFreeze: this.getAddress(params.freeze || params.manager),
assetClawback: this.getAddress(params.clawback || params.manager),
assetManager: this.getAddress(params.manager || params.from),
assetReserve: this.getAddress(params.reserve),
assetFreeze: this.getAddress(params.freeze),
assetClawback: this.getAddress(params.clawback),
assetDefaultFrozen: params.defaultFrozen,
lease: this.getLease(params.lease),
...rest,
}
break;
case 'asset-modify':
algoTxn = {
type: 'acfg',
assetIndex: params.assetId,
from: this.getAddress(params.from),
note: params.note || undefined,
assetIndex: params.assetId,
assetManager: this.getAddress(params.manager),
assetReserve: this.getAddress(params.reserve),
assetFreeze: this.getAddress(params.freeze),
assetClawback: this.getAddress(params.clawback),
lease: this.getLease(params.lease),
...rest,
}
break
case 'asset-freeze':
algoTxn = {
type: 'afrz',
assetIndex: params.assetId,
from: this.getAddress(params.from),
note: params.note || undefined,
assetIndex: params.assetId,
freezeAccount: this.getAddress(params.target),
freezeState: params.state,
lease: this.getLease(params.lease),
...rest,
}
break
case 'asset-destroy':
algoTxn = {
type: 'acfg',
assetIndex: params.assetId,
from: this.getAddress(params.from),
note: params.note || undefined,
lease: this.getLease(params.lease),
assetIndex: params.assetId,
...rest,
}
break
Expand All @@ -150,8 +141,6 @@ export default class AlgoTransaction {
from: this.getAddress(params.from),
to: this.getAddress(params.from),
assetIndex: params.assetId,
note: params.note || undefined,
lease: this.getLease(params.lease),
...rest,
}
break
Expand All @@ -163,23 +152,19 @@ export default class AlgoTransaction {
amount: params.amount,
assetIndex: params.assetId,
closeRemainderTo: this.getAddress(params.closeRemainderTo),
assetRevocationTarget: this.getAddress(params.assetRevocationTarget),
note: params.note || undefined,
lease: this.getLease(params.lease),
assetRevocationTarget: this.getAddress(params.clawback),
...rest,
}
break
case 'keyreg':
algoTxn = {
type: 'keyreg',
from: this.getAddress(params.from),
note: params.note || undefined,
voteKey: this.getAddress(params.vote),
selectionKey: this.getAddress(params.selection),
voteFirst: params.first,
voteLast: params.last,
voteKeyDilution: params.dilution,
lease: this.getLease(params.lease),
...rest,
}
break
Expand Down
Loading

0 comments on commit b56c77e

Please sign in to comment.