-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc update #1079
Misc update #1079
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/> | ||
// Licensed under the Apache License, version 2.0 | ||
|
||
export type Web3Method = | ||
| 'requestEthereumAccounts' | ||
| 'signEthereumMessage' | ||
| 'signEthereumTransaction' | ||
| 'submitEthereumTransaction' | ||
| 'ethereumAddressFromSignedMessage' | ||
| 'scanQRCode' | ||
| 'generic' | ||
| 'childRequestEthereumAccounts' | ||
| 'addEthereumChain' | ||
| 'switchEthereumChain' | ||
| 'makeEthereumJSONRPCRequest' | ||
| 'watchAsset' | ||
| 'selectProvider' | ||
| 'connectAndSignIn'; | ||
export const web3Methods = [ | ||
'requestEthereumAccounts', | ||
'signEthereumMessage', | ||
'signEthereumTransaction', | ||
'submitEthereumTransaction', | ||
'ethereumAddressFromSignedMessage', | ||
'scanQRCode', | ||
'generic', | ||
'childRequestEthereumAccounts', | ||
'addEthereumChain', | ||
'switchEthereumChain', | ||
'makeEthereumJSONRPCRequest', | ||
'watchAsset', | ||
'selectProvider', | ||
'connectAndSignIn', | ||
] as const; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can derive union type from array, but not other way around. doing this so wallet can check is a string is valid web3method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. love it |
||
|
||
export type Web3Method = (typeof web3Methods)[number]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ type _Web3Request = | |
appLogoUrl: string | null; | ||
}; | ||
} | ||
| { | ||
method: 'childRequestEthereumAccounts'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another type that is used between WL extension and RN, adding it here as the new |
||
} | ||
| { | ||
method: 'connectAndSignIn'; | ||
params: { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
save selected sdkversion in localstorage, so sdk remians the same version on each refresh