Skip to content

Cannot use NetworkType.CUSTOM to sign

Describe the bug (current behavior)

When using the BeaconSDK to sign custom payload for a dApp running on our Layer 2 solution Deku, it is impossible a connect to the wallet with NetworkType.CUSTOM. Using NetworkType.MAINNET does the job, but it is not suitable for production environment.

The error faced when setting NetworkType.CUSTOM is the following:

Network Error

The wallet does not support this network. Please select another one.

For information, here is the code we use to create the Wallet:

const Tezos = new TezosToolkit("https://mainnet.tezos.marigold.dev/");
const myWallet = new BeaconWallet({
    name: "decookies",
    preferredNetwork: NetworkType.CUSTOM,
});
Tezos.setWalletProvider(myWallet);

// then later
await latestState.current.wallet.requestPermissions({
    network: {
        type: NetworkType.CUSTOM,
        rpcUrl: "https://mainnet.tezos.marigold.dev/"
    }
});

Finally, when signing:

signature = await signer.client.requestSignPayload({
    signingType: SigningType.RAW,
    payload: stringToHex(fullPayload)
}).then(val => val.signature);

Not being able to use NetworkType.CUSTOM makes Umami-wallet unsuitable and unusable for the production environment of our dApp on our Layer 2.

Let me know if any more information is needed.

Regards,

Gauthier