-
Notifications
You must be signed in to change notification settings - Fork 28
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: support starknet snap for metamask #450
base: next
Are you sure you want to change the base?
Conversation
# [0.14.0](https://github.com/rango-exchange/rango-client/compare/[email protected]@0.14.0) (2023-08-03) | ||
|
||
|
||
|
||
# [0.13.0](https://github.com/rango-exchange/rango-client/compare/[email protected]@0.13.0) (2023-08-01) | ||
|
||
|
||
|
||
# [0.9.0](https://github.com/rango-exchange/rango-client/compare/[email protected]@0.9.0) (2023-07-31) | ||
|
||
|
||
|
||
# [0.7.0](https://github.com/rango-exchange/rango-client/compare/[email protected]@0.7.0) (2023-07-11) |
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.
please remove content of this file
@@ -0,0 +1 @@ | |||
# @rango-dev/provider-metamask |
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.
please update readme
return accounts; | ||
}; | ||
|
||
export const subscribe: Subscribe = subscribeToEvm; |
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.
we probably don't need this.
|
||
export const getSigners: (provider: any) => SignerFactory = signer; | ||
|
||
export const canEagerConnect: CanEagerConnect = canEagerlyConnectToEvm; |
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.
Please check if we need this.
const starknet = starknetBlockchain(allBlockChains); | ||
return { | ||
name: 'Starknet Snap', | ||
img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/metamask/icon.svg', |
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.
we need another icon from design team.
try { | ||
for (const call of calls) { | ||
const res = await sendTransaction( | ||
this.provider, | ||
call.contractAddress, | ||
call.entrypoint, | ||
(call.calldata as string[]).toString(), | ||
address, | ||
chainId | ||
); | ||
console.log({ res }); | ||
} | ||
|
||
return { hash: '' }; | ||
} catch (err) { | ||
console.log({ err }); | ||
|
||
if (SignerError.isSignerError(err)) { | ||
throw err; | ||
} else { | ||
throw new SignerError(SignerErrorCode.SEND_TX_ERROR, undefined, err); | ||
} | ||
} | ||
} |
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.
we need to update this code to handle multiple calls once we have access to starkNet_executeTxn
.
Consensys/starknet-snap#181
Summary
The Starknet snap allows developers to deploy Starknet accounts, make transactions on Starknet, and interact with Starknet smart contracts. We have to implement it in the providers.
How did you test this change?
You can test this by running the widget and connecting to Starknet Snap and swap in Blockchain Starknet
Checklist: