-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BW-857] Abstract handshake into
coinbase_handshake
(#1475)
* SDK changes * playground changes * merge switch w if * allow wallet_sendCalls in provider * both methods * wallet_getCallsStatus * tests
- Loading branch information
1 parent
701e2d4
commit 88773cb
Showing
9 changed files
with
185 additions
and
12 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
27 changes: 27 additions & 0 deletions
27
examples/testapp/src/components/RpcMethods/method/ephemeralMethods.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,27 @@ | ||
import { RpcRequestInput } from './RpcRequestInput'; | ||
|
||
const walletSendCallsEphemeral: RpcRequestInput = { | ||
method: 'wallet_sendCalls', | ||
params: [ | ||
{ key: 'version', required: true }, | ||
{ key: 'chainId', required: true }, | ||
{ key: 'calls', required: true }, | ||
], | ||
format: (data: Record<string, string>) => [ | ||
{ | ||
chainId: data.chainId, | ||
calls: data.calls, | ||
version: data.version, | ||
}, | ||
], | ||
}; | ||
|
||
const walletSignEphemeral: RpcRequestInput = { | ||
method: 'wallet_sign', | ||
params: [{ key: 'message', required: true }], | ||
format: (data: Record<string, string>) => [ | ||
`0x${Buffer.from(data.message, 'utf8').toString('hex')}`, | ||
], | ||
}; | ||
|
||
export const ephemeralMethods = [walletSendCallsEphemeral, walletSignEphemeral]; |
26 changes: 26 additions & 0 deletions
26
examples/testapp/src/components/RpcMethods/shortcut/ephemeralMethodShortcuts.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,26 @@ | ||
import { ShortcutType } from './ShortcutType'; | ||
|
||
const walletSendCallsEphemeralShortcuts: ShortcutType[] = [ | ||
{ | ||
key: 'wallet_sendCalls', | ||
data: { | ||
chainId: '84532', | ||
calls: [], | ||
version: '1', | ||
}, | ||
}, | ||
]; | ||
|
||
const walletSignEphemeralShortcuts: ShortcutType[] = [ | ||
{ | ||
key: 'wallet_sign', | ||
data: { | ||
message: 'Hello, world!', | ||
}, | ||
}, | ||
]; | ||
|
||
export const ephemeralMethodShortcutsMap = { | ||
wallet_sendCalls: walletSendCallsEphemeralShortcuts, | ||
wallet_sign: walletSignEphemeralShortcuts, | ||
}; |
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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const CB_KEYS_URL = 'https://keys.coinbase.com/connect'; | ||
export const CB_WALLET_RPC_URL = 'http://rpc.wallet.coinbase.com'; | ||
export const WALLETLINK_URL = 'https://www.walletlink.org'; | ||
export const CBW_MOBILE_DEEPLINK_URL = 'https://go.cb-w.com/walletlink'; |
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