-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding More Methods for Testdapp (#1065)
* added section to methods * shortcuts * more shortcuts for switch/add * wider * signMsg + send * removed dup * dynamically import SDK * misc * separate shortcuts and methods * updated to master, 3.9, 3.7 * RpcRequestInput * 3.9.0-canary.5 * bump version
- Loading branch information
1 parent
a4a3194
commit b2f1e86
Showing
20 changed files
with
1,497 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
apps/testapp/src/components/RpcMethods/method/RpcRequestInput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { JSONRPCMethod } from '@coinbase/wallet-sdk/dist/provider/JSONRPC'; | ||
|
||
type FormattedParamsType = Record<string, unknown> | string; | ||
|
||
type methodType = `${JSONRPCMethod}`; | ||
|
||
export type RpcRequestInput = { | ||
connected?: boolean; | ||
method: methodType; | ||
params: Array<{ key: string; required?: boolean }>; | ||
format?: (data: Record<string, string>) => FormattedParamsType[]; | ||
}; |
13 changes: 13 additions & 0 deletions
13
apps/testapp/src/components/RpcMethods/method/connectionMethods.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { RpcRequestInput } from './RpcRequestInput'; | ||
|
||
const ethRequestAccounts: RpcRequestInput = { | ||
method: 'eth_requestAccounts', | ||
params: [], | ||
}; | ||
|
||
const ethAccounts: RpcRequestInput = { | ||
method: 'eth_accounts', | ||
params: [], | ||
}; | ||
|
||
export const connectionMethods = [ethRequestAccounts, ethAccounts]; |
Oops, something went wrong.