Skip to content

generateExitPortal

Generate (insert) an exit portal — the off-ramp that unshields funds out of Curvy to a destination address. Delegates to the backend, which derives and returns the portal address and its flavour.

Import

ts
import { generateExitPortal } from "@0xcurvy/curvy-sdk/actions";

Usage

ts
const { address, flavour } = await generateExitPortal({
  curvyId: "alice.curvy.name",
  currencyId: 1,
  exitAddress: "0x...",
});

Signature

ts
function generateExitPortal(parameters: GenerateExitPortalParameters): Promise<{ address: HexString; flavour: NETWORK_FLAVOUR_VALUES; }>

Returns

Promise<{ address: HexString; flavour: NETWORK_FLAVOUR_VALUES; }>

The action resolves or returns the value shown in the signature.

Parameters

curvyId

  • Type: \${string}.staging-curvy.name` | `${string}.curvy.name` | `${string}.local-curvy.name` | undefined`
  • Required: no

The Curvy handle whose keys should own the portal.

ts
const result = await generateExitPortal({
  curvyId, 
  currencyId,
  exitAddress,
});

publicKeys

  • Type: PortalPublicKeysInput | undefined
  • Required: no

Explicit public keys to use instead of resolving a Curvy handle.

ts
const result = await generateExitPortal({
  publicKeys, 
  currencyId,
  exitAddress,
});

currencyId

  • Type: number
  • Required: yes

The Curvy currency identifier for the asset being withdrawn.

ts
const result = await generateExitPortal({
  currencyId, 
  exitAddress,
});

exitAddress

  • Type: string
  • Required: yes

The public destination address that receives the withdrawn funds.

ts
const result = await generateExitPortal({
  currencyId,
  exitAddress, 
});

coinType

  • Type: string
  • Required: no

An optional coin-type selector for the portal's network flavour.

ts
const result = await generateExitPortal({
  currencyId,
  exitAddress,
  coinType, 
});

exitNetworkId

  • Type: number
  • Required: no

The optional destination network identifier.

ts
const result = await generateExitPortal({
  currencyId,
  exitAddress,
  exitNetworkId, 
});

exitCurrencyId

  • Type: number
  • Required: no

The optional destination currency identifier used by an exit bridge.

ts
const result = await generateExitPortal({
  currencyId,
  exitAddress,
  exitCurrencyId, 
});

config

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
const result = await generateExitPortal({
  currencyId,
  exitAddress,
  config, 
});

Errors

Errors from config resolution and the underlying SDK operation are propagated to the caller.

Source

packages/@0xcurvy/sdk/src/actions/portals/generateExitPortal.ts