Skip to content

sign

Signs data using the Chain Signatures contract.

Usage

const signature = await nearChainSigContract.sign({
  path: 'my_derivation_path',
  payload: Array.from(new Uint8Array(32).fill(1)), // 32-byte array
  key_version: 0,
})

Parameters

ParameterTypeDescription
argsSignArgsArguments for signing data
args.pathstringThe derivation path to use
args.predecessorstringThe account ID requesting the signature
args.payloadstringThe data to sign (32-byte hex string)
options?objectOptional configuration for signing
options.nonce?numberOptional nonce to use for the transaction

Returns

TypeDescription
Promise<RSVSignature>The signature in RSV format