Skip to content
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

Draft
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

mikasackermn
Copy link
Collaborator

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:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

Comment on lines +1 to +13
# [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)
Copy link
Member

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
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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',
Copy link
Member

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.

Comment on lines +25 to +48
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);
}
}
}
Copy link
Member

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

@RanGojo RanGojo added the wait label Dec 6, 2023
@RanGojo RanGojo changed the title feat: support Starknet Snap for Metamask feat: support starknet snap for metamask Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants