-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat: decouple from snjs #194
Conversation
1. Implemented JSON-RPC SNIP (https://community.starknet.io/t/snip-standardizing-starknet-wallet-connections-with-write-api-and-json-rpc-integration/98049) 2. Decoupled get-starknet-core from snjs 3. Added silent mode to wallet-window connection
it will be complicated for wallets to decode FELT-encoded entrypoints. it's doable but slow, and slightly shifting from a pure RPC-schema approach seems reasonable in this use case.
I can't comment inline because there was no change, but in my experience |
@@ -39,11 +40,14 @@ export interface ConnectOptions extends GetWalletOptions { | |||
storeVersion?: StoreVersion | |||
} | |||
|
|||
const enableWithVersion = async (wallet: StarknetWindowObject | null) => { | |||
const enableWithVersion = async ( |
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.
Should get rid of this method and just use connect -> sn.enable()
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.
could u pls show with code? 🙏
Maybe we can do a complex typing here like
If it's only a string, we apply the same icon for both dark and light mode in the Wallet connection modal. |
@avimak I think we can also get rid of
EDIT: we can also get rid of |
Co-authored-by: naorye2 <[email protected]>
Co-authored-by: naorye2 <[email protected]>
as-per @amanusk suggestion
} from "starknet4" | ||
export enum StarknetChainId { | ||
SN_MAIN = "0x534e5f4d41494e", | ||
SN_GOERLI = "0x534e5f474f45524c49", |
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.
You should add Sepolia Testnet, as Braavos is handling it.
SN_SEPOLIA = "0x534e5f5345504f4c4941"
/** | ||
* The class ABI, as supplied by the user declaring the class | ||
*/ | ||
abi?: string |
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.
Type string for abi is not working properly.
Only any[]
is working properly.
|
||
export type AccountChangeEventHandler = (accounts: string[]) => void | ||
type Call = { |
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.
Call type : This type name already exists in Starknet.js, but their definition are not the same, generating confusion when coding. My proposal is to rename in the interface Call
to CallParameters
.
|
||
export interface GetStarknetOptions { | ||
windowObject: Record<string, any> | ||
isWalletObject: (wallet: any) => boolean |
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.
For devs who would like to create their own UI, it will be useful to export for them :
isWalletObject
scanObjectForWallets
* feat: enhance RpcMessage and EventListener types * chore: export more types
…into feat/new-json-rpc-api
get-starknet-core
from snjs