Narval | Docs
GithubHome
  • Narval Connect
    • Overview
    • Getting Started
  • Security Overview
  • Providers
    • Providers
      • Anchorage
      • BitGo
      • Fireblocks
  • Guide
    • ConnectClient
    • Connect Widget
      • initiateConnect
      • completeConnect
    • Using a Connection
      • listWallets
      • getWalletById
      • listAccounts
      • getAccountById
      • listAddresses
      • getAddressById
      • listKnownDestinations
      • sendTransfer
      • getTransfer
      • EVM Transactions
        • sendTransaction
        • getTransactionById
        • signMessage
        • getSignMessageById
        • signTypedData
        • getTypedDataById
      • Staking
        • Ethereum (ETH)
        • Polygon (POL)
        • Solana (SOL)
        • Sui (SUI)
      • Raw Signing
        • signRaw
        • getRawSignRequest
    • Manage Connections
      • listConnections
      • getConnection
      • revokeConnection
  • API Reference
    • REST API
      • Authorization
      • Connect Widget
      • Networks & Assets
      • Wallets, Accounts, Addresses
      • Known Destinations
      • Transfer
      • Stake
        • Ethereum
        • Polygon
        • Solana
        • Sui
      • Transactions
        • Ethereum (EVM)
      • Raw Signing
      • Transit Encryption Key
      • Manage Connections
Powered by GitBook
On this page
  1. Guide
  2. Using a Connection
  3. EVM Transactions

signTypedData

connectClient.evm.signTypedData(params) ⇒

Signs EVM typed data (EIP-712) using a provider connection.

Kind: instance method of ConnectClient Returns: Promise with the signed typed data response Throws:

  • ArmorySdkException If there's an error signing the typed data

Param
Description

params

Parameters for signing typed data

params.connectionId

Unique identifier of the provider connection

params.accessToken

Optional access token for authentication

params.data

Typed data signing request

params.data.data

The typed data to sign (EIP-712 format)

params.data.data.domain

Domain parameters for the typed data

params.data.data.types

Type definitions for the structured data

params.data.data.primaryType

The primary type being signed

params.data.data.message

The data to sign, structured according to types

params.data.source

Source of the signing request

params.data.source.type

Type of source ('account' or 'address')

params.data.source.id

Identifier of the source account or address

params.data.idempotenceId

Unique identifier to ensure idempotence

params.data.requestId

Optional request identifier for tracking

Example

const signedTypedData = await connectClient.evm.signTypedData({
  connectionId: "conn-123",
  data: {
    data: {
      domain: {
        name: "MyDApp",
        version: "1",
        chainId: 1,
        verifyingContract: "0x1234567890123456789012345678901234567890"
      },
      types: {
        Person: [
          { name: "name", type: "string" },
          { name: "wallet", type: "address" }
        ],
        Mail: [
          { name: "from", type: "Person" },
          { name: "to", type: "Person" },
          { name: "contents", type: "string" }
        ]
      },
      primaryType: "Mail",
      message: {
        from: {
          name: "Alice",
          wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
        },
        to: {
          name: "Bob",
          wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
        },
        contents: "Hello, Bob!"
      }
    },
    source: {
      type: "account",
      id: "acc-456"
    },
    idempotenceId: "idem-789"
  }
});
PreviousgetSignMessageByIdNextgetTypedDataById

Last updated 29 days ago