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

[sdk] Add check if the signer is on the chainId as fromChain #222

Open
1 task
ecdsafu opened this issue Oct 19, 2023 · 2 comments
Open
1 task

[sdk] Add check if the signer is on the chainId as fromChain #222

ecdsafu opened this issue Oct 19, 2023 · 2 comments
Labels

Comments

@ecdsafu
Copy link
Contributor

ecdsafu commented Oct 19, 2023

Description / Steps to reproduce

this is a common problem for devs using our SDK. Partners are not used to developing cross chain and a simple error message to show this would save a lot of dev time.

Add a function to the SDK which checks if a signer is on the correct chain for a route, returning (isCorrectChainId: Boolean, message String)

const signerChainId = parseInt(await provider.send("eth_chainId", []), 16).toString();
if (signerChainId !== route.params.fromChain) {
    // throw error "signer is on the wrong chain ID (${signerChainId}). Please use a signer on chain ID ${route.params.fromChain.chainId}"
}

Acceptance Criteria

  • isCorrectChainId is available on the SDK
@ecdsafu ecdsafu added the sdk label Oct 19, 2023
@oi9n
Copy link

oi9n commented Feb 3, 2024

Description / Steps to reproduce

this is a common problem for devs using our SDK. Partners are not used to developing cross chain and a simple error message to show this would save a lot of dev time.

Add a function to the SDK which checks if a signer is on the correct chain for a route, returning (isCorrectChainId: Boolean, message String)

const signerChainId = parseInt(await provider.send("eth_chainId", []), 16).toString();
if (signerChainId !== route.params.fromChain) {
    // throw error "signer is on the wrong chain ID (${signerChainId}). Please use a signer on chain ID ${route.params.fromChain.chainId}"
}

Acceptance Criteria

  • isCorrectChainId is available on the SDK

i have the solution where can i send it to u?

@davidpco
Copy link

Addressed by PR #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants