@harmony-js/contract
Advanced tools
Comparing version 0.0.46 to 0.0.47
@@ -0,0 +0,0 @@ /// <reference types="bn.js" /> |
@@ -0,0 +0,0 @@ import { AbiCoder as ABICoder, ParamType } from './abiCoder'; |
import { AbiCoderClass } from './api'; | ||
export declare function AbiCoder(): AbiCoderClass; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,0 +0,0 @@ export declare const jsonInterfaceMethodToString: (json: any) => string; |
@@ -0,0 +0,0 @@ import { Wallet } from '@harmony-js/account'; |
@@ -0,0 +0,0 @@ import { Wallet } from '@harmony-js/account'; |
@@ -0,0 +0,0 @@ import { LogSub } from '@harmony-js/network'; |
@@ -0,0 +0,0 @@ import { AbiCoderClass } from '../abi/api'; |
@@ -0,0 +0,0 @@ export * from './abi/index'; |
@@ -0,0 +0,0 @@ import { Wallet } from '@harmony-js/account'; |
@@ -47,8 +47,9 @@ "use strict"; | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var nonce_1, _a, gasLimit_1, _b, from_1, result, error_1; | ||
return tslib_1.__generator(this, function (_c) { | ||
switch (_c.label) { | ||
var e_1, _a, nonce_1, _b, _c, gasLimit_1, _d, from_1, keys, txPayload, sendPayload, keys_1, keys_1_1, key, result, error_1; | ||
return tslib_1.__generator(this, function (_e) { | ||
switch (_e.label) { | ||
case 0: | ||
_c.trys.push([0, 6, , 7]); | ||
_a = network_1.getResultForData; | ||
_e.trys.push([0, 8, , 9]); | ||
if (!(this.wallet.signer || options.from)) return [3 /*break*/, 2]; | ||
_c = network_1.getResultForData; | ||
return [4 /*yield*/, this.wallet.messenger.send("hmy_getTransactionCount" /* GetTransactionCount */, [ | ||
@@ -59,13 +60,19 @@ this.wallet.signer ? this.wallet.signer.address : options.from, | ||
case 1: | ||
nonce_1 = _a.apply(void 0, [_c.sent()]); | ||
if (!options) return [3 /*break*/, 2]; | ||
gasLimit_1 = options.gas || options.gasLimit; | ||
return [3 /*break*/, 4]; | ||
_b = _c.apply(void 0, [_e.sent()]); | ||
return [3 /*break*/, 3]; | ||
case 2: | ||
_b = utils_1.hexToBN; | ||
return [4 /*yield*/, this.estimateGas()]; | ||
_b = '0x0'; | ||
_e.label = 3; | ||
case 3: | ||
gasLimit_1 = _b.apply(void 0, [_c.sent()]); | ||
_c.label = 4; | ||
nonce_1 = _b; | ||
if (!options) return [3 /*break*/, 4]; | ||
gasLimit_1 = options.gas || options.gasLimit; | ||
return [3 /*break*/, 6]; | ||
case 4: | ||
_d = utils_1.hexToBN; | ||
return [4 /*yield*/, this.estimateGas()]; | ||
case 5: | ||
gasLimit_1 = _d.apply(void 0, [_e.sent()]); | ||
_e.label = 6; | ||
case 6: | ||
if (this.wallet.signer) { | ||
@@ -78,8 +85,27 @@ from_1 = | ||
}); | ||
keys = Object.keys(this.transaction.txPayload); | ||
txPayload = this.transaction.txPayload; | ||
sendPayload = {}; | ||
try { | ||
for (keys_1 = tslib_1.__values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) { | ||
key = keys_1_1.value; | ||
// tslint:disable-next-line: no-unused-expression | ||
if (txPayload[key] !== '0x') { | ||
sendPayload[key] = txPayload[key]; | ||
} | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return [4 /*yield*/, this.wallet.messenger.send("hmy_call" /* Call */, [ | ||
this.transaction.txPayload, | ||
sendPayload, | ||
blockNumber, | ||
])]; | ||
case 5: | ||
result = _c.sent(); | ||
case 7: | ||
result = _e.sent(); | ||
if (result.isError()) { | ||
@@ -96,7 +122,7 @@ throw result.message; | ||
} | ||
return [3 /*break*/, 7]; | ||
case 6: | ||
error_1 = _c.sent(); | ||
return [3 /*break*/, 9]; | ||
case 8: | ||
error_1 = _e.sent(); | ||
throw error_1; | ||
case 7: return [2 /*return*/]; | ||
case 9: return [2 /*return*/]; | ||
} | ||
@@ -103,0 +129,0 @@ }); |
@@ -0,0 +0,0 @@ import { AbiCoderClass } from '../abi/api'; |
@@ -0,0 +0,0 @@ import { AbiItemModel, AbiOutput, AbiInput } from './types'; |
@@ -0,0 +0,0 @@ import { AbiItemModel } from './types'; |
@@ -0,0 +0,0 @@ export interface AbiModel { |
@@ -0,0 +0,0 @@ import { AbiItemModel } from '../models/types'; |
@@ -0,0 +0,0 @@ import { AbiItemModel } from '../models/types'; |
@@ -0,0 +0,0 @@ export declare const inputLogFormatter: (options: any) => any; |
@@ -0,0 +0,0 @@ import { AbiModel } from '../models/AbiModel'; |
@@ -0,0 +0,0 @@ export interface ContractOptions { |
@@ -0,0 +0,0 @@ export declare enum ContractStatus { |
{ | ||
"name": "@harmony-js/contract", | ||
"version": "0.0.46", | ||
"version": "0.0.47", | ||
"description": "contract libraries for harmony", | ||
@@ -21,9 +21,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@harmony-js/account": "0.0.46", | ||
"@harmony-js/crypto": "0.0.46", | ||
"@harmony-js/network": "0.0.46", | ||
"@harmony-js/transaction": "0.0.46", | ||
"@harmony-js/utils": "0.0.46" | ||
"@harmony-js/account": "0.0.47", | ||
"@harmony-js/crypto": "0.0.47", | ||
"@harmony-js/network": "0.0.47", | ||
"@harmony-js/transaction": "0.0.47", | ||
"@harmony-js/utils": "0.0.47" | ||
}, | ||
"gitHead": "e5d47c94bb0c804bc0b3189687f624624cbdc4d0" | ||
"gitHead": "caa33e4b2efba09a933b15a378c785d2140006ea" | ||
} |
@@ -65,8 +65,11 @@ import { Wallet } from '@harmony-js/account'; | ||
try { | ||
const nonce = getResultForData( | ||
await this.wallet.messenger.send(RPCMethod.GetTransactionCount, [ | ||
this.wallet.signer ? this.wallet.signer.address : options.from, | ||
blockNumber, | ||
]), | ||
); | ||
const nonce = | ||
this.wallet.signer || options.from | ||
? getResultForData( | ||
await this.wallet.messenger.send(RPCMethod.GetTransactionCount, [ | ||
this.wallet.signer ? this.wallet.signer.address : options.from, | ||
blockNumber, | ||
]), | ||
) | ||
: '0x0'; | ||
@@ -85,2 +88,3 @@ let gasLimit: any; | ||
} | ||
this.transaction = this.transaction.map((tx: any) => { | ||
@@ -96,5 +100,38 @@ return { | ||
}); | ||
const keys: string[] = Object.keys(this.transaction.txPayload); | ||
interface TxPayload { | ||
[key: string]: any; | ||
from?: string; | ||
to?: string; | ||
shardID?: string; | ||
gas?: string; | ||
gasPrice?: string; | ||
value?: string; | ||
data?: string; | ||
nonce?: string; | ||
} | ||
interface SendPayload { | ||
[key: string]: any; | ||
from?: string; | ||
to?: string; | ||
shardID?: string; | ||
gas?: string; | ||
gasPrice?: string; | ||
value?: string; | ||
data?: string; | ||
nonce?: string; | ||
} | ||
const txPayload: TxPayload = this.transaction.txPayload; | ||
const sendPayload: SendPayload = {}; | ||
for (const key of keys) { | ||
// tslint:disable-next-line: no-unused-expression | ||
if (txPayload[key] !== '0x') { | ||
sendPayload[key] = txPayload[key]; | ||
} | ||
} | ||
const result = await this.wallet.messenger.send(RPCMethod.Call, [ | ||
this.transaction.txPayload, | ||
sendPayload, | ||
blockNumber, | ||
@@ -215,2 +252,3 @@ ]); | ||
); | ||
return result; | ||
@@ -217,0 +255,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16665611
12469
+ Added@harmony-js/account@0.0.47(transitive)
+ Added@harmony-js/core@0.0.47(transitive)
+ Added@harmony-js/crypto@0.0.47(transitive)
+ Added@harmony-js/network@0.0.47(transitive)
+ Added@harmony-js/transaction@0.0.47(transitive)
+ Added@harmony-js/utils@0.0.47(transitive)
- Removed@harmony-js/account@0.0.46(transitive)
- Removed@harmony-js/core@0.0.46(transitive)
- Removed@harmony-js/crypto@0.0.46(transitive)
- Removed@harmony-js/network@0.0.46(transitive)
- Removed@harmony-js/transaction@0.0.46(transitive)
- Removed@harmony-js/utils@0.0.46(transitive)
Updated@harmony-js/account@0.0.47
Updated@harmony-js/crypto@0.0.47
Updated@harmony-js/network@0.0.47
Updated@harmony-js/utils@0.0.47