mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-09 18:45:38 +00:00
c54453729c
* correct web3 hide/show logic * refactor web3 node lib * refactor web3 wallet to use new web3 node * update web3 node init to use new lib * update web3 wallet saga to use new lib, address unlock flow bug * remove comments * add validators for web3 methods * update web3 node to use latest standards * remove legacy function * update lib call, add account unlock check * add & use new flavor of unsetWeb3Node * address PR feedback * add test, update tests, update snapshot
30 lines
642 B
TypeScript
30 lines
642 B
TypeScript
import RPCRequests from '../rpc/requests';
|
|
import {
|
|
SendTransactionRequest,
|
|
SignMessageRequest,
|
|
GetAccountsRequest,
|
|
Web3Transaction
|
|
} from './types';
|
|
|
|
export default class Web3Requests extends RPCRequests {
|
|
public sendTransaction(web3Tx: Web3Transaction): SendTransactionRequest {
|
|
return {
|
|
method: 'eth_sendTransaction',
|
|
params: [web3Tx]
|
|
};
|
|
}
|
|
|
|
public signMessage(msgHex: string, fromAddr: string): SignMessageRequest {
|
|
return {
|
|
method: 'personal_sign',
|
|
params: [msgHex, fromAddr]
|
|
};
|
|
}
|
|
|
|
public getAccounts(): GetAccountsRequest {
|
|
return {
|
|
method: 'eth_accounts'
|
|
};
|
|
}
|
|
}
|