Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenmarcus committed Aug 20, 2024
1 parent 475ed07 commit f89b8d7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ This module provides a wrapper around common RPC calls used to fetch on-chain da
## Available Modules & Methods

We now accepts rpcUrl in each method, so you can pass your own RPC regarding one of those on the list:
`packages/rpc/src/util.ts#9`
https://docs.near.org/api/rpc/providers

If `rpcUrl` is not passed, it will fallback to the `https://rpc.mainnet.near.org`.

### `getBalance(account: string, rpcUrl?: string): BN`

Expand Down
2 changes: 1 addition & 1 deletion packages/rpc/src/methods/keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AccessKey, getAccessKeys } from './keys';
jest.mock('cross-fetch');

describe('keys', () => {
const getRes = async (): Promise<AccessKey[]> => await getAccessKeys({'nate.near', rpcUrl: 'rpc'});
const getRes = async (): Promise<AccessKey[]> => await getAccessKeys({ accountId: 'nate.near', rpcUrl: 'rpc'});

it('should return access keys for accounts', async () => {
(fetch as jest.Mock).mockResolvedValueOnce({
Expand Down
2 changes: 1 addition & 1 deletion packages/rpc/src/methods/txnstatus.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { queryNearRpc, requestFromNearRpc } from '../util';
import { queryNearRpc } from '../util';

export type TxnStatus = 'pending' | 'success' | 'failure';

Expand Down
2 changes: 1 addition & 1 deletion packages/rpc/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fetch from 'cross-fetch';



export const queryNearRpc = async ({params, method, rpcUrl}) => {
export const queryNearRpc = async ({params, method, rpcUrl}): Promise<{ result: Record<string, unknown>, error: unknown } | undefined> => {
return await requestFromNearRpc({
jsonrpc: '2.0',
id: 'dontcare',
Expand Down

0 comments on commit f89b8d7

Please sign in to comment.