sign
Signs a transaction or message using the MPC (Multi-Party Computation) protocol.
This function interacts with an MPC service to perform a signature operation. It takes in necessary details like API key, chain ID, elliptic curve type, message to sign, and RPC URL. It internally fetches a signing share from the keychain, builds the payload for the MPC service, and then calls the service to perform the signing.
Return
The resulting signature as a String.
Parameters
The API key used for authenticating with the MPC service.
The ID of the blockchain network to which the transaction or message pertains.
The elliptic curve used for signing (e.g., secp256k1).
A PortalSignRequest object containing the method and parameters for signing. The structure of this parameter will dictate what operation needs to be performed, it can contain a message to sign or details about the transaction to sign.
The RPC endpoint URL for interacting with the blockchain network.