UNPKG

openchain-sdk-yxl-wx-request

Version:

openchain sd YxL wx request

42 lines (31 loc) 1.02 kB
'use strict'; require('chai').should(); const OpenChainSDK = require('../index'); const sdk = new OpenChainSDK({ host: 'nodeapitest.yuxinlink.com', }); describe('Test contract create operation', function() { it('test operation.contractCreateOperation()', function() { let contractCreateOperation = sdk.operation.contractCreateOperation({ sourceAddress: 'YxLVkMLxmJEtDQEob3SvVnZGjp7XrWSDvKm7a', initBalance: '1000', type: 0, payload: 'afasfsaff', initInput: 'aaaaa', metadata: 'Test contract create operation', }); if (contractCreateOperation.errorCode !== 0) { console.log(contractCreateOperation); return; } const operationItem = contractCreateOperation.result.operation; const blobInfo = sdk.transaction.buildBlob({ sourceAddress: 'YxLVkMLxmJEtDQEob3SvVnZGjp7XrWSDvKm7a', gasPrice: '1000', feeLimit: '1000000', nonce: '123', operations: [ operationItem ], }); console.log(blobInfo); }); });