├── MANIFEST.in ├── eosjs_python ├── js │ ├── __init__.py │ ├── test.js │ ├── ConvertKey.js │ ├── package.json │ ├── GenerateKeys.js │ ├── GetBlock.js │ ├── GetCurrencyBalance.js │ ├── Encrypt.js │ ├── Decrypt.js │ ├── ContractDeserializer.js │ ├── GetAccount.js │ ├── PushContractTransaction.js │ ├── ActionDeserializer.js │ ├── GetTable.js │ ├── CreateAccount.js │ └── package-lock.json ├── tests │ ├── __init__.py │ ├── test_generate_keys.py │ ├── test_get_block.py │ ├── test_get_currency_balance.py │ ├── test_data_deserializer.py │ ├── test_pushContractTransaction.py │ └── test_newaccount.py ├── .gitignore ├── __init__.pyc ├── Exceptions.pyc ├── Exceptions.py └── __init__.py ├── setup.cfg ├── .DS_Store ├── .gitignore ├── setup.py ├── LICENSE.txt └── README.md /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include eosjs_python/js/*.js -------------------------------------------------------------------------------- /eosjs_python/js/__init__.py: -------------------------------------------------------------------------------- 1 | # package 2 | -------------------------------------------------------------------------------- /eosjs_python/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # package 2 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEvaCom/eosjs_python/HEAD/.DS_Store -------------------------------------------------------------------------------- /eosjs_python/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | js/node_modules/ 3 | .DS_Store 4 | *.pyc -------------------------------------------------------------------------------- /eosjs_python/js/test.js: -------------------------------------------------------------------------------- 1 | ecc = require('eosjs'); 2 | 3 | console.log('test'); 4 | -------------------------------------------------------------------------------- /eosjs_python/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEvaCom/eosjs_python/HEAD/eosjs_python/__init__.pyc -------------------------------------------------------------------------------- /eosjs_python/Exceptions.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoEvaCom/eosjs_python/HEAD/eosjs_python/Exceptions.pyc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | dist/ 3 | eosjs_python.egg-info/ 4 | .idea/ 5 | __pycache__/ 6 | eosjs_python/js/node_modules/ -------------------------------------------------------------------------------- /eosjs_python/tests/test_generate_keys.py: -------------------------------------------------------------------------------- 1 | from eosjs_python import Eos 2 | 3 | 4 | key_pair = Eos.generate_key_pair() 5 | print(key_pair) -------------------------------------------------------------------------------- /eosjs_python/js/ConvertKey.js: -------------------------------------------------------------------------------- 1 | ecc = require('eosjs-ecc'); 2 | 3 | const key_k1_format = process.argv[2]; 4 | 5 | var key = ecc.PublicKey.fromString(key_k1_format); 6 | var keyPlainText = key.toString(); 7 | console.log(keyPlainText); 8 | -------------------------------------------------------------------------------- /eosjs_python/tests/test_get_block.py: -------------------------------------------------------------------------------- 1 | from eosjs_python import Eos 2 | 3 | eos = Eos({ 4 | 'http_address': 'https://chain-net-prod.eva.cab/', 5 | 'key_provider': '5KR93vcDVtJJ8eZ3td4gU87p8PPhsfgK5NZKyDij83kSRJ2UTrM' 6 | }) 7 | 8 | print(eos.get_block('2454645')) 9 | -------------------------------------------------------------------------------- /eosjs_python/tests/test_get_currency_balance.py: -------------------------------------------------------------------------------- 1 | from eosjs_python import Eos 2 | 3 | eos = Eos({ 4 | 'http_address': 'http://localhost:8888', 5 | 'key_provider': '5KR93vcDVtJJ8eZ3td4gU87p8PPhsfgK5NZKyDij83kSRJ2UTrM' 6 | }) 7 | 8 | eos.get_currency_balance('eosio.token', 'xcdzdbkqamvu', 'EVA') 9 | -------------------------------------------------------------------------------- /eosjs_python/Exceptions.py: -------------------------------------------------------------------------------- 1 | class GenerateKeysException(Exception): 2 | pass 3 | 4 | class CreateAccountException(Exception): 5 | pass 6 | 7 | class PushContractTransactionException(Exception): 8 | pass 9 | 10 | class GetTableException(Exception): 11 | pass 12 | 13 | class GetBalanceException(Exception): 14 | pass 15 | 16 | class GetAccountException(Exception): 17 | pass 18 | 19 | class EncryptSecretException(Exception): 20 | pass -------------------------------------------------------------------------------- /eosjs_python/tests/test_data_deserializer.py: -------------------------------------------------------------------------------- 1 | from eosjs_python import Eos 2 | import json 3 | 4 | eos = Eos({ 5 | 'http_address': '' #Your endpoint 6 | }) 7 | 8 | abi_hex = "" #Your ABI hex-encoded binary data for the contract 9 | data_hex = "" #Your hex-encoded binary data for the action 10 | 11 | contract = eos.deserialize_contract(abi_hex[0]) 12 | contract_r = json.dumps(contract) 13 | 14 | action = eos.deserialize_action_data(""" YOUR DATA """) 15 | 16 | print(action) -------------------------------------------------------------------------------- /eosjs_python/js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eosjs_python", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "CreateAccount.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Raphael Gaudreault", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bytebuffer": "^5.0.1", 13 | "eosjs-deserialize": "npm:eosjs@^21.0.3", 14 | "fetch": "^1.1.0", 15 | "long": "^4.0.0", 16 | "node-fetch": "^2.6.1" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name='eosjs_python', 4 | version='0.2.4', 5 | description='Python library to communicate with eosjs in order to sign blockchain transactions.', 6 | url='https://github.com/EvaCoop/eosjs_python', 7 | author='Raphael Gaudreault, Jean Robatto', 8 | author_email='raphael.gaudreault@eva.coop, jean.robatto@eva.coop', 9 | license='MIT', 10 | packages=['eosjs_python'], 11 | install_requires=['Naked'], 12 | include_package_data=True, 13 | zip_safe=False) 14 | -------------------------------------------------------------------------------- /eosjs_python/js/GenerateKeys.js: -------------------------------------------------------------------------------- 1 | eos = require('eosjs') 2 | ecc = require('eosjs-ecc-eva'); 3 | 4 | function generate_eos_keys() { 5 | return ecc.randomKey().then(privateKey => { 6 | const publicKey = ecc.privateToPublic(privateKey); 7 | return { 8 | "private": privateKey, 9 | "public": publicKey 10 | } 11 | }).then(responseData => { 12 | return responseData; 13 | }); 14 | } 15 | 16 | 17 | 18 | function main(){ 19 | keys = {} 20 | generate_eos_keys().then(key => {return key;}).then(key => { 21 | console.log(JSON.stringify(key)); 22 | }); 23 | } 24 | 25 | main(); -------------------------------------------------------------------------------- /eosjs_python/js/GetBlock.js: -------------------------------------------------------------------------------- 1 | Eos = require('eosjs'); 2 | 3 | const httpEndpointAddress = process.argv[2]; 4 | const chain_id = process.argv[3]; 5 | const wif = process.argv[4]; 6 | const blockNum = process.argv[5]; 7 | 8 | eos = Eos({ 9 | keyProvider: wif, 10 | httpEndpoint: httpEndpointAddress, 11 | chainId: chain_id 12 | }) 13 | 14 | var params = { 15 | block: blockNum, 16 | json: true, 17 | }; 18 | 19 | eos.block(params).then(response => { 20 | console.log(JSON.stringify(response)); 21 | }).catch(function (e) { 22 | console.error(e); 23 | process.exit(1); 24 | }) 25 | -------------------------------------------------------------------------------- /eosjs_python/tests/test_pushContractTransaction.py: -------------------------------------------------------------------------------- 1 | from eosjs_python import Eos 2 | 3 | eos = Eos({ 4 | 'http_address': 'http://localhost:8888', 5 | 'key_provider': '5JhhMGNPsuU42XXjZ57FcDKvbb7KLrehN65tdTQFrH51uruZLHi' 6 | }) 7 | 8 | #cleos push action eosio.token transfer '["eva","rider1","1 EVA","initial balance"]' -p eva 9 | 10 | eos.push_transaction('eosio.token','transfer','eva','active',{ 11 | "from":"eva", 12 | "to":"rider1", 13 | "quantity":"1 EVA", 14 | "memo":"" 15 | }) 16 | 17 | #cleos push action eva createrider '["rider3"]' -p rider3 18 | 19 | eos.push_transaction('eva','createrider','rider3','active',{ 20 | "account":"rider3" 21 | }) 22 | -------------------------------------------------------------------------------- /eosjs_python/tests/test_newaccount.py: -------------------------------------------------------------------------------- 1 | from eosjs_python import Eos 2 | 3 | eos = Eos({ 4 | 'http_address': 'http://localhost:8888', 5 | 'key_provider': '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3' 6 | }) 7 | 8 | test = eos.newaccount({ 9 | 'creator': 'eosio', 10 | 'name': 'mytestacc14', 11 | 'owner_public_key': 'EOS7aJDVdDjcpjAXS53sFoVMHQJdFTMhaS3mThnXE3okFEtvxmQov', 12 | 'active_public_key': 'EOS7aJDVdDjcpjAXS53sFoVMHQJdFTMhaS3mThnXE3okFEtvxmQov', 13 | 'buyrambytes_bytes': 8192, 14 | 'delegatebw_stake_net_quantity': '100.0000 SYS', 15 | 'delegatebw_stake_cpu_quantity': '100.0000 SYS', 16 | 'delegatebw_transfer': 0 17 | }) 18 | 19 | print(test) 20 | -------------------------------------------------------------------------------- /eosjs_python/js/GetCurrencyBalance.js: -------------------------------------------------------------------------------- 1 | Eos = require('eosjs') // Eos = require('./src') 2 | 3 | const httpEndpointAddress = process.argv[2]; 4 | const chain_id = process.argv[3]; 5 | const keyProviderValue = process.argv[4]; 6 | const code = process.argv[5]; 7 | const account = process.argv[6]; 8 | const symbol = process.argv[7]; 9 | 10 | 11 | eos = Eos({ 12 | keyProvider: keyProviderValue, 13 | httpEndpoint: httpEndpointAddress, 14 | chainId: chain_id 15 | }) 16 | 17 | eos.getCurrencyBalance({ 18 | code: code, 19 | account: account, 20 | symbol: symbol, 21 | json: true, 22 | }).then(response => { 23 | console.log(JSON.stringify(response)); 24 | }).catch(function (e) { 25 | console.error(e); 26 | process.exit(1); 27 | }) -------------------------------------------------------------------------------- /eosjs_python/js/Encrypt.js: -------------------------------------------------------------------------------- 1 | ecc = require('eosjs-ecc-eva'); 2 | 3 | const privKeySender = process.argv[2]; 4 | const pubKeyRecipient = process.argv[3]; 5 | const message = process.argv[4]; 6 | 7 | 8 | function encrypt(privKeySender, pubKeyRecipient, message){ 9 | let encryptedMessage = ecc.Aes.encrypt(privKeySender, pubKeyRecipient, message); 10 | var b64EncryptedMessage = encryptedMessage.message.toString("base64"); 11 | try { 12 | let data = encryptedMessage.nonce.low + "...." + encryptedMessage.nonce.high + "...." + encryptedMessage.checksum + "...." + b64EncryptedMessage; 13 | console.log(data); 14 | } catch(error) { 15 | console.error(error); 16 | process.exit(1); 17 | } 18 | } 19 | encrypt(privKeySender, pubKeyRecipient, message); 20 | 21 | -------------------------------------------------------------------------------- /eosjs_python/js/Decrypt.js: -------------------------------------------------------------------------------- 1 | ecc = require('eosjs-ecc-eva'); 2 | var Long = require('long'); 3 | 4 | const privKeyRecipient = process.argv[2]; 5 | const pubKeySender = process.argv[3]; 6 | const encryptedMessage = process.argv[4]; 7 | 8 | function decrypt(privKeyRecipient, pubKeySender, encryptedMessage){ 9 | var values = encryptedMessage.split("...."); 10 | var low = Number(values[0]); 11 | var high = Number(values[1]); 12 | var nonce = new Long(low, high, false); 13 | var checksum = Number(values[2]); 14 | var message = Buffer.from(values[3], "base64"); 15 | try { 16 | let messageBuffer = ecc.Aes.decrypt(privKeyRecipient, pubKeySender, nonce.toNumber(), message, checksum); 17 | console.log(messageBuffer.toString("utf8")); 18 | } catch(error) { 19 | console.error(error); 20 | process.exit(1); 21 | } 22 | } 23 | 24 | decrypt(privKeyRecipient, pubKeySender, encryptedMessage); -------------------------------------------------------------------------------- /eosjs_python/js/ContractDeserializer.js: -------------------------------------------------------------------------------- 1 | const { Api, JsonRpc } = require('eosjs-deserialize'); 2 | const { hexToUint8Array } = require('eosjs-deserialize/dist/eosjs-serialize') 3 | const fetch = require('node-fetch'); 4 | const util = require('util'); 5 | 6 | const endpoint = process.argv[2]; 7 | const cAbiHex = process.argv[3]; 8 | 9 | /** 10 | * Deserializes contract abi to json 11 | */ 12 | function deserializeContract(endpoint, cAbiHex) { 13 | //Setup API 14 | const rpc = new JsonRpc(endpoint, { fetch }); 15 | const api = new Api({ 16 | rpc, 17 | signatureProvider: null, 18 | textDecoder: new util.TextDecoder(), 19 | textEncoder: new util.TextEncoder() 20 | }) 21 | 22 | const cAbiRaw = hexToUint8Array(cAbiHex); 23 | const cAbiJson = api.rawAbiToJson(cAbiRaw); 24 | 25 | console.log(JSON.stringify({cAbiJson})); 26 | } 27 | 28 | deserializeContract(endpoint, cAbiHex); -------------------------------------------------------------------------------- /eosjs_python/js/GetAccount.js: -------------------------------------------------------------------------------- 1 | Eos = require('eosjs') // Eos = require('./src') 2 | 3 | const httpEndpointAddress = process.argv[2]; 4 | const chain_id = process.argv[3]; 5 | const wif = process.argv[4]; 6 | const accountName = process.argv[5]; 7 | 8 | eos = Eos({ 9 | keyProvider: wif, 10 | httpEndpoint: httpEndpointAddress, 11 | chainId: chain_id 12 | }) 13 | 14 | eos.getAccount(accountName).then(accountData => { 15 | var permissions = accountData.permissions; 16 | var entry = null; 17 | var data = {}; 18 | for (var i = 0; i < permissions.length; i++){ 19 | var permission = permissions[i]; 20 | if (permission.perm_name == 'owner'){ 21 | data['owner'] = permission.required_auth.keys[0].key; 22 | } else if(permission.perm_name == 'active'){ 23 | data['active'] = permission.required_auth.keys[0].key; 24 | } 25 | } 26 | console.log(JSON.stringify(data)); 27 | }).catch(function (e) { 28 | console.error(e); 29 | process.exit(1); 30 | });; -------------------------------------------------------------------------------- /eosjs_python/js/PushContractTransaction.js: -------------------------------------------------------------------------------- 1 | Eos = require('eosjs') // Eos = require('./src') 2 | 3 | const httpEndpointAddress = process.argv[2]; 4 | const chain_id = process.argv[3]; 5 | const wif = process.argv[4]; 6 | const contract_account = process.argv[5]; 7 | const contract_function = process.argv[6]; 8 | const authorization_actor = process.argv[7]; 9 | const authorization_permission = process.argv[8]; 10 | const data_values = JSON.parse(process.argv[9]); 11 | 12 | eos = Eos({ 13 | keyProvider: wif, 14 | httpEndpoint: httpEndpointAddress, 15 | chainId: chain_id 16 | }) 17 | 18 | 19 | eos.transaction({ 20 | actions: [ 21 | { 22 | account: contract_account, 23 | name: contract_function, 24 | authorization: [{ 25 | actor: authorization_actor, 26 | permission: authorization_permission 27 | }], 28 | data: data_values 29 | } 30 | ] 31 | }).then(function (value){ 32 | console.log(JSON.stringify(value)); 33 | return value; 34 | }).catch(function (e) { 35 | console.error(e); 36 | process.exit(1); 37 | }) -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2018 EVA. 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 13 | all 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 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /eosjs_python/js/ActionDeserializer.js: -------------------------------------------------------------------------------- 1 | const { createInitialTypes, getType, getTypesFromAbi, deserializeActionData } = require('eosjs-deserialize/dist/eosjs-serialize') 2 | const { hexToUint8Array } = require('eosjs-deserialize/dist/eosjs-serialize') 3 | const util = require('util'); 4 | 5 | const cAbiJson = process.argv[2]; 6 | const cAccount = process.argv[3]; 7 | const actName = process.argv[4]; 8 | const actDataHex = process.argv[5]; 9 | 10 | /** 11 | * Deserializes action data based on a specific contract abi. 12 | */ 13 | function deserializeActData(cAbiJson, cAccount, actName, actDataHex) { 14 | 15 | cAbiJson = JSON.parse(cAbiJson); 16 | 17 | const types = getTypesFromAbi(createInitialTypes(), cAbiJson); 18 | 19 | const actions = new Map(); 20 | for (const { name, type } of cAbiJson.actions) { 21 | actions.set(name, getType(types, type)); 22 | } 23 | const contract = { types, actions }; 24 | 25 | const actDataJson = deserializeActionData( 26 | contract, 27 | cAccount, 28 | actName, 29 | actDataHex, 30 | new util.TextEncoder(), 31 | new util.TextDecoder()); 32 | 33 | console.log(JSON.stringify(actDataJson)); 34 | } 35 | 36 | deserializeActData(cAbiJson, cAccount, actName, actDataHex); -------------------------------------------------------------------------------- /eosjs_python/js/GetTable.js: -------------------------------------------------------------------------------- 1 | Eos = require('eosjs') // Eos = require('./src') 2 | 3 | const httpEndpointAddress = process.argv[2]; 4 | const chain_id = process.argv[3]; 5 | const wif = process.argv[4]; 6 | const code = process.argv[5]; 7 | const scope = process.argv[6]; 8 | const table = process.argv[7]; 9 | const key_type = process.argv[8]; 10 | const index_position = process.argv[9]; 11 | const limit = process.argv[10]; 12 | const table_key = process.argv[11]; 13 | const lower_bound = process.argv[12]; 14 | 15 | 16 | eos = Eos({ 17 | keyProvider: wif, 18 | httpEndpoint: httpEndpointAddress, 19 | chainId: chain_id 20 | }) 21 | 22 | var params = { 23 | code: code, 24 | scope: scope, 25 | table: table, 26 | json: true, 27 | }; 28 | 29 | if (key_type.length > 0){ 30 | params['key_type'] = key_type; 31 | } 32 | 33 | if (index_position.length > 0){ 34 | params['index_position'] = parseInt(index_position); 35 | } 36 | 37 | if (limit.length > 0){ 38 | params['limit'] = parseInt(limit); 39 | } 40 | 41 | if (table_key.length > 0){ 42 | params['table_key'] = table_key; 43 | } 44 | 45 | if (lower_bound.length > 0){ 46 | params['lower_bound'] = lower_bound; 47 | } 48 | 49 | eos.getTableRows(params).then(response => { 50 | console.log(JSON.stringify(response)); 51 | }).catch(function (e) { 52 | console.error(e); 53 | process.exit(1); 54 | }) 55 | -------------------------------------------------------------------------------- /eosjs_python/js/CreateAccount.js: -------------------------------------------------------------------------------- 1 | Eos = require('eosjs') 2 | 3 | const httpEndpointAddress = process.argv[2]; 4 | const chain_id = process.argv[3]; 5 | const creator_account = process.argv[4]; 6 | const account_name = process.argv[5]; 7 | const keyProviderValue = process.argv[6]; 8 | const owner_public_key = process.argv[7]; 9 | const active_public_key = process.argv[8]; 10 | const buyrambytes_bytes = process.argv[9]; 11 | const delegatebw_stake_net_quantity = process.argv[10]; 12 | const delegatebw_stake_cpu_quantity = process.argv[11]; 13 | const delegatebw_transfer = process.argv[12]; 14 | 15 | 16 | function create_account(httpEndpointAddress, creator_account, account_name, keyProviderValue, owner_public_key, active_public_key, buyrambytes_bytes, delegatebw_stake_net_quantity, delegatebw_stake_cpu_quantity, delegatebw_transfer){ 17 | eos = Eos({keyProvider: keyProviderValue, httpEndpoint: httpEndpointAddress, chainId: chain_id}) 18 | eos.transaction(tr => { 19 | let data = { 20 | creator: creator_account, 21 | name: account_name, 22 | owner: owner_public_key, 23 | active: active_public_key 24 | } 25 | console.log(data); 26 | tr.newaccount(data); 27 | tr.buyrambytes({ 28 | payer: creator_account, 29 | receiver: account_name, 30 | bytes: parseInt(buyrambytes_bytes) 31 | }); 32 | tr.delegatebw({ 33 | from: creator_account, 34 | receiver: account_name, 35 | stake_net_quantity: delegatebw_stake_net_quantity, 36 | stake_cpu_quantity: delegatebw_stake_cpu_quantity, 37 | transfer: parseInt(delegatebw_transfer) 38 | }); 39 | }).then(function (value){ 40 | console.log(JSON.stringify(value)); 41 | }).catch(function (e) { 42 | console.error(e); 43 | process.exit(1); 44 | }) 45 | } 46 | 47 | 48 | create_account(httpEndpointAddress, creator_account, account_name, keyProviderValue, owner_public_key, active_public_key, buyrambytes_bytes, delegatebw_stake_net_quantity, delegatebw_stake_cpu_quantity, delegatebw_transfer); 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EOSJS PYTHON 2 | 3 | eosjs python is a eosjs wrapper to communicate with the eos blockchain in python. It works by wrapping the nodejs library eosjs into a Python package. 4 | 5 | ## Authors 6 | * [@raphaelgodro](https://github.com/raphaelgodro) 7 | 8 | ## License 9 | This project is licensed under the MIT License. 10 | 11 | ## Installation 12 | 13 | First, install nodejs if its not on your system already: 14 | ``` 15 | apt-get update 16 | apt-get -y install curl 17 | curl -sL https://deb.nodesource.com/setup_10.x | bash 18 | apt-get -y install nodejs 19 | ``` 20 | 21 | Then install from Pypi packages: 22 | ``` 23 | pip3 install eosjs_python 24 | ``` 25 | 26 | Or from source`(if you want to contribute)` : 27 | ``` 28 | git clone https://github.com/EvaCoop/eosjs_python 29 | cd eosjs_python 30 | python3 setup.py develop 31 | ``` 32 | 33 | You also need eosjs as a node dependency. 34 | You could install it globally 35 | ``` 36 | npm install -g eosjs 37 | ``` 38 | Or can also install it in the js subdirectory within this package 39 | ``` 40 | cd js && npm install 41 | ``` 42 | 43 | In order for the repo to work, one really need to install the js dependencies. 44 | 45 | ## Examples using the library 46 | 47 | ### Generate ECC keys 48 | ```python 49 | from eosjs_python import Eos 50 | 51 | key_pair = Eos.generate_key_pair() 52 | print(key_pair) 53 | ``` 54 | 55 | ### Create EOS account 56 | ```python 57 | from eosjs_python import Eos 58 | 59 | eos = Eos({ 60 | 'http_address': 'http://167.99.181.173/:8888', 61 | 'key_provider': '5KjwNHXDMwdEbzBx858GpDqGM2u3wD4rYkYNskRdcgTZTcQEBQZ' 62 | }) 63 | 64 | resp = eos.newaccount({ 65 | 'creator': 'eosio', 66 | 'name': 'mytestacc13', 67 | 'owner_public_key': 'EOS7vTHtMbZ1g9P8BiyAGD7Ni7H6UALVLVCW13xZrXT4heCBke3it', 68 | 'active_public_key': 'EOS8KKKYBBdwrmXRRynDXSxTX2qoT9TA4agahXXF4ccUgRCy81RNc', 69 | 'buyrambytes_bytes': 8192, 70 | 'delegatebw_stake_net_quantity': '100.0000 SYS', 71 | 'delegatebw_stake_cpu_quantity': '100.0000 SYS', 72 | 'delegatebw_transfer': 0 73 | }) 74 | ``` 75 | 76 | ### Push transaction into contract 77 | ```python 78 | from eosjs_python import Eos 79 | 80 | eos = Eos({ 81 | 'http_address': 'http://172.18.0.1:8888', 82 | 'key_provider': '5JhhMGNPsuU42XXjZ57FcDKvbb7KLrehN65tdTQFrH51uruZLHi' 83 | }) 84 | 85 | #cleos push action eosio.token transfer '["eva","rider1","1 EVA","initial balance"]' -p eva 86 | 87 | eos.push_transaction('eosio.token','transfer','eva','active',{ 88 | "from":"eva", 89 | "to":"mytestacc13", 90 | "quantity":"1 EVA", 91 | "memo":"" 92 | }) 93 | ``` 94 | 95 | ### Reading a table 96 | ```python 97 | from eosjs_python import Eos 98 | eos = Eos({ 99 | 'http_address': 'http://127.0.0.1:8888', 100 | 'key_provider': '5JhhMGNPsuU42XXjZ57FcDKvbb7KLrehN65tdTQFrH51uruZLHi' 101 | }) 102 | eos.get_table('eva', 'eva', 'communities') 103 | 104 | ``` 105 | 106 | ### Getting Currency Balance 107 | 108 | ```python 109 | from eosjs_python import Eos 110 | 111 | eos = Eos({ 112 | 'http_address': 'http://localhost:8888', 113 | 'key_provider': '5KR93vcDVtJJ8eZ3td4gU87p8PPhsfgK5NZKyDij83kSRJ2UTrM' 114 | }) 115 | 116 | eos.get_currency_balance('eosio.token', 'xcdzdbkqamvu', 'EVA') 117 | 118 | ``` 119 | 120 | ### Send secrets 121 | This is useful to share secrets on a public blockchain 122 | ```python 123 | /* 124 | Sender 125 | Private key: 5KiKyYPR3tJjwRt1XsJXXofD3YsYUSzSfvPg7pCSNDv64Av28ib 126 | Public key: EOS6Fz1GpMuxh3ZXGX34N7B7xY9VP5hmxcxRYBvgSkJRT4eGWPUvD 127 | 128 | Receiver 129 | Private key: 5KhAG8w3K8HVDaJLY6HxZTrfrZs7mjU9Afih5axxpRLNW6rvEDf 130 | Public key: EOS6E3T6S2xy5Fu2fZrZbHRsPNHjx5JXXFkBwQA9gCrgVTDALxQeC 131 | */ 132 | from eosjs_python import Eos 133 | encrypted_msg = Eos.encrypt_chain_message("5KiKyYPR3tJjwRt1XsJXXofD3YsYUSzSfvPg7pCSNDv64Av28ib", "EOS6E3T6S2xy5Fu2fZrZbHRsPNHjx5JXXFkBwQA9gCrgVTDALxQeC", "secret chain message") 134 | plaintext = Eos.decrypt_chain_message("5KhAG8w3K8HVDaJLY6HxZTrfrZs7mjU9Afih5axxpRLNW6rvEDf", "EOS6Fz1GpMuxh3ZXGX34N7B7xY9VP5hmxcxRYBvgSkJRT4eGWPUvD", encrypted_msg) 135 | print(plaintext) 136 | ``` 137 | ## Contributing 138 | 139 | Some work still has to be done to interface with all eosjs possibilities, feel free to send some pull requests! 140 | -------------------------------------------------------------------------------- /eosjs_python/__init__.py: -------------------------------------------------------------------------------- 1 | from Naked.toolshed.shell import (muterun_js) 2 | import json, os, requests 3 | from eosjs_python.Exceptions import * 4 | 5 | 6 | class Eos: 7 | current_dir = os.path.dirname(os.path.realpath(__file__)) 8 | 9 | def __init__(self, config): 10 | self.http_address = config['http_address'] if 'http_address' in config else None 11 | self.key_provider = config[ 12 | 'key_provider'] if 'key_provider' in config else '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3' 13 | self.chain_id = config['chain_id'] if 'chain_id' in config else self.get_chain_id() 14 | if 'debug' in config: 15 | self.debug_mode = config['debug'] 16 | else: 17 | self.debug_mode = False 18 | 19 | @classmethod 20 | def convert_key (cls, key_k1_format): 21 | """ 22 | DConvert key K1 format to EOS#### 23 | """ 24 | arguments = "'%s'" % ( 25 | key_k1_format 26 | ) 27 | response = muterun_js(cls.current_dir + '/js/ConvertKey.js', arguments=arguments) 28 | if response.exitcode == 0: 29 | true_string = response.stdout.decode('utf8').replace('\n', '') 30 | return true_string 31 | else: 32 | raise GetAccountException(response.stderr) 33 | 34 | @classmethod 35 | def generate_key_pair(cls): 36 | response = muterun_js(cls.current_dir + '/js/GenerateKeys.js') 37 | if response.exitcode == 0: 38 | true_string = response.stdout.decode('utf8') 39 | data = json.loads(true_string) 40 | return data 41 | else: 42 | raise GenerateKeysException(response.stderr) 43 | 44 | @classmethod 45 | def encrypt_chain_message(cls, privKeySender, pubKeyRecipient, message): 46 | arguments = "'%s' '%s' '%s'" % ( 47 | privKeySender, 48 | pubKeyRecipient, 49 | message 50 | ) 51 | 52 | response = muterun_js(cls.current_dir + '/js/Encrypt.js', arguments=arguments) 53 | if response.exitcode == 0: 54 | encrypted_msg = response.stdout.decode('utf8') 55 | return encrypted_msg.replace("\n", "") 56 | else: 57 | raise EncryptSecretException(response.stderr) 58 | 59 | @classmethod 60 | def decrypt_chain_message(cls, privKeyRecipient, pubKeySender, encryptedMessage): 61 | arguments = "'%s' '%s' '%s'" % ( 62 | privKeyRecipient, 63 | pubKeySender, 64 | encryptedMessage 65 | ) 66 | 67 | response = muterun_js(cls.current_dir + '/js/Decrypt.js', arguments=arguments) 68 | if response.exitcode == 0: 69 | plaintext = response.stdout.decode('utf8') 70 | return plaintext.replace("\n", "") 71 | else: 72 | raise EncryptSecretException(response.stderr) 73 | 74 | def newaccount(self, config): 75 | """ 76 | node CreateAccount.js 'http://172.18.0.1:8888' 'eosio' 'mytest12' '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3' '5JuaVWh3LDh1VH69urCdCa3A2YiQydbsLM1ZtGgsTXLYouxaTfc' 'EOS7vTHtMbZ1g9P8BiyAGD7Ni7H6UALVLVCW13xZrXT4heCBke3it' 'EOS8KKKYBBdwrmXRRynDXSxTX2qoT9TA4agahXXF4ccUgRCy81RNc' 8192 '100.0000 SYS' '100.0000 SYS' 0 77 | """ 78 | arguments = "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s'" % ( 79 | self.http_address, 80 | self.chain_id, 81 | config['creator'] if 'creator' in config else 'eosio', 82 | config['name'], 83 | self.key_provider, 84 | config['owner_public_key'], 85 | config['active_public_key'], 86 | config['buyrambytes_bytes'] if 'buyrambytes_bytes' in config else 8192, 87 | config['delegatebw_stake_net_quantity'] if 'delegatebw_stake_net_quantity' in config else '100.0000 SYS', 88 | config['delegatebw_stake_cpu_quantity'] if 'delegatebw_stake_cpu_quantity' in config else '100.0000 SYS', 89 | config['delegatebw_transfer'] if 'delegatebw_transfer' in config else 0 90 | ) 91 | response = muterun_js(self.current_dir + '/js/CreateAccount.js', arguments=arguments) 92 | if response.exitcode == 0: 93 | return 94 | else: 95 | raise CreateAccountException(response.stderr) 96 | 97 | def push_transaction(self, acct_contract, func_name, acct_owner, permission, data): 98 | """ 99 | node PushContractTransaction.js 'http://127.0.0.1:8888' '5JhhMGNPsuU52XXjZ57FcDKvbb7KLrEhN65tdTQFrH51uruZLHi' 'eosio.token' 'transfer' 'eva' 'active' '{"from":"eva","to":"rider1","quantity":"1 EVA","memo":""}' 100 | """ 101 | arguments = "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s'" % ( 102 | self.http_address, 103 | self.chain_id, 104 | self.key_provider, 105 | acct_contract, 106 | func_name, 107 | acct_owner, 108 | permission, 109 | json.dumps(data) 110 | ) 111 | response = muterun_js(self.current_dir + '/js/PushContractTransaction.js', arguments=arguments) 112 | if response.exitcode == 0: 113 | data = self.load_data(response.stdout) 114 | return data 115 | else: 116 | raise PushContractTransactionException(response.stderr) 117 | 118 | def get_table(self, code, scope, table, key_type='', index_position='', limit='', table_key='', lower_bound=''): 119 | arguments = "'%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s'" % ( 120 | self.http_address, 121 | self.chain_id, 122 | self.key_provider, 123 | code, 124 | scope, 125 | table, 126 | key_type, 127 | index_position, 128 | limit, 129 | table_key, 130 | lower_bound 131 | ) 132 | response = muterun_js(self.current_dir + '/js/GetTable.js', arguments=arguments) 133 | if response.exitcode == 0: 134 | data = self.load_data(response.stdout) 135 | return data 136 | else: 137 | raise GetTableException(response.stderr) 138 | 139 | def get_currency_balance(self, code, account, symbol): 140 | """ 141 | node GetCurrencyBalance.js 'http://127.0.0.1:8888' '5JhhMGNPsuU52XXjZ57FcDKvbb7KLrEhN65tdTQFrH51uruZLHi' 'eosio.token' 'xd455yhesww2' 'EVA' 142 | """ 143 | arguments = "'%s' '%s' '%s' '%s' '%s' '%s'" % ( 144 | self.http_address, 145 | self.chain_id, 146 | self.key_provider, 147 | code, 148 | account, 149 | symbol 150 | ) 151 | response = muterun_js(self.current_dir + '/js/GetCurrencyBalance.js', arguments=arguments) 152 | if response.exitcode == 0: 153 | data = self.load_data(response.stdout) 154 | return data 155 | else: 156 | raise GetBalanceException(response.stderr) 157 | 158 | def get_account(self, account_name): 159 | """ 160 | nodejs GetAccount.js "https://eos.greymass.com:443" "WIF" "eosjacklucky" 161 | """ 162 | arguments = "'%s' '%s' '%s' '%s'" % ( 163 | self.http_address, 164 | self.chain_id, 165 | self.key_provider, 166 | account_name 167 | ) 168 | response = muterun_js(self.current_dir + '/js/GetAccount.js', arguments=arguments) 169 | if response.exitcode == 0: 170 | data = self.load_data(response.stdout) 171 | return data 172 | else: 173 | raise GetAccountException(response.stderr) 174 | 175 | def load_data(self, stdout): 176 | true_string = stdout.decode('utf8') 177 | if self.debug_mode: 178 | print(true_string) 179 | return json.loads(true_string) 180 | 181 | 182 | def get_chain_id(self): 183 | r = requests.get(self.http_address+"/v1/chain/get_info") 184 | response = json.loads(r.text) 185 | return response["chain_id"] 186 | 187 | def get_block (self, block_num): 188 | """ 189 | nodejs GetBlock.js "https://eos.greymass.com:443" "WIF" "eosjacklucky" 190 | """ 191 | arguments = "'%s' '%s' '%s' '%s'" % ( 192 | self.http_address, 193 | self.chain_id, 194 | self.key_provider, 195 | block_num 196 | ) 197 | response = muterun_js(self.current_dir + '/js/GetBlock.js', arguments=arguments) 198 | if response.exitcode == 0: 199 | data = self.load_data(response.stdout) 200 | return data 201 | else: 202 | raise GetAccountException(response.stderr) 203 | 204 | def deserialize_action_data (self, c_abi, c_account, act_name, act_data_hex): 205 | """ 206 | Deserializes action data based on a specific contract abi. 207 | """ 208 | arguments = "'%s' '%s' '%s' '%s'" % ( 209 | c_abi, 210 | c_account, 211 | act_name, 212 | act_data_hex 213 | ) 214 | response = muterun_js(self.current_dir + '/js/ActionDeserializer.js', arguments=arguments) 215 | if response.exitcode == 0: 216 | data = self.load_data(response.stdout) 217 | return data 218 | else: 219 | raise GetAccountException(response.stderr) 220 | 221 | def deserialize_contract (self, c_abi_hex): 222 | """ 223 | Deserializes contract binary data 224 | """ 225 | arguments = "'%s' '%s'" % ( 226 | self.http_address, 227 | c_abi_hex 228 | ) 229 | response = muterun_js(self.current_dir + '/js/ContractDeserializer.js', arguments=arguments) 230 | if response.exitcode == 0: 231 | data = self.load_data(response.stdout) 232 | return data 233 | else: 234 | raise GetAccountException(response.stderr) 235 | -------------------------------------------------------------------------------- /eosjs_python/js/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eosjs_python", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "eosjs_python", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bytebuffer": "^5.0.1", 13 | "eosjs-deserialize": "npm:eosjs@^21.0.3", 14 | "fetch": "^1.1.0", 15 | "long": "^4.0.0", 16 | "node-fetch": "^2.6.1" 17 | } 18 | }, 19 | "node_modules/biskviit": { 20 | "version": "1.0.1", 21 | "resolved": "https://registry.npmjs.org/biskviit/-/biskviit-1.0.1.tgz", 22 | "integrity": "sha1-A3oM1LcbnjMf2QoRIt4X3EnkIKc=", 23 | "dependencies": { 24 | "psl": "^1.1.7" 25 | }, 26 | "engines": { 27 | "node": ">=1.0.0" 28 | } 29 | }, 30 | "node_modules/bn.js": { 31 | "version": "4.11.9", 32 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", 33 | "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" 34 | }, 35 | "node_modules/brorand": { 36 | "version": "1.1.0", 37 | "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", 38 | "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" 39 | }, 40 | "node_modules/bytebuffer": { 41 | "version": "5.0.1", 42 | "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", 43 | "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", 44 | "dependencies": { 45 | "long": "3.2.0" 46 | }, 47 | "engines": { 48 | "node": ">=0.8" 49 | } 50 | }, 51 | "node_modules/bytebuffer/node_modules/long": { 52 | "version": "3.2.0", 53 | "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", 54 | "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", 55 | "engines": { 56 | "node": ">=0.6" 57 | } 58 | }, 59 | "node_modules/elliptic": { 60 | "version": "6.5.3", 61 | "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", 62 | "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", 63 | "dependencies": { 64 | "bn.js": "^4.4.0", 65 | "brorand": "^1.0.1", 66 | "hash.js": "^1.0.0", 67 | "hmac-drbg": "^1.0.0", 68 | "inherits": "^2.0.1", 69 | "minimalistic-assert": "^1.0.0", 70 | "minimalistic-crypto-utils": "^1.0.0" 71 | } 72 | }, 73 | "node_modules/encoding": { 74 | "version": "0.1.12", 75 | "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", 76 | "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", 77 | "dependencies": { 78 | "iconv-lite": "~0.4.13" 79 | } 80 | }, 81 | "node_modules/eosjs-deserialize": { 82 | "name": "eosjs", 83 | "version": "21.0.3", 84 | "resolved": "https://registry.npmjs.org/eosjs/-/eosjs-21.0.3.tgz", 85 | "integrity": "sha512-EO/lM1pvA1nohzmPnwyE6k5OvYqRo9ZkI6PfMI4npXkru04Nt/zBjcneNLFpRc7gg5W7vtGLzJeLB7NOFquDMg==", 86 | "dependencies": { 87 | "elliptic": "6.5.3", 88 | "hash.js": "1.1.7", 89 | "pako": "1.0.11" 90 | } 91 | }, 92 | "node_modules/fetch": { 93 | "version": "1.1.0", 94 | "resolved": "https://registry.npmjs.org/fetch/-/fetch-1.1.0.tgz", 95 | "integrity": "sha1-CoJ58Gvjf58Ou1Z1YKMKSA2lmi4=", 96 | "dependencies": { 97 | "biskviit": "1.0.1", 98 | "encoding": "0.1.12" 99 | } 100 | }, 101 | "node_modules/hash.js": { 102 | "version": "1.1.7", 103 | "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", 104 | "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", 105 | "dependencies": { 106 | "inherits": "^2.0.3", 107 | "minimalistic-assert": "^1.0.1" 108 | } 109 | }, 110 | "node_modules/hmac-drbg": { 111 | "version": "1.0.1", 112 | "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", 113 | "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", 114 | "dependencies": { 115 | "hash.js": "^1.0.3", 116 | "minimalistic-assert": "^1.0.0", 117 | "minimalistic-crypto-utils": "^1.0.1" 118 | } 119 | }, 120 | "node_modules/iconv-lite": { 121 | "version": "0.4.24", 122 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 123 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 124 | "dependencies": { 125 | "safer-buffer": ">= 2.1.2 < 3" 126 | }, 127 | "engines": { 128 | "node": ">=0.10.0" 129 | } 130 | }, 131 | "node_modules/inherits": { 132 | "version": "2.0.4", 133 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 134 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 135 | }, 136 | "node_modules/long": { 137 | "version": "4.0.0", 138 | "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", 139 | "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" 140 | }, 141 | "node_modules/minimalistic-assert": { 142 | "version": "1.0.1", 143 | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", 144 | "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" 145 | }, 146 | "node_modules/minimalistic-crypto-utils": { 147 | "version": "1.0.1", 148 | "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", 149 | "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" 150 | }, 151 | "node_modules/node-fetch": { 152 | "version": "2.6.1", 153 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 154 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", 155 | "engines": { 156 | "node": "4.x || >=6.0.0" 157 | } 158 | }, 159 | "node_modules/pako": { 160 | "version": "1.0.11", 161 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", 162 | "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" 163 | }, 164 | "node_modules/psl": { 165 | "version": "1.8.0", 166 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", 167 | "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" 168 | }, 169 | "node_modules/safer-buffer": { 170 | "version": "2.1.2", 171 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 172 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 173 | } 174 | }, 175 | "dependencies": { 176 | "biskviit": { 177 | "version": "1.0.1", 178 | "resolved": "https://registry.npmjs.org/biskviit/-/biskviit-1.0.1.tgz", 179 | "integrity": "sha1-A3oM1LcbnjMf2QoRIt4X3EnkIKc=", 180 | "requires": { 181 | "psl": "^1.1.7" 182 | } 183 | }, 184 | "bn.js": { 185 | "version": "4.11.9", 186 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", 187 | "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" 188 | }, 189 | "brorand": { 190 | "version": "1.1.0", 191 | "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", 192 | "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" 193 | }, 194 | "bytebuffer": { 195 | "version": "5.0.1", 196 | "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", 197 | "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", 198 | "requires": { 199 | "long": "3.2.0" 200 | }, 201 | "dependencies": { 202 | "long": { 203 | "version": "3.2.0", 204 | "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", 205 | "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" 206 | } 207 | } 208 | }, 209 | "elliptic": { 210 | "version": "6.5.3", 211 | "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", 212 | "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", 213 | "requires": { 214 | "bn.js": "^4.4.0", 215 | "brorand": "^1.0.1", 216 | "hash.js": "^1.0.0", 217 | "hmac-drbg": "^1.0.0", 218 | "inherits": "^2.0.1", 219 | "minimalistic-assert": "^1.0.0", 220 | "minimalistic-crypto-utils": "^1.0.0" 221 | } 222 | }, 223 | "encoding": { 224 | "version": "0.1.12", 225 | "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", 226 | "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", 227 | "requires": { 228 | "iconv-lite": "~0.4.13" 229 | } 230 | }, 231 | "eosjs-deserialize": { 232 | "version": "npm:eosjs@21.0.3", 233 | "resolved": "https://registry.npmjs.org/eosjs/-/eosjs-21.0.3.tgz", 234 | "integrity": "sha512-EO/lM1pvA1nohzmPnwyE6k5OvYqRo9ZkI6PfMI4npXkru04Nt/zBjcneNLFpRc7gg5W7vtGLzJeLB7NOFquDMg==", 235 | "requires": { 236 | "elliptic": "6.5.3", 237 | "hash.js": "1.1.7", 238 | "pako": "1.0.11" 239 | } 240 | }, 241 | "fetch": { 242 | "version": "1.1.0", 243 | "resolved": "https://registry.npmjs.org/fetch/-/fetch-1.1.0.tgz", 244 | "integrity": "sha1-CoJ58Gvjf58Ou1Z1YKMKSA2lmi4=", 245 | "requires": { 246 | "biskviit": "1.0.1", 247 | "encoding": "0.1.12" 248 | } 249 | }, 250 | "hash.js": { 251 | "version": "1.1.7", 252 | "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", 253 | "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", 254 | "requires": { 255 | "inherits": "^2.0.3", 256 | "minimalistic-assert": "^1.0.1" 257 | } 258 | }, 259 | "hmac-drbg": { 260 | "version": "1.0.1", 261 | "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", 262 | "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", 263 | "requires": { 264 | "hash.js": "^1.0.3", 265 | "minimalistic-assert": "^1.0.0", 266 | "minimalistic-crypto-utils": "^1.0.1" 267 | } 268 | }, 269 | "iconv-lite": { 270 | "version": "0.4.24", 271 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 272 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 273 | "requires": { 274 | "safer-buffer": ">= 2.1.2 < 3" 275 | } 276 | }, 277 | "inherits": { 278 | "version": "2.0.4", 279 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 280 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 281 | }, 282 | "long": { 283 | "version": "4.0.0", 284 | "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", 285 | "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" 286 | }, 287 | "minimalistic-assert": { 288 | "version": "1.0.1", 289 | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", 290 | "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" 291 | }, 292 | "minimalistic-crypto-utils": { 293 | "version": "1.0.1", 294 | "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", 295 | "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" 296 | }, 297 | "node-fetch": { 298 | "version": "2.6.1", 299 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 300 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" 301 | }, 302 | "pako": { 303 | "version": "1.0.11", 304 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", 305 | "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" 306 | }, 307 | "psl": { 308 | "version": "1.8.0", 309 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", 310 | "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" 311 | }, 312 | "safer-buffer": { 313 | "version": "2.1.2", 314 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 315 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 316 | } 317 | } 318 | } 319 | --------------------------------------------------------------------------------