├── .gitignore ├── Interfaces ├── README.md ├── coin-interface.ts └── protocol-interface.ts ├── LICENSE ├── README.md ├── addresses.js ├── build-api.js ├── build-api.ls ├── compile ├── compile.sh ├── config-parser.js ├── config-parser.ls ├── deadline.js ├── deadline.ls ├── examples ├── README.md ├── example-1-core.js ├── example-1-core.ls ├── example-2-create-accounts.js ├── example-2-create-accounts.ls ├── example-3-get_balances.js ├── example-3-get_balances.ls ├── example-4-send_transaction.js ├── example-4-send_transaction.ls └── plugins │ ├── erc20-rem.json │ ├── erc20-sprkl.json │ ├── erc20-stt.json │ └── xem.json ├── index.js ├── index.ls ├── json-parse.js ├── json-parse.ls ├── load-coins.js ├── load-coins.ls ├── load-providers.js ├── load-providers.ls ├── math.js ├── math.ls ├── node_modules_embed ├── ethereumjs-tx │ ├── index.js │ └── params.json ├── ethereumjs-wallet │ ├── LICENSE │ ├── hdkey.js │ ├── index.js │ ├── package.json │ ├── provider-engine.js │ └── thirdparty.js ├── scrypt.js │ ├── LICENSE │ ├── README.md │ ├── circle.yml │ ├── index.js │ ├── js.js │ ├── package.json │ └── test │ │ └── index.js └── scryptsy │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── lib │ ├── index.js │ ├── scrypt.js │ ├── scryptSync.js │ └── utils.js │ └── package.json ├── package-lock.json ├── package.json ├── plugins ├── btc-coin.js ├── btc-coin.ls ├── btc-rs.js ├── btc-rs.ls ├── btc-segwit-coin.js ├── btc-segwit-coin.ls ├── dash-coin.js ├── dash-coin.ls ├── doge-coin.js ├── doge-coin.ls ├── eos-coin.js ├── eos-coin.ls ├── etc-coin.js ├── etc-coin.ls ├── eth-coin.js ├── eth-coin.ls ├── eth-rs.js ├── eth-rs.ls ├── gobyte-coin.js ├── gobyte-coin.ls ├── gobyte-topup.js ├── gobyte-topup.ls ├── ltc-coin.js ├── ltc-coin.ls ├── qiwi-coin.js ├── qiwi-coin.ls ├── qiwi-rs.js ├── qiwi-rs.ls ├── sprkl-coin.js ├── sprkl-coin.ls ├── stt-coin.json ├── trx-coin.js ├── trx-coin.ls ├── trycrypto-topup.js ├── trycrypto-topup.ls ├── usd-ac-rs.js ├── usd-ac-rs.ls ├── usdt-coin.js ├── usdt-coin.ls ├── usdt-rs.js ├── usdt-rs.ls ├── vlx-coin.js ├── vlx-coin.ls ├── vlx2-coin.js ├── vlx2-coin.ls ├── waves-coin.js ├── waves-coin.ls ├── xem-coin.js ├── xem-coin.ls ├── xlm-coin.js ├── xlm-coin.ls ├── xmr-coin.js ├── xmr-coin.ls ├── xrp-coin.js ├── xrp-coin.ls ├── ym-coin.js ├── ym-coin.ls ├── ym-rs.js ├── ym-rs.ls ├── zec-coin.js └── zec-coin.ls ├── pow ├── pow-gen.js ├── pow-gen.ls ├── pow-solve.js ├── pow-solve.ls ├── pow-test.js ├── pow-test.ls ├── pow-verify.js └── pow-verify.ls ├── providers ├── blockstream.js ├── blockstream.ls ├── coinpay.js ├── coinpay.ls ├── cryptonote.js ├── cryptonote.ls ├── deps-mobile.js ├── deps-mobile.ls ├── deps-standard.js ├── deps-standard.ls ├── deps.js ├── deps.ls ├── eos.js ├── eos.ls ├── erc20.js ├── erc20.ls ├── eth.js ├── eth.ls ├── insight.js ├── insight.ls ├── insight_segwit.js ├── insight_segwit.ls ├── insightzec.js ├── insightzec.ls ├── interface.js ├── liqpay.js ├── liqpay.ls ├── omni.js ├── omni.ls ├── qiwi.js ├── qiwi.ls ├── ripple.js ├── ripple.ls ├── rst.js ├── rst.ls ├── stellar.js ├── stellar.ls ├── superagent-adapter.js ├── superagent-adapter.ls ├── superagent.js ├── superagent.ls ├── tron.js ├── tron.ls ├── velas2.js ├── velas2.ls ├── waves.js ├── waves.ls ├── xem.js ├── xem.ls ├── ym.js └── ym.ls ├── push ├── test-bn.js ├── tests ├── README.md ├── check-config.js ├── check-config.ls ├── check-fields.js ├── check-fields.ls ├── eos.js ├── eos.ls ├── main.js ├── main.ls ├── mnemonic.js ├── mnemonic.ls ├── plugin-to-json.js ├── plugin-to-json.ls ├── test-bip.js ├── test-bip.ls ├── test-coin-non-zero.js ├── test-coin-non-zero.ls ├── test-coin.js ├── test-coin.ls ├── test-coins.js ├── test-coins.ls ├── test-seed.js ├── test-seed.ls ├── types.js └── types.ls ├── web3t-test.js ├── web3t-test.ls └── web3t.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /Interfaces/README.md: -------------------------------------------------------------------------------- 1 | The concept includes 2 types of entities: 2 | 3 | 1. Providers 4 | 2. Plugins 5 | 6 | ## Description 7 | 8 | #### 1. Providers 9 | 10 | Most heavy code. Everything which implements the communication with protocol 11 | 12 | For example `bitcore` provides functionality for bitcoin and all his forks 13 | 14 | 15 | #### 2. Plugins 16 | 17 | Configurations which can be pluged-in on the fly. 18 | 19 | Plugins should have a corresponding `provider` 20 | 21 | ## Interface 22 | 23 | #### 1. Providers implements functions 24 | 25 | ```Javascript 26 | 27 | export getKeys = ({ network, mnemonic, index }, cb)=> 28 | cb(null, ...); //Get { privateKey, address } 29 | 30 | export pushTx = ({ rawtx } , cb)=> 31 | cb(null, ...); //Get transactionUrl 32 | 33 | export getBalance = ( {address, network} , cb)=> 34 | cb(null, ...); //Get balance 35 | 36 | export getTransactions = ({ address, network }, cb)=> 37 | cb(null, ...); //Get array or transactions 38 | 39 | export createTransaction = ({account, recipient, amount, amount-fee, data} , cb)--> 40 | cb(null, ...); //Get signed transaction (hex) 41 | 42 | export calcFee = ({tx, network} , cb)--> 43 | cb(null, ...); //Get amount fee 44 | 45 | ``` 46 | 47 | #### 2. Plugins 48 | 49 | ```Javascript 50 | export type = 'coin' 51 | 52 | //put network specific configuration here 53 | export mainnet = { 54 | api : { 55 | url: "..." 56 | } 57 | } 58 | 59 | //put network specific configuration here 60 | export testnet = { 61 | api : { 62 | url: "..." 63 | } 64 | } 65 | export enabled = true; 66 | 67 | ``` -------------------------------------------------------------------------------- /Interfaces/coin-interface.ts: -------------------------------------------------------------------------------- 1 | interface Bip32 { 2 | public: number; 3 | private: number; 4 | } 5 | 6 | interface Api { 7 | //Different blockchain can use the same protocol. Like bitcoin and litecoin, ethereum and ethereum classic 8 | protocol: string; 9 | //Connection to the fullNode (absolute path) 10 | url: string; 11 | } 12 | 13 | interface Network { 14 | decimals: number; 15 | txFee: number; 16 | mask: string; 17 | api: Api; 18 | messagePrefix?: string; 19 | bech32?: string; 20 | bip32?: Bip32; 21 | pubKeyHash?: number; 22 | scriptHash?: number; 23 | wif?: number; 24 | } 25 | 26 | interface Coin { 27 | symbol: string; 28 | imageUrl: string; 29 | testnet: Network; 30 | mainnet: Network; 31 | } -------------------------------------------------------------------------------- /Interfaces/protocol-interface.ts: -------------------------------------------------------------------------------- 1 | interface BalanceRequest { 2 | //Definition in coin-interface.ts 3 | network: Network; 4 | address: number; 5 | } 6 | 7 | interface PushTxRequest { 8 | //Definition in coin-interface.ts 9 | network: Network; 10 | //Signed Transaction 11 | rawtx: number; 12 | } 13 | 14 | interface TransactionRequest { 15 | network: Network; 16 | sender: number; 17 | recipient: number; 18 | amount: number; 19 | amountFee: number; 20 | data: number; 21 | } 22 | 23 | interface KeyRequest { 24 | network: Network; 25 | mnemonic: string; 26 | index: number; 27 | } 28 | 29 | interface Keys { 30 | publicKey: String; 31 | privateKey: String; 32 | } 33 | 34 | interface Protocol { 35 | //Generate Keys 36 | getKeys(request: KeyRequest, callback: Function): Keys; 37 | //Calculate fee based on bites or amount 38 | calcFee(tx: TransactionRequest): number; 39 | //Get Current Balance from FullNode 40 | getBalance(request: BalanceRequest, callback: Function): void; 41 | //Notify FullNode about new signed transaction 42 | pushTx(request: PushTxRequest, callback: Function): void; 43 | //verify encoded transaction for data. Mostly for Smart Contract Systems 44 | checkDecodedData(decoded-data: string, data: number): bool; 45 | //Create new signed transaction 46 | createTransaction(request: TransactionRequest, callback: Function): void; 47 | //Get transaction history 48 | getTransactions(request: BalanceRequest, callback: Function ): void; 49 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Ethnamed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /addresses.js: -------------------------------------------------------------------------------- 1 | const crypto = require("crypto"); 2 | 3 | const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; 4 | const ALPHABET_MAP = {}; 5 | 6 | for (let i = 0; i < ALPHABET.length; i++) { 7 | ALPHABET_MAP[ALPHABET.charAt(i)] = i; 8 | } 9 | 10 | const BASE = 58; 11 | 12 | const BITS_PER_DIGIT = Math.log(BASE) / Math.log(2); 13 | 14 | function maxEncodedLen(n) { 15 | return Math.ceil(n / BITS_PER_DIGIT); 16 | } 17 | 18 | function sha256(string) { 19 | return crypto 20 | .createHash("sha256") 21 | .update(string) 22 | .digest("hex"); 23 | } 24 | 25 | function ethToVlx(address_string) { 26 | const clean_address = address_string.replace(/^0x/i, "").toLowerCase(); 27 | 28 | if (clean_address.length !== 40) { 29 | throw new Error("Invalid address length"); 30 | } 31 | 32 | const checksum = sha256(sha256(clean_address)).substring(0, 8); 33 | 34 | const long_address = clean_address + checksum; 35 | buffer = Buffer.from(long_address, "hex"); 36 | 37 | if (buffer.length === 0) { 38 | throw new Error("Invalid address"); 39 | } 40 | 41 | let digits = [0]; 42 | for (let i = 0; i < buffer.length; i++) { 43 | for (let j = 0; j < digits.length; j++) digits[j] <<= 8; 44 | 45 | digits[0] += buffer[i]; 46 | 47 | let carry = 0; 48 | for (let j = 0; j < digits.length; ++j) { 49 | digits[j] += carry; 50 | 51 | carry = (digits[j] / BASE) | 0; 52 | digits[j] %= BASE; 53 | } 54 | 55 | while (carry) { 56 | digits.push(carry % BASE); 57 | 58 | carry = (carry / BASE) | 0; 59 | } 60 | } 61 | 62 | const zeros = maxEncodedLen(buffer.length * 8) - digits.length; 63 | 64 | for (let i = 0; i < zeros; i++) digits.push(0); 65 | 66 | return ( 67 | "V" + 68 | digits 69 | .reverse() 70 | .map(function(digit) { 71 | return ALPHABET[digit]; 72 | }) 73 | .join("") 74 | ); 75 | } 76 | 77 | function vlxToEth(address_string) { 78 | if (address_string.length === 0) return null; 79 | string = address_string.replace("V", ""); 80 | let bytes = [0]; 81 | for (let i = 0; i < string.length; i++) { 82 | const c = string[i]; 83 | if (!(c in ALPHABET_MAP)) throw new Error("Non-base58 character"); 84 | 85 | for (let j = 0; j < bytes.length; j++) bytes[j] *= BASE; 86 | bytes[0] += ALPHABET_MAP[c]; 87 | 88 | let carry = 0; 89 | for (let j = 0; j < bytes.length; ++j) { 90 | bytes[j] += carry; 91 | 92 | carry = bytes[j] >> 8; 93 | bytes[j] &= 0xff; 94 | } 95 | 96 | while (carry) { 97 | bytes.push(carry & 0xff); 98 | 99 | carry >>= 8; 100 | } 101 | } 102 | 103 | const zeros = 24 - bytes.length; 104 | 105 | for (let i = 0; i < zeros; i++) { 106 | bytes.push(0); 107 | } 108 | const buff = Buffer.from(bytes.reverse()); 109 | const long_address = buff.toString("hex"); 110 | 111 | if (long_address.length !== 48) { 112 | throw new Error("Invalid address"); 113 | } 114 | const address = long_address.slice(0, 40); 115 | const address_checksum = long_address.slice(40, 48); 116 | 117 | if (!address || !address_checksum) { 118 | throw new Error("Invalid address"); 119 | } 120 | 121 | const checksum = sha256(sha256(address)).substring(0, 8); 122 | 123 | if (address_checksum !== checksum) { 124 | throw new Error("Invalid checksum"); 125 | } 126 | 127 | return "0x" + address; 128 | } 129 | 130 | 131 | module.exports.vlxToEth = vlxToEth; 132 | module.exports.ethToVlx = ethToVlx; -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | fs "**/*.ls" | map "lsc -c *" | bash -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | lsc -c build-api.ls 2 | lsc -c config-parser.ls 3 | lsc -c deadline.ls 4 | lsc -c examples/example-1-core.ls 5 | lsc -c examples/example-2-create-accounts.ls 6 | lsc -c examples/example-3-get_balances.ls 7 | lsc -c examples/example-4-send_transaction.ls 8 | lsc -c index.ls 9 | lsc -c json-parse.ls 10 | lsc -c load-coins.ls 11 | lsc -c load-providers.ls 12 | lsc -c math.ls 13 | lsc -c node_modules/core-js/build/build.ls 14 | lsc -c node_modules/core-js/build/Gruntfile.ls 15 | lsc -c node_modules/ripple-keypairs/node_modules/core-js/build/build.ls 16 | lsc -c node_modules/ripple-keypairs/node_modules/core-js/build/Gruntfile.ls 17 | lsc -c plugins/btc-coin.ls 18 | lsc -c plugins/btc-rs.ls 19 | lsc -c plugins/dash-coin.ls 20 | lsc -c plugins/doge-coin.ls 21 | lsc -c plugins/eos-coin.ls 22 | lsc -c plugins/etc-coin.ls 23 | lsc -c plugins/eth-coin.ls 24 | lsc -c plugins/eth-rs.ls 25 | lsc -c plugins/gobyte-coin.ls 26 | lsc -c plugins/gobyte-topup.ls 27 | lsc -c plugins/ltc-coin.ls 28 | lsc -c plugins/qiwi-coin.ls 29 | lsc -c plugins/qiwi-rs.ls 30 | lsc -c plugins/sprkl-coin.ls 31 | lsc -c plugins/trx-coin.ls 32 | lsc -c plugins/trycrypto-topup.ls 33 | lsc -c plugins/usd-ac-rs.ls 34 | lsc -c plugins/usdt-coin.ls 35 | lsc -c plugins/usdt-rs.ls 36 | lsc -c plugins/waves-coin.ls 37 | lsc -c plugins/xem-coin.ls 38 | lsc -c plugins/xlm-coin.ls 39 | lsc -c plugins/xmr-coin.ls 40 | lsc -c plugins/xrp-coin.ls 41 | lsc -c plugins/ym-coin.ls 42 | lsc -c plugins/ym-rs.ls 43 | lsc -c plugins/zec-coin.ls 44 | lsc -c pow/pow-gen.ls 45 | lsc -c pow/pow-solve.ls 46 | lsc -c pow/pow-test.ls 47 | lsc -c pow/pow-verify.ls 48 | lsc -c providers/coinpay.ls 49 | lsc -c providers/cryptonote.ls 50 | lsc -c providers/eos.ls 51 | lsc -c providers/erc20.ls 52 | lsc -c providers/eth.ls 53 | lsc -c providers/insight.ls 54 | lsc -c providers/insightzec.ls 55 | lsc -c providers/liqpay.ls 56 | lsc -c providers/omni.ls 57 | lsc -c providers/qiwi.ls 58 | lsc -c providers/ripple.ls 59 | lsc -c providers/rst.ls 60 | lsc -c providers/stellar.ls 61 | lsc -c providers/superagent.ls 62 | lsc -c providers/tron.ls 63 | lsc -c providers/waves.ls 64 | lsc -c providers/xem.ls 65 | lsc -c providers/ym.ls 66 | lsc -c tests/check-config.ls 67 | lsc -c tests/check-fields.ls 68 | lsc -c tests/eos.ls 69 | lsc -c tests/main.ls 70 | lsc -c tests/mnemonic.ls 71 | lsc -c tests/plugin-to-json.ls 72 | lsc -c tests/test-coin-non-zero.ls 73 | lsc -c tests/test-coin.ls 74 | lsc -c tests/test-coins.ls 75 | lsc -c tests/test-seed.ls 76 | lsc -c tests/types.ls 77 | -------------------------------------------------------------------------------- /config-parser.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var ref$, map, pairsToObj, split, tail, getMode, parseMappingString, parseMappingObject, getMapping, toString$ = {}.toString; 4 | ref$ = require('prelude-ls'), map = ref$.map, pairsToObj = ref$.pairsToObj, split = ref$.split, tail = ref$.tail; 5 | getMode = function(config){ 6 | if (toString$.call(config).slice(8, -1) === 'String') { 7 | return config.split(',')[0]; 8 | } 9 | if (toString$.call(config).slice(8, -1) === 'Object') { 10 | return getMode(config.mode); 11 | } 12 | return 'testnet'; 13 | }; 14 | parseMappingString = function(config){ 15 | var all; 16 | all = config.split(',').map(function(it){ 17 | return it.trim(); 18 | }); 19 | if (!all.length === 1) { 20 | return {}; 21 | } 22 | return pairsToObj( 23 | map(function(it){ 24 | return [it[1], it[0]]; 25 | })( 26 | map(split(' for '))( 27 | tail( 28 | all)))); 29 | }; 30 | parseMappingObject = function(config){ 31 | var mapping; 32 | mapping = parseMappingString(config.mode); 33 | importAll$(mapping, config.networkMapping) == null && {}; 34 | return mapping; 35 | }; 36 | getMapping = function(config){ 37 | if (toString$.call(config).slice(8, -1) === 'String') { 38 | return parseMappingString(config); 39 | } 40 | if (toString$.call(config).slice(8, -1) === 'Object') { 41 | return parseMappingObject(config); 42 | } 43 | return {}; 44 | }; 45 | module.exports = function(config){ 46 | var mode, mapping, getModeFor; 47 | mode = getMode(config); 48 | mapping = getMapping(config); 49 | getModeFor = function(symbol){ 50 | var ref$; 51 | return (ref$ = mapping[symbol]) != null ? ref$ : mode; 52 | }; 53 | return { 54 | getModeFor: getModeFor 55 | }; 56 | }; 57 | function importAll$(obj, src){ 58 | for (var key in src) obj[key] = src[key]; 59 | return obj; 60 | } 61 | }).call(this); 62 | -------------------------------------------------------------------------------- /config-parser.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \prelude-ls : { map, pairs-to-obj, split, tail } 3 | } 4 | get-mode = (config)-> 5 | return config.split(\,).0 if typeof! config is \String 6 | return get-mode config.mode if typeof! config is \Object 7 | \testnet 8 | parse-mapping-string = (config)-> 9 | all = config.split(\,).map(-> it.trim!) 10 | return {} if not all.length is 1 11 | all 12 | |> tail 13 | |> map split ' for ' 14 | |> map -> [it.1, it.0] 15 | |> pairs-to-obj 16 | parse-mapping-object = (config)-> 17 | mapping = parse-mapping-string config.mode 18 | mapping <<<< config.network-mapping ? {} 19 | mapping 20 | get-mapping = (config)-> 21 | return parse-mapping-string config if typeof! config is \String 22 | return parse-mapping-object config if typeof! config is \Object 23 | {} 24 | module.exports = (config)-> 25 | mode = get-mode config 26 | mapping = get-mapping config 27 | get-mode-for = (symbol)-> 28 | mapping[symbol] ? mode 29 | { get-mode-for } -------------------------------------------------------------------------------- /deadline.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | module.exports = 25000; 4 | }).call(this); 5 | -------------------------------------------------------------------------------- /deadline.ls: -------------------------------------------------------------------------------- 1 | module.exports = 25000 -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | ## How To 4 | 5 | * Core (Init) 6 | 7 | Init default core coins `btc`,`ltc`,`eth`,`dash` and custom `stt`,`rem`,`xem`,`sprkl` 8 | 9 | * Create Account 10 | 11 | Each account requires mnemonic pharse and unique index (integer) 12 | 13 | * Get Balance 14 | 15 | Get Balance requires account object ({ address }) to check it in blockchain via public node 16 | 17 | * Send Transactions 18 | 19 | Requires account object, recipient (to) and amount 20 | 21 | ## Examples written on [Livscript](livescript.net) Language. This language compiles into Javascript. 22 | 23 | You can compile each file into javascript with command 24 | 25 | ```sh 26 | cd examples 27 | npm i livescript -g 28 | lsc -c *.ls 29 | ``` 30 | 31 | But if you want to read it please follow the conversion guide 32 | 33 | 1. Callback Notation 34 | 35 | ```Livscript 36 | err, account <- create-account 37 | ``` 38 | 39 | is same as 40 | 41 | ```Javascript 42 | create-account(function(err, account) { 43 | 44 | }); 45 | ``` 46 | 47 | 2. Import Notation 48 | 49 | ```Livscript 50 | require! { 51 | \./example-1-core.ls 52 | \./example-3-create_accounts.ls 53 | } 54 | ``` 55 | 56 | is same as 57 | 58 | ```Javascript 59 | import example-1-core from "./example-1-core.ls"; 60 | import example-3-create_accounts from "./example-3-create-accounts.ls"; 61 | ``` 62 | 63 | 3. Naming Notation 64 | 65 | ```Livscript 66 | const var-name = 1 67 | ``` 68 | 69 | is same as 70 | 71 | ```Javascript 72 | const varName = 1; 73 | ``` 74 | 75 | 4. Error Notation 76 | 77 | ```Livscript 78 | return cb err if err? 79 | ``` 80 | 81 | is same as 82 | 83 | ```Javascript 84 | if(err) { 85 | return cb(err); 86 | } 87 | ``` -------------------------------------------------------------------------------- /examples/example-1-core.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var web3tBuilder, rem, sprkl, stt, xem, mode, plugins, initWeb3t, mnemonic, out$ = typeof exports != 'undefined' && exports || this; 4 | web3tBuilder = require('../index.ls'); 5 | rem = require('./plugins/erc20-rem.json'); 6 | sprkl = require('./plugins/erc20-sprkl.json'); 7 | stt = require('./plugins/erc20-stt.json'); 8 | xem = require('./plugins/xem.json'); 9 | mode = 'testnet'; 10 | plugins = { 11 | sprkl: sprkl, 12 | rem: rem, 13 | stt: stt, 14 | xem: xem 15 | }; 16 | out$.initWeb3t = initWeb3t = function(cb){ 17 | return web3tBuilder({ 18 | mode: mode, 19 | plugins: plugins 20 | }, cb); 21 | }; 22 | out$.mnemonic = mnemonic = "some unique pharses should be here"; 23 | }).call(this); 24 | -------------------------------------------------------------------------------- /examples/example-1-core.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../index.ls : web3t-builder #same as web3t 3 | \./plugins/erc20-rem.json : rem 4 | \./plugins/erc20-sprkl.json : sprkl 5 | \./plugins/erc20-stt.json : stt 6 | \./plugins/xem.json : xem 7 | } 8 | 9 | mode = \testnet 10 | 11 | plugins = { sprkl, rem, stt, xem } 12 | 13 | export init-web3t = (cb)-> 14 | web3t-builder({ mode, plugins }, cb) 15 | 16 | export mnemonic = "some unique pharses should be here" -------------------------------------------------------------------------------- /examples/example-2-create-accounts.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var ref$, initWeb3t, mnemonic, createBtcAccount, createLtcAccount, createDashAccount, createEthAccount, createXemAccount, createRemAccount, createSttAccount, createSprklAccount, out$ = typeof exports != 'undefined' && exports || this; 4 | ref$ = require('./example-1-core.ls'), initWeb3t = ref$.initWeb3t, mnemonic = ref$.mnemonic; 5 | out$.createBtcAccount = createBtcAccount = function(index, cb){ 6 | return initWeb3t(function(err, web3t){ 7 | if (err != null) { 8 | return cb(err); 9 | } 10 | return web3t.btc.createAccount({ 11 | mnemonic: mnemonic, 12 | index: index 13 | }, cb); 14 | }); 15 | }; 16 | out$.createLtcAccount = createLtcAccount = function(index, cb){ 17 | return initWeb3t(function(err, web3t){ 18 | if (err != null) { 19 | return cb(err); 20 | } 21 | return web3t.ltc.createAccount({ 22 | mnemonic: mnemonic, 23 | index: index 24 | }, cb); 25 | }); 26 | }; 27 | out$.createDashAccount = createDashAccount = function(index, cb){ 28 | return initWeb3t(function(err, web3t){ 29 | if (err != null) { 30 | return cb(err); 31 | } 32 | return web3t.dash.createAccount({ 33 | mnemonic: mnemonic, 34 | index: index 35 | }, cb); 36 | }); 37 | }; 38 | out$.createEthAccount = createEthAccount = function(index, cb){ 39 | return initWeb3t(function(err, web3t){ 40 | if (err != null) { 41 | return cb(err); 42 | } 43 | return web3t.eth.createAccount({ 44 | mnemonic: mnemonic, 45 | index: index 46 | }, cb); 47 | }); 48 | }; 49 | out$.createXemAccount = createXemAccount = function(index, cb){ 50 | return initWeb3t(function(err, web3t){ 51 | if (err != null) { 52 | return cb(err); 53 | } 54 | return web3t.xem.createAccount({ 55 | mnemonic: mnemonic, 56 | index: index 57 | }, cb); 58 | }); 59 | }; 60 | out$.createRemAccount = createRemAccount = function(index, cb){ 61 | return initWeb3t(function(err, web3t){ 62 | if (err != null) { 63 | return cb(err); 64 | } 65 | return web3t.rem.createAccount({ 66 | mnemonic: mnemonic, 67 | index: index 68 | }, cb); 69 | }); 70 | }; 71 | out$.createSttAccount = createSttAccount = function(index, cb){ 72 | return initWeb3t(function(err, web3t){ 73 | if (err != null) { 74 | return cb(err); 75 | } 76 | return web3t.stt.createAccount({ 77 | mnemonic: mnemonic, 78 | index: index 79 | }, cb); 80 | }); 81 | }; 82 | out$.createSprklAccount = createSprklAccount = function(index, cb){ 83 | return initWeb3t(function(err, web3t){ 84 | if (err != null) { 85 | return cb(err); 86 | } 87 | return web3t.sprkl.createAccount({ 88 | mnemonic: mnemonic, 89 | index: index 90 | }, cb); 91 | }); 92 | }; 93 | }).call(this); 94 | -------------------------------------------------------------------------------- /examples/example-2-create-accounts.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./example-1-core.ls : { init-web3t, mnemonic } 3 | } 4 | 5 | ## Core 6 | 7 | export create-btc-account = (index, cb )-> 8 | err, web3t <- init-web3t 9 | return cb err if err? 10 | web3t.btc.create-account({ mnemonic, index }, cb) 11 | 12 | export create-ltc-account = (index, cb )-> 13 | err, web3t <- init-web3t 14 | return cb err if err? 15 | web3t.ltc.create-account({ mnemonic, index }, cb) 16 | 17 | export create-dash-account = (index, cb )-> 18 | err, web3t <- init-web3t 19 | return cb err if err? 20 | web3t.dash.create-account({ mnemonic, index }, cb) 21 | 22 | export create-eth-account = (index, cb )-> 23 | err, web3t <- init-web3t 24 | return cb err if err? 25 | web3t.eth.create-account({ mnemonic, index }, cb) 26 | 27 | # Plugins 28 | 29 | export create-xem-account = (index, cb )-> 30 | err, web3t <- init-web3t 31 | return cb err if err? 32 | web3t.xem.create-account({ mnemonic, index }, cb) 33 | 34 | export create-rem-account = (index, cb )-> 35 | err, web3t <- init-web3t 36 | return cb err if err? 37 | web3t.rem.create-account({ mnemonic, index }, cb) 38 | 39 | export create-stt-account = (index, cb )-> 40 | err, web3t <- init-web3t 41 | return cb err if err? 42 | web3t.stt.create-account({ mnemonic, index }, cb) 43 | 44 | export create-sprkl-account = (index, cb )-> 45 | err, web3t <- init-web3t 46 | return cb err if err? 47 | web3t.sprkl.create-account({ mnemonic, index }, cb) 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/example-3-get_balances.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var initWeb3t, ref$, createBtcAccount, createLtcAccount, createSttAccount, getBtcBalance, getLtcBalance, getSttBalance, out$ = typeof exports != 'undefined' && exports || this; 4 | initWeb3t = require('./example-1-core.ls').initWeb3t; 5 | ref$ = require('./example-2-create_accounts.ls'), createBtcAccount = ref$.createBtcAccount, createLtcAccount = ref$.createLtcAccount, createSttAccount = ref$.createSttAccount; 6 | out$.getBtcBalance = getBtcBalance = function(cb){ 7 | return createBtcAccount(0, function(err, account){ 8 | if (err != null) { 9 | return cb(err); 10 | } 11 | return initWeb3t(function(err, web3t){ 12 | if (err != null) { 13 | return cb(err); 14 | } 15 | return web3t.btc.getBalance({ 16 | account: account 17 | }, cb); 18 | }); 19 | }); 20 | }; 21 | out$.getLtcBalance = getLtcBalance = function(cb){ 22 | return createLtcAccount(0, function(err, account){ 23 | if (err != null) { 24 | return cb(err); 25 | } 26 | return initWeb3t(function(err, web3t){ 27 | if (err != null) { 28 | return cb(err); 29 | } 30 | return web3t.ltc.getBalance({ 31 | account: account 32 | }, cb); 33 | }); 34 | }); 35 | }; 36 | out$.getSttBalance = getSttBalance = function(cb){ 37 | return createSttAccount(0, function(err, account){ 38 | if (err != null) { 39 | return cb(err); 40 | } 41 | return initWeb3t(function(err, web3t){ 42 | if (err != null) { 43 | return cb(err); 44 | } 45 | return web3t.stt.getBalance({ 46 | account: account 47 | }, cb); 48 | }); 49 | }); 50 | }; 51 | }).call(this); 52 | -------------------------------------------------------------------------------- /examples/example-3-get_balances.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./example-1-core.ls : { init-web3t } 3 | \./example-2-create_accounts.ls : { 4 | create-btc-account 5 | create-ltc-account 6 | create-stt-account 7 | } 8 | } 9 | 10 | export get-btc-balance = (cb)-> 11 | err, account <- create-btc-account 0 12 | return cb err if err? 13 | err, web3t <- init-web3t 14 | return cb err if err? 15 | web3t.btc.get-balance { account }, cb 16 | 17 | 18 | export get-ltc-balance = (cb)-> 19 | err, account <- create-ltc-account 0 20 | return cb err if err? 21 | err, web3t <- init-web3t 22 | return cb err if err? 23 | web3t.ltc.get-balance { account }, cb 24 | 25 | 26 | export get-stt-balance = (cb)-> 27 | err, account <- create-stt-account 0 28 | return cb err if err? 29 | err, web3t <- init-web3t 30 | return cb err if err? 31 | web3t.stt.get-balance { account }, cb 32 | 33 | # Everything else is the same 34 | -------------------------------------------------------------------------------- /examples/example-4-send_transaction.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var initWeb3t, ref$, createBtcAccount, createLtcAccount, createSttAccount, sendBtcTransaction, sendLtcTransaction, sendSttTransaction, out$ = typeof exports != 'undefined' && exports || this; 4 | initWeb3t = require('./example-1-core.ls').initWeb3t; 5 | ref$ = require('./example-2-create_accounts.ls'), createBtcAccount = ref$.createBtcAccount, createLtcAccount = ref$.createLtcAccount, createSttAccount = ref$.createSttAccount; 6 | out$.sendBtcTransaction = sendBtcTransaction = function(cb){ 7 | return createBtcAccount(0, function(err, account){ 8 | if (err != null) { 9 | return cb(err); 10 | } 11 | return initWeb3t(function(err, web3t){ 12 | if (err != null) { 13 | return cb(err); 14 | } 15 | return createBtcAccount(1, function(err, accountReceiver){ 16 | var to, amount; 17 | to = accountReceiver.address; 18 | amount = "1"; 19 | return web3t.btc.sendTransaction({ 20 | account: account, 21 | to: to, 22 | amount: amount 23 | }, cb); 24 | }); 25 | }); 26 | }); 27 | }; 28 | out$.sendLtcTransaction = sendLtcTransaction = function(cb){ 29 | return createLtcAccount(0, function(err, account){ 30 | if (err != null) { 31 | return cb(err); 32 | } 33 | return initWeb3t(function(err, web3t){ 34 | if (err != null) { 35 | return cb(err); 36 | } 37 | return createLtcAccount(1, function(err, accountReceiver){ 38 | var to, amount; 39 | to = accountReceiver.address; 40 | amount = "1"; 41 | return web3t.ltc.sendTransaction({ 42 | account: account, 43 | to: to, 44 | amount: amount 45 | }, cb); 46 | }); 47 | }); 48 | }); 49 | }; 50 | out$.sendSttTransaction = sendSttTransaction = function(cb){ 51 | return createSttAccount(0, function(err, account){ 52 | if (err != null) { 53 | return cb(err); 54 | } 55 | return initWeb3t(function(err, web3t){ 56 | if (err != null) { 57 | return cb(err); 58 | } 59 | return createSttAccount(1, function(err, accountReceiver){ 60 | var to, amount; 61 | to = accountReceiver.address; 62 | amount = "1"; 63 | return web3t.stt.sendTransaction({ 64 | account: account, 65 | to: to, 66 | amount: amount 67 | }, cb); 68 | }); 69 | }); 70 | }); 71 | }; 72 | }).call(this); 73 | -------------------------------------------------------------------------------- /examples/example-4-send_transaction.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./example-1-core.ls : { init-web3t } 3 | \./example-2-create_accounts.ls : { 4 | create-btc-account 5 | create-ltc-account 6 | create-stt-account 7 | } 8 | } 9 | 10 | export send-btc-transaction = (cb)-> 11 | err, account <- create-btc-account 0 12 | return cb err if err? 13 | err, web3t <- init-web3t 14 | return cb err if err? 15 | err, account-receiver <- create-btc-account 1 16 | const to = account-receiver.address 17 | const amount = "1" 18 | web3t.btc.send-transaction { account, to, amount }, cb 19 | 20 | 21 | export send-ltc-transaction = (cb)-> 22 | err, account <- create-ltc-account 0 23 | return cb err if err? 24 | err, web3t <- init-web3t 25 | return cb err if err? 26 | err, account-receiver <- create-ltc-account 1 27 | const to = account-receiver.address 28 | const amount = "1" 29 | web3t.ltc.send-transaction({ account, to, amount }, cb) 30 | 31 | 32 | export send-stt-transaction = (cb)-> 33 | err, account <- create-stt-account 0 34 | return cb err if err? 35 | err, web3t <- init-web3t 36 | return cb err if err? 37 | err, account-receiver <- create-stt-account 1 38 | const to = account-receiver.address 39 | const amount = "1" 40 | web3t.stt.send-transaction({ account, to, amount }, cb) 41 | 42 | # Everything else is the same 43 | -------------------------------------------------------------------------------- /examples/plugins/erc20-rem.json: -------------------------------------------------------------------------------- 1 | { 2 | "usdInfo": "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=REM&tsyms=USD).REM.USD", 3 | "image": "https://res.cloudinary.com/nixar-work/image/upload/v1547598371/logo_icon_white.png", 4 | "token": "rem", 5 | "enabled": true, 6 | "type": "coin", 7 | "testnet": { 8 | "decimals": 4, 9 | "txFee": "0.0030", 10 | "address": "0xe639041fd04a0e767870b18cb341f1cd2bec296f", 11 | "messagePrefix": "Ethereum", 12 | "mask": "0x0000000000000000000000000000000000000000", 13 | "api": { 14 | "provider": "erc20", 15 | "web3Provider":"https://ropsten.infura.io/UoCkF4efTrbEGU8Qpcs0", 16 | "url":"https://ropsten.etherscan.io", 17 | "apiUrl":"http://api-ropsten.etherscan.io/api" 18 | } 19 | }, 20 | "mainnet": { 21 | "decimals": 4, 22 | "txFee": "0.0030", 23 | "messagePrefix": "Ethereum", 24 | "address": "0x83984d6142934bb535793a82adb0a46ef0f66b6d", 25 | "mask": "0x0000000000000000000000000000000000000000", 26 | "api": { 27 | "provider": "erc20", 28 | "web3Provider": "https://mainnet.infura.io/UoCkF4efTrbEGU8Qpcs0", 29 | "url": "https://etherscan.io", 30 | "apiUrl": "https://api.etherscan.io/api" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /examples/plugins/erc20-sprkl.json: -------------------------------------------------------------------------------- 1 | { 2 | "usdInfo":"url(http://sparklemobile.io:2000/rate).SPRKL.USD", 3 | "image":"https://res.cloudinary.com/nixar-work/image/upload/v1545329215/sparkle-ethnamed.png", 4 | "token":"sprkl", 5 | "enabled":true, 6 | "type":"coin", 7 | "testnet":{ 8 | "decimals":18, 9 | "txFee":"0.0020", 10 | "address":"0x2AE67539e628a36cfEc0F8D720489d490b525637", 11 | "messagePrefix":"Ethereum", 12 | "mask":"0x0000000000000000000000000000000000000000", 13 | "api":{ 14 | "provider":"erc20", 15 | "web3Provider":"https://ropsten.infura.io/UoCkF4efTrbEGU8Qpcs0", 16 | "url":"https://ropsten.etherscan.io", 17 | "apiUrl":"http://api-ropsten.etherscan.io/api" 18 | } 19 | }, 20 | "mainnet":{ 21 | "decimals":18, 22 | "txFee":"0.0014", 23 | "messagePrefix":"Ethereum", 24 | "address":"0x73779dF3F86A4F314655247443dB8780a9b9F4CC", 25 | "mask":"0x0000000000000000000000000000000000000000", 26 | "api":{ 27 | "provider":"erc20", 28 | "web3Provider":"https://mainnet.infura.io/UoCkF4efTrbEGU8Qpcs0", 29 | "url":"https://etherscan.io", 30 | "apiUrl":"https://api.etherscan.io/api" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /examples/plugins/erc20-stt.json: -------------------------------------------------------------------------------- 1 | { 2 | "usdInfo": "url(http://209.126.79.30:3333/rate).STT.USD", 3 | "image": "https://res.cloudinary.com/dfbhd7liw/image/upload/v1547131066/coin.png", 4 | "token": "stt", 5 | "enabled": true, 6 | "type": "coin", 7 | "testnet": { 8 | "decimals": 18, 9 | "txFee": "0.0030", 10 | "address": "0x9d10ff02163ecf1f5bf01e4596fc3dca579f2617", 11 | "messagePrefix": "Ethereum", 12 | "mask": "0x0000000000000000000000000000000000000000", 13 | "api": { 14 | "provider": "erc20", 15 | "web3Provider":"https://ropsten.infura.io/UoCkF4efTrbEGU8Qpcs0", 16 | "url":"https://ropsten.etherscan.io", 17 | "apiUrl":"http://api-ropsten.etherscan.io/api" 18 | } 19 | }, 20 | "mainnet": { 21 | "decimals": 18, 22 | "txFee": "0.0030", 23 | "messagePrefix": "Ethereum", 24 | "address": "0x0bbb5a54767166b21e4a74d30500248a05ed985f", 25 | "mask": "0x0000000000000000000000000000000000000000", 26 | "api": { 27 | "provider": "erc20", 28 | "web3Provider": "https://mainnet.infura.io/UoCkF4efTrbEGU8Qpcs0", 29 | "url": "https://etherscan.io", 30 | "apiUrl": "https://api.etherscan.io/api" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /examples/plugins/xem.json: -------------------------------------------------------------------------------- 1 | { 2 | "mainnet": { 3 | "decimals": 6, 4 | "txFee": "0.05", 5 | "id": 104, 6 | "prefix": "68", 7 | "char": "N", 8 | "api": { 9 | "provider": "xem", 10 | "nodeAddress": "http://hugealice3.nem.ninja", 11 | "nodePort": 7890, 12 | "url": "http://chain.nem.ninja/#", 13 | "apiUrl": "http://chain.nem.ninja/api3" 14 | } 15 | }, 16 | "testnet": { 17 | "decimals": 6, 18 | "txFee": "0.05", 19 | "id": -104, 20 | "prefix": "98", 21 | "char": "T", 22 | "api": { 23 | "provider": "xem", 24 | "nodeAddress": "http://23.228.67.85", 25 | "nodePort": 7890, 26 | "url": "http://bob.nem.ninja:8765/#", 27 | "apiUrl": "http://bob.nem.ninja:8765/api3" 28 | } 29 | }, 30 | "type": "coin", 31 | "enabled": true, 32 | "token": "xem", 33 | "image": "./res/nem-ethnamed.png", 34 | "usdInfo": "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM&tsyms=USD).XEM.USD" 35 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var loadProviders, loadCoins, buildApi; 4 | loadProviders = require('./load-providers.js'); 5 | loadCoins = require('./load-coins.js'); 6 | buildApi = require('./build-api.js'); 7 | module.exports = function(config, cb){ 8 | return loadCoins(config, function(err, coins){ 9 | if (err != null) { 10 | return cb(err); 11 | } 12 | return loadProviders(config, function(err, providers){ 13 | if (err != null) { 14 | return cb(err); 15 | } 16 | return buildApi(coins, providers, config, function(err, api){ 17 | if (err != null) { 18 | return cb(err); 19 | } 20 | return cb(null, api); 21 | }); 22 | }); 23 | }); 24 | }; 25 | }).call(this); 26 | -------------------------------------------------------------------------------- /index.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./load-providers.js 3 | \./load-coins.js 4 | \./build-api.js 5 | } 6 | 7 | module.exports = (config, cb)-> 8 | err, coins <- load-coins config 9 | return cb err if err? 10 | err, providers <- load-providers config 11 | return cb err if err? 12 | err, api <- build-api coins, providers, config 13 | return cb err if err? 14 | cb null, api 15 | -------------------------------------------------------------------------------- /json-parse.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | module.exports = function(obj, cb){ 4 | var err; 5 | try { 6 | return cb(null, JSON.parse(obj)); 7 | } catch (e$) { 8 | err = e$; 9 | return cb(err); 10 | } 11 | }; 12 | }).call(this); 13 | -------------------------------------------------------------------------------- /json-parse.ls: -------------------------------------------------------------------------------- 1 | module.exports = (obj, cb)-> 2 | try 3 | cb null, JSON.parse(obj) 4 | catch err 5 | cb err -------------------------------------------------------------------------------- /load-coins.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var btc, dash, eth, etc, ltc, usdt, ref$, objToPairs, pairsToObj, filter, onlyCoins, extendCoins, toString$ = {}.toString; 4 | btc = require('./plugins/btc-coin.js'); 5 | dash = require('./plugins/dash-coin.js'); 6 | eth = require('./plugins/eth-coin.js'); 7 | etc = require('./plugins/etc-coin.js'); 8 | ltc = require('./plugins/ltc-coin.js'); 9 | usdt = require('./plugins/usdt-coin.js'); 10 | ref$ = require('prelude-ls'), objToPairs = ref$.objToPairs, pairsToObj = ref$.pairsToObj, filter = ref$.filter; 11 | onlyCoins = function(plugins){ 12 | return pairsToObj( 13 | filter(function(it){ 14 | var ref$; 15 | return ((ref$ = it[1]) != null ? ref$.type : void 8) === 'coin'; 16 | })( 17 | objToPairs( 18 | plugins))); 19 | }; 20 | extendCoins = function(coins, config){ 21 | if (toString$.call(config.plugins).slice(8, -1) !== 'Object') { 22 | return; 23 | } 24 | return importAll$(coins, onlyCoins(config.plugins)); 25 | }; 26 | module.exports = function(config, cb){ 27 | var def; 28 | def = { 29 | btc: btc, 30 | dash: dash, 31 | eth: eth, 32 | ltc: ltc, 33 | usdt: usdt, 34 | etc: etc 35 | }; 36 | extendCoins(def, config); 37 | return cb(null, def); 38 | }; 39 | function importAll$(obj, src){ 40 | for (var key in src) obj[key] = src[key]; 41 | return obj; 42 | } 43 | }).call(this); 44 | -------------------------------------------------------------------------------- /load-coins.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./plugins/btc-coin.js : btc 3 | \./plugins/dash-coin.js : dash 4 | \./plugins/eth-coin.js : eth 5 | \./plugins/etc-coin.js : etc 6 | \./plugins/ltc-coin.js : ltc 7 | #\./plugins/xem-coin.js : xem 8 | #\./plugins/xrp-coin.js : xrp 9 | \./plugins/usdt-coin.js : usdt 10 | #\./plugins/vlx-coin.js : vlx 11 | #\./plugins/eos-coin.js : eos 12 | #\./plugins/xlm-coin.js : xlm 13 | #\./plugins/trx-coin.js : trx 14 | #\./plugins/xmr-coin.js : xmr 15 | #\./plugins/qiwi-coin.js : qiwi_token 16 | #\./plugins/ym-coin.js : ym_token 17 | \prelude-ls : { obj-to-pairs, pairs-to-obj, filter } 18 | } 19 | only-coins = (plugins)-> 20 | plugins 21 | |> obj-to-pairs 22 | |> filter (.1?type is \coin) 23 | |> pairs-to-obj 24 | extend-coins = (coins, config)-> 25 | return if typeof! config.plugins isnt \Object 26 | coins <<<< only-coins config.plugins 27 | module.exports = (config, cb)-> 28 | #eos 29 | def = { btc, dash, eth, ltc, usdt, etc, /*vlx xlm, trx, xmr, */ } 30 | extend-coins def, config 31 | cb null, def -------------------------------------------------------------------------------- /load-providers.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var eth, insight, blockstream, erc20, omni, velas2, extendProviders, toString$ = {}.toString; 4 | eth = require('./providers/eth.js'); 5 | insight = require('./providers/insight.js'); 6 | blockstream = require('./providers/blockstream.js'); 7 | erc20 = require('./providers/erc20.js'); 8 | omni = require('./providers/omni.js'); 9 | velas2 = require('./providers/velas2.js'); 10 | extendProviders = function(providers, config){ 11 | if (toString$.call(config.providers).slice(8, -1) !== 'Object') { 12 | return; 13 | } 14 | return importAll$(providers, config.providers); 15 | }; 16 | module.exports = function(config, cb){ 17 | var def; 18 | def = { 19 | eth: eth, 20 | insight: insight, 21 | erc20: erc20, 22 | omni: omni, 23 | velas2: velas2, 24 | blockstream: blockstream 25 | }; 26 | extendProviders(def, config); 27 | return cb(null, def); 28 | }; 29 | function importAll$(obj, src){ 30 | for (var key in src) obj[key] = src[key]; 31 | return obj; 32 | } 33 | }).call(this); 34 | -------------------------------------------------------------------------------- /load-providers.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./providers/eth.js 3 | \./providers/insight.js 4 | \./providers/blockstream.js 5 | \./providers/erc20.js 6 | \./providers/omni.js 7 | \./providers/velas2.js 8 | #\./providers/eos.js 9 | #\./providers/stellar.js 10 | #\./providers/tron.js 11 | #\./providers/cryptonote.js 12 | #\./providers/xem.js 13 | #\./providers/ripple.js 14 | } 15 | extend-providers = (providers, config)-> 16 | return if typeof! config.providers isnt \Object 17 | providers <<<< config.providers 18 | module.exports = (config, cb)-> 19 | def = { eth, insight, erc20, omni, velas2, blockstream } 20 | extend-providers def, config 21 | cb null, def -------------------------------------------------------------------------------- /math.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var bignumber, ref$, map, pairsToObj, math; 4 | bignumber = require('bignumber.js'); 5 | ref$ = require('prelude-ls'), map = ref$.map, pairsToObj = ref$.pairsToObj; 6 | math = function($){ 7 | return function(x, y){ 8 | var err; 9 | if (x === '..' || y === '..') { 10 | return '..'; 11 | } 12 | try { 13 | return new bignumber(x)[$](y).toFixed(); 14 | } catch (e$) { 15 | err = e$; 16 | throw x + " " + $ + " " + y + " = " + err; 17 | } 18 | }; 19 | }; 20 | module.exports = pairsToObj( 21 | map(function(it){ 22 | return [it, math(it)]; 23 | })( 24 | ['plus', 'minus', 'times', 'div'])); 25 | module.exports.fromHex = function(hex){ 26 | return new bignumber(hex, 16).toFixed(); 27 | }; 28 | }).call(this); 29 | -------------------------------------------------------------------------------- /math.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \bignumber.js 3 | \prelude-ls : { map, pairs-to-obj } 4 | } 5 | math = ($)-> (x, y)-> 6 | return '..' if x is '..' or y is '..' 7 | try 8 | new bignumber(x)[$](y).to-fixed! 9 | catch err 10 | throw "#{x} #{$} #{y} = #{err}" 11 | module.exports = 12 | <[ plus minus times div ]> 13 | |> map -> [it, math(it)] 14 | |> pairs-to-obj 15 | module.exports.from-hex = (hex)-> 16 | new bignumber(hex, 16).to-fixed! -------------------------------------------------------------------------------- /node_modules_embed/ethereumjs-wallet/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alex Beregszaszi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules_embed/ethereumjs-wallet/hdkey.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var HDKey = require('hdkey'); 4 | var Wallet = require('./index.js'); 5 | 6 | function EthereumHDKey() {} 7 | 8 | /* 9 | * Horrible wrapping. 10 | */ 11 | function fromHDKey(hdkey) { 12 | var ret = new EthereumHDKey(); 13 | ret._hdkey = hdkey; 14 | return ret; 15 | } 16 | 17 | EthereumHDKey.fromMasterSeed = function (seedBuffer) { 18 | return fromHDKey(HDKey.fromMasterSeed(seedBuffer)); 19 | }; 20 | 21 | EthereumHDKey.fromExtendedKey = function (base58key) { 22 | return fromHDKey(HDKey.fromExtendedKey(base58key)); 23 | }; 24 | 25 | EthereumHDKey.prototype.privateExtendedKey = function () { 26 | if (!this._hdkey.privateExtendedKey) { 27 | throw new Error('This is a public key only wallet'); 28 | } 29 | return this._hdkey.privateExtendedKey; 30 | }; 31 | 32 | EthereumHDKey.prototype.publicExtendedKey = function () { 33 | return this._hdkey.publicExtendedKey; 34 | }; 35 | 36 | EthereumHDKey.prototype.derivePath = function (path) { 37 | return fromHDKey(this._hdkey.derive(path)); 38 | }; 39 | 40 | EthereumHDKey.prototype.deriveChild = function (index) { 41 | return fromHDKey(this._hdkey.deriveChild(index)); 42 | }; 43 | 44 | EthereumHDKey.prototype.getWallet = function () { 45 | if (this._hdkey._privateKey) { 46 | return Wallet.fromPrivateKey(this._hdkey._privateKey); 47 | } else { 48 | return Wallet.fromPublicKey(this._hdkey._publicKey, true); 49 | } 50 | }; 51 | 52 | module.exports = EthereumHDKey; -------------------------------------------------------------------------------- /node_modules_embed/ethereumjs-wallet/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "ethereumjs-wallet@0.6.3", 3 | "_id": "ethereumjs-wallet@0.6.3", 4 | "_inBundle": false, 5 | "_integrity": "sha512-qiXPiZOsStem+Dj/CQHbn5qex+FVkuPmGH7SvSnA9F3tdRDt8dLMyvIj3+U05QzVZNPYh4HXEdnzoYI4dZkr9w==", 6 | "_location": "/ethereumjs-wallet", 7 | "_phantomChildren": { 8 | "@types/bn.js": "4.11.6", 9 | "bindings": "1.5.0", 10 | "bn.js": "4.11.8", 11 | "create-hash": "1.2.0", 12 | "ethjs-util": "0.1.6", 13 | "inherits": "2.0.4", 14 | "nan": "2.14.0", 15 | "rlp": "2.2.4", 16 | "safe-buffer": "5.2.0", 17 | "secp256k1": "3.8.0" 18 | }, 19 | "_requested": { 20 | "type": "version", 21 | "registry": true, 22 | "raw": "ethereumjs-wallet@0.6.3", 23 | "name": "ethereumjs-wallet", 24 | "escapedName": "ethereumjs-wallet", 25 | "rawSpec": "0.6.3", 26 | "saveSpec": null, 27 | "fetchSpec": "0.6.3" 28 | }, 29 | "_requiredBy": [ 30 | "/" 31 | ], 32 | "_resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz", 33 | "_shasum": "b0eae6f327637c2aeb9ccb9047b982ac542e6ab1", 34 | "_spec": "ethereumjs-wallet@0.6.3", 35 | "_where": "/root/web3.space/web3t", 36 | "author": { 37 | "name": "Alex Beregszaszi", 38 | "email": "alex@rtfs.hu" 39 | }, 40 | "bugs": { 41 | "url": "https://github.com/ethereumjs/ethereumjs-wallet/issues" 42 | }, 43 | "bundleDependencies": false, 44 | "dependencies": { 45 | "aes-js": "^3.1.1", 46 | "bs58check": "^2.1.2", 47 | "ethereumjs-util": "^6.0.0", 48 | "hdkey": "^1.1.0", 49 | "randombytes": "^2.0.6", 50 | "safe-buffer": "^5.1.2", 51 | "utf8": "^3.0.0", 52 | "uuid": "^3.3.2" 53 | }, 54 | "deprecated": false, 55 | "description": "Utilities for handling Ethereum keys", 56 | "devDependencies": { 57 | "babel-cli": "^6.26.0", 58 | "babel-preset-env": "^1.7.0", 59 | "coveralls": "^3.0.0", 60 | "istanbul": "^0.4.5", 61 | "mocha": "^5.2.0", 62 | "standard": "^12.0.0" 63 | }, 64 | "files": [ 65 | "*.js", 66 | "test/" 67 | ], 68 | "homepage": "https://github.com/ethereumjs/ethereumjs-wallet", 69 | "keywords": [ 70 | "ethereum", 71 | "wallets", 72 | "keys" 73 | ], 74 | "license": "MIT", 75 | "main": "index.js", 76 | "name": "ethereumjs-wallet", 77 | "repository": { 78 | "type": "git", 79 | "url": "git+https://github.com/ethereumjs/ethereumjs-wallet.git" 80 | }, 81 | "scripts": { 82 | "build:dist": "babel src/ -d .", 83 | "coverage": "istanbul cover _mocha", 84 | "coveralls": "npm run build:dist && npm run coverage && coveralls " 4 | }, 5 | "bugs": { 6 | "url": "https://github.com/web3space/web3t/issues" 7 | }, 8 | "bundleDependencies": false, 9 | "dependencies": { 10 | "aes-js": "^3.1.1", 11 | "big-integer": "1.6.45", 12 | "bip39": "2.5.0", 13 | "bitcoinjs-lib": "3.3.2", 14 | "bs58": "4.0.1", 15 | "bs58check": "^2.1.2", 16 | "cross-fetch": "3.0.4", 17 | "ethereumjs-common": "1.5.0", 18 | "ethereumjs-util": "^6.0.0", 19 | "hdkey": "^1.1.0", 20 | "moment": "2.22.2", 21 | "prelude-ls": "1.1.2", 22 | "qs": "6.5.2", 23 | "randombytes": "^2.0.6", 24 | "safe-buffer": "^5.1.2", 25 | "tor-request": "^3.1.0", 26 | "utf8": "^3.0.0", 27 | "uuid": "^3.3.2", 28 | "web3": "0.20.1" 29 | }, 30 | "deprecated": false, 31 | "description": "Unified Open Source Coin Registry (Same interface for all possible coins, tokens)", 32 | "homepage": "https://github.com/ethnamed/web3t#readme", 33 | "keywords": [ 34 | "crypto", 35 | "standard", 36 | "ethnamed" 37 | ], 38 | "license": "ISC", 39 | "main": "index.js", 40 | "name": "web3t", 41 | "repository": { 42 | "type": "git", 43 | "url": "git+https://github.com/ethnamed/web3t.git" 44 | }, 45 | "scripts": { 46 | "test": "echo \"Error: no test specified\" && exit 1", 47 | "dev-setup": "npm i browserify browserify-livescript -g", 48 | "mobile1": "browserify --s module -d -t browserify-livescript index.ls > ./web3t.js", 49 | "mobile2": "browserify --s module -d -t browserify-livescript ./mobile/index.ls > ./mobile/web3t.js" 50 | }, 51 | "version": "0.7.1", 52 | "devDependencies": { 53 | "browserify-livescript": "^0.2.4" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /plugins/doge-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | incorrect: true, 6 | decimals: 8, 7 | txFee: '0.0001', 8 | mask: 'L000000000000000000000000000000000', 9 | api: { 10 | provider: 'insight', 11 | url: 'https://insight.litecore.io', 12 | decimal: 8 13 | }, 14 | messagePrefix: '\x19Litecoin Signed Message:\n', 15 | bip32: { 16 | 'public': 0x019da462, 17 | 'private': 0x019d9cfe 18 | }, 19 | pubKeyHash: 0x30, 20 | scriptHash: 0x32, 21 | wif: 0xb0 22 | }; 23 | out$.testnet = testnet = { 24 | decimals: 8, 25 | txFee: '0.0001', 26 | mask: 'L000000000000000000000000000000000', 27 | api: { 28 | provider: 'insight', 29 | url: 'https://insight.litecore.io', 30 | decimal: 8 31 | }, 32 | messagePrefix: '\x19Litecoin Signed Message:\n', 33 | bip32: { 34 | 'public': 0x0432a9a8, 35 | 'private': 0x0432a243 36 | }, 37 | pubKeyHash: 0x71, 38 | scriptHash: 0xc4, 39 | wif: 241 40 | }; 41 | out$.type = type = 'coin'; 42 | out$.enabled = enabled = false; 43 | out$.token = token = 'doge'; 44 | out$.image = image = './res/doge-ethnamed.png'; 45 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=DOGE&tsyms=USD).DOGE.USD"; 46 | }).call(this); 47 | -------------------------------------------------------------------------------- /plugins/doge-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | incorrect: yes 3 | decimals: 8 4 | tx-fee: \0.0001 5 | mask: 'L000000000000000000000000000000000' 6 | api: 7 | provider: \insight 8 | url: \https://insight.litecore.io 9 | decimal: 8 10 | message-prefix: '\x19Litecoin Signed Message:\n' 11 | bip32: 12 | public: 0x019da462 13 | private: 0x019d9cfe 14 | pub-key-hash: 0x30 15 | script-hash: 0x32 16 | wif: 0xb0 17 | export testnet = 18 | decimals: 8 19 | tx-fee: \0.0001 20 | mask: 'L000000000000000000000000000000000' 21 | api: 22 | provider: \insight 23 | url: \https://insight.litecore.io 24 | decimal: 8 25 | message-prefix: '\x19Litecoin Signed Message:\n' 26 | bip32: 27 | public: 0x0432a9a8 28 | private: 0x0432a243 29 | pub-key-hash: 0x71 30 | script-hash: 0xc4 31 | wif: 241 32 | export type = \coin 33 | export enabled = no 34 | export token = \doge 35 | export image = \./res/doge-ethnamed.png 36 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=DOGE&tsyms=USD).DOGE.USD" -------------------------------------------------------------------------------- /plugins/eos-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 1, 6 | txFee: '0', 7 | mask: 'username', 8 | chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906', 9 | registerAccountLink: 'https://www.zeos.co/en/home?public-key=:public-key', 10 | api: { 11 | provider: 'eos', 12 | nodeUrl: ['https://api.eosnewyork.io', 'https://api.eosio.cr:80', 'https://api.eosdetroit.io:443', 'https://eos.greymass.com:443', 'https://api.eosmetal.io:18890', 'http://api.hkeos.com:80', 'https://eosapi.blockmatrix.network:443', 'https://fn.eossweden.se:443', 'http://api.blockgenicbp.com:8888', 'http://mainnet.eoscalgary.io:80', 'https://node1.eosphere.io', 'https://eos.saltblock.io', 'http://eos-api.worbli.io:80', 'https://eos-api.worbli.io:443', 'http://mainnet.eoscalgary.io:80', 'http://user-api.eoseoul.io:80', 'https://node2.liquideos.com:8883', 'https://api.eosuk.io:443', 'http://api1.eosdublin.io:80', 'http://api.eosvibes.io:80', 'http://api.cypherglass.com:8888', 'http://bp.cryptolions.io:8888', 'http://dc1.eosemerge.io', 'https://api.eosio.cr:443', 'https://api.eosn.io', 'https://eu1.eosdac.io:443', 'https://api.main.alohaeos.com:443', 'https://rpc.eosys.io'], 13 | apiUrl: 'https://api.eospark.com', 14 | explorerUrl: 'https://eospark.com', 15 | decimal: 1 16 | } 17 | }; 18 | out$.testnet = testnet = { 19 | txFee: '0', 20 | decimals: 1, 21 | mask: 'username', 22 | registerAccountLink: 'https://www.google.com/search?q=eos+account+jungle', 23 | api: { 24 | provider: 'eos', 25 | nodeUrl: 'https://jungle.eosio.cr:443', 26 | apiRul: 'https://api.jungle.eospark.com', 27 | explorerUrl: 'https://jungle.eospark.com', 28 | decimal: 1 29 | } 30 | }; 31 | out$.color = color = '#272431'; 32 | out$.type = type = 'coin'; 33 | out$.enabled = enabled = true; 34 | out$.token = token = 'eos'; 35 | out$.image = image = 'https://res.cloudinary.com/nixar-work/image/upload/v1550938232/EOS.png'; 36 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=EOS&tsyms=USD).EOS.USD"; 37 | }).call(this); 38 | -------------------------------------------------------------------------------- /plugins/eos-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 1 3 | tx-fee: \0 4 | mask: 'username' 5 | chainId: \aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 6 | register-account-link: \https://www.zeos.co/en/home?public-key=:public-key 7 | api: 8 | provider: \eos 9 | node-url: 10 | * \https://api.eosnewyork.io 11 | * \https://api.eosio.cr:80 12 | * \https://api.eosdetroit.io:443 13 | * \https://eos.greymass.com:443 14 | * \https://api.eosmetal.io:18890 15 | * \http://api.hkeos.com:80 16 | * \https://eosapi.blockmatrix.network:443 17 | * \https://fn.eossweden.se:443 18 | * \http://api.blockgenicbp.com:8888 19 | * \http://mainnet.eoscalgary.io:80 20 | * \https://node1.eosphere.io 21 | * \https://eos.saltblock.io 22 | * \http://eos-api.worbli.io:80 23 | * \https://eos-api.worbli.io:443 24 | * \http://mainnet.eoscalgary.io:80 25 | * \http://user-api.eoseoul.io:80 26 | * \https://node2.liquideos.com:8883 27 | * \https://api.eosuk.io:443 28 | * \http://api1.eosdublin.io:80 29 | * \http://api.eosvibes.io:80 30 | * \http://api.cypherglass.com:8888 31 | * \http://bp.cryptolions.io:8888 32 | * \http://dc1.eosemerge.io 33 | * \https://api.eosio.cr:443 34 | * \https://api.eosn.io 35 | * \https://eu1.eosdac.io:443 36 | * \https://api.main.alohaeos.com:443 37 | * \https://rpc.eosys.io 38 | api-url: \https://api.eospark.com 39 | explorer-url: \https://eospark.com 40 | decimal: 1 41 | export testnet = 42 | tx-fee: \0 43 | decimals: 1 44 | mask: 'username' 45 | register-account-link: \https://www.google.com/search?q=eos+account+jungle 46 | api: 47 | provider: \eos 48 | node-url: \https://jungle.eosio.cr:443 49 | api-rul: \https://api.jungle.eospark.com 50 | explorer-url: \https://jungle.eospark.com 51 | decimal: 1 52 | export color = \#272431 53 | export type = \coin 54 | export enabled = yes 55 | export token = \eos 56 | export image = \https://res.cloudinary.com/nixar-work/image/upload/v1550938232/EOS.png 57 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=EOS&tsyms=USD).EOS.USD" -------------------------------------------------------------------------------- /plugins/eth-rs.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var url, mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | url = 'https://royalswap.com'; 5 | out$.mainnet = mainnet = { 6 | decimals: 2, 7 | txFee: 50, 8 | messagePrefix: 'Ethereum', 9 | mask: '0x0000000000000000000000000000000000000000', 10 | api: { 11 | provider: 'eth', 12 | url: url + "/fiat/explorer", 13 | apiUrl: url + "/fiat-token/eth_rs", 14 | web3Provider: url + "/fiat-token/eth_rs" 15 | } 16 | }; 17 | out$.testnet = testnet = { 18 | disabled: true 19 | }; 20 | out$.color = color = '#5838B8'; 21 | out$.testnet = testnet = ropsten; 22 | out$.type = type = 'coin'; 23 | out$.enabled = enabled = true; 24 | out$.token = token = 'eth_rs'; 25 | out$.image = image = './res/eth-ethnamed.png'; 26 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).ETH.USD"; 27 | }).call(this); 28 | -------------------------------------------------------------------------------- /plugins/eth-rs.ls: -------------------------------------------------------------------------------- 1 | #require! { 2 | # \../config-public.json : { web3stable: { url } } 3 | #} 4 | url = \https://royalswap.com 5 | export mainnet = 6 | decimals: 2 7 | tx-fee: 50 8 | message-prefix: 'Ethereum' 9 | mask: \0x0000000000000000000000000000000000000000 10 | api: 11 | provider: \eth 12 | url : "#{url}/fiat/explorer" 13 | apiUrl : "#{url}/fiat-token/eth_rs" 14 | web3Provider : "#{url}/fiat-token/eth_rs" 15 | export testnet = 16 | disabled: yes 17 | export color = \#5838B8 18 | export testnet = ropsten 19 | export type = \coin 20 | export enabled = yes 21 | export token = \eth_rs 22 | export image = \./res/eth-ethnamed.png 23 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).ETH.USD" -------------------------------------------------------------------------------- /plugins/gobyte-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, txTypes, color, branding, links, type, enabled, name, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 8, 6 | txFee: '0.00001', 7 | txFeeAutoMode: 'per-byte', 8 | txFeeOptions: { 9 | auto: '0.00001', 10 | cheap: '0.00001', 11 | instantPerInput: '0.0001', 12 | instantServicePrice: 0, 13 | privatePerInput: '0.005', 14 | privateServicePrice: '0.025', 15 | feePerByte: '0.00000001' 16 | }, 17 | mask: '1000000000000000000000000000000000', 18 | api: { 19 | provider: 'insight', 20 | url: 'https://insight.gobyte.network', 21 | apiName: 'insight-api-gobyte', 22 | mixingList: "https://explorer.gobyte.network:5002/api/masternodelist", 23 | decimal: 8 24 | }, 25 | messagePrefix: '\x18GoByte Signed Message:\n', 26 | bech32: 'bc', 27 | bip32: { 28 | 'public': 0x488b21e, 29 | 'private': 0x488ade4 30 | }, 31 | pubKeyHash: 0x26, 32 | scriptHash: 0x10, 33 | wif: 0xc6, 34 | dustThreshold: 5460 35 | }; 36 | out$.testnet = testnet = { 37 | txFee: '0.00005', 38 | txFeeOptions: { 39 | fast: '0.00005', 40 | cheap: '0.00001', 41 | instantPerInput: '0.0001', 42 | privatePerInput: '0.005', 43 | feePerByte: '0.00000001' 44 | }, 45 | decimals: 8, 46 | mask: 'n000000000000000000000000000000000', 47 | api: { 48 | provider: 'insight', 49 | url: 'https://texplorer.gobyte.network:4001', 50 | apiName: 'insight-api-gobyte', 51 | decimal: 8 52 | }, 53 | messagePrefix: '\x18GoByte Signed Message:\n', 54 | topup: 'https://testnet.manu.backend.hamburg/faucet', 55 | bech32: 'tb', 56 | bip32: { 57 | 'public': 0x043587cf, 58 | 'private': 0x04358394 59 | }, 60 | pubKeyHash: 0x70, 61 | scriptHash: 0x14, 62 | wif: 0xf0, 63 | dustThreshold: 5460 64 | }; 65 | out$.txTypes = txTypes = ['regular', 'instant']; 66 | out$.color = color = '#545DF1'; 67 | out$.branding = branding = { 68 | logo: 'https://www.gobyte.network/img/logo.svg', 69 | title: "GoByte Multicurrency Wallet", 70 | important: true, 71 | topup: 'gobyte' 72 | }; 73 | out$.links = links = [ 74 | { 75 | image: 'https://www.gobyte.network/img/fb.png', 76 | href: 'https://wwww.facebook.com/gobytenetwork' 77 | }, { 78 | image: 'https://www.gobyte.network/img/twitter.png', 79 | href: 'https://twitter.com/gobytenetwork' 80 | }, { 81 | image: 'https://www.gobyte.network/img/reddit.png', 82 | href: 'https://www.reddit.com/r/gobytenetwork/' 83 | }, { 84 | image: 'https://www.gobyte.network/img/slack.png', 85 | href: 'https://gobyte.slack.com/' 86 | }, { 87 | image: 'https://www.gobyte.network/img/discordapp.png', 88 | href: 'https://discord.gobyte.network/' 89 | }, { 90 | image: 'https://www.gobyte.network/img/telegram.png', 91 | href: 'https://t.me/gobytenetwork' 92 | }, { 93 | image: 'https://www.gobyte.network/img/github.png', 94 | href: 'https://github.com/gobytecoin/gobyte' 95 | } 96 | ]; 97 | out$.type = type = 'coin'; 98 | out$.enabled = enabled = true; 99 | out$.name = name = 'Gobyte'; 100 | out$.token = token = 'gbx'; 101 | out$.image = image = 'https://res.cloudinary.com/nixar-work/image/upload/v1548537659/gobyte.png'; 102 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=GBX&tsyms=USD).GBX.USD"; 103 | }).call(this); 104 | -------------------------------------------------------------------------------- /plugins/gobyte-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 8 3 | tx-fee: \0.00001 4 | tx-fee-auto-mode: \per-byte 5 | tx-fee-options: 6 | auto: \0.00001 7 | cheap: \0.00001 8 | instant-per-input: \0.0001 9 | instant-service-price: 0 10 | private-per-input: \0.005 11 | private-service-price: \0.025 12 | fee-per-byte: \0.00000001 13 | mask: '1000000000000000000000000000000000' 14 | api: 15 | provider: \insight 16 | url: \https://insight.gobyte.network 17 | api-name: \insight-api-gobyte 18 | mixing-list: "https://explorer.gobyte.network:5002/api/masternodelist" 19 | decimal: 8 20 | message-prefix: '\x18GoByte Signed Message:\n' 21 | bech32: 'bc' 22 | bip32: 23 | public: 0x488b21e 24 | private: 0x488ade4 25 | pubKeyHash: 0x26 #38 base58Prefixes[PUBKEY_ADDRESS] 26 | scriptHash: 0x10 #16 base58Prefixes[SCRIPT_ADDRESS] 27 | wif: 0xc6 #198 base58Prefixes[SECRET_KEY] 28 | dust-threshold: 5460 29 | export testnet = 30 | tx-fee: \0.00005 31 | tx-fee-options: 32 | fast: \0.00005 33 | cheap: \0.00001 34 | instant-per-input: \0.0001 35 | private-per-input: \0.005 36 | fee-per-byte: \0.00000001 37 | decimals: 8 38 | mask: 'n000000000000000000000000000000000' 39 | api: 40 | provider: \insight 41 | url: \https://texplorer.gobyte.network:4001 42 | api-name: \insight-api-gobyte 43 | decimal: 8 44 | messagePrefix: '\x18GoByte Signed Message:\n' 45 | topup: \https://testnet.manu.backend.hamburg/faucet 46 | bech32: 'tb' 47 | bip32: 48 | public: 0x043587cf 49 | private: 0x04358394 50 | pubKeyHash: 0x70 #base58Prefixes[PUBKEY_ADDRESS] 51 | scriptHash: 0x14 #base58Prefixes[SCRIPT_ADDRESS] 52 | wif: 0xf0 #base58Prefixes[SECRET_KEY] 53 | dust-threshold: 5460 54 | export tx-types = <[ regular instant ]> 55 | export color = \#545DF1 56 | export branding = 57 | logo: \https://www.gobyte.network/img/logo.svg 58 | title: "GoByte Multicurrency Wallet" 59 | important: yes 60 | topup: \gobyte 61 | export links = 62 | * image: \https://www.gobyte.network/img/fb.png 63 | href: \https://wwww.facebook.com/gobytenetwork 64 | * image: \https://www.gobyte.network/img/twitter.png 65 | href: \https://twitter.com/gobytenetwork 66 | * image: \https://www.gobyte.network/img/reddit.png 67 | href: \https://www.reddit.com/r/gobytenetwork/ 68 | * image: \https://www.gobyte.network/img/slack.png 69 | href: \https://gobyte.slack.com/ 70 | * image: \https://www.gobyte.network/img/discordapp.png 71 | href: \https://discord.gobyte.network/ 72 | * image: \https://www.gobyte.network/img/telegram.png 73 | href: \https://t.me/gobytenetwork 74 | * image: \https://www.gobyte.network/img/github.png 75 | href: \https://github.com/gobytecoin/gobyte 76 | export type = \coin 77 | export enabled = yes 78 | export name = 'Gobyte' 79 | export token = \gbx 80 | export image = \https://res.cloudinary.com/nixar-work/image/upload/v1548537659/gobyte.png 81 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=GBX&tsyms=USD).GBX.USD" -------------------------------------------------------------------------------- /plugins/gobyte-topup.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var topupCoinsByMask, networks, type, enabled, token, image, address, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.topupCoinsByMask = topupCoinsByMask = "*"; 5 | out$.networks = networks = "mainnet"; 6 | out$.type = type = 'topup'; 7 | out$.enabled = enabled = true; 8 | out$.token = token = 'gobyte'; 9 | out$.image = image = 'https://res.cloudinary.com/nixar-work/image/upload/v1547940596/logo3-bl.png'; 10 | out$.address = address = "https://exchange.gobyte.network/?from=EUR&to={token}&address={address}"; 11 | }).call(this); 12 | -------------------------------------------------------------------------------- /plugins/gobyte-topup.ls: -------------------------------------------------------------------------------- 1 | export topup-coins-by-mask = "*" 2 | export networks = "mainnet" 3 | export type = \topup 4 | export enabled = yes 5 | export token = \gobyte 6 | export image = \https://res.cloudinary.com/nixar-work/image/upload/v1547940596/logo3-bl.png 7 | export address = "https://exchange.gobyte.network/?from=EUR&to={token}&address={address}" -------------------------------------------------------------------------------- /plugins/ltc-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 8 3 | tx-fee: \0.0001 4 | tx-fee-options: 5 | auto: \0.0001 6 | cheap: \0.000014 7 | mask: 'L000000000000000000000000000000000' 8 | api: 9 | provider: \insight 10 | url: \https://insight.litecore.io 11 | decimal: 8 12 | message-prefix: '\x19Litecoin Signed Message:\n' 13 | bip32: 14 | public: 0x019da462 15 | private: 0x019d9cfe 16 | pub-key-hash: 0x30 17 | script-hash: 0x32 18 | wif: 0xb0 19 | export testnet = 20 | decimals: 8 21 | tx-fee: \0.0001 22 | tx-fee-options: 23 | auto: \0.0001 24 | cheap: \0.000014 25 | topup: \https://litecoin-faucet.com/ 26 | mask: 'n000000000000000000000000000000000' 27 | api: 28 | provider: \insight 29 | url: \https://testnet.litecore.io 30 | decimal: 8 31 | message-prefix: '\x19Litecoin Signed Message:\n' 32 | bip32: 33 | public: 0x0436ef7d 34 | private: 0x0436f6e1 35 | pub-key-hash: 0x6f 36 | script-hash: 0xc4 37 | wif: 0xef 38 | export color = \#a04b55 39 | export type = \coin 40 | export enabled = yes 41 | export name = 'Litecoin' 42 | export token = \ltc 43 | export image = "data:image/png;base64,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" 44 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).LTC.USD" -------------------------------------------------------------------------------- /plugins/sprkl-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, ropsten, color, testnet, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 18, 6 | txFee: '0.0014', 7 | messagePrefix: 'Ethereum', 8 | address: '0x73779dF3F86A4F314655247443dB8780a9b9F4CC', 9 | mask: '0x0000000000000000000000000000000000000000', 10 | api: { 11 | provider: 'erc20', 12 | web3Provider: 'https://mainnet.infura.io/UoCkF4efTrbEGU8Qpcs0', 13 | url: 'https://etherscan.io', 14 | apiUrl: 'https://api.etherscan.io/api' 15 | } 16 | }; 17 | out$.ropsten = ropsten = { 18 | decimals: 18, 19 | txFee: '0.0020', 20 | address: '0x57BC203385A221942449c4bB1dBc0D775c8B5A02', 21 | messagePrefix: 'Ethereum', 22 | mask: '0x0000000000000000000000000000000000000000', 23 | api: { 24 | provider: 'erc20', 25 | web3Provider: "https://ropsten.infura.io/UoCkF4efTrbEGU8Qpcs0", 26 | url: "https://ropsten.etherscan.io", 27 | apiUrl: "http://api-ropsten.etherscan.io/api" 28 | } 29 | }; 30 | out$.color = color = '#5E72E4'; 31 | out$.testnet = testnet = ropsten; 32 | out$.type = type = 'coin'; 33 | out$.enabled = enabled = true; 34 | out$.token = token = 'sprkl'; 35 | out$.image = image = './res/sparkle-ethnamed.png'; 36 | out$.usdInfo = usdInfo = 1; 37 | }).call(this); 38 | -------------------------------------------------------------------------------- /plugins/sprkl-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 18 3 | tx-fee: \0.0014 4 | message-prefix: 'Ethereum' 5 | address: \0x73779dF3F86A4F314655247443dB8780a9b9F4CC 6 | mask: \0x0000000000000000000000000000000000000000 7 | api: 8 | provider: \erc20 9 | web3Provider : \https://mainnet.infura.io/UoCkF4efTrbEGU8Qpcs0 10 | url : \https://etherscan.io 11 | apiUrl : \https://api.etherscan.io/api 12 | export ropsten = 13 | decimals: 18 14 | tx-fee: \0.0020 15 | address: \0x57BC203385A221942449c4bB1dBc0D775c8B5A02 16 | message-prefix: 'Ethereum' 17 | mask: \0x0000000000000000000000000000000000000000 18 | api: 19 | provider: \erc20 20 | web3Provider : "https://ropsten.infura.io/UoCkF4efTrbEGU8Qpcs0" 21 | url : "https://ropsten.etherscan.io" 22 | apiUrl : "http://api-ropsten.etherscan.io/api" 23 | export color = \#5E72E4 24 | export testnet = ropsten 25 | export type = \coin 26 | export enabled = yes 27 | export token = \sprkl 28 | export image = \./res/sparkle-ethnamed.png 29 | export usd-info = 1 -------------------------------------------------------------------------------- /plugins/stt-coin.json: -------------------------------------------------------------------------------- 1 | { 2 | "usdInfo": "url(https://staramba.kauri.one).STT.USD", 3 | "image": "https://res.cloudinary.com/dfbhd7liw/image/upload/v1547131066/coin.png", 4 | "token": "stt", 5 | "enabled": true, 6 | "type": "coin", 7 | "color": "#000000", 8 | "testnet": { 9 | "decimals": 18, 10 | "txFee": "0.0030", 11 | "txFeeIn": "eth", 12 | "address": "0x9d10ff02163ecf1f5bf01e4596fc3dca579f2617", 13 | "messagePrefix": "Ethereum", 14 | "mask": "0x0000000000000000000000000000000000000000", 15 | "api": { 16 | "provider": "erc20", 17 | "web3Provider":"https://ropsten.infura.io/UoCkF4efTrbEGU8Qpcs0", 18 | "url":"https://ropsten.etherscan.io", 19 | "apiUrl":"http://api-ropsten.etherscan.io/api" 20 | } 21 | }, 22 | "mainnet": { 23 | "decimals": 18, 24 | "txFee": "0.0040", 25 | "txFeeIn": "eth", 26 | "messagePrefix": "Ethereum", 27 | "address": "0x0bbb5a54767166b21e4a74d30500248a05ed985f", 28 | "mask": "0x0000000000000000000000000000000000000000", 29 | "api": { 30 | "provider": "erc20", 31 | "web3Provider": "https://mainnet.infura.io/UoCkF4efTrbEGU8Qpcs0", 32 | "url": "https://etherscan.io", 33 | "apiUrl": "https://api.etherscan.io/api" 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /plugins/trx-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 1, 6 | txFee: '0.0000001', 7 | txFeeOptions: { 8 | fast: '0.000001', 9 | cheap: '0.0000002' 10 | }, 11 | mask: 'username', 12 | api: { 13 | provider: 'tron', 14 | nodeUrl: "", 15 | apiUrl: "", 16 | explorerUrl: "", 17 | decimal: 1 18 | } 19 | }; 20 | out$.testnet = testnet = { 21 | txFee: '0.0000001', 22 | txFeeOptions: { 23 | fast: '0.000001', 24 | cheap: '0.0000002' 25 | }, 26 | decimals: 1, 27 | mask: 'username', 28 | api: { 29 | provider: 'tron', 30 | nodeUrl: "", 31 | apiRul: "", 32 | explorerUrl: "", 33 | decimal: 1 34 | } 35 | }; 36 | out$.color = color = '#000000'; 37 | out$.type = type = 'coin'; 38 | out$.enabled = enabled = true; 39 | out$.token = token = 'trx'; 40 | out$.image = image = 'https://s2.coinmarketcap.com/static/img/coins/200x200/1958.png'; 41 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=TRX&tsyms=USD).TRX.USD"; 42 | }).call(this); 43 | -------------------------------------------------------------------------------- /plugins/trx-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 1 3 | tx-fee: \0.0000001 4 | tx-fee-options: 5 | fast: \0.000001 6 | cheap: \0.0000002 7 | mask: 'username' 8 | api: 9 | provider: \tron 10 | node-url: "" 11 | api-url: "" 12 | explorer-url: "" 13 | decimal: 1 14 | export testnet = 15 | tx-fee: \0.0000001 16 | tx-fee-options: 17 | fast: \0.000001 18 | cheap: \0.0000002 19 | decimals: 1 20 | mask: 'username' 21 | api: 22 | provider: \tron 23 | node-url: "" 24 | api-rul: "" 25 | explorer-url: "" 26 | decimal: 1 27 | export color = \#000000 28 | export type = \coin 29 | export enabled = yes 30 | export token = \trx 31 | export image = \https://s2.coinmarketcap.com/static/img/coins/200x200/1958.png 32 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=TRX&tsyms=USD).TRX.USD" -------------------------------------------------------------------------------- /plugins/trycrypto-topup.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var topupCoinsByMask, networks, type, enabled, token, image, address, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.topupCoinsByMask = topupCoinsByMask = "*"; 5 | out$.networks = networks = "mainnet"; 6 | out$.type = type = 'topup'; 7 | out$.enabled = enabled = true; 8 | out$.token = token = 'trycrypto'; 9 | out$.image = image = 'https://res.cloudinary.com/nixar-work/image/upload/v1547940596/logo3-bl.png'; 10 | out$.address = address = "https://trycrypto.net/?from=EUR&to={token}&address={address}"; 11 | }).call(this); 12 | -------------------------------------------------------------------------------- /plugins/trycrypto-topup.ls: -------------------------------------------------------------------------------- 1 | export topup-coins-by-mask = "*" 2 | export networks = "mainnet" 3 | export type = \topup 4 | export enabled = yes 5 | export token = \trycrypto 6 | export image = \https://res.cloudinary.com/nixar-work/image/upload/v1547940596/logo3-bl.png 7 | export address = "https://trycrypto.net/?from=EUR&to={token}&address={address}" -------------------------------------------------------------------------------- /plugins/usd-ac-rs.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var url, mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | url = 'https://royalswap.com'; 5 | out$.mainnet = mainnet = { 6 | decimals: 2, 7 | txFee: 0, 8 | txFeeOptions: { 9 | withdraw: 0 10 | }, 11 | messagePrefix: 'Ethereum', 12 | mask: '0x0000000000000000000000000000000000000000', 13 | api: { 14 | provider: 'rst', 15 | url: url + "/fiat/explorer", 16 | apiUrl: url + "/fiat-token/usd_ac_rs", 17 | web3Provider: url + "/fiat-token/usd_ac_rs" 18 | } 19 | }; 20 | out$.testnet = testnet = { 21 | disabled: true 22 | }; 23 | out$.color = color = "#62C272"; 24 | out$.type = type = 'coin'; 25 | out$.enabled = enabled = true; 26 | out$.token = token = 'usd_ac_rs'; 27 | out$.image = image = "https://bitcoin-debit-cards.com/wp-content/uploads/2017/12/advcash-app.png"; 28 | out$.usdInfo = usdInfo = 1; 29 | }).call(this); 30 | -------------------------------------------------------------------------------- /plugins/usd-ac-rs.ls: -------------------------------------------------------------------------------- 1 | #require! { 2 | # \../config-public.json : { web3stable: { url } } 3 | #} 4 | url = \https://royalswap.com 5 | export mainnet = 6 | decimals: 2 7 | tx-fee: 0 8 | tx-fee-options: 9 | withdraw: 0 10 | message-prefix: 'Ethereum' 11 | mask: \0x0000000000000000000000000000000000000000 12 | api: 13 | provider: \rst 14 | url : "#{url}/fiat/explorer" 15 | apiUrl : "#{url}/fiat-token/usd_ac_rs" 16 | web3Provider : "#{url}/fiat-token/usd_ac_rs" 17 | export testnet = 18 | disabled: yes 19 | export color = "#62C272" 20 | export type = \coin 21 | export enabled = yes 22 | export token = \usd_ac_rs 23 | export image = "https://bitcoin-debit-cards.com/wp-content/uploads/2017/12/advcash-app.png" 24 | export usd-info = 1 -------------------------------------------------------------------------------- /plugins/usdt-rs.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var url, mainnet, testnet, type, enabled, token, color, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | url = 'https://royalswap.com'; 5 | out$.mainnet = mainnet = { 6 | decimals: 2, 7 | txFee: 50, 8 | messagePrefix: 'Ethereum', 9 | mask: '0x0000000000000000000000000000000000000000', 10 | api: { 11 | provider: 'eth', 12 | url: url + "/fiat/explorer", 13 | apiUrl: url + "/fiat-token/usdt_rs", 14 | web3Provider: url + "/fiat-token/usdt_rs" 15 | } 16 | }; 17 | out$.testnet = testnet = { 18 | disabled: true 19 | }; 20 | out$.type = type = 'coin'; 21 | out$.enabled = enabled = true; 22 | out$.token = token = 'usdt_rs'; 23 | out$.color = color = '#26A17B'; 24 | out$.image = image = "data:image/png;base64,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"; 25 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).USDT.USD"; 26 | }).call(this); 27 | -------------------------------------------------------------------------------- /plugins/usdt-rs.ls: -------------------------------------------------------------------------------- 1 | #require! { 2 | # \../config-public.json : { web3stable: { url } } 3 | #} 4 | url = \https://royalswap.com 5 | export mainnet = 6 | decimals: 2 7 | tx-fee: 50 8 | message-prefix: 'Ethereum' 9 | mask: \0x0000000000000000000000000000000000000000 10 | api: 11 | provider: \eth 12 | url : "#{url}/fiat/explorer" 13 | apiUrl : "#{url}/fiat-token/usdt_rs" 14 | web3Provider : "#{url}/fiat-token/usdt_rs" 15 | export testnet = 16 | disabled: yes 17 | export type = \coin 18 | export enabled = yes 19 | export token = \usdt_rs 20 | export color = \#26A17B 21 | export image = "data:image/png;base64,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" 22 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).USDT.USD" -------------------------------------------------------------------------------- /plugins/waves-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 8, 6 | txFee: '0.001', 7 | mask: '3P000000000000000000000000000000000', 8 | messagePrefix: 'Waves', 9 | api: { 10 | provider: 'waves', 11 | url: 'https://wavesexplorer.com' 12 | } 13 | }; 14 | out$.testnet = testnet = { 15 | decimals: 8, 16 | txFee: '0.001', 17 | mask: '3P000000000000000000000000000000000', 18 | messagePrefix: 'Waves', 19 | api: { 20 | provider: 'waves', 21 | url: 'https://wavesexplorer.com' 22 | } 23 | }; 24 | out$.type = type = 'coin'; 25 | out$.enabled = enabled = false; 26 | out$.token = token = 'waves'; 27 | out$.image = image = '//res.cloudinary.com/nixar-work/image/upload/v1525380100/waves-icon.png'; 28 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=WAVES&tsyms=USD).WAVES.USD"; 29 | }).call(this); 30 | -------------------------------------------------------------------------------- /plugins/waves-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 8 3 | tx-fee: \0.001 4 | mask: '3P000000000000000000000000000000000' 5 | message-prefix: 'Waves' 6 | api: 7 | provider: \waves 8 | url: \https://wavesexplorer.com 9 | export testnet = 10 | decimals: 8 11 | tx-fee: \0.001 12 | mask: '3P000000000000000000000000000000000' 13 | message-prefix: 'Waves' 14 | api: 15 | provider: \waves 16 | url: \https://wavesexplorer.com 17 | export type = \coin 18 | export enabled = no 19 | export token = \waves 20 | export image = \//res.cloudinary.com/nixar-work/image/upload/v1525380100/waves-icon.png 21 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=WAVES&tsyms=USD).WAVES.USD" -------------------------------------------------------------------------------- /plugins/xem-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var nem, proxy, mainnet, testnet, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | nem = require('nem-sdk')['default']; 5 | proxy = 'https://cors-anywhere.herokuapp.com/'; 6 | proxy = ''; 7 | out$.mainnet = mainnet = { 8 | decimals: 6, 9 | txFee: '0.05', 10 | id: 104, 11 | prefix: "68", 12 | char: "N", 13 | api: { 14 | provider: 'xem', 15 | nodeAddress: nem.model.nodes.defaultMainnet, 16 | nodePort: nem.model.nodes.defaultPort, 17 | url: nem.model.nodes.mainnetExplorer.replace('/transfer/', ''), 18 | apiUrl: proxy + "http://chain.nem.ninja/api3" 19 | } 20 | }; 21 | out$.testnet = testnet = { 22 | decimals: 6, 23 | txFee: '0.05', 24 | id: -104, 25 | prefix: "98", 26 | char: "T", 27 | api: { 28 | provider: 'xem', 29 | nodeAddress: nem.model.nodes.defaultTestnet, 30 | nodePort: nem.model.nodes.defaultPort, 31 | url: nem.model.nodes.testnetExplorer.replace('/transfer/', ''), 32 | apiUrl: proxy + "http://bob.nem.ninja:8765/api3" 33 | } 34 | }; 35 | out$.type = type = 'coin'; 36 | out$.enabled = enabled = true; 37 | out$.token = token = 'xem'; 38 | out$.image = image = './res/nem-ethnamed.png'; 39 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).XEM.USD"; 40 | }).call(this); 41 | -------------------------------------------------------------------------------- /plugins/xem-coin.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \nem-sdk : { default: nem } 3 | } 4 | proxy = \https://cors-anywhere.herokuapp.com/ 5 | proxy = '' 6 | export mainnet = 7 | decimals: 6 8 | tx-fee: \0.05 9 | id : 104 10 | prefix : "68" 11 | char : "N" 12 | api: 13 | provider: \xem 14 | node-address: nem.model.nodes.default-mainnet 15 | node-port: nem.model.nodes.default-port 16 | url: nem.model.nodes.mainnet-explorer.replace('/transfer/', '') 17 | api-url : "#{proxy}http://chain.nem.ninja/api3" 18 | export testnet = 19 | decimals: 6 20 | tx-fee: \0.05 21 | id : -104 22 | prefix : "98" 23 | char : "T" 24 | api: 25 | provider: \xem 26 | node-address: nem.model.nodes.default-testnet 27 | node-port: nem.model.nodes.default-port 28 | url: nem.model.nodes.testnet-explorer.replace('/transfer/', '') 29 | api-url : "#{proxy}http://bob.nem.ninja:8765/api3" 30 | export type = \coin 31 | export enabled = yes 32 | export token = \xem 33 | export image = \./res/nem-ethnamed.png 34 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH,LTC,DASH,XEM,USDT,ETC&tsyms=USD).XEM.USD" -------------------------------------------------------------------------------- /plugins/xlm-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 1, 6 | txFee: '0.0000001', 7 | txFeeOptions: { 8 | auto: '0.000001', 9 | cheap: '0.0000002' 10 | }, 11 | mask: 'username', 12 | api: { 13 | provider: 'stellar', 14 | nodeUrl: "", 15 | apiUrl: "https://horizon.stellar.org", 16 | explorerUrl: "https://steexp.com", 17 | decimal: 1 18 | } 19 | }; 20 | out$.testnet = testnet = { 21 | txFee: '0.0000001', 22 | txFeeOptions: { 23 | auto: '0.000001', 24 | cheap: '0.0000002' 25 | }, 26 | decimals: 1, 27 | mask: 'username', 28 | api: { 29 | provider: 'stellar', 30 | nodeUrl: "", 31 | apiUrl: "https://horizon-testnet.stellar.org", 32 | explorerUrl: "", 33 | decimal: 1 34 | } 35 | }; 36 | out$.color = color = '#D9F0F7'; 37 | out$.type = type = 'coin'; 38 | out$.enabled = enabled = true; 39 | out$.token = token = 'xlm'; 40 | out$.image = image = 'https://crushcrypto.com/wp-content/uploads/2018/08/Stellar-Logo.jpg'; 41 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=XLM&tsyms=USD).XLM.USD"; 42 | }).call(this); 43 | -------------------------------------------------------------------------------- /plugins/xlm-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 1 3 | tx-fee: \0.0000001 4 | tx-fee-options: 5 | auto: \0.000001 6 | cheap: \0.0000002 7 | mask: 'username' 8 | api: 9 | provider: \stellar 10 | node-url: "" 11 | api-url: "https://horizon.stellar.org" 12 | explorer-url: "https://steexp.com" 13 | decimal: 1 14 | export testnet = 15 | tx-fee: \0.0000001 16 | tx-fee-options: 17 | auto: \0.000001 18 | cheap: \0.0000002 19 | decimals: 1 20 | mask: 'username' 21 | api: 22 | provider: \stellar 23 | node-url: "" 24 | api-url: "https://horizon-testnet.stellar.org" 25 | explorer-url: "" 26 | decimal: 1 27 | export color = \#D9F0F7 28 | export type = \coin 29 | export enabled = yes 30 | export token = \xlm 31 | export image = \https://crushcrypto.com/wp-content/uploads/2018/08/Stellar-Logo.jpg 32 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=XLM&tsyms=USD).XLM.USD" -------------------------------------------------------------------------------- /plugins/xmr-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, type, color, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | messagePrefix: 'Monero', 6 | api: { 7 | provider: 'cryptonote', 8 | url: 'https://xmrchain.com', 9 | apiUrl: 'https://xmrchain.com/api', 10 | nodeUrl: 'http://node.moneroworld.com:18089/json_rpc' 11 | } 12 | }; 13 | out$.testnet = testnet = { 14 | messagePrefix: 'Monero', 15 | api: { 16 | provider: 'cryptonote', 17 | url: 'https://testnet.xmrchain.com', 18 | apiUrl: 'https://testnet.xmrchain.com/api', 19 | nodeUrl: 'testnet.xmrchain.net:28081/json_rpc' 20 | } 21 | }; 22 | out$.type = type = 'coin'; 23 | out$.color = color = '#FF6601'; 24 | out$.enabled = enabled = false; 25 | out$.token = token = 'xmr'; 26 | out$.image = image = './res/xml-ethnamed.png'; 27 | out$.usdInfo = usdInfo = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=XMR&tsyms=USD).XMR.USD"; 28 | }).call(this); 29 | -------------------------------------------------------------------------------- /plugins/xmr-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | message-prefix: 'Monero' 3 | api: 4 | provider: \cryptonote 5 | url: \https://xmrchain.com 6 | api-url: \https://xmrchain.com/api 7 | node-url: \http://node.moneroworld.com:18089/json_rpc 8 | export testnet = 9 | message-prefix: 'Monero' 10 | api: 11 | provider: \cryptonote 12 | url: \https://testnet.xmrchain.com 13 | api-url: \https://testnet.xmrchain.com/api 14 | node-url: \testnet.xmrchain.net:28081/json_rpc 15 | export type = \coin 16 | export color = \#FF6601 17 | export enabled = no 18 | export token = \xmr 19 | export image = \./res/xml-ethnamed.png 20 | export usd-info = "url(https://min-api.cryptocompare.com/data/pricemulti?fsyms=XMR&tsyms=USD).XMR.USD" -------------------------------------------------------------------------------- /plugins/xrp-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, type, enabled, token, image, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | decimals: 8, 6 | txFee: '0.0000004', 7 | mask: '1000000000000000000000000000000000', 8 | api: { 9 | provider: 'ripple', 10 | url: 'https://bithomp.com/explorer', 11 | apiUrl: 'http://s2.ripple.com:51234/', 12 | decimal: 8 13 | } 14 | }; 15 | out$.testnet = testnet = { 16 | txFee: 0.0001, 17 | decimals: 8, 18 | mask: '1000000000000000000000000000000000', 19 | api: { 20 | provider: 'ripple', 21 | url: 'https://bithomp.com/explorer', 22 | apiUrl: 'https://s.altnet.rippletest.net:51234', 23 | decimal: 8 24 | }, 25 | topup: 'https://testnet.manu.backend.hamburg/faucet' 26 | }; 27 | out$.type = type = 'coin'; 28 | out$.enabled = enabled = false; 29 | out$.token = token = 'xrp'; 30 | out$.image = image = './res/xrp-ethnamed.png'; 31 | }).call(this); 32 | -------------------------------------------------------------------------------- /plugins/xrp-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | decimals: 8 3 | tx-fee: \0.0000004 4 | mask: '1000000000000000000000000000000000' 5 | api: 6 | provider: \ripple 7 | url: \https://bithomp.com/explorer 8 | api-url: \http://s2.ripple.com:51234/ 9 | decimal: 8 10 | export testnet = 11 | tx-fee: 0.0001 12 | decimals: 8 13 | mask: '1000000000000000000000000000000000' 14 | api: 15 | provider: \ripple 16 | url: \https://bithomp.com/explorer 17 | api-url: \https://s.altnet.rippletest.net:51234 18 | decimal: 8 19 | topup: \https://testnet.manu.backend.hamburg/faucet 20 | export type = \coin 21 | export enabled = no 22 | export token = \xrp 23 | export image = \./res/xrp-ethnamed.png -------------------------------------------------------------------------------- /plugins/ym-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | out$.mainnet = mainnet = { 5 | privateKey: '...', 6 | decimals: 0, 7 | mask: '+30001234567', 8 | api: { 9 | provider: 'ym' 10 | } 11 | }; 12 | out$.testnet = testnet = { 13 | disabled: true 14 | }; 15 | out$.color = color = '#F8C600'; 16 | out$.type = type = 'coin'; 17 | out$.enabled = enabled = true; 18 | out$.token = token = 'ym'; 19 | out$.image = image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAdVBMVEX/////zADZrQAAAADdsAD9ygDltwD5xwDhtADvvwDywQDesQD2xADouQDrvADtvQAOCwDBmgDPpQAfGABlUAC3kgCsiQC+mACnhQCTdQBjTwAmHgChgABvWACCaAB+ZAB0XABBNABPPwBVRAAaFACzjwA/MgAt6XdQAAAD6ElEQVR4nO3b6U7bUBAFYG6cxNkJWykpgUIp7/+IBdSWYN99mzNXM78ty5/G9jmOlLMzGZnRKOoLyDSqEYhqBKLagCjVBkQ1AlFtQJRqA6Iagag2IEq1AVGNQFQjkKGDKWTEYArROFhCdA6GEC2DIcTgYAcxOZhBjAxmEIuDFcTm4ASxOvhA7Aw+EJeDC8Tp4AFxM3hAfBwcIF4OfIgfAx/i60CHeDvAIf4OaEgAAxoS5ACGhDlgIYEMWEiwAxQS7oCERDAgIVEOQEicAw8S6UCDxDLQIPEOLEiCAwmSwkCCpDlwIIkOFEgqAwWS7sCAZHAgQHIwECB5HPSQTA5ySC4HMSQbgxiS0UEKyekghGRlEEIyO8gguR1EkOwMIkgBBwmkhIMCUsRRH1KGUR9SylEbUsxRF1KOUReSdqWX9w+Pd5cIkBTF+njVfcyPW3JIAmN+6D7njhiS4Pi+707nghQSz+ivu6/zTAmJd2yeu+Es6SDxjv5p5Oi0ry5whxreV+9zQwVJcNxrHHQbiXfM9zrInAgS71C/dI4r7aHQkInO0R21x04n+sknjneogxaiD0RkSK99Qp70BxeHxDvURcBCoCF3Ose14eDSkASH+ql7Za0YQo5jx974ZYUMeRhDtO0EHvJ7tA/T52F5SIpD9S+D58P8xY4NGVTGg+k5x4ecvrdeLbcVPkTdvH4oXq4NMcgG8tbkL77drj2Og4f4jkAEIhCBCEQgAhGIQAQiEIEIRCACEYhABCIQgQhEIAIRiEAEQgrpG4EsDQxmkH5udLCCrEy3FS/IzLIOTpCNbR18ILOtncEFslm7HDwgOyeDBaRfeDgYQM59GPgQv3XgQ8yVhBXEex3gEGsl4QNxVBI2EFclYQJxVxIeEI9KwgLiU0kYQPrwdUBCPCsJOiQkA5Eh/pUEGhK9jsli/E9rQkhQJTmZ+XKmORsZJLCS/FesdApCSGgleZ+pUUEGCa8kk+l2Yz0lCSS4krgURJDASrLeORUkkLB1+CkoICGVZLHrvc9bGRKQgYulv6I6xLuSBCoqQ3zXoY9uHIhfJbGFHgTEp5JYoxsE4l7HdGv90y4GxFlJPKIbAeJoiOmKOpCZtZJ4Rzc5xFZJQqKbGmJex+I8m6I8xJiB4dFNCjFUkuyKwhD9OqIKCClEl4EJ0U0FGVeSt+gupSgIGa4jS+jVhwwqSXFFKciXSpIruutDTivJOl90V4d8VpKMBcQ92SH/1lEi9GyTGfI3A2srVG7IsmB0OyYOope8r6NcdDsmI2SV8ttB8kRCNJJNlbgwTj4I8cRC4CTREDRJPARMkgDBoiRBkCypEJl68wf0n238vgGZKQAAAABJRU5ErkJggg=="; 20 | out$.usdInfo = usdInfo = "1/url(https://api.exchangeratesapi.io/latest?base=USD).rates.RUB"; 21 | }).call(this); 22 | -------------------------------------------------------------------------------- /plugins/ym-coin.ls: -------------------------------------------------------------------------------- 1 | export mainnet = 2 | private-key: \... 3 | decimals: 0 4 | mask: \+30001234567 5 | api: 6 | provider: \ym 7 | export testnet = 8 | disabled: yes 9 | export color = \#F8C600 10 | export type = \coin 11 | export enabled = yes 12 | export token = \ym 13 | export image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAdVBMVEX/////zADZrQAAAADdsAD9ygDltwD5xwDhtADvvwDywQDesQD2xADouQDrvADtvQAOCwDBmgDPpQAfGABlUAC3kgCsiQC+mACnhQCTdQBjTwAmHgChgABvWACCaAB+ZAB0XABBNABPPwBVRAAaFACzjwA/MgAt6XdQAAAD6ElEQVR4nO3b6U7bUBAFYG6cxNkJWykpgUIp7/+IBdSWYN99mzNXM78ty5/G9jmOlLMzGZnRKOoLyDSqEYhqBKLagCjVBkQ1AlFtQJRqA6Iagag2IEq1AVGNQFQjkKGDKWTEYArROFhCdA6GEC2DIcTgYAcxOZhBjAxmEIuDFcTm4ASxOvhA7Aw+EJeDC8Tp4AFxM3hAfBwcIF4OfIgfAx/i60CHeDvAIf4OaEgAAxoS5ACGhDlgIYEMWEiwAxQS7oCERDAgIVEOQEicAw8S6UCDxDLQIPEOLEiCAwmSwkCCpDlwIIkOFEgqAwWS7sCAZHAgQHIwECB5HPSQTA5ySC4HMSQbgxiS0UEKyekghGRlEEIyO8gguR1EkOwMIkgBBwmkhIMCUsRRH1KGUR9SylEbUsxRF1KOUReSdqWX9w+Pd5cIkBTF+njVfcyPW3JIAmN+6D7njhiS4Pi+707nghQSz+ivu6/zTAmJd2yeu+Es6SDxjv5p5Oi0ry5whxreV+9zQwVJcNxrHHQbiXfM9zrInAgS71C/dI4r7aHQkInO0R21x04n+sknjneogxaiD0RkSK99Qp70BxeHxDvURcBCoCF3Ose14eDSkASH+ql7Za0YQo5jx974ZYUMeRhDtO0EHvJ7tA/T52F5SIpD9S+D58P8xY4NGVTGg+k5x4ecvrdeLbcVPkTdvH4oXq4NMcgG8tbkL77drj2Og4f4jkAEIhCBCEQgAhGIQAQiEIEIRCACEYhABCIQgQhEIAIRiEAEQgrpG4EsDQxmkH5udLCCrEy3FS/IzLIOTpCNbR18ILOtncEFslm7HDwgOyeDBaRfeDgYQM59GPgQv3XgQ8yVhBXEex3gEGsl4QNxVBI2EFclYQJxVxIeEI9KwgLiU0kYQPrwdUBCPCsJOiQkA5Eh/pUEGhK9jsli/E9rQkhQJTmZ+XKmORsZJLCS/FesdApCSGgleZ+pUUEGCa8kk+l2Yz0lCSS4krgURJDASrLeORUkkLB1+CkoICGVZLHrvc9bGRKQgYulv6I6xLuSBCoqQ3zXoY9uHIhfJbGFHgTEp5JYoxsE4l7HdGv90y4GxFlJPKIbAeJoiOmKOpCZtZJ4Rzc5xFZJQqKbGmJex+I8m6I8xJiB4dFNCjFUkuyKwhD9OqIKCClEl4EJ0U0FGVeSt+gupSgIGa4jS+jVhwwqSXFFKciXSpIruutDTivJOl90V4d8VpKMBcQ92SH/1lEi9GyTGfI3A2srVG7IsmB0OyYOope8r6NcdDsmI2SV8ttB8kRCNJJNlbgwTj4I8cRC4CTREDRJPARMkgDBoiRBkCypEJl68wf0n238vgGZKQAAAABJRU5ErkJggg==" 14 | export usd-info = "1/url(https://api.exchangeratesapi.io/latest?base=USD).rates.RUB" -------------------------------------------------------------------------------- /plugins/ym-rs.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var url, mainnet, testnet, color, type, enabled, token, image, usdInfo, out$ = typeof exports != 'undefined' && exports || this; 4 | url = 'https://royalswap.com'; 5 | out$.mainnet = mainnet = { 6 | decimals: 2, 7 | txFee: 0, 8 | txFeeOptions: { 9 | withdraw: "50 + 2%" 10 | }, 11 | messagePrefix: 'Ethereum', 12 | mask: '0x0000000000000000000000000000000000000000', 13 | api: { 14 | provider: 'rst', 15 | url: url + "/fiat/explorer", 16 | apiUrl: url + "/fiat-token/ym_rs", 17 | web3Provider: url + "/fiat-token/ym_rs" 18 | } 19 | }; 20 | out$.testnet = testnet = { 21 | disabled: true 22 | }; 23 | out$.color = color = '#F8C600'; 24 | out$.type = type = 'coin'; 25 | out$.enabled = enabled = true; 26 | out$.token = token = 'ym_rs'; 27 | out$.image = image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAdVBMVEX/////zADZrQAAAADdsAD9ygDltwD5xwDhtADvvwDywQDesQD2xADouQDrvADtvQAOCwDBmgDPpQAfGABlUAC3kgCsiQC+mACnhQCTdQBjTwAmHgChgABvWACCaAB+ZAB0XABBNABPPwBVRAAaFACzjwA/MgAt6XdQAAAD6ElEQVR4nO3b6U7bUBAFYG6cxNkJWykpgUIp7/+IBdSWYN99mzNXM78ty5/G9jmOlLMzGZnRKOoLyDSqEYhqBKLagCjVBkQ1AlFtQJRqA6Iagag2IEq1AVGNQFQjkKGDKWTEYArROFhCdA6GEC2DIcTgYAcxOZhBjAxmEIuDFcTm4ASxOvhA7Aw+EJeDC8Tp4AFxM3hAfBwcIF4OfIgfAx/i60CHeDvAIf4OaEgAAxoS5ACGhDlgIYEMWEiwAxQS7oCERDAgIVEOQEicAw8S6UCDxDLQIPEOLEiCAwmSwkCCpDlwIIkOFEgqAwWS7sCAZHAgQHIwECB5HPSQTA5ySC4HMSQbgxiS0UEKyekghGRlEEIyO8gguR1EkOwMIkgBBwmkhIMCUsRRH1KGUR9SylEbUsxRF1KOUReSdqWX9w+Pd5cIkBTF+njVfcyPW3JIAmN+6D7njhiS4Pi+707nghQSz+ivu6/zTAmJd2yeu+Es6SDxjv5p5Oi0ry5whxreV+9zQwVJcNxrHHQbiXfM9zrInAgS71C/dI4r7aHQkInO0R21x04n+sknjneogxaiD0RkSK99Qp70BxeHxDvURcBCoCF3Ose14eDSkASH+ql7Za0YQo5jx974ZYUMeRhDtO0EHvJ7tA/T52F5SIpD9S+D58P8xY4NGVTGg+k5x4ecvrdeLbcVPkTdvH4oXq4NMcgG8tbkL77drj2Og4f4jkAEIhCBCEQgAhGIQAQiEIEIRCACEYhABCIQgQhEIAIRiEAEQgrpG4EsDQxmkH5udLCCrEy3FS/IzLIOTpCNbR18ILOtncEFslm7HDwgOyeDBaRfeDgYQM59GPgQv3XgQ8yVhBXEex3gEGsl4QNxVBI2EFclYQJxVxIeEI9KwgLiU0kYQPrwdUBCPCsJOiQkA5Eh/pUEGhK9jsli/E9rQkhQJTmZ+XKmORsZJLCS/FesdApCSGgleZ+pUUEGCa8kk+l2Yz0lCSS4krgURJDASrLeORUkkLB1+CkoICGVZLHrvc9bGRKQgYulv6I6xLuSBCoqQ3zXoY9uHIhfJbGFHgTEp5JYoxsE4l7HdGv90y4GxFlJPKIbAeJoiOmKOpCZtZJ4Rzc5xFZJQqKbGmJex+I8m6I8xJiB4dFNCjFUkuyKwhD9OqIKCClEl4EJ0U0FGVeSt+gupSgIGa4jS+jVhwwqSXFFKciXSpIruutDTivJOl90V4d8VpKMBcQ92SH/1lEi9GyTGfI3A2srVG7IsmB0OyYOope8r6NcdDsmI2SV8ttB8kRCNJJNlbgwTj4I8cRC4CTREDRJPARMkgDBoiRBkCypEJl68wf0n238vgGZKQAAAABJRU5ErkJggg=="; 28 | out$.usdInfo = usdInfo = "1/url(https://api.exchangeratesapi.io/latest?base=USD).rates.RUB"; 29 | }).call(this); 30 | -------------------------------------------------------------------------------- /plugins/ym-rs.ls: -------------------------------------------------------------------------------- 1 | #require! { 2 | # \../config-public.json : { web3stable: { url } } 3 | #} 4 | url = \https://royalswap.com 5 | export mainnet = 6 | decimals: 2 7 | tx-fee: 0 8 | tx-fee-options: 9 | withdraw: "50 + 2%" 10 | message-prefix: 'Ethereum' 11 | mask: \0x0000000000000000000000000000000000000000 12 | api: 13 | provider: \rst 14 | url : "#{url}/fiat/explorer" 15 | apiUrl : "#{url}/fiat-token/ym_rs" 16 | web3Provider : "#{url}/fiat-token/ym_rs" 17 | export testnet = 18 | disabled: yes 19 | export color = \#F8C600 20 | export type = \coin 21 | export enabled = yes 22 | export token = \ym_rs 23 | export image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAdVBMVEX/////zADZrQAAAADdsAD9ygDltwD5xwDhtADvvwDywQDesQD2xADouQDrvADtvQAOCwDBmgDPpQAfGABlUAC3kgCsiQC+mACnhQCTdQBjTwAmHgChgABvWACCaAB+ZAB0XABBNABPPwBVRAAaFACzjwA/MgAt6XdQAAAD6ElEQVR4nO3b6U7bUBAFYG6cxNkJWykpgUIp7/+IBdSWYN99mzNXM78ty5/G9jmOlLMzGZnRKOoLyDSqEYhqBKLagCjVBkQ1AlFtQJRqA6Iagag2IEq1AVGNQFQjkKGDKWTEYArROFhCdA6GEC2DIcTgYAcxOZhBjAxmEIuDFcTm4ASxOvhA7Aw+EJeDC8Tp4AFxM3hAfBwcIF4OfIgfAx/i60CHeDvAIf4OaEgAAxoS5ACGhDlgIYEMWEiwAxQS7oCERDAgIVEOQEicAw8S6UCDxDLQIPEOLEiCAwmSwkCCpDlwIIkOFEgqAwWS7sCAZHAgQHIwECB5HPSQTA5ySC4HMSQbgxiS0UEKyekghGRlEEIyO8gguR1EkOwMIkgBBwmkhIMCUsRRH1KGUR9SylEbUsxRF1KOUReSdqWX9w+Pd5cIkBTF+njVfcyPW3JIAmN+6D7njhiS4Pi+707nghQSz+ivu6/zTAmJd2yeu+Es6SDxjv5p5Oi0ry5whxreV+9zQwVJcNxrHHQbiXfM9zrInAgS71C/dI4r7aHQkInO0R21x04n+sknjneogxaiD0RkSK99Qp70BxeHxDvURcBCoCF3Ose14eDSkASH+ql7Za0YQo5jx974ZYUMeRhDtO0EHvJ7tA/T52F5SIpD9S+D58P8xY4NGVTGg+k5x4ecvrdeLbcVPkTdvH4oXq4NMcgG8tbkL77drj2Og4f4jkAEIhCBCEQgAhGIQAQiEIEIRCACEYhABCIQgQhEIAIRiEAEQgrpG4EsDQxmkH5udLCCrEy3FS/IzLIOTpCNbR18ILOtncEFslm7HDwgOyeDBaRfeDgYQM59GPgQv3XgQ8yVhBXEex3gEGsl4QNxVBI2EFclYQJxVxIeEI9KwgLiU0kYQPrwdUBCPCsJOiQkA5Eh/pUEGhK9jsli/E9rQkhQJTmZ+XKmORsZJLCS/FesdApCSGgleZ+pUUEGCa8kk+l2Yz0lCSS4krgURJDASrLeORUkkLB1+CkoICGVZLHrvc9bGRKQgYulv6I6xLuSBCoqQ3zXoY9uHIhfJbGFHgTEp5JYoxsE4l7HdGv90y4GxFlJPKIbAeJoiOmKOpCZtZJ4Rzc5xFZJQqKbGmJex+I8m6I8xJiB4dFNCjFUkuyKwhD9OqIKCClEl4EJ0U0FGVeSt+gupSgIGa4jS+jVhwwqSXFFKciXSpIruutDTivJOl90V4d8VpKMBcQ92SH/1lEi9GyTGfI3A2srVG7IsmB0OyYOope8r6NcdDsmI2SV8ttB8kRCNJJNlbgwTj4I8cRC4CTREDRJPARMkgDBoiRBkCypEJl68wf0n238vgGZKQAAAABJRU5ErkJggg==" 24 | export usd-info = "1/url(https://api.exchangeratesapi.io/latest?base=USD).rates.RUB" -------------------------------------------------------------------------------- /pow/pow-gen.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var keythereum; 4 | keythereum = require('keythereum'); 5 | module.exports = function(complexity){ 6 | var dk, nonce; 7 | complexity == null && (complexity = 18); 8 | dk = keythereum.create(); 9 | nonce = keythereum.privateKeyToAddress(dk.privateKey); 10 | return { 11 | complexity: complexity, 12 | nonce: nonce 13 | }; 14 | }; 15 | }).call(this); 16 | -------------------------------------------------------------------------------- /pow/pow-gen.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \keythereum 3 | } 4 | 5 | module.exports = (complexity=18)-> 6 | dk = keythereum.create! 7 | nonce = keythereum.private-key-to-address dk.privateKey 8 | { complexity, nonce } 9 | -------------------------------------------------------------------------------- /pow/pow-solve.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var pow, solver, solve; 4 | pow = require('proof-of-work'); 5 | solver = new pow.Solver(); 6 | solve = function(arg$, cb){ 7 | var nonce, complexity, prefix; 8 | nonce = arg$.nonce, complexity = arg$.complexity; 9 | prefix = Buffer.from(nonce, 'hex'); 10 | nonce = solver.solve(complexity, prefix); 11 | return cb(null, nonce.toString('hex')); 12 | }; 13 | module.exports = solve; 14 | }).call(this); 15 | -------------------------------------------------------------------------------- /pow/pow-solve.ls: -------------------------------------------------------------------------------- 1 | # add "proof-of-work": "3.3.2" to package.json 2 | 3 | require! { 4 | \proof-of-work : pow 5 | } 6 | solver = new pow.Solver! 7 | solve = ({ nonce, complexity }, cb)-> 8 | prefix = Buffer.from nonce, \hex 9 | nonce = solver.solve complexity, prefix 10 | cb null, nonce.to-string(\hex) 11 | module.exports = solve -------------------------------------------------------------------------------- /pow/pow-test.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var powVerify, powSolve, powGen, task; 4 | powVerify = require('./pow-verify.js'); 5 | powSolve = require('./pow-solve.js'); 6 | powGen = require('./pow-gen.js'); 7 | task = powGen(19); 8 | powSolve(task, function(err, solution){ 9 | console.log(err, solution); 10 | return powVerify((import$({ 11 | solution: solution 12 | }, task)), function(err, res){ 13 | return console.log(err, res); 14 | }); 15 | }); 16 | function import$(obj, src){ 17 | var own = {}.hasOwnProperty; 18 | for (var key in src) if (own.call(src, key)) obj[key] = src[key]; 19 | return obj; 20 | } 21 | }).call(this); 22 | -------------------------------------------------------------------------------- /pow/pow-test.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./pow-verify.js 3 | \./pow-solve.js 4 | \./pow-gen.js 5 | } 6 | 7 | task = pow-gen 19 8 | 9 | err, solution <- pow-solve task 10 | console.log err, solution 11 | 12 | err, res <- pow-verify { solution, ...task } 13 | console.log err, res -------------------------------------------------------------------------------- /pow/pow-verify.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var pow, arrayToHex, verify; 4 | pow = require('proof-of-work'); 5 | arrayToHex = function(arr){ 6 | return arr.map(function(it){ 7 | return +it.toString(16); 8 | }).join(''); 9 | }; 10 | verify = function(arg$, cb){ 11 | var nonce, complexity, solution, size, n, prefix, validity, verifier, hex, result; 12 | nonce = arg$.nonce, complexity = arg$.complexity, solution = arg$.solution; 13 | size = 1024; 14 | n = 16; 15 | prefix = Buffer.from(nonce, 'hex'); 16 | validity = 60000; 17 | verifier = new pow.Verifier({ 18 | size: size, 19 | n: n, 20 | complexity: complexity, 21 | prefix: prefix, 22 | validity: validity 23 | }); 24 | hex = (function(){ 25 | switch (false) { 26 | case !(solution.indexOf(',') > -1): 27 | return solution.split(','); 28 | default: 29 | return solution; 30 | } 31 | }()); 32 | result = verifier.check(Buffer.from(hex, "hex")); 33 | return cb(null, result); 34 | }; 35 | module.exports = verify; 36 | }).call(this); 37 | -------------------------------------------------------------------------------- /pow/pow-verify.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \proof-of-work : pow 3 | } 4 | 5 | array-to-hex = (arr)-> 6 | arr.map(-> +it.to-string(16)).join('') 7 | 8 | verify = ({ nonce, complexity, solution }, cb)-> 9 | size = 1024 10 | n = 16 11 | prefix = Buffer.from(nonce, 'hex') 12 | validity = 60000 13 | verifier = new pow.Verifier { size, n, complexity, prefix, validity } 14 | hex = 15 | | solution.index-of(',') > -1 => solution.split(',') 16 | | _ => solution 17 | result = verifier.check Buffer.from(hex, "hex") 18 | cb null, result 19 | module.exports = verify -------------------------------------------------------------------------------- /providers/cryptonote.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var generateAddress, ref$, post, get, rawtransaction, transaction, outputs, search, calcFee, getKeys, pushTx, getBalance, getUnconfirmedBalance, getTransactions, createTransaction, out$ = typeof exports != 'undefined' && exports || this; 4 | generateAddress = require('../library/monero.js').generateAddress; 5 | ref$ = require('superagent'), post = ref$.post, get = ref$.get; 6 | rawtransaction = function(arg$, cb){ 7 | var network, txhash; 8 | network = arg$.network, txhash = arg$.txhash; 9 | return get(network.api.apiUrl + "/api/rawtransaction/" + txhash).end(cb); 10 | }; 11 | transaction = function(arg$, cb){ 12 | var network, txhash; 13 | network = arg$.network, txhash = arg$.txhash; 14 | return get(network.api.apiUrl + "/api/transaction/" + txhash).end(cb); 15 | }; 16 | outputs = function(arg$, cb){ 17 | var network, txhash, address, viewkey; 18 | network = arg$.network, txhash = arg$.txhash, address = arg$.address, viewkey = arg$.viewkey; 19 | return get(network.api.apiUrl + "/outputs?txhash=" + txhash + "&address=" + address + "&viewkey=" + viewkey + "&txprove=0").end(cb); 20 | }; 21 | search = function(arg$, cb){ 22 | var network, txhash; 23 | network = arg$.network, txhash = arg$.txhash; 24 | return get(network.api.apiUrl + "/search/" + txhash).end(cb); 25 | }; 26 | out$.calcFee = calcFee = function(arg$, cb){ 27 | var network, tx; 28 | network = arg$.network, tx = arg$.tx; 29 | return cb(null); 30 | }; 31 | out$.getKeys = getKeys = function(arg$, cb){ 32 | var network, mnemonic, index, ref$, address, spendKey, viewKey; 33 | network = arg$.network, mnemonic = arg$.mnemonic, index = arg$.index; 34 | ref$ = generateAddress(mnemonic + " / " + index), address = ref$.address, spendKey = ref$.spendKey, viewKey = ref$.viewKey; 35 | return { 36 | address: address, 37 | privateKey: spendKey, 38 | viewKey: viewKey 39 | }; 40 | }; 41 | out$.pushTx = pushTx = curry$(function(arg$, cb){ 42 | var rawtx; 43 | rawtx = arg$.rawtx; 44 | return cb("Not Implemented"); 45 | }); 46 | out$.getBalance = getBalance = function(arg$, cb){ 47 | var address, network; 48 | address = arg$.address, network = arg$.network; 49 | return cb("Not Implemented"); 50 | }; 51 | out$.getUnconfirmedBalance = getUnconfirmedBalance = function(arg$, cb){ 52 | var network, address; 53 | network = arg$.network, address = arg$.address; 54 | return cb("Not Implemented"); 55 | }; 56 | out$.getTransactions = getTransactions = function(arg$, cb){ 57 | var address, network; 58 | address = arg$.address, network = arg$.network; 59 | return cb("Not Implemented"); 60 | }; 61 | out$.createTransaction = createTransaction = curry$(function(arg$, cb){ 62 | var account, recipient, amount, amountFee, data, txType; 63 | account = arg$.account, recipient = arg$.recipient, amount = arg$.amount, amountFee = arg$.amountFee, data = arg$.data, txType = arg$.txType; 64 | return cb("Not Implemented"); 65 | }); 66 | function curry$(f, bound){ 67 | var context, 68 | _curry = function(args) { 69 | return f.length > 1 ? function(){ 70 | var params = args ? args.concat() : []; 71 | context = bound ? context || this : this; 72 | return params.push.apply(params, arguments) < 73 | f.length && arguments.length ? 74 | _curry.call(context, params) : f.apply(context, params); 75 | } : f; 76 | }; 77 | return _curry(); 78 | } 79 | }).call(this); 80 | -------------------------------------------------------------------------------- /providers/cryptonote.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../library/monero.js : { generate-address } 3 | \superagent : { post, get } 4 | } 5 | # API doc 6 | # https://github.com/moneroexamples/onion-monero-blockchain-explorer#apioutputstxhashtx_hashaddressviewkeytxprove01 7 | 8 | rawtransaction = ({ network, txhash }, cb)-> 9 | get "#{network.api.api-url}/api/rawtransaction/#{txhash}" .end cb 10 | 11 | transaction = ({ network, txhash }, cb)-> 12 | get "#{network.api.api-url}/api/transaction/#{txhash}" .end cb 13 | 14 | outputs = ({ network, txhash, address, viewkey }, cb)-> 15 | get "#{network.api.api-url}/outputs?txhash=#{txhash}&address=#{address}&viewkey=#{viewkey}&txprove=0" .end cb 16 | 17 | search = ({ network, txhash }, cb)-> 18 | get "#{network.api.api-url}/search/#{txhash}" .end cb 19 | 20 | export calc-fee = ({ network, tx }, cb)-> 21 | return cb null 22 | 23 | export get-keys = ({ network, mnemonic, index }, cb)-> 24 | { address, spend-key, view-key } = generate-address "#{mnemonic} / #{index}" 25 | { address, private-key: spend-key, view-key } 26 | export push-tx = ({ rawtx } , cb)--> 27 | cb "Not Implemented" 28 | export get-balance = ({address, network} , cb)-> 29 | cb "Not Implemented" 30 | #input = 31 | # jsonrpc : "2.0" 32 | # id : "0" 33 | # method : \get_payments 34 | # params: 35 | # payment_id: \426870cb29c598e191184fa87003ca562d9e25f761ee9e520a888aec95195912 36 | #err, data <- post "http://testnet.xmrchain.net:28081/json_rpc", input .end 37 | #console.log err, data 38 | export get-unconfirmed-balance = ({ network, address} , cb)-> 39 | cb "Not Implemented" 40 | export get-transactions = ({ address, network }, cb)-> 41 | cb "Not Implemented" 42 | export create-transaction = ({account, recipient, amount, amount-fee, data, tx-type} , cb)--> 43 | cb "Not Implemented" 44 | #get-balance {} -------------------------------------------------------------------------------- /providers/deps-mobile.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var BitcoinLib, nodeLibsBrowser, Web3, Tx, BN, asyncRandomBytes, safeCrypto, hdkey, bip39; 4 | BitcoinLib = require('rn-bitcoinjs-lib'); 5 | nodeLibsBrowser = require('node-libs-browser'); 6 | Web3 = require('web3'); 7 | Tx = require('ethereumjs-tx'); 8 | BN = require('ethereumjs-util').BN; 9 | asyncRandomBytes = require('react-native-secure-randombytes').asyncRandomBytes; 10 | safeCrypto = require('react-native-safe-crypto'); 11 | hdkey = require('ethereumjs-wallet-react-native/hdkey.js'); 12 | bip39 = require('react-native-bip39'); 13 | window.randomBytes = asyncRandomBytes; 14 | window.scryptsy = safeCrypto.scrypt; 15 | module.exports = { 16 | BitcoinLib: BitcoinLib, 17 | Web3: Web3, 18 | Tx: Tx, 19 | BN: BN, 20 | hdkey: hdkey, 21 | bip39: bip39 22 | }; 23 | }).call(this); 24 | -------------------------------------------------------------------------------- /providers/deps-mobile.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \rn-bitcoinjs-lib : BitcoinLib 3 | \node-libs-browser 4 | \web3 : \Web3 5 | \ethereumjs-tx : Tx 6 | \ethereumjs-util : { BN } 7 | \react-native-secure-randombytes : { asyncRandomBytes } 8 | \react-native-safe-crypto : safeCrypto 9 | \ethereumjs-wallet-react-native/hdkey.js 10 | \react-native-bip39 : bip39 11 | } 12 | 13 | # for web3 according to https://github.com/ethereum/web3.js/issues/1022#issuecomment-330825219 14 | #node-libs-browser 15 | # but I could be wrong because of https://gist.github.com/dougbacelar/29e60920d8fa1982535247563eb63766 16 | 17 | # https://github.com/WoeOm/ethereumjs-wallet-react-native requirement 18 | window.randomBytes = asyncRandomBytes 19 | window.scryptsy = safeCrypto.scrypt 20 | 21 | 22 | module.exports = { BitcoinLib, Web3, Tx, BN, hdkey, bip39 } -------------------------------------------------------------------------------- /providers/deps-standard.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var BitcoinLib, Web3, Tx, BN, hdkey, bip39, mnemonicToSeed, cache; 4 | BitcoinLib = require('bitgo-utxo-lib'); 5 | Web3 = require('web3'); 6 | Tx = require('../node_modules_embed/ethereumjs-tx/index.js'); 7 | BN = require('ethereumjs-util').BN; 8 | hdkey = require('../node_modules_embed/ethereumjs-wallet/hdkey.js'); 9 | bip39 = require('bip39'); 10 | mnemonicToSeed = bip39.mnemonicToSeed; 11 | cache = {}; 12 | bip39.mnemonicToSeed = function(mnemonic){ 13 | if (cache[mnemonic] == null) { 14 | cache[mnemonic] = mnemonicToSeed(mnemonic); 15 | } 16 | return cache[mnemonic]; 17 | }; 18 | module.exports = { 19 | BitcoinLib: BitcoinLib, 20 | Web3: Web3, 21 | Tx: Tx, 22 | BN: BN, 23 | hdkey: hdkey, 24 | bip39: bip39 25 | }; 26 | }).call(this); 27 | -------------------------------------------------------------------------------- /providers/deps-standard.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \bitgo-utxo-lib : BitcoinLib 3 | #\bitcoinjs-lib : BitcoinLib 4 | \web3 : \Web3 5 | \../node_modules_embed/ethereumjs-tx/index.js : Tx 6 | #\bignumber.js : BN 7 | \ethereumjs-util : { BN } 8 | \../node_modules_embed/ethereumjs-wallet/hdkey.js 9 | \bip39 10 | } 11 | 12 | # performance optimization start 13 | mnemonic-to-seed = bip39.mnemonic-to-seed 14 | cache = {} 15 | bip39.mnemonic-to-seed = (mnemonic)-> 16 | cache[mnemonic] = mnemonic-to-seed mnemonic if not cache[mnemonic]? 17 | cache[mnemonic] 18 | # performance optimization end 19 | 20 | module.exports = { BitcoinLib, Web3, Tx, BN, hdkey, bip39 } -------------------------------------------------------------------------------- /providers/deps.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var depsStandard; 4 | depsStandard = require('./deps-standard.js'); 5 | module.exports = depsStandard; 6 | }).call(this); 7 | -------------------------------------------------------------------------------- /providers/deps.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./deps-standard.js 3 | } 4 | module.exports = deps-standard -------------------------------------------------------------------------------- /providers/eos.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \eosjs : Eos 3 | \./superagent.js : { post, get } 4 | \prelude-ls : { map, filter, foldl } 5 | \../math.js : { plus } 6 | } 7 | #https://developer.eospark.com/api-doc/https/transaction.html#push-transaction 8 | #https://developers.eos.io/eosio-nodeos/reference 9 | #https://github.com/MarcelBlockchain/eosjs-node-cli/blob/master/eos.js 10 | #https://github.com/EOSIO/eosjs-api/blob/master/docs/api.md 11 | #https://eosio.stackexchange.com/questions/1989/sign-push-transaction-separately-eosjs/1992 12 | as-callback = (promise, cb)-> 13 | state = 14 | res: null 15 | err: null 16 | promise 17 | .then do 18 | * (res)-> state.res = res 19 | .catch (err)-> state.err = err 20 | .finally -> 21 | #console.log state 22 | cb state.err, state.res 23 | apikey = \a9564ebc3289b7a14551baf8ad5ec60a 24 | list-accounts = ({ network, public-key } , cb)-> 25 | eos = get-eos { network } 26 | err, data <- as-callback eos.get-key-accounts(public-key) 27 | return cb err if err? 28 | names = data.account_names ? [] 29 | cb null, names 30 | export calc-fee = ({ network, tx }, cb)-> 31 | cb null 32 | no-account = null 33 | export get-keys = ({ network, mnemonic, index }, cb)-> 34 | { ecc } = Eos.modules 35 | private-key = ecc.seed-private "#{mnemonic} #{index}" 36 | public-key = ecc.private-to-public private-key 37 | err, accounts <- list-accounts { network, public-key } 38 | return cb err if err? 39 | address = accounts?0 ? no-account 40 | cb null, { public-key, private-key, address } 41 | transform-tx = (network, t)--> 42 | { explorer-url } = network.api 43 | dec = get-dec network 44 | network = \eos 45 | tx = t.trx_id 46 | amount = t.quantity `div` dec 47 | time = t.timestamp 48 | url = "#{explorer-url}/tx/#{tx}" 49 | fee = 0 `div` dec 50 | from = t.sender 51 | to = t.receiver 52 | { network, tx, amount, fee, time, url, from, to } 53 | export get-transactions = ({ network, address }, cb)-> 54 | return cb null, [] if no-account is address 55 | account-name = address 56 | err, data <- get "#{network.api.api-url}/api?module=account&action=get_account_related_trx_info&apikey=#{apikey}&account=#{account-name}&page=1&size=2&transaction_type=3" 57 | return cb err if err? 58 | return cb data.text if data.body.errno isnt 0 59 | list = data.body.data?trace_list ? [] 60 | transformed = 61 | list |> map transform network 62 | cb null, transformed 63 | get-random-int = (max)-> 64 | Math.floor(Math.random! * Math.floor(max)) 65 | get-random-url = (arr)-> 66 | index = get-random-int arr.length 67 | #arr[index] ? arr.0 68 | arr.2 69 | get-node-url = (node-url)-> 70 | return node-url if typeof! node-url is \String 71 | return get-random-url node-url if typeof! node-url is \Array 72 | null 73 | get-eos = ({ network, account })-> 74 | key-provider = 75 | | account?private-key? => [account.private-key] 76 | | _ => null 77 | config = 78 | chain-id: network.chain-id 79 | key-provider: key-provider 80 | http-endpoint : get-node-url network.api.node-url 81 | sign: key-provider? 82 | broadcast: no 83 | verbose: no 84 | Eos config 85 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, fee-type, tx-type} , cb)-> 86 | return cb "Account is not registered" if account.address is no-account 87 | eos = get-eos { network, account } 88 | broadcast = no 89 | sign = yes 90 | from = account.address 91 | err, tr <- as-callback eos.transfer(from, recipient, amount, data, { broadcast, sign }) 92 | #console.log('created transaction: ', tr) 93 | cb null, tr.transaction 94 | export push-tx = ({ network, rawtx } , cb)--> 95 | eos = get-eos { network } 96 | err, data <- as-callback eos.push-transaction(rawtx) 97 | return cb err if err? 98 | cb null, data 99 | export get-unconfirmed-balance = ({ network, address} , cb)-> 100 | cb "Not Implemented" 101 | export check-tx-status = ({ network, tx }, cb)-> 102 | cb "Not Implemented" 103 | export get-total-received = ({ address, network }, cb)-> 104 | err, txs <- get-transactions { address, network } 105 | total = 106 | txs |> filter (-> it.to is address) 107 | |> map (.amount) 108 | |> foldl plus, 0 109 | cb null, total 110 | export get-balance = ({ network, address }, cb)-> 111 | #address = \helloworldjs 112 | return cb null, 0 if address is no-account 113 | account-name = address 114 | err, data <- get "#{network.api.api-url}/api?module=account&action=get_account_balance&apikey=#{apikey}&account=#{account-name}" .end 115 | return cb err if err? 116 | return cb data.text if data.body.errno isnt 0 117 | balance = data.body.data?balance ? 0 118 | cb null, balance -------------------------------------------------------------------------------- /providers/insight_segwit.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var insight, calcFee, getBitcoinFullpairByIndex, getKeys, createTransaction, pushTx, getTotalReceived, getUnconfirmedBalance, getBalance, checkTxStatus, getTransactions, out$ = typeof exports != 'undefined' && exports || this; 4 | insight = require('./insight.ls'); 5 | out$.calcFee = calcFee = insight.calcFee; 6 | getBitcoinFullpairByIndex = function(mnemonic, index, network){ 7 | var seed, hdnode, address, privateKey, publicKey; 8 | seed = bip39.mnemonicToSeedHex(mnemonic); 9 | hdnode = BitcoinLib.HDNode.fromSeedHex(seed, network).derive(index); 10 | address = hdnode.getAddress(); 11 | privateKey = hdnode.keyPair.toWIF(); 12 | publicKey = hdnode.getPublicKeyBuffer().toString('hex'); 13 | return { 14 | address: address, 15 | privateKey: privateKey, 16 | publicKey: publicKey 17 | }; 18 | }; 19 | out$.getKeys = getKeys = function(arg$, cb){ 20 | var network, mnemonic, index, result, address, ref$; 21 | network = arg$.network, mnemonic = arg$.mnemonic, index = arg$.index; 22 | result = getBitcoinFullpairByIndex(mnemonic, index, network); 23 | console.log('here'); 24 | address = BitcoinLib.payments.p2sh({ 25 | redeem: bitcoin.payments.p2wpkh({ 26 | pubkey: publicKey 27 | }) 28 | }).address; 29 | return cb(null, (ref$ = {}, import$(ref$, result), ref$.address = address, ref$)); 30 | }; 31 | out$.createTransaction = createTransaction = insight.createTransaction; 32 | out$.pushTx = pushTx = insight.pushTx; 33 | out$.getTotalReceived = getTotalReceived = insight.getTotalReceived; 34 | out$.getUnconfirmedBalance = getUnconfirmedBalance = insight.getUnconfirmedBalance; 35 | out$.getBalance = getBalance = insight.getBalance; 36 | out$.checkTxStatus = checkTxStatus = insight.checkTxStatus; 37 | out$.getTransactions = getTransactions = insight.getTransactions; 38 | function import$(obj, src){ 39 | var own = {}.hasOwnProperty; 40 | for (var key in src) if (own.call(src, key)) obj[key] = src[key]; 41 | return obj; 42 | } 43 | }).call(this); 44 | -------------------------------------------------------------------------------- /providers/insight_segwit.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./insight.ls 3 | } 4 | export calc-fee = insight.calc-fee 5 | get-bitcoin-fullpair-by-index = (mnemonic, index, network)-> 6 | seed = bip39.mnemonic-to-seed-hex mnemonic 7 | hdnode = BitcoinLib.HDNode.from-seed-hex(seed, network).derive(index) 8 | address = hdnode.get-address! 9 | private-key = hdnode.key-pair.toWIF! 10 | public-key = hdnode.get-public-key-buffer!.to-string(\hex) 11 | { address, private-key, public-key } 12 | export get-keys = ({ network, mnemonic, index }, cb)-> 13 | result = get-bitcoin-fullpair-by-index mnemonic, index, network 14 | console.log \here 15 | const { address } = BitcoinLib.payments.p2sh do 16 | redeem: bitcoin.payments.p2wpkh { pubkey: public-key } 17 | cb null, { ...result, address } 18 | export create-transaction = insight.create-transaction 19 | export push-tx = insight.push-tx 20 | export get-total-received = insight.get-total-received 21 | export get-unconfirmed-balance = insight.get-unconfirmed-balance 22 | export get-balance = insight.get-balance 23 | export check-tx-status = insight.check-tx-status 24 | export get-transactions = insight.get-transactions -------------------------------------------------------------------------------- /providers/insightzec.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \moment 3 | \prelude-ls : { map, foldl, any, each, find, sum, filter } 4 | \./superagent.js : { get, post } 5 | \../math.js : { plus, minus, div, times } 6 | \bitcoinjs-lib-zcash : BitcoinLib 7 | \../json-parse.js 8 | \../deadline.js 9 | } 10 | export calc-fee = ({ network, tx }, cb)-> 11 | export get-keys = ({ network, mnemonic, index }, cb)-> 12 | extend = (add, json)--> json <<< add 13 | get-dec = (network)-> 14 | { decimals } = network 15 | 10^decimals 16 | add-value = (network, it)--> 17 | dec = get-dec network 18 | it.value = 19 | | it.satoshis? => it.satoshis 20 | | it.amount? => it.amount `times` dec 21 | | _ => 0 22 | get-outputs = ({ network, address} , cb)--> 23 | { url } = network.api 24 | body <- get "#url/api/addr/#{address}/utxo" .then 25 | err, result <- json-parse body.text 26 | return cb err if err? 27 | return cb "Result is not an array" if typeof! result isnt \Array 28 | result 29 | |> each add-value network 30 | |> map extend { network, address } 31 | |> -> cb null, it 32 | export create-transaction = ({ network, account, recipient, amount, amount-fee}, cb)-> 33 | err, outputs <- get-outputs { network, account.address} 34 | return cb err if err? 35 | return cb 'Not Enough Funds (Unspent Outputs)' if outputs.length is 0 36 | is-no-value = 37 | outputs |> find (-> !it.value?) 38 | return cb 'Each output should have a value' if is-no-value 39 | dec = get-dec network 40 | value = amount `times` dec 41 | fee = amount-fee `times` dec 42 | total = 43 | outputs 44 | |> map (.value) 45 | |> sum 46 | return cb 'Total is NaN' if isNaN total 47 | tx = new BitcoinLib.TransactionBuilder network 48 | rest = total `minus` value `minus` fee 49 | tx.add-output recipient, +value 50 | tx.add-output account.address, +rest 51 | apply = (output, i)-> 52 | tx.add-input output.txid, output.vout 53 | sign = (output, i)-> 54 | key = BitcoinLib.ECPair.fromWIF(account.private-key, network) 55 | tx.sign i, key 56 | outputs.for-each apply 57 | outputs.for-each sign 58 | rawtx = tx.build!.to-hex! 59 | cb null, { rawtx } 60 | export push-tx = ({ network, rawtx } , cb)--> 61 | { url } = network.api 62 | res <- post "#url/api/tx/send", { rawtx } .then 63 | return cb res.body if res.bad-request 64 | cb null, res.body 65 | export get-balance = ({ address, network } , cb)-> 66 | return cb "Url is not defined" if not network?api?url? 67 | err, data <-! get "#{network.api.url}/api/addr/#{address}/balance" .end 68 | return cb err if err? or data.text.length is 0 69 | dec = get-dec network 70 | num = data.text `div` dec 71 | cb null, num 72 | transform-tx = (net, t)--> 73 | same-value = (out)-> 74 | parse-float(out.value `minus` t.value-out) is 0 75 | network = net.token 76 | tx = t.txid 77 | time = t.time 78 | amount = t.value-out 79 | fee = t.fees ? 0 80 | to = t.vout?filter?(same-value)?map(-> it.script-pub-key?addresses?0)?0 81 | url = "#{net.api.url}/tx/#{tx}" 82 | { network, tx, amount, fee, time, url, to } 83 | export get-transactions = ({ network, address}, cb)-> 84 | return cb "Url is not defined" if not network?api?url? 85 | err, data <-! get "#{network.api.url}/api/txs/?address=#{address}" .end 86 | return cb err if err? 87 | err, result <- json-parse data.text 88 | return cb err if err? 89 | return cb "Unexpected result" if typeof! result?txs isnt \Array 90 | txs = 91 | result.txs |> map transform-tx network 92 | cb null, txs -------------------------------------------------------------------------------- /providers/interface.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web3space/web3t/0c7773f0cc2cbf7a375199396dbdd0c046eeec54/providers/interface.js -------------------------------------------------------------------------------- /providers/liqpay.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | 4 | }).call(this); 5 | -------------------------------------------------------------------------------- /providers/liqpay.ls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web3space/web3t/0c7773f0cc2cbf7a375199396dbdd0c046eeec54/providers/liqpay.ls -------------------------------------------------------------------------------- /providers/qiwi.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \node-qiwi-api : { Qiwi } 3 | \prelude-ls : { map, find, split, map } 4 | \../math.js : { div, times, plus, minus } 5 | \moment 6 | } 7 | export calc-fee = ({ network, fee-type, account, amount, to, data }, cb)-> 8 | fixed = 50 9 | return cb null, fixed if +amount is 0 10 | def = fixed `plus` ((amount `div` 100) `times` 2) 11 | #return cb null, def if (to ? "").length is 0 12 | cb null, def 13 | #err, api <- get-api network.private-key 14 | #return cb err if err? 15 | #err, fee <- api.check-comission to 16 | #return cb err if err? 17 | #res = 18 | # | fee.rate? => (amount `div` 100) `times` fee.rate 19 | # | _ => fee.fixed 20 | #cb null, res 21 | export get-keys = ({ network, mnemonic, index }, cb)-> 22 | err, api <- get-api network.private-key 23 | return cb err if err? 24 | err, info <- api.get-account-info 25 | return cb err if err? 26 | address = \+ + info.contract-info?contract-id 27 | cb null, { network.private-key , address } 28 | transform-tx = (network, t)--> 29 | { url } = network.api 30 | tx = t.txnId 31 | amount = t.total.amount 32 | time = moment(t.date).utc!.unix! 33 | fee = t.commission.amount 34 | from = if t.type is 'OUT' then t.personId else t.account 35 | to = if t.type is 'OUT' then t.account else t.personId 36 | { network: 'qiwi', tx, amount, fee, time, url, t.from, t.to } 37 | export get-transactions = ({ network, address }, cb)-> 38 | err, api <- get-api network.private-key 39 | return cb err if err? 40 | sources = 41 | | network.currency is 643 => <[ QW_RUB ]> 42 | | _ => [] 43 | err, info <- api.get-operation-history { rows: 25, sources } 44 | return cb err if err? 45 | return cb "expected array" if typeof! info.data isnt \Array 46 | txs = 47 | info.data |> map transform-tx network 48 | cb null, txs 49 | get-dec = (network)-> 50 | { decimals } = network 51 | 10^decimals 52 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, fee-type, tx-type} , cb)--> 53 | err, balance <- get-balance { network, account.address } 54 | return cb err if err? 55 | rest = balance `minus` (amount `plus` amount-fee) 56 | return cb "Balance is not enough to send this amount" if +rest < 0 57 | return cb err if err? 58 | rawtx = "#{amount} -> #{recipient}" 59 | cb null, { rawtx } 60 | export push-tx = ({ network, rawtx } , cb)--> 61 | return cb "rawtx should be an string" if typeof! rawtx isnt \String 62 | [amount, account] = 63 | rawtx |> split '->' 64 | |> map -> it.trim! 65 | err, api <- get-api network.private-key 66 | return cb err if err? 67 | data = { amount, comment: 'Money Transfer', account } 68 | send-name = 69 | | account.match(/^[0-9]{16}$/) => \toCard 70 | | account.match(/^\+[0-9]{10}$/) => \toWallet 71 | | account.match(/^[0-9]{10}$/) => \toMobilePhone 72 | | _ => \toWallet 73 | #console.log [amount, account], send-name 74 | err, data <- api[send-name] data 75 | #console.log { err ,data } 76 | return cb err if err? 77 | return cb data.message if data.code is \QWPRC-319 78 | tx = data.transaction.id 79 | cb null, { tx, ...data } 80 | export get-total-received = ({ address, network }, cb)-> 81 | get-api = (private-key, cb)-> 82 | api = new Qiwi private-key 83 | cb null, api 84 | export get-balance = ({ network, address } , cb)-> 85 | return cb "private key is required" if not network?private-key? 86 | err, api <- get-api network.private-key 87 | return cb err if err? 88 | err, info <- api.get-balance 89 | return cb err if err? 90 | account = 91 | info.accounts |> find (.currency is network.currency) 92 | return cb null, 0 if not account? 93 | cb null, account.balance.amount -------------------------------------------------------------------------------- /providers/ripple.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./superagent.js 3 | \ripple-keypairs : { derive-keypair, derive-address, generate-seed } 4 | \big.js : big 5 | \hash.js : hashjs 6 | \prelude-ls : { map } 7 | } 8 | 9 | deadline = 15000 10 | 11 | query = ({ network, method, params }, cb)-> 12 | req = superagent.post network.api.api-url .send { method, params } 13 | err, res <- req.timeout(deadline).end 14 | return cb err if err? 15 | if not res.body 16 | err = Error 'no response' 17 | err.code = res.status 18 | if res.status isnt 200 19 | err = Error res.body 20 | err.code = res.status 21 | result = void 22 | if res.body.error 23 | err = Error res.body.error 24 | err.code = res.status 25 | result = res.body 26 | else 27 | result = res.body.result 28 | cb && cb err, result 29 | 30 | 31 | export calc-fee = ({ network, tx }, cb)-> 32 | cb null 33 | export get-keys = ({ network, mnemonic, index }, cb)-> 34 | entropy = (hashjs.sha512!.update "#mnemonic / #index").digest!.slice 0, 32 35 | secret = generate-seed { entropy } 36 | keypair = derive-keypair secret 37 | address = derive-address keypair.public-key 38 | cb null, { address, secret } 39 | export push-tx = ({ rawtx, network } , cb)--> 40 | data = 41 | method: \submit 42 | params: [{ tx_blob: rawtx }] 43 | network: network 44 | err, res <- query data 45 | return cb err if err? 46 | cb null 47 | export get-balance = ({ address } , cb)-> 48 | err, data <- get "https://data.ripple.com/v2/accounts/#{address}/balances" 49 | cb err, data 50 | transform-tx = (network, tx)--> 51 | #https://xrpcharts.ripple.com/#/transactions/8D51797E60C2E87FAE2B771EDD63809D30055F213408A93B594155FBE85743CF 52 | tx 53 | export get-transactions = ({ address, network }, cb)-> 54 | account = address 55 | data = 56 | method: \account_tx 57 | params: [{ account }] 58 | network: network 59 | err, res <- query data 60 | return cb err if err? 61 | txs = 62 | res.transactions |> map transform-tx 63 | cb null, txs 64 | export get-unconfirmed-balance = ({ network, address} , cb)-> 65 | cb "Not Implemented" 66 | export check-tx-status = ({ network, tx }, cb)-> 67 | cb "Not Implemented" 68 | export get-total-received = ({ address, network }, cb)-> 69 | cb "Not Implemented" 70 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, tx-type} , cb)--> 71 | tx_json = 72 | Account: account.address 73 | Destination: recipient 74 | Amount: big(amount).mul(10^6).to-fixed! 75 | TransactionType: \Payment 76 | secret = account.private-key 77 | data = 78 | method: \sign 79 | params: [{ secret, tx_json }] 80 | network: network 81 | err, res <- query data 82 | return cb err if err? 83 | cb null, res -------------------------------------------------------------------------------- /providers/rst.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var eth, ref$, plus, minus, times, div, fromHex, utils, isAddress, isChecksumAddress, toHexString, stringToHex, calcFee, createTransaction; 4 | eth = require('./eth.js'); 5 | ref$ = require('../math.js'), plus = ref$.plus, minus = ref$.minus, times = ref$.times, div = ref$.div, fromHex = ref$.fromHex; 6 | utils = require('ethers').utils; 7 | isAddress = function(address){ 8 | if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) { 9 | return false; 10 | } else { 11 | if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) { 12 | return true; 13 | } else { 14 | return isChecksumAddress(address); 15 | } 16 | } 17 | }; 18 | isChecksumAddress = function(address){ 19 | var addressHash, i; 20 | address = address.replace('0x', ''); 21 | addressHash = sha3(address.toLowerCase()); 22 | i = 0; 23 | while (i < 40) { 24 | if (parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i] || parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i]) { 25 | return false; 26 | } 27 | i++; 28 | } 29 | return true; 30 | }; 31 | toHexString = function(byteArray){ 32 | return Array.from(byteArray, function(byte){ 33 | return ('0' + (byte & 255).toString(16)).slice(-2); 34 | }).join(''); 35 | }; 36 | stringToHex = function(str){ 37 | return function(it){ 38 | return "0x" + it; 39 | }( 40 | toHexString( 41 | utils.toUtf8Bytes( 42 | str))); 43 | }; 44 | calcFee = function(arg$, cb){ 45 | var network, feeType, account, amount, to, data, ref$, ref1$, fixed, def; 46 | network = arg$.network, feeType = arg$.feeType, account = arg$.account, amount = arg$.amount, to = arg$.to, data = arg$.data; 47 | if (isAddress(to)) { 48 | return cb(null, 0); 49 | } 50 | if (((ref$ = network.txFeeOptions) != null ? ref$.withdraw : void 8) === 0) { 51 | return cb(null, 0); 52 | } 53 | if (((ref1$ = network.txFeeOptions) != null ? ref1$.withdraw : void 8) !== "50 + 2%") { 54 | return cb("unsupported tx option"); 55 | } 56 | fixed = 50; 57 | if (+amount === 0) { 58 | return cb(null, fixed); 59 | } 60 | def = plus(fixed, times(div(amount, 100), 2)); 61 | return cb(null, def); 62 | }; 63 | createTransaction = curry$(function(config, cb){ 64 | var recipient, data, ref$; 65 | if (config.recipient == null) { 66 | return cb("config.recipient is required"); 67 | } 68 | recipient = config.recipient; 69 | recipient = (function(){ 70 | switch (false) { 71 | case !isAddress(config.recipient): 72 | return config.recipient; 73 | default: 74 | return config.account.address; 75 | } 76 | }()); 77 | data = (function(){ 78 | switch (false) { 79 | case !isAddress(config.recipient): 80 | return config.data; 81 | default: 82 | return stringToHex(config.recipient); 83 | } 84 | }()); 85 | return eth.createTransaction((ref$ = {}, import$(ref$, config), ref$.recipient = recipient, ref$.data = data, ref$), cb); 86 | }); 87 | module.exports = (ref$ = {}, import$(ref$, eth), ref$.createTransaction = createTransaction, ref$.calcFee = calcFee, ref$); 88 | function import$(obj, src){ 89 | var own = {}.hasOwnProperty; 90 | for (var key in src) if (own.call(src, key)) obj[key] = src[key]; 91 | return obj; 92 | } 93 | function curry$(f, bound){ 94 | var context, 95 | _curry = function(args) { 96 | return f.length > 1 ? function(){ 97 | var params = args ? args.concat() : []; 98 | context = bound ? context || this : this; 99 | return params.push.apply(params, arguments) < 100 | f.length && arguments.length ? 101 | _curry.call(context, params) : f.apply(context, params); 102 | } : f; 103 | }; 104 | return _curry(); 105 | } 106 | }).call(this); 107 | -------------------------------------------------------------------------------- /providers/rst.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./eth.js 3 | \../math.js : { plus, minus, times, div, from-hex } 4 | \ethers : { utils } 5 | } 6 | is-address = (address) -> 7 | if not //^(0x)?[0-9a-f]{40}$//i.test address 8 | false 9 | else 10 | if (//^(0x)?[0-9a-f]{40}$//.test address) or //^(0x)?[0-9A-F]{40}$//.test address then true else isChecksumAddress address 11 | is-checksum-address = (address) -> 12 | address = address.replace '0x', '' 13 | addressHash = sha3 address.toLowerCase! 14 | i = 0 15 | while i < 40 16 | return false if (parseInt addressHash[i], 16) > 7 and address[i].toUpperCase! isnt address[i] or (parseInt addressHash[i], 16) <= 7 and address[i].toLowerCase! isnt address[i] 17 | i++ 18 | true 19 | toHexString = (byteArray) -> (Array.from byteArray, (byte) -> ('0' + (byte .&. 255).toString 16).slice -2).join '' 20 | string-to-hex = (str)-> 21 | str 22 | |> utils.toUtf8Bytes 23 | |> toHexString 24 | |> -> "0x#{it}" 25 | calc-fee = ({ network, fee-type, account, amount, to, data }, cb)-> 26 | return cb null, 0 if is-address to 27 | return cb null, 0 if network.tx-fee-options?withdraw is 0 28 | return cb "unsupported tx option" if network.tx-fee-options?withdraw isnt "50 + 2%" 29 | fixed = 50 30 | return cb null, fixed if +amount is 0 31 | def = fixed `plus` ((amount `div` 100) `times` 2) 32 | #return cb null, def if (to ? "").length is 0 33 | cb null, def 34 | #err, api <- get-api network.private-key 35 | #return cb err if err? 36 | #err, fee <- api.check-comission to 37 | #return cb err if err? 38 | #res = 39 | # | fee.rate? => (amount `div` 100) `times` fee.rate 40 | # | _ => fee.fixed 41 | #cb null, res 42 | create-transaction = (config , cb)--> 43 | #console.log \create-transaction, config 44 | return cb "config.recipient is required" if not config.recipient? 45 | { recipient } = config 46 | recipient = 47 | | is-address config.recipient => config.recipient 48 | | _ => config.account.address 49 | data = 50 | | is-address config.recipient => config.data 51 | | _ => string-to-hex config.recipient 52 | eth.create-transaction { ...config, recipient, data }, cb 53 | module.exports = { ...eth, create-transaction, calc-fee } -------------------------------------------------------------------------------- /providers/stellar.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var ref$, post, get, map, find, sdk, hd, calcFee, noAccount, getKeys, transformTx, getUnconfirmedBalance, getTransactions, createTransaction, pushTx, checkTxStatus, getTotalReceived, getBalance, out$ = typeof exports != 'undefined' && exports || this; 4 | ref$ = require('superagent'), post = ref$.post, get = ref$.get; 5 | ref$ = require('prelude-ls'), map = ref$.map, find = ref$.find; 6 | sdk = require('stellar-sdk'); 7 | hd = require('stellar-hd-wallet'); 8 | out$.calcFee = calcFee = function(arg$, cb){ 9 | var network, tx; 10 | network = arg$.network, tx = arg$.tx; 11 | return cb(null); 12 | }; 13 | noAccount = null; 14 | out$.getKeys = getKeys = function(arg$, cb){ 15 | var network, mnemonic, index, wallet, publicKey, privateKey, address, err; 16 | network = arg$.network, mnemonic = arg$.mnemonic, index = arg$.index; 17 | try { 18 | wallet = hd.fromMnemonic(mnemonic); 19 | publicKey = wallet.getPublicKey(index); 20 | privateKey = wallet.getSecret(index); 21 | address = null; 22 | return cb(null, { 23 | publicKey: publicKey, 24 | privateKey: privateKey, 25 | address: address 26 | }); 27 | } catch (e$) { 28 | err = e$; 29 | return cb(err); 30 | } 31 | }; 32 | transformTx = curry$(function(network, t){ 33 | var explorerUrl, dec, tx, amount, time, url, fee, from, to; 34 | explorerUrl = network.api.explorerUrl; 35 | dec = getDec(network); 36 | network = 'xlm'; 37 | tx = t.trx_id; 38 | amount = div(t.quantity, dec); 39 | time = t.timestamp; 40 | url = explorerUrl + "/tx/" + tx; 41 | fee = div(0, dec); 42 | from = t.sender; 43 | to = t.receiver; 44 | return { 45 | network: network, 46 | tx: tx, 47 | amount: amount, 48 | fee: fee, 49 | time: time, 50 | url: url, 51 | from: from, 52 | to: to 53 | }; 54 | }); 55 | out$.getUnconfirmedBalance = getUnconfirmedBalance = function(arg$, cb){ 56 | var network, address; 57 | network = arg$.network, address = arg$.address; 58 | return cb("Not Implemented"); 59 | }; 60 | out$.getTransactions = getTransactions = function(arg$, cb){ 61 | var network, address; 62 | network = arg$.network, address = arg$.address; 63 | return cb("Not Implemented"); 64 | }; 65 | out$.createTransaction = createTransaction = curry$(function(arg$, cb){ 66 | var network, account, recipient, amount, amountFee, data, feeType, txType; 67 | network = arg$.network, account = arg$.account, recipient = arg$.recipient, amount = arg$.amount, amountFee = arg$.amountFee, data = arg$.data, feeType = arg$.feeType, txType = arg$.txType; 68 | return cb("Not Implemented"); 69 | }); 70 | out$.pushTx = pushTx = curry$(function(arg$, cb){ 71 | var network, rawtx; 72 | network = arg$.network, rawtx = arg$.rawtx; 73 | return cb("Not Implemented"); 74 | }); 75 | out$.checkTxStatus = checkTxStatus = function(arg$, cb){ 76 | var network, tx; 77 | network = arg$.network, tx = arg$.tx; 78 | return cb("Not Implemented"); 79 | }; 80 | out$.getTotalReceived = getTotalReceived = function(arg$, cb){ 81 | var address, network; 82 | address = arg$.address, network = arg$.network; 83 | return cb("Not Implemented"); 84 | }; 85 | out$.getBalance = getBalance = function(arg$, cb){ 86 | var network, address; 87 | network = arg$.network, address = arg$.address; 88 | cb("Not Implemented"); 89 | return get(network.api.apiUrl + "/accounts/{address}").end(function(err, data){ 90 | var balance, xlmBalance, ref$; 91 | if (err != null) { 92 | return cb(err); 93 | } 94 | balance = find(function(it){ 95 | return it.asset_code === 'XLM'; 96 | })( 97 | data.body.balances); 98 | xlmBalance = (ref$ = balance != null ? balance.balance : void 8) != null ? ref$ : 0; 99 | return cb(null, xlmBalance); 100 | }); 101 | }; 102 | function curry$(f, bound){ 103 | var context, 104 | _curry = function(args) { 105 | return f.length > 1 ? function(){ 106 | var params = args ? args.concat() : []; 107 | context = bound ? context || this : this; 108 | return params.push.apply(params, arguments) < 109 | f.length && arguments.length ? 110 | _curry.call(context, params) : f.apply(context, params); 111 | } : f; 112 | }; 113 | return _curry(); 114 | } 115 | }).call(this); 116 | -------------------------------------------------------------------------------- /providers/stellar.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \superagent : { post, get } 3 | \prelude-ls : { map, find } 4 | \stellar-sdk : sdk 5 | \stellar-hd-wallet : hd 6 | } 7 | #https://stellar.github.io/js-stellar-sdk/ 8 | #https://github.com/chatch/stellar-hd-wallet 9 | #https://www.stellar.org/developers/horizon/reference/endpoints/transactions-create.html 10 | export calc-fee = ({ network, tx }, cb)-> 11 | cb null 12 | no-account = null 13 | export get-keys = ({ network, mnemonic, index }, cb)-> 14 | try 15 | wallet = hd.from-mnemonic mnemonic 16 | public-key = wallet.get-public-key index 17 | private-key = wallet.get-secret index 18 | address = null 19 | cb null, { public-key, private-key, address } 20 | catch err 21 | cb err 22 | transform-tx = (network, t)--> 23 | { explorer-url } = network.api 24 | dec = get-dec network 25 | network = \xlm 26 | tx = t.trx_id 27 | amount = t.quantity `div` dec 28 | time = t.timestamp 29 | url = "#{explorer-url}/tx/#{tx}" 30 | fee = 0 `div` dec 31 | from = t.sender 32 | to = t.receiver 33 | { network, tx, amount, fee, time, url, from, to } 34 | export get-unconfirmed-balance = ({ network, address} , cb)-> 35 | cb "Not Implemented" 36 | export get-transactions = ({ network, address }, cb)-> 37 | cb "Not Implemented" 38 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, fee-type, tx-type} , cb)--> 39 | cb "Not Implemented" 40 | export push-tx = ({ network, rawtx } , cb)--> 41 | cb "Not Implemented" 42 | export check-tx-status = ({ network, tx }, cb)-> 43 | cb "Not Implemented" 44 | export get-total-received = ({ address, network }, cb)-> 45 | cb "Not Implemented" 46 | export get-balance = ({ network, address }, cb)-> 47 | cb "Not Implemented" 48 | err, data <- get "#{network.api.api-url}/accounts/{address}" .end 49 | return cb err if err? 50 | balance = 51 | data.body.balances |> find (.asset_code is \XLM) 52 | xlm-balance = balance?balance ? 0 53 | cb null, xlm-balance -------------------------------------------------------------------------------- /providers/superagent-adapter.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \cross-fetch : fetch 3 | \tor-request : tor 4 | \qs : { stringify } 5 | } 6 | json-parse = (text, cb)-> 7 | try 8 | cb null, JSON.parse(text) 9 | catch err 10 | cb err 11 | json-stringify = (model, cb)-> 12 | try 13 | cb null, JSON.stringify(model) 14 | catch err 15 | cb err 16 | as-callback = (p, cb)-> 17 | #p.then (res)-> res 18 | p.catch (err) -> cb err 19 | p.then (data)-> 20 | cb null, data 21 | form-encoded = (data, cb)-> 22 | res = stringify data 23 | cb null, res 24 | get-body = (headers, data, cb)-> 25 | return json-stringify data, cb if headers["Content-Type"] is "application/json" 26 | return form-encoded data, cb if headers["Content-Type"] is "application/x-www-form-urlencoded" 27 | cb "header #{headers['Content-Type']} is not supported" 28 | make-body = (method, headers, data, cb)-> 29 | return cb null if method not in <[ POST PUT ]> 30 | err, body <- get-body headers, data 31 | return cb err if err? 32 | cb null, { method, body, headers } 33 | get-type = (type)-> 34 | | type is "application/json" => "application/json" 35 | | type is "json" => "application/json" 36 | | type is "form" => "application/x-www-form-urlencoded" 37 | | _ => type 38 | clear-timer = (cb)-> 39 | delete cb.timer 40 | clear-timeout cb.timer 41 | reset-request = (cb)-> -> 42 | return console.log('ignored reset') if not cb.timer? 43 | clear-timer cb 44 | cb "Deadline was reached" 45 | get-cb-with-deadline = (timeout, cb)-> 46 | return cb "timeout.deadline is expected" if typeof! timeout.deadline isnt \Number 47 | cb.timer = set-timeout reset-request(cb), timeout.deadline 48 | (err, data)-> 49 | return console.log('ignored response') if not cb.timer? 50 | clear-timer cb 51 | cb err, data 52 | make-cross-api = (method)-> (url, data)-> 53 | $ = {} 54 | headers = { 55 | "Content-Type": "application/json" 56 | } 57 | $._timeout = 58 | deadline: 30000 59 | $.type = (type)-> 60 | headers["Content-Type"] = get-type type 61 | $.timeout = (timeout)-> 62 | $._timeout = timeout 63 | $ 64 | $.set = (header, value)-> 65 | headers[header] = value 66 | $ 67 | $.end = (fcb)-> 68 | real-data = data ? {} 69 | cb = get-cb-with-deadline $._timeout , fcb 70 | err, body <- make-body method, headers, real-data 71 | return cb err if err? 72 | p = fetch url, body 73 | err, data <- as-callback p 74 | return cb err if err? 75 | return cb "expected data" if not data? 76 | err, text <- as-callback data.text! 77 | return cb err if err? 78 | err, body <- json-parse text 79 | #return cb err if err? 80 | cb null, { body, text } 81 | $ 82 | $ 83 | make-tor-api = (method)-> (url, data)-> 84 | $ = {} 85 | headers = { 86 | "Content-Type": "application/json" 87 | } 88 | $.type = (type)-> 89 | headers["Content-Type"] = get-type type 90 | $.timeout = (timeout)-> 91 | $._timeout = timeout 92 | $ 93 | $.set = (header, value)-> 94 | headers[header] = value 95 | $ 96 | $.end = (cb)-> 97 | real-data = data ? {} 98 | err, body <- make-body method, headers, real-data 99 | return cb err if err? 100 | tor.setTorAddress("localhost", "9050") 101 | err, res, text <- tor.request url, body 102 | err, body <- json-parse text 103 | #return cb err if err? 104 | console.log \make-tor-request, method, url, err, body 105 | cb null, { body, text } 106 | $ 107 | $ 108 | module.exports = 109 | all: 110 | post : make-cross-api \POST 111 | get : make-cross-api \GET 112 | put : make-cross-api \PUT 113 | tor: 114 | post : make-tor-api \POST 115 | get : make-tor-api \GET 116 | put : make-tor-api \PUT 117 | type: \all -------------------------------------------------------------------------------- /providers/superagent.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var superagent, crossFetch, ref$, keys, each, addSets, tryWithPow, buildRequest, post, put, get, out$ = typeof exports != 'undefined' && exports || this; 4 | superagent = require('./superagent-adapter.js'); 5 | crossFetch = require('cross-fetch'); 6 | ref$ = require('prelude-ls'), keys = ref$.keys, each = ref$.each; 7 | addSets = function(instance, sets){ 8 | if (sets == null) { 9 | return; 10 | } 11 | return each(function(it){ 12 | return instance.set(it, sets[it]); 13 | })( 14 | keys( 15 | sets)); 16 | }; 17 | tryWithPow = function(instance, data, cb){ 18 | var nonce, complexity; 19 | nonce = data.headers['pow-nonce']; 20 | complexity = data.headers['pow-complexity']; 21 | return cb("Not Implemented"); 22 | if (typeof err != 'undefined' && err !== null) { 23 | return cb(err); 24 | } 25 | return instance.set('pow-result', result).end(cb); 26 | }; 27 | buildRequest = function(method){ 28 | return function(){ 29 | var args, res$, i$, to$, originalRequest, $; 30 | res$ = []; 31 | for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) { 32 | res$.push(arguments[i$]); 33 | } 34 | args = res$; 35 | originalRequest = superagent[superagent.type][method]; 36 | $ = {}; 37 | $.timeout = function(timeout){ 38 | $._timeout = timeout; 39 | return $; 40 | }; 41 | $.type = function(type){ 42 | $._type = type; 43 | return $; 44 | }; 45 | $.set = function(name, value){ 46 | var ref$; 47 | $._set = (ref$ = $._set) != null 48 | ? ref$ 49 | : {}; 50 | $._set[name] = value; 51 | return $; 52 | }; 53 | $.end = function(cb){ 54 | var instance; 55 | instance = originalRequest.apply(originalRequest, args); 56 | if ($._type != null) { 57 | instance.type($._type); 58 | } 59 | if ($._timeout != null) { 60 | instance.timeout($._timeout); 61 | } 62 | addSets(instance, $._set); 63 | return instance.end(function(err, data){ 64 | if ((data != null ? data.status : void 8) === 401 && data.headers['www-authenticate'] === 'pow') { 65 | return tryWithPow(instance, data, cb); 66 | } 67 | if ((data != null ? data.status : void 8) >= 400) { 68 | return cb(err, data); 69 | } 70 | return cb(err, data); 71 | }); 72 | }; 73 | return $; 74 | }; 75 | }; 76 | out$.post = post = buildRequest('post'); 77 | out$.put = put = buildRequest('put'); 78 | out$.get = get = buildRequest('get'); 79 | }).call(this); 80 | -------------------------------------------------------------------------------- /providers/superagent.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./superagent-adapter.js : superagent 3 | \cross-fetch 4 | #\../pow/pow-solve.js 5 | \prelude-ls : { keys, each } 6 | } 7 | add-sets = (instance, sets)-> 8 | return if not sets? 9 | sets |> keys |> each (-> instance.set(it, sets[it]) ) 10 | try-with-pow = (instance, data, cb)-> 11 | nonce = data.headers[\pow-nonce] 12 | complexity = data.headers[\pow-complexity] 13 | return cb "Not Implemented" 14 | #err, result <- pow-solve { nonce, complexity } 15 | return cb err if err? 16 | instance.set(\pow-result, result).end cb 17 | build-request = (method)-> (...args)-> 18 | #console.log \superagent.type , superagent.type 19 | original-request = superagent[superagent.type][method] 20 | $ = {} 21 | $.timeout = (timeout)-> 22 | $._timeout = timeout 23 | $ 24 | $.type = (type)-> 25 | $._type = type 26 | $ 27 | $.set = (name, value)-> 28 | $._set = $._set ? {} 29 | $._set[name] = value 30 | $ 31 | $.end = (cb)-> 32 | instance = original-request.apply(original-request, args) 33 | instance.type($._type) if $._type? 34 | instance.timeout($._timeout) if $._timeout? 35 | add-sets instance, $._set 36 | err, data <- instance.end 37 | return try-with-pow instance, data, cb if data?status is 401 and data.headers[\www-authenticate] is \pow 38 | return cb err, data if data?status >= 400 39 | cb err, data 40 | $ 41 | export post = build-request \post 42 | export put = build-request \put 43 | export get = build-request \get -------------------------------------------------------------------------------- /providers/tron.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var ref$, post, get, map, calcFee, noAccount, getKeys, transformTx, getTransactions, createTransaction, pushTx, checkTxStatus, getTotalReceived, getUnconfirmedBalance, getBalance, out$ = typeof exports != 'undefined' && exports || this; 4 | ref$ = require('./superagent.js'), post = ref$.post, get = ref$.get; 5 | map = require('prelude-ls').map; 6 | out$.calcFee = calcFee = function(arg$, cb){ 7 | var network, tx; 8 | network = arg$.network, tx = arg$.tx; 9 | return cb(null); 10 | }; 11 | noAccount = null; 12 | out$.getKeys = getKeys = function(arg$, cb){ 13 | var network, mnemonic, index; 14 | network = arg$.network, mnemonic = arg$.mnemonic, index = arg$.index; 15 | return cb("Not Implemented"); 16 | }; 17 | transformTx = curry$(function(network, t){ 18 | var explorerUrl, dec, tx, amount, time, url, fee, from, to; 19 | explorerUrl = network.api.explorerUrl; 20 | dec = getDec(network); 21 | network = 'trx'; 22 | tx = t.trx_id; 23 | amount = div(t.quantity, dec); 24 | time = t.timestamp; 25 | url = explorerUrl + "/tx/" + tx; 26 | fee = div(0, dec); 27 | from = t.sender; 28 | to = t.receiver; 29 | return { 30 | network: network, 31 | tx: tx, 32 | amount: amount, 33 | fee: fee, 34 | time: time, 35 | url: url, 36 | from: from, 37 | to: to 38 | }; 39 | }); 40 | out$.getTransactions = getTransactions = function(arg$, cb){ 41 | var network, address; 42 | network = arg$.network, address = arg$.address; 43 | return cb("Not Implemented"); 44 | }; 45 | out$.createTransaction = createTransaction = curry$(function(arg$, cb){ 46 | var network, account, recipient, amount, amountFee, data, feeType, txType; 47 | network = arg$.network, account = arg$.account, recipient = arg$.recipient, amount = arg$.amount, amountFee = arg$.amountFee, data = arg$.data, feeType = arg$.feeType, txType = arg$.txType; 48 | return cb("Not Implemented"); 49 | }); 50 | out$.pushTx = pushTx = curry$(function(arg$, cb){ 51 | var network, rawtx; 52 | network = arg$.network, rawtx = arg$.rawtx; 53 | return cb("Not Implemented"); 54 | }); 55 | out$.checkTxStatus = checkTxStatus = function(arg$, cb){ 56 | var network, tx; 57 | network = arg$.network, tx = arg$.tx; 58 | return cb("Not Implemented"); 59 | }; 60 | out$.getTotalReceived = getTotalReceived = function(arg$, cb){ 61 | var address, network; 62 | address = arg$.address, network = arg$.network; 63 | return cb("Not Implemented"); 64 | }; 65 | out$.getUnconfirmedBalance = getUnconfirmedBalance = function(arg$, cb){ 66 | var network, address; 67 | network = arg$.network, address = arg$.address; 68 | return cb("Not Implemented"); 69 | }; 70 | out$.getBalance = getBalance = function(arg$, cb){ 71 | var network, address; 72 | network = arg$.network, address = arg$.address; 73 | return cb("Not Implemented"); 74 | }; 75 | function curry$(f, bound){ 76 | var context, 77 | _curry = function(args) { 78 | return f.length > 1 ? function(){ 79 | var params = args ? args.concat() : []; 80 | context = bound ? context || this : this; 81 | return params.push.apply(params, arguments) < 82 | f.length && arguments.length ? 83 | _curry.call(context, params) : f.apply(context, params); 84 | } : f; 85 | }; 86 | return _curry(); 87 | } 88 | }).call(this); 89 | -------------------------------------------------------------------------------- /providers/tron.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./superagent.js : { post, get } 3 | \prelude-ls : { map } 4 | } 5 | export calc-fee = ({ network, tx }, cb)-> 6 | cb null 7 | no-account = null 8 | export get-keys = ({ network, mnemonic, index }, cb)-> 9 | cb "Not Implemented" 10 | transform-tx = (network, t)--> 11 | { explorer-url } = network.api 12 | dec = get-dec network 13 | network = \trx 14 | tx = t.trx_id 15 | amount = t.quantity `div` dec 16 | time = t.timestamp 17 | url = "#{explorer-url}/tx/#{tx}" 18 | fee = 0 `div` dec 19 | from = t.sender 20 | to = t.receiver 21 | { network, tx, amount, fee, time, url, from, to } 22 | export get-transactions = ({ network, address }, cb)-> 23 | cb "Not Implemented" 24 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, fee-type, tx-type} , cb)--> 25 | cb "Not Implemented" 26 | export push-tx = ({ network, rawtx } , cb)--> 27 | cb "Not Implemented" 28 | export check-tx-status = ({ network, tx }, cb)-> 29 | cb "Not Implemented" 30 | export get-total-received = ({ address, network }, cb)-> 31 | cb "Not Implemented" 32 | export get-unconfirmed-balance = ({ network, address} , cb)-> 33 | cb "Not Implemented" 34 | export get-balance = ({ network, address }, cb)-> 35 | cb "Not Implemented" -------------------------------------------------------------------------------- /providers/waves.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var get, div, jsonParse, deadline, calcFee, getKeys, createTransaction, pushTx, getUnconfirmedBalance, getBalance, checkTxStatus, getTotalReceived, getTransactions, out$ = typeof exports != 'undefined' && exports || this; 4 | get = require('./superagent.js').get; 5 | div = require('../math.js').div; 6 | jsonParse = require('../json-parse.js'); 7 | deadline = require('../deadline.js'); 8 | out$.calcFee = calcFee = function(arg$, cb){ 9 | var network, tx; 10 | network = arg$.network, tx = arg$.tx; 11 | return cb(null); 12 | }; 13 | out$.getKeys = getKeys = function(arg$, cb){ 14 | var network, mnemonic, index; 15 | network = arg$.network, mnemonic = arg$.mnemonic, index = arg$.index; 16 | return cb("Not implemented"); 17 | }; 18 | out$.createTransaction = createTransaction = curry$(function(arg$, cb){ 19 | var account, recipient, amount, amountFee; 20 | account = arg$.account, recipient = arg$.recipient, amount = arg$.amount, amountFee = arg$.amountFee; 21 | return cb("Not implemented"); 22 | }); 23 | out$.pushTx = pushTx = curry$(function(arg$, cb){ 24 | var network, rawtx; 25 | network = arg$.network, rawtx = arg$.rawtx; 26 | return cb("Not implemented"); 27 | }); 28 | out$.getUnconfirmedBalance = getUnconfirmedBalance = function(arg$, cb){ 29 | var network, address; 30 | network = arg$.network, address = arg$.address; 31 | return cb("Not Implemented"); 32 | }; 33 | out$.getBalance = getBalance = function(arg$, cb){ 34 | var address; 35 | address = arg$.address; 36 | return get("https://nodes.wavesnodes.com/addresses/balance/" + address).timeout({ 37 | deadline: deadline 38 | }).end(function(err, res){ 39 | if (err != null) { 40 | return cb(err); 41 | } 42 | return jsonParse(res.text, function(err, result){ 43 | var balance; 44 | if (err != null) { 45 | return cb(err); 46 | } 47 | if ((result != null ? result.balance : void 8) == null) { 48 | return cb("Balance is not available"); 49 | } 50 | balance = div(result.balance, 100000000); 51 | return cb(null, balance); 52 | }); 53 | }); 54 | }; 55 | out$.checkTxStatus = checkTxStatus = function(arg$, cb){ 56 | var network, tx; 57 | network = arg$.network, tx = arg$.tx; 58 | return cb("Not Implemented"); 59 | }; 60 | out$.getTotalReceived = getTotalReceived = function(arg$, cb){ 61 | var address, network; 62 | address = arg$.address, network = arg$.network; 63 | return cb("Not Implemented"); 64 | }; 65 | out$.getTransactions = getTransactions = function(arg$, cb){ 66 | var network, address; 67 | network = arg$.network, address = arg$.address; 68 | return cb(null, []); 69 | }; 70 | function curry$(f, bound){ 71 | var context, 72 | _curry = function(args) { 73 | return f.length > 1 ? function(){ 74 | var params = args ? args.concat() : []; 75 | context = bound ? context || this : this; 76 | return params.push.apply(params, arguments) < 77 | f.length && arguments.length ? 78 | _curry.call(context, params) : f.apply(context, params); 79 | } : f; 80 | }; 81 | return _curry(); 82 | } 83 | }).call(this); 84 | -------------------------------------------------------------------------------- /providers/waves.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./superagent.js : { get } 3 | \../math.js : { div } 4 | \../json-parse.js 5 | \../deadline.js 6 | } 7 | export calc-fee = ({ network, tx }, cb)-> 8 | cb null 9 | export get-keys = ({ network, mnemonic, index }, cb)-> 10 | cb "Not implemented" 11 | export create-transaction = ({ account, recipient, amount, amount-fee } , cb)--> 12 | cb "Not implemented" 13 | export push-tx = ({ network, rawtx } , cb)--> 14 | cb "Not implemented" 15 | export get-unconfirmed-balance = ({ network, address} , cb)-> 16 | cb "Not Implemented" 17 | export get-balance = ({ address } , cb)-> 18 | err, res <- get "https://nodes.wavesnodes.com/addresses/balance/#address" .timeout({ deadline }).end 19 | return cb err if err? 20 | err, result <- json-parse res.text 21 | return cb err if err? 22 | return cb "Balance is not available" if not result?balance? 23 | balance = result.balance `div` 100000000 24 | cb null, balance 25 | export check-tx-status = ({ network, tx }, cb)-> 26 | cb "Not Implemented" 27 | export get-total-received = ({ address, network }, cb)-> 28 | cb "Not Implemented" 29 | export get-transactions = ({ network, address}, cb)-> 30 | cb null, [] -------------------------------------------------------------------------------- /providers/xem.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \nem-sdk : { default: nem } 3 | \./superagent.js : { get } 4 | \../json-parse.js 5 | \prelude-ls : { filter, map, head, foldl } 6 | \../math.js : { minus, div, plus } 7 | \../deadline.js 8 | } 9 | export calc-fee = ({ network, tx }, cb)-> 10 | cb null 11 | export get-keys = ({ network, mnemonic, index }, cb)-> 12 | private-key = nem.crypto.helpers.derive-pass-sha(mnemonic, 6000).priv 13 | kp = nem.crypto.key-pair.create nem.utils.helpers.fix-private-key private-key 14 | address = nem.model.address.to-address kp.public-key.to-string!, network.id 15 | cb null, { address, private-key } 16 | transform-transfer = (network, tx)--> 17 | amount = tx.amount `div` (network.decimals ^ 10) 18 | fee = tx.fee `div` (network.decimals ^ 10) 19 | time = tx.timestamp_unix 20 | to = tx.r_printablekey 21 | from = tx.s_printablekey 22 | url = "#{network.api.url}/transfer/#{tx.id}" 23 | { network, tx: tx.id, amount, fee, time, url, from, to } 24 | export get-transactions = ({ network, address }, cb)-> 25 | err, data <- get "#{network.api.api-url}/account?address=#{address}" .timeout { deadline } .end 26 | return cb err if err? 27 | err, result <- json-parse data.text 28 | return cb null, [] if not result.raw? 29 | return cb err if err? 30 | err, data <- get "#{network.api.api-url}/account_transactions?id=#{result.raw.id}&iid=0" .timeout { deadline } .end 31 | return cb err if err? 32 | err, result <- json-parse data.text 33 | return cb err if err? 34 | txs = 35 | result.transfers 36 | |> map transform-transfer network 37 | cb null, txs 38 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, message-type, fee-type, tx-type} , cb)--> 39 | return cb "Params are required" if not network? or not account? or not recipient? or not amount-fee? 40 | err, xem-balance <- get-balance { network, account.address } 41 | return cb err if err? 42 | return cb "Balance is not enough to send this amount" if +xem-balance < +(amount `plus` amount-fee) 43 | #return cb "Balance is not enough to send tx" if +balance-eth < +(amount `plus` amount-fee) 44 | common = nem.model.objects.create(\common) "", account.private-key 45 | transfer-transaction = nem.model.objects.get \transferTransaction 46 | transfer-transaction.amount = amount 47 | transfer-transaction.message = data ? "" 48 | transfer-transaction.recipient = recipient 49 | transfer-transaction.is-multisig = no 50 | transfer-transaction.multisig-account = "" 51 | transfer-transaction.message-type = message-type ? 0 52 | transaction-entity = nem.model.transactions.prepare(\transferTransaction)(common, transfer-transaction, network.id) 53 | kp = nem.crypto.key-pair.create nem.utils.helpers.fix-private-key account.private-key 54 | serialized = nem.utils.serialization.serialize-transaction transaction-entity 55 | signature = kp.sign serialized 56 | result = 57 | data : nem.utils.convert.ua2hex serialized 58 | signature : signature.to-string! 59 | rawtx = JSON.stringify result 60 | cb null, { rawtx } 61 | export push-tx = ({ network, rawtx } , cb)--> 62 | endpoint = nem.model.objects.create(\endpoint) network.api.node-address, network.api.node-port 63 | success = (res)-> 64 | return cb res.message if res.code >= 2 65 | cb null, res?transaction-hash?data 66 | failed = (res)-> 67 | cb res 68 | nem.com.requests.transaction.announce endpoint, rawtx .then success, failed 69 | export check-tx-status = ({ network, tx }, cb)-> 70 | cb "Not Implemented" 71 | export get-total-received = ({ address, network }, cb)-> 72 | err, txs <- get-transactions { address, network } 73 | total = 74 | txs |> filter (-> it.to is address) 75 | |> map (.amount) 76 | |> foldl plus, 0 77 | cb null, total 78 | export get-unconfirmed-balance = ({ network, address} , cb)-> 79 | cb "Not Implemented" 80 | export get-balance = ({ network, address } , cb)-> 81 | err, data <- get "#{network.api.api-url}/account?address=#{address}" .timeout { deadline } .end 82 | return cb err if err? 83 | err, result <- json-parse data.text 84 | return cb err if err? 85 | return cb null, "0" if not result.raw? 86 | input = 87 | result.raw.balance 88 | |> filter (.type is 1) 89 | |> map (.sum) 90 | |> head 91 | output = 92 | result.raw.balance 93 | |> filter (.type is 2) 94 | |> map (.sum) 95 | |> head 96 | return cb null, "0" if not input? 97 | saldo = input `minus` (output ? 0) 98 | print = saldo `div` (10^6) 99 | cb null, print -------------------------------------------------------------------------------- /providers/ym.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \yandex-money-sdk : { Wallet } 3 | \prelude-ls : { map, find, split, map } 4 | \../math.js : { div, times, plus, minus } 5 | \moment 6 | } 7 | export calc-fee = ({ network, fee-type, account, amount, to, data }, cb)-> 8 | fixed = 50 9 | return cb null, fixed if +amount is 0 10 | def = fixed `plus` ((amount `div` 100) `times` 2) 11 | cb null, def 12 | export get-keys = ({ network, mnemonic, index }, cb)-> 13 | err, api <- get-api network.private-key 14 | return cb err if err? 15 | err, info <- api.account-info 16 | return cb err if err? 17 | address = info.account 18 | cb null, { network.private-key , address } 19 | transform-tx = (network, t)--> 20 | { url } = network.api 21 | tx = t.operation_id 22 | amount = t.amount 23 | time = moment.utc(t.date).unix! 24 | fee = \n/a 25 | type = t.direction.to-upper-case! 26 | from = if t.direction is \out then 'my account' 27 | to2 = if t.direction is \out then 'recipient' 28 | { network: 'ym', tx, amount, fee, time, url, t.from, to: to2, type } 29 | export get-transactions = ({ network, address }, cb)-> 30 | err, api <- get-api network.private-key 31 | return cb err if err? 32 | err, info <- api.operation-history { records: 25 } 33 | return cb err if err? 34 | return cb "expected array" if typeof! info.operations isnt \Array 35 | txs = 36 | info.operations |> map transform-tx network 37 | cb null, txs 38 | export create-transaction = ({ network, account, recipient, amount, amount-fee, data, fee-type, tx-type} , cb)--> 39 | err, balance <- get-balance { network, account.address } 40 | return cb err if err? 41 | rest = balance `minus` (amount `plus` amount-fee) 42 | return cb "Balance is not enough to send this amount" if +rest < 0 43 | return cb err if err? 44 | options = 45 | pattern_id : \p2p 46 | to : recipient 47 | amount_due : amount 48 | comment : "Payment" 49 | message : "Payment" 50 | label : "payment" 51 | test_payment : no 52 | test_result : \success 53 | err, res <- api.request-payment options 54 | return cb err if err? 55 | return cb res if res.status isnt \success 56 | rawtx = data.request_id 57 | cb null, { rawtx } 58 | export push-tx = ({ network, rawtx } , cb)--> 59 | return cb "rawtx should be an string" if typeof! rawtx isnt \String 60 | err, api <- get-api network.private-key 61 | return cb err if err? 62 | request_id = rawtx 63 | err, data <- api.process-payment { request_id } 64 | #console.log err, data 65 | return cb err if err? 66 | return cb data if data.status isnt \success 67 | cb null, data.operation_id 68 | export get-total-received = ({ address, network }, cb)-> 69 | cb "Not Implemented" 70 | get-api = (private-key, cb)-> 71 | api = new Wallet private-key 72 | cb null, api 73 | export get-balance = ({ network, address } , cb)-> 74 | return cb "private key is required" if not network?private-key? 75 | err, api <- get-api network.private-key 76 | return cb err if err? 77 | err, info <- api.account-info 78 | return cb err if err? 79 | cb null, info.balance -------------------------------------------------------------------------------- /push: -------------------------------------------------------------------------------- 1 | lsc -c index.ls 2 | git add . 3 | git commit -m "update npm" 4 | git push 5 | npm publish -------------------------------------------------------------------------------- /test-bn.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/web3space/web3t/0c7773f0cc2cbf7a375199396dbdd0c046eeec54/test-bn.js -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | ### Run Tests 2 | 3 | We cover all functionality by tests 4 | 5 | Run Once 6 | ```sh 7 | npm i livescript -g 8 | ``` 9 | 10 | Run Each Time 11 | ``` 12 | lsc ./main.ls 13 | ``` -------------------------------------------------------------------------------- /tests/check-config.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var configParser; 4 | configParser = require('../config-parser.js'); 5 | module.exports = function(cb){ 6 | var config; 7 | config = configParser('testnet'); 8 | if (config.getModeFor('eth') !== 'testnet') { 9 | return cb("Wrong network " + config.getModeFor('eth') + ", expected testnet"); 10 | } 11 | config = configParser('testnet, ethnamed for eth'); 12 | if (config.getModeFor('eth') !== 'ethnamed') { 13 | return cb("Wrong network " + config.getModeFor('eth') + ", expected ethnamed"); 14 | } 15 | return cb(null); 16 | }; 17 | }).call(this); 18 | -------------------------------------------------------------------------------- /tests/check-config.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../config-parser.js 3 | } 4 | 5 | module.exports = (cb)-> 6 | config = config-parser \testnet 7 | return cb "Wrong network #{config.get-mode-for \eth}, expected testnet" if config.get-mode-for(\eth) isnt \testnet 8 | config = config-parser 'testnet, ethnamed for eth' 9 | return cb "Wrong network #{config.get-mode-for \eth}, expected ethnamed" if config.get-mode-for(\eth) isnt \ethnamed 10 | cb null -------------------------------------------------------------------------------- /tests/check-fields.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var types, fields, checkFields; 4 | types = require('./types.js'); 5 | fields = ['sendTransaction', 'createAccount', 'calcFee', 'getBalance', 'getHistory', 'sendAllFunds']; 6 | checkFields = function(web3t, cb){ 7 | var coins; 8 | if (typeof err != 'undefined' && err !== null) { 9 | return cb(err); 10 | } 11 | coins = Object.keys(web3t); 12 | if (coins.filter(function(it){ 13 | return !in$(it, types); 14 | }).length > 0) { 15 | return cb("Cannot find coins " + coins.join(',')); 16 | } 17 | if (types.filter(function(it){ 18 | return !in$(it, coins); 19 | }).length > 0) { 20 | return cb("Cannot find types"); 21 | } 22 | if (coins.filter(function(t){ 23 | return Object.keys(web3t[t]).filter(function(f){ 24 | return !in$(f, fields); 25 | }).length > 0; 26 | }).length > 0) { 27 | return cb("Cannot find field in definition"); 28 | } 29 | if (coins.filter(function(t){ 30 | return fields.filter(function(f){ 31 | return !in$(f, Object.keys(web3t[t])); 32 | }).length > 0; 33 | }).length > 0) { 34 | return cb("Cannot find fields"); 35 | } 36 | return cb(null); 37 | }; 38 | module.exports = checkFields; 39 | function in$(x, xs){ 40 | var i = -1, l = xs.length >>> 0; 41 | while (++i < l) if (x === xs[i]) return true; 42 | return false; 43 | } 44 | }).call(this); 45 | -------------------------------------------------------------------------------- /tests/check-fields.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./types.js 3 | } 4 | 5 | fields = <[ sendTransaction createAccount calcFee getBalance getHistory sendAllFunds ]> 6 | check-fields = (web3t, cb)-> 7 | 8 | return cb err if err? 9 | coins = 10 | Object.keys web3t 11 | return cb "Cannot find coins #{coins.join(',')}" if coins.filter(-> it not in types).length > 0 12 | return cb "Cannot find types" if types.filter(-> it not in coins).length > 0 13 | return cb "Cannot find field in definition" if coins.filter((t)-> Object.keys(web3t[t]).filter((f)-> f not in fields).length > 0 ).length > 0 14 | return cb "Cannot find fields" if coins.filter((t)-> fields.filter((f)-> f not in Object.keys(web3t[t])).length > 0 ).length > 0 15 | cb null 16 | module.exports = check-fields -------------------------------------------------------------------------------- /tests/eos.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var buildWeb3t, mnemonic; 4 | buildWeb3t = require('../index.js'); 5 | mnemonic = require('./mnemonic.js'); 6 | process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; 7 | buildWeb3t('mainnet', function(err, web3t){ 8 | var ref$, createAccount, getBalance, calcFee; 9 | ref$ = web3t.eth, createAccount = ref$.createAccount, getBalance = ref$.getBalance, calcFee = ref$.calcFee; 10 | return createAccount({ 11 | mnemonic: mnemonic, 12 | index: 0 13 | }, function(err, account){ 14 | var to; 15 | to = '0x35b686646ffc646969953dbe12252d554fe6c5ce'; 16 | return calcFee({ 17 | account: account, 18 | to: to, 19 | data: '0x', 20 | feeType: 'auto', 21 | amount: "0" 22 | }, function(err, fee){ 23 | return console.log(err, fee); 24 | }); 25 | }); 26 | }); 27 | }).call(this); 28 | -------------------------------------------------------------------------------- /tests/eos.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../index.js : build-web3t 3 | \./mnemonic.js 4 | } 5 | process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0 6 | err, web3t <- build-web3t \mainnet 7 | 8 | { create-account, get-balance, calc-fee } = web3t.eth 9 | 10 | err, account <- create-account { mnemonic, index: 0 } 11 | #console.log err, account 12 | 13 | to = \0x35b686646ffc646969953dbe12252d554fe6c5ce 14 | 15 | err, fee <- calc-fee { account, to, data: '0x', fee-type: \auto, amount: "0" } 16 | console.log err, fee 17 | 18 | #err, balance <- get-balance { account } 19 | 20 | #console.log err, balance -------------------------------------------------------------------------------- /tests/main.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var buildWeb3t, checkFields, testCoins, checkConfig, main; 4 | buildWeb3t = require('../index.js'); 5 | checkFields = require('./check-fields.js'); 6 | testCoins = require('./test-coins.js'); 7 | checkConfig = require('./check-config.js'); 8 | process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; 9 | main = function(network, cb){ 10 | return checkConfig(function(err){ 11 | if (err != null) { 12 | return cb(err); 13 | } 14 | return buildWeb3t(network, function(err, web3t){ 15 | if (err != null) { 16 | return cb(err); 17 | } 18 | return checkFields(web3t, function(err){ 19 | if (err != null) { 20 | return cb(err); 21 | } 22 | return testCoins(web3t, function(err){ 23 | if (err != null) { 24 | return cb(err); 25 | } 26 | return cb(null); 27 | }); 28 | }); 29 | }); 30 | }); 31 | }; 32 | main('testnet, ethnamed for eth', function(err, result){ 33 | if (err != null) { 34 | return console.error(err); 35 | } 36 | return console.log(result); 37 | }); 38 | }).call(this); 39 | -------------------------------------------------------------------------------- /tests/main.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../index.js : build-web3t 3 | \./check-fields.js 4 | \./test-coins.js 5 | \./check-config.js 6 | } 7 | process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0 8 | main = (network, cb)-> 9 | err <- check-config 10 | return cb err if err? 11 | err, web3t <- build-web3t network 12 | return cb err if err? 13 | err <- check-fields web3t 14 | return cb err if err? 15 | err <- test-coins web3t 16 | return cb err if err? 17 | cb null 18 | # 19 | # 20 | # 21 | err, result <- main 'testnet, ethnamed for eth' 22 | return console.error err if err? 23 | console.log result -------------------------------------------------------------------------------- /tests/mnemonic.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | module.exports = "xmr bch btg ltc eth eos xem ada dash btc zec bcn"; 4 | module.exports = "cat thumb picture vehicle olympic dawn air wealth crop whale glare sheriff note diagram fly"; 5 | }).call(this); 6 | -------------------------------------------------------------------------------- /tests/mnemonic.ls: -------------------------------------------------------------------------------- 1 | module.exports = "xmr bch btg ltc eth eos xem ada dash btc zec bcn" 2 | module.exports = "cat thumb picture vehicle olympic dawn air wealth crop whale glare sheriff note diagram fly" 3 | #module.exports = "xmr bch btg ltc eth eos xem ada dash btc zec bcn ss" 4 | -------------------------------------------------------------------------------- /tests/plugin-to-json.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var gobyteCoin, ref$, readFileSync, writeFileSync, text; 4 | gobyteCoin = require('../plugins/gobyte-coin.js'); 5 | ref$ = require('fs'), readFileSync = ref$.readFileSync, writeFileSync = ref$.writeFileSync; 6 | text = JSON.stringify(gobyteCoin, null, 4); 7 | writeFileSync('./gobyte-coin.json', text); 8 | }).call(this); 9 | -------------------------------------------------------------------------------- /tests/plugin-to-json.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../plugins/gobyte-coin.js 3 | fs : { read-file-sync, write-file-sync } 4 | } 5 | 6 | text = JSON.stringify gobyte-coin, null, 4 7 | write-file-sync './gobyte-coin.json', text -------------------------------------------------------------------------------- /tests/test-bip.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var bip39, seed; 4 | bip39 = require('bip39'); 5 | seed = bip39.mnemonicToSeedHex("asdf asdf asdf sfd asdf "); 6 | console.log(seed); 7 | }).call(this); 8 | -------------------------------------------------------------------------------- /tests/test-bip.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \bip39 3 | } 4 | 5 | seed = bip39.mnemonic-to-seed-hex "asdf asdf asdf sfd asdf " 6 | console.log seed -------------------------------------------------------------------------------- /tests/test-coin-non-zero.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var mnemonic, index; 4 | mnemonic = require('./mnemonic.ls'); 5 | index = 0; 6 | module.exports = function(coin, cb){ 7 | var createAccount, getBalance, sendAllFunds; 8 | createAccount = coin.createAccount, getBalance = coin.getBalance, sendAllFunds = coin.sendAllFunds; 9 | return createAccount({ 10 | mnemonic: mnemonic, 11 | index: index 12 | }, function(err, account){ 13 | if (err != null) { 14 | return cb(err); 15 | } 16 | return getBalance({ 17 | account: account 18 | }, function(err, balance){ 19 | if (err != null) { 20 | return cb(err); 21 | } 22 | if (+balance === 0) { 23 | return cb("Balance is zero"); 24 | } 25 | return createAccount({ 26 | mnemonic: mnemonic, 27 | index: 1 28 | }, function(err, recipient){ 29 | if (err) { 30 | return cb(err); 31 | } 32 | return sendAllFunds({ 33 | account: account, 34 | to: recipient.address 35 | }, function(err, tx){ 36 | if (err != null) { 37 | return cb(err); 38 | } 39 | return cb(null); 40 | }); 41 | }); 42 | }); 43 | }); 44 | }; 45 | }).call(this); 46 | -------------------------------------------------------------------------------- /tests/test-coin-non-zero.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./mnemonic.ls 3 | } 4 | index = 0 5 | module.exports = (coin, cb)-> 6 | { create-account, get-balance, send-all-funds } = coin 7 | err, account <- create-account { mnemonic, index } 8 | return cb err if err? 9 | err, balance <- get-balance { account } 10 | return cb err if err? 11 | return cb "Balance is zero" if +balance is 0 12 | err, recipient <- create-account { mnemonic, index: 1 } 13 | return cb err if err 14 | err, tx <- send-all-funds { account, to: recipient.address } 15 | return cb err if err? 16 | cb null -------------------------------------------------------------------------------- /tests/test-coin.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var testCoinNonZero, mnemonic, index, toString$ = {}.toString; 4 | testCoinNonZero = require('./test-coin-non-zero.ls'); 5 | mnemonic = require('./mnemonic.ls'); 6 | index = 0; 7 | module.exports = function(type, coin, cb){ 8 | var createAccount, getBalance, calcFee; 9 | console.log(type); 10 | createAccount = coin.createAccount, getBalance = coin.getBalance, calcFee = coin.calcFee; 11 | if (toString$.call(createAccount).slice(8, -1) !== 'Function') { 12 | return cb("Create Account is not a function"); 13 | } 14 | if (toString$.call(getBalance).slice(8, -1) !== 'Function') { 15 | return cb("Get Balance is not a function"); 16 | } 17 | return createAccount({ 18 | mnemonic: mnemonic, 19 | index: index 20 | }, function(err, account){ 21 | if (account.address == null) { 22 | return cb("Address is not found"); 23 | } 24 | if (account.privateKey == null) { 25 | return cb("Private Key is not found"); 26 | } 27 | if (err != null) { 28 | return cb(err); 29 | } 30 | return getBalance({ 31 | account: account 32 | }, function(err, balance){ 33 | if (err != null) { 34 | return cb(err); 35 | } 36 | if (balance == null) { 37 | return cb("Balance is wrong"); 38 | } 39 | if (+balance === 0) { 40 | return cb(null); 41 | } 42 | return cb(null); 43 | }); 44 | }); 45 | }; 46 | }).call(this); 47 | -------------------------------------------------------------------------------- /tests/test-coin.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./test-coin-non-zero.ls 3 | \./mnemonic.ls 4 | } 5 | index = 0 6 | module.exports = (type, coin, cb)-> 7 | console.log type 8 | { create-account, get-balance, calc-fee } = coin 9 | return cb "Create Account is not a function" if typeof! create-account isnt \Function 10 | return cb "Get Balance is not a function" if typeof! get-balance isnt \Function 11 | err, account <- create-account { mnemonic, index } 12 | return cb "Address is not found" if not account.address? 13 | return cb "Private Key is not found" if not account.private-key? 14 | return cb err if err? 15 | err, balance <- get-balance { account } 16 | return cb err if err? 17 | return cb "Balance is wrong" if not balance? 18 | return cb null if +balance is 0 19 | #err <- test-coin-non-zero coin 20 | #return cb err if err? 21 | cb null -------------------------------------------------------------------------------- /tests/test-coins.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var types, testCoin, testCoins, slice$ = [].slice; 4 | types = require('./types.ls'); 5 | testCoin = require('./test-coin.ls'); 6 | testCoins = function(arg$, web3t, cb){ 7 | var type, types, coin; 8 | type = arg$[0], types = slice$.call(arg$, 1); 9 | if (type == null) { 10 | return cb(null); 11 | } 12 | coin = web3t[type]; 13 | if (coin == null) { 14 | return cb("Type Not Found"); 15 | } 16 | return testCoin(type, coin, function(err, data){ 17 | if (err != null) { 18 | return cb(err); 19 | } 20 | return testCoins(types, web3t, function(err, coins){ 21 | if (err != null) { 22 | return cb(err); 23 | } 24 | return cb(null, data); 25 | }); 26 | }); 27 | }; 28 | module.exports = function(web3t, cb){ 29 | return testCoins(types, web3t, cb); 30 | }; 31 | }).call(this); 32 | -------------------------------------------------------------------------------- /tests/test-coins.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./types.ls 3 | \./test-coin.ls 4 | } 5 | test-coins = ([type, ...types], web3t, cb)-> 6 | return cb null if not type? 7 | coin = web3t[type] 8 | return cb "Type Not Found" if not coin? 9 | err, data <- test-coin type, coin 10 | return cb err if err? 11 | err, coins <- test-coins types, web3t 12 | return cb err if err? 13 | cb null, data 14 | module.exports = (web3t, cb)-> 15 | test-coins types, web3t, cb -------------------------------------------------------------------------------- /tests/test-seed.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var buildWeb3t, mnemonic; 4 | buildWeb3t = require('../index.ls'); 5 | mnemonic = "step world panther frog tiny express ensure wear soldier album make kit"; 6 | buildWeb3t("mainnet", function(err, web3t){ 7 | return web3t.btc.createAccount({ 8 | mnemonic: mnemonic, 9 | index: 1 10 | }, function(err, account){ 11 | return console.log(err, account != null ? account.address : void 8); 12 | }); 13 | }); 14 | }).call(this); 15 | -------------------------------------------------------------------------------- /tests/test-seed.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \../index.ls : build-web3t 3 | } 4 | 5 | mnemonic = "step world panther frog tiny express ensure wear soldier album make kit" 6 | 7 | err, web3t <- build-web3t "mainnet" 8 | 9 | err, account <- web3t.btc.createAccount { mnemonic, index: 1 } 10 | console.log err, account?address -------------------------------------------------------------------------------- /tests/types.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | module.exports = ['btc', 'dash', 'eth', 'ltc', 'xem', 'usdt']; 4 | }).call(this); 5 | -------------------------------------------------------------------------------- /tests/types.ls: -------------------------------------------------------------------------------- 1 | module.exports = <[ btc dash eth ltc xem usdt ]> -------------------------------------------------------------------------------- /web3t-test.js: -------------------------------------------------------------------------------- 1 | // Generated by LiveScript 1.6.0 2 | (function(){ 3 | var web3t; 4 | web3t = require('./web3t.js'); 5 | console.log(web3t); 6 | }).call(this); 7 | -------------------------------------------------------------------------------- /web3t-test.ls: -------------------------------------------------------------------------------- 1 | require! { 2 | \./web3t.js 3 | } 4 | 5 | console.log web3t 6 | --------------------------------------------------------------------------------