Skip to content

Commit 4c44c23

Browse files
authored
Merge pull request #210 from TripleSpeeder/develop
fix: add "jsonrpc: '2.0'" to sendAsync methods. Closes #211
2 parents 40c0128 + fb6d999 commit 4c44c23

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/modules/select/wallets/portis.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function portis(options: SdkWalletOptions & CommonWalletOptions): WalletModule {
5151

5252
provider.sendAsync(
5353
{
54+
jsonrpc: '2.0',
5455
method: 'eth_getBalance',
5556
params: [provider.address, 'latest'],
5657
id: 1

src/modules/select/wallets/squarelink.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function squarelink(
5050

5151
provider.sendAsync(
5252
{
53+
jsonrpc: '2.0',
5354
method: 'eth_getBalance',
5455
params: [instance.accounts[0], 'latest'],
5556
id: 1

src/utilities.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function getNetwork(provider: any): Promise<number | any> {
77
return new Promise((resolve, reject) => {
88
provider.sendAsync(
99
{
10+
jsonrpc: '2.0',
1011
method: 'net_version',
1112
params: [],
1213
id: 42
@@ -24,6 +25,7 @@ export function getAddress(provider: any): Promise<string | any> {
2425
return new Promise((resolve, reject) => {
2526
provider.sendAsync(
2627
{
28+
jsonrpc: '2.0',
2729
method: 'eth_accounts',
2830
params: [],
2931
id: 42
@@ -48,6 +50,7 @@ export function getBalance(provider: any): Promise<string | any> {
4850

4951
provider.sendAsync(
5052
{
53+
jsonrpc: '2.0',
5154
method: 'eth_getBalance',
5255
params: [currentAddress, 'latest'],
5356
id: 42

0 commit comments

Comments
 (0)