-
Notifications
You must be signed in to change notification settings - Fork 39
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 #504 from EdgeApp/william/no-meta-tokens
No meta tokens
- Loading branch information
Showing
42 changed files
with
1,973 additions
and
1,740 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/node_modules/@tronscan/client/src/utils/tronWeb.js b/node_modules/@tronscan/client/src/utils/tronWeb.js | ||
index 6b1bc38..3f48a11 100644 | ||
--- a/node_modules/@tronscan/client/src/utils/tronWeb.js | ||
+++ b/node_modules/@tronscan/client/src/utils/tronWeb.js | ||
@@ -25,7 +25,7 @@ const { | ||
const fromHexString = hexString => | ||
new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))); | ||
|
||
-export function transactionJsonToProtoBuf(transaction) { | ||
+function transactionJsonToProtoBuf(transaction) { | ||
const rawData = transaction["raw_data"]; | ||
const contractJson = rawData.contract[0]; | ||
const transactionObj = contractJsonToProtobuf(contractJson); | ||
@@ -52,7 +52,7 @@ export function transactionJsonToProtoBuf(transaction) { | ||
return transactionObj; | ||
} | ||
|
||
-export function contractJsonToProtobuf(contract) { | ||
+function contractJsonToProtobuf(contract) { | ||
const value = contract.parameter.value; | ||
switch (contract.type) { | ||
|
||
@@ -365,3 +365,8 @@ export function contractJsonToProtobuf(contract) { | ||
|
||
} | ||
} | ||
+ | ||
+module.exports = { | ||
+ transactionJsonToProtoBuf, | ||
+ contractJsonToProtobuf | ||
+}; |
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,33 @@ | ||
import { asMaybe, asObject, asString } from 'cleaners' | ||
import { EdgeMetaToken, EdgeTokenMap } from 'edge-core-js' | ||
|
||
/** | ||
* The `networkLocation` field is untyped, | ||
* but many currency plugins will put a contract address in there. | ||
*/ | ||
export const asMaybeContractLocation = asMaybe( | ||
asObject({ | ||
contractAddress: asString | ||
}) | ||
) | ||
|
||
/** | ||
* Downgrades EdgeToken objects to the legacy EdgeMetaToken format. | ||
*/ | ||
export function makeMetaTokens(tokens: EdgeTokenMap): EdgeMetaToken[] { | ||
const out: EdgeMetaToken[] = [] | ||
for (const tokenId of Object.keys(tokens)) { | ||
const { currencyCode, displayName, denominations, networkLocation } = | ||
tokens[tokenId] | ||
|
||
const cleanLocation = asMaybeContractLocation(networkLocation) | ||
if (cleanLocation == null) continue | ||
out.push({ | ||
currencyCode, | ||
currencyName: displayName, | ||
denominations, | ||
contractAddress: cleanLocation.contractAddress | ||
}) | ||
} | ||
return out | ||
} |
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 { eos } from './info/eosInfo' | ||
import { telos } from './info/telosInfo' | ||
import { wax } from './info/waxInfo' | ||
|
||
export const eosPlugins = { | ||
eos, | ||
telos, | ||
wax | ||
} |
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 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
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
Oops, something went wrong.