Signature

Type JsonRpcSigner(for browser)

L1 private key.

constructor

/**
* @param {provider}
*/
newRpcSignerWithProvider(provider)

Example

await window.ethereum.request({ method: 'eth_requestAccounts' });
const provider = window.ethereum;
const signer = new wasm.newRpcSignerWithProvider(provider);

func initZklinkSigner

/**
* @param {string | undefined} [signature]
* @returns {Promise<void>}
*/
initZklinkSigner(signature)

Initialize ZkLink L3 private key

func address

Return address

func signatureSeed

Return signature seed

Type Signer(for nodejs)

L1 private key.

constructor

Create a Eth or Starknet private key signer.

func getPubkey

Return hex string of public key.

func getPubkeyHash

Return hex string of public key hash.

func signMusig

Sign and create ZkLinkSignature from raw message.

func signChangePubkeyWithOnchain

func signChangePubkeyWithEthEcdsaAuth

func signChangePubkeyWithCreate2DataAuth

Example

func signWithdraw

func signTransfer

func signForcedExit

func createSignedOrder

func signOrderMatching

Example

func createSignedContract

func signContractMatching

func signAutoDeleveraging

func signFunding

func signLiquidation

func getZkLinkSigner

Type ZkLinkSigner

ZkLinkSigner includes the L1 private key(Eth or Starknet) and L3 private key.

func ethSig

Creat a ZkLinkSigner from eth personal sign.

input:

  • sig: hex string of eth personal sign(with or without 0x prefix)

func starknetSig

Creat a ZkLinkSigner from starknet signature.

input:

  • sig: hex string of starknet signature(with or without 0x prefix)

Last updated

Was this helpful?