Created
September 4, 2014 00:00
-
-
Save irisli/93776ef9c8c6145ba8b9 to your computer and use it in GitHub Desktop.
Detects which characters are valid in Stellar.
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
// Ways to use this: | |
// node stellarCurrencyDetector.js | sh | |
// node stellarCurrencyDetector.js | sh > stellarCurrencyDetectorOutput.txt | |
// Test results can be seen here: https://www.stellar.org/viewer/#test/gHQbh2U1CzPo4kH93CCmL5oxK79SqcT7mm | |
var hexes = []; | |
for (var i = 0; i <= 255; i++) { | |
hexes.push(i.toString(16).toUpperCase()); | |
} | |
for (var i = 0; i < hexes.length; i++) { | |
console.log( | |
'curl -X POST https://test.stellar.org:9002 -d \'\n' + | |
'{\n' + | |
' "method": "submit",\n' + | |
' "params": [\n' + | |
' {\n' + | |
' "secret": "secretXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",\n' + | |
' "tx_json": {\n' + | |
' "TransactionType": "TrustSet",\n' + | |
' "Account": "gAccountXXXXXXXXXXXXXXXXXXXXXXXXXX",\n' + | |
' "LimitAmount": {\n' + | |
' "currency": "000000000000000000000000' + hexes[i] + hexes[i] + hexes[i] + '0000000000",\n' + | |
' "value": "10",\n' + | |
' "issuer": "gIssuerXXXXXXXXXXXXXXXXXXXXXXXXXXX"\n' + | |
' }\n' + | |
' }\n' + | |
' }\n' + | |
' ]\n' + | |
'}\';' | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment