Skip to content

Commit

Permalink
Updating internal types from numbers to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman committed Jul 20, 2021
1 parent 7760526 commit 2038030
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Expand Up @@ -318,7 +318,7 @@ export function genUtxoForAddresses(
tx_hash: tx.hash,
tx_index: j,
receiver: tx.outputs[j].address,
amount: tx.outputs[j].value.toString(),
amount: tx.outputs[j].value,
creationHeight: tx.outputs[j].creationHeight,
boxId: tx.outputs[j].id,
assets: tx.outputs[j].assets,
Expand Down
10 changes: 5 additions & 5 deletions packages/yoroi-extension/app/api/ergo/lib/state-fetch/types.js
Expand Up @@ -14,7 +14,7 @@ export type RemoteUnspentOutput = {|
+creationHeight: number,
+boxId: string,
+assets?: $ReadOnlyArray<$ReadOnly<{
amount: number,
amount: string,
tokenId: string,
...
}>>,
Expand Down Expand Up @@ -75,7 +75,7 @@ export type ErgoTxOutput = {
additionalRegisters: {| [key: string]: string /* hex */ |},
address: string,
assets: $ReadOnlyArray<$ReadOnly<{
amount: number,
amount: string,
tokenId: string,
...
}>>,
Expand All @@ -87,7 +87,7 @@ export type ErgoTxOutput = {
index: number, // index of this output in this tx
mainChain: boolean,
spentTransactionId: null | string,
value: number,
value: string,
...
};
export type ErgoTxInput = {
Expand All @@ -98,9 +98,9 @@ export type ErgoTxInput = {
outputIndex: number, // index in tx that created the output we're consuming
spendingProof: string,
transactionId: string, // txHash of this tx
value: number,
value: string,
assets: $ReadOnlyArray<$ReadOnly<{
amount: number,
amount: string,
tokenId: string,
...
}>>,
Expand Down
Expand Up @@ -114,7 +114,7 @@ export function toErgoBoxJSON(
): ErgoBoxJson {
return {
boxId: utxo.boxId,
value: Number.parseInt(utxo.amount, 10),
value: utxo.amount,
ergoTree: utxo.ergoTree,
assets: (utxo.assets ?? []).map(asset => ({
amount: asset.amount,
Expand Down

0 comments on commit 2038030

Please sign in to comment.