Skip to content

CAIP-2 standard support #529

@lordshashank

Description

@lordshashank

Request to support CAIP-2, in synapse which enables cross chain and smart contract account compatible providers to be used.
Basically I am trying embedded wallet support for eastore.xyz, and facing this issue

errors.ts:17 Uncaught (in promise) Error: NetworkUtils getFilecoinNetworkType failed: Failed to detect network: invalid BigNumberish string: Cannot convert eip155:314159 to a BigInt (argument="value", value="eip155:314159", code=INVALID_ARGUMENT, version=6.15.0)
    at createError (errors.ts:17:18)
    at getFilecoinNetworkType (network.ts:40:22)
    at async WarmStorageService.create (service.ts:142:25)
    at async Synapse.create (synapse.ts:131:32)
    at async SynapseProvider.useCallback[initializeSynapse] (SynapseContext.tsx:35:29)

which is because the

const network = await provider.getNetwork()
call fails in case of embedded wallet as the chain id is expected to be in bigint for but instead it is in caip-2 form as "eip155:314159" which leads to parsing failure. This was leading to failiure in Synapse.create as it was not able to detect network.
This would enable people to do gas sponsorships, enable smart accounts, etc through synapse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📌 Triage

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions