Skip to main content

bridge/functions/buildBridgeOutPayload.md

buildBridgeOutPayload(dto, config): Promise<SignedBridgeOutPayload>

Build an EIP-712 signed bridge out payload.

The payload is signed using EIP-712 typed data signing and includes:

  • The message to be signed
  • The EIP-712 signature
  • The typed data types and domain for verification
  • An Ethereum signed message prefix over the deterministic JSON of the typed data (its number is the UTF-16 length of that string, as launchpad-sdk always sent it; the typed-data hash does not cover it)

Parameters​

ParameterTypeDescription
dtoBridgeRequestDtoBridge request (a uniqueKey is generated when it has none)
configBuildBridgeOutPayloadConfigThe signer

Returns​

Promise<SignedBridgeOutPayload>

The payload for GalaConnectClient.requestBridgeOut

Throws​

GalaSDKError INVALID_BRIDGE_OPTION (destinationChainId) for a chain id that is not a positive integer; CSPRNG_UNAVAILABLE when a key must be generated and the platform has no crypto.getRandomValues; SIGNING_FAILED when the signer fails (see signBridgeOut)