@harmony-js/account
Advanced tools
Comparing version 0.1.1 to 0.1.2
/// <reference types="bn.js" /> | ||
import { BN, Signature } from '@harmony-js/crypto'; | ||
import { ChainID, ChainType } from '@harmony-js/utils'; | ||
import { HttpProvider, WSProvider } from '@harmony-js/network'; | ||
import { HttpProvider, WSProvider, RPCRequestPayload } from '@harmony-js/network'; | ||
import { TransasctionReceipt } from '@harmony-js/transaction'; | ||
@@ -38,4 +38,4 @@ interface Web3TxPrams { | ||
getHdWallet(mnemonic: string): void; | ||
send(...args: [string, (string | any[] | undefined)?, (string | undefined)?]): void; | ||
sendAsync(...args: [string, (string | any[] | undefined)?, (string | undefined)?]): void; | ||
send(...args: [RPCRequestPayload<any>, any]): void; | ||
sendAsync(...args: [RPCRequestPayload<any>, any]): void; | ||
getAccounts(cb?: Function): string[]; | ||
@@ -42,0 +42,0 @@ getPrivateKey(address: string, cb?: Function): any; |
@@ -85,3 +85,9 @@ "use strict"; | ||
} | ||
this.messenger.send.apply(this.messenger, args); | ||
var method = args[0].method; | ||
var newMethod = method; | ||
if (method.startsWith('eth')) { | ||
newMethod = method.replace('eth', 'hmy'); | ||
} | ||
args[0].method = newMethod; | ||
this.provider.send(args[0], args[1]); | ||
}; | ||
@@ -88,0 +94,0 @@ HDNode.prototype.sendAsync = function () { |
@@ -783,3 +783,9 @@ /** | ||
} | ||
this.messenger.send.apply(this.messenger, args); | ||
var method = args[0].method; | ||
var newMethod = method; | ||
if (method.startsWith('eth')) { | ||
newMethod = method.replace('eth', 'hmy'); | ||
} | ||
args[0].method = newMethod; | ||
this.provider.send(args[0], args[1]); | ||
}; | ||
@@ -786,0 +792,0 @@ HDNode.prototype.sendAsync = function () { |
@@ -779,3 +779,9 @@ /** | ||
} | ||
this.messenger.send.apply(this.messenger, args); | ||
var method = args[0].method; | ||
var newMethod = method; | ||
if (method.startsWith('eth')) { | ||
newMethod = method.replace('eth', 'hmy'); | ||
} | ||
args[0].method = newMethod; | ||
this.provider.send(args[0], args[1]); | ||
}; | ||
@@ -782,0 +788,0 @@ HDNode.prototype.sendAsync = function () { |
@@ -780,3 +780,9 @@ /** | ||
} | ||
this.messenger.send.apply(this.messenger, args); | ||
var method = args[0].method; | ||
var newMethod = method; | ||
if (method.startsWith('eth')) { | ||
newMethod = method.replace('eth', 'hmy'); | ||
} | ||
args[0].method = newMethod; | ||
this.provider.send(args[0], args[1]); | ||
}; | ||
@@ -783,0 +789,0 @@ HDNode.prototype.sendAsync = function () { |
{ | ||
"name": "@harmony-js/account", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "account and wallet for harmony", | ||
@@ -21,3 +21,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@harmony-js/core": "0.1.1", | ||
"@harmony-js/core": "0.1.2", | ||
"@harmony-js/crypto": "0.1.0", | ||
@@ -28,3 +28,3 @@ "@harmony-js/network": "0.1.1", | ||
}, | ||
"gitHead": "c25c3dacfc42f5055928cfd74fece9df667f852d" | ||
"gitHead": "74bd9e9327a5a24aba4d7662d458f96fda172aae" | ||
} |
@@ -13,4 +13,9 @@ import {bip39, hdkey, getAddress, BN, Signature} from '@harmony-js/crypto'; | ||
} from '@harmony-js/utils'; | ||
import {Messenger, HttpProvider, WSProvider} from '@harmony-js/network'; | ||
import { | ||
Messenger, | ||
HttpProvider, | ||
WSProvider, | ||
RPCRequestPayload, | ||
} from '@harmony-js/network'; | ||
import { | ||
Transaction, | ||
@@ -125,11 +130,14 @@ TxStatus, | ||
} | ||
send( | ||
...args: [string, (string | any[] | undefined)?, (string | undefined)?] | ||
) { | ||
this.messenger.send.apply(this.messenger, args); | ||
send(...args: [RPCRequestPayload<any>, any]) { | ||
const method = args[0].method; | ||
let newMethod: string = method; | ||
if (method.startsWith('eth')) { | ||
newMethod = method.replace('eth', 'hmy'); | ||
} | ||
args[0].method = newMethod; | ||
this.provider.send(args[0], args[1]); | ||
} | ||
sendAsync( | ||
...args: [string, (string | any[] | undefined)?, (string | undefined)?] | ||
) { | ||
sendAsync(...args: [RPCRequestPayload<any>, any]) { | ||
this.send(...args); | ||
@@ -136,0 +144,0 @@ } |
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
357218
4333
+ Added@harmony-js/contract@0.1.2(transitive)
+ Added@harmony-js/core@0.1.2(transitive)
- Removed@harmony-js/contract@0.1.1(transitive)
- Removed@harmony-js/core@0.1.1(transitive)
Updated@harmony-js/core@0.1.2