-
Notifications
You must be signed in to change notification settings - Fork 106
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
Decoupled Starknet.js - Experimental Braavos wallet 0.0.1 #196
Comments
the
the
we already have these APIs today:
|
Thanks for the answers.
{
type: "wallet_requestAccounts"
params?: RequestAccountsParameters
result: string[]
} with a response as an array of string (just for an account address)? export type AccountChangeEventHandler = (accounts?: string[]) => void with again an array of string (with again a 's' at the end of 'account'?
|
Hello, |
3. Event |
7. Request for Network : export type RpcMessage =
| {
type: "wallet_requestNetwork"
params?: RequestNetworkParameters
result: string // authorized answers : SN_MAIN or SN_GOERLI or Error
}
export interface RequestNetworkParameters {
/**
* If true, the wallet will not show the wallet-unlock UI in case of a locked wallet,
* nor the dApp-approve UI in case of a non-allowed dApp.
*/
silentMode?: boolean
} |
10. requests |
11. request |
15. request export interface AddDeployAccountTransactionResult {
transaction_hash: FELT
contract_address: FELT
} But the real response is an array for |
16. request |
17. |
In summary, my feeling is that the |
I have made some extra-tests, and I just added 3 comments : 15a, 15b & 18. |
18. Unsubscribe wallet.off('networkChanged', () => {}); but the events continue to be received. The subscription do not stop. |
Yes, just like today when a dapp calls
|
L1 compatibility considerations, see https://docs.metamask.io/wallet/how-to/connect/access-accounts/#handle-accounts |
Actually, following Francesco's suggestion, we should also include the
4. Event
|
Actually, as part of |
That's an implementation detail of the wallet. It's up to the wallet to decide whether to accept the data as-is in certain cases or to ignore everything except the address and fetch the information from the chain.
this request must return a
if argent isn't returning a boolean, that should be communicated directly to them and flagged as a bug (cc @dhruvkelawala ) |
we didn't implement it (yet) on Braavos. |
Naor is working on a common types library for snjs/get-starknet, which I guess will help us align on types. 12. request Would you prefer receiving |
A dApp can register multiple callbacks for the same event. If you want to stop receiving events in a specific callback, you should pass the same callback registered in
|
Hello,
PR #194 has been created by @avimak to decouple Starknet.js from get-Starknet.
One consequence is that Starknet.js will have to communicate directly with the Wallets (ArgentX, Braavos, ...). Work is in progress in the Starknet.js team (@tabaktoni).
My understanding is that the DAPP will request to get-starknet-ui a simplified
StarknetWindowObject
(without any .provider and .account), and will have access to some requests & events.Requests :
wallet_requestAccounts
wallet_watchAsset
wallet_addStarknetChain
wallet_switchStarknetChain
starknet_addInvokeTransaction
starknet_addDeclareTransaction
starknet_addDeployAccountTransaction
starknet_signTypedData
Events :
accountsChanged
networkChanged
I have some questions :
Transaction rejected
starknet_addInvokeTransaction
starknet_addDeclareTransaction
starknet_addDeployAccountTransaction
&starknet_signTypedData
, and if the user reject the request of signature, how will be the DAPP informed?starknet_signTypedData
, and if the typed Message has a wrong format, how the DAPP will be informed?Current account
wallet_requestAccounts
or the eventaccountsChanged
, the DAPP is informed of the list of accounts related to the current network. How Starknet.js will be able to switch to one of these accounts?Event for account changed in Wallet
If the current network is switched in the Wallet, the DAPP is informed by the event
networkChanged
.If the current account is switched in the Wallet, there is no event for this situation. Couldn't it be beneficial to add an event
addressChanged
?estimateFee
There are no requests for estimateFee. How will the DAPPs handles this subject?
simulateTransaction
Same question than the previous subject.
The text was updated successfully, but these errors were encountered: