Skip to content

Function: register()

function register(opts: WalletRegisterOptions): void

Registers the required components and initializes the SDK

Parameters

opts: WalletRegisterOptions = {}

Returns

void

Examples

Connect to HappyChain Sepolia

register()

Connect to a pre-defined chain

import { register } from '@happychain/js'
import { testnet } from '@happychain/js/chains'
// ---cut---
register({ chainId: testnet.chainId })
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2307. Expected: // @errors: 2307 Compiler Errors: index.ts [2307] 66 - Cannot find module '@happychain/js/chains' or its corresponding type declarations.

Connect to a custom chain

register({ chainId: "0x7a69" }) // in hex format

Defined in

packages/sdk-vanillajs/lib/register.ts:47