Class: Signer
Implements​
Constructors​
constructor​
• new Signer(pk?
)
Parameters​
Name | Type |
---|---|
pk | string | Uint8Array |
Defined in​
Properties​
pk​
• Protected
pk: string
| Uint8Array
Defined in​
Methods​
getPubKey​
â–¸ getPubKey(): Promise
<string
>
Method to get the public key of the signer
Returns​
Promise
<string
>
format: hex-string
Implementation of​
Defined in​
signMessage​
â–¸ signMessage(typedData
, accountAddress
): Promise
<Signature
>
Signs a JSON object for off-chain usage with the Starknet private key and returns the signature This adds a message prefix so it can't be interchanged with transactions
Parameters​
Name | Type | Description |
---|---|---|
typedData | TypedData | JSON object to be signed |
accountAddress | string |
Returns​
Promise
<Signature
>
Implementation of​
Defined in​
signTransaction​
â–¸ signTransaction(transactions
, details
): Promise
<Signature
>
Signs transactions with the Starknet private key and returns the signature
Parameters​
Name | Type | Description |
---|---|---|
transactions | Call [] | Array of Call objects, each including: - contractAddress - entrypoint - calldata |
details | InvocationsSignerDetails | InvocationsSignerDetails object with: - walletAddress - chainId - cairoVersion - maxFee - version - nonce |
Returns​
Promise
<Signature
>
Implementation of​
SignerInterface.signTransaction
Defined in​
signDeployAccountTransaction​
â–¸ signDeployAccountTransaction(details
): Promise
<Signature
>
Signs a DEPLOY_ACCOUNT transaction with the Starknet private key and returns the signature
Parameters​
Name | Type |
---|---|
details | DeployAccountSignerDetails |
Returns​
Promise
<Signature
>
Implementation of​
SignerInterface.signDeployAccountTransaction
Defined in​
signDeclareTransaction​
â–¸ signDeclareTransaction(details
): Promise
<Signature
>
Signs a DECLARE transaction with the Starknet private key and returns the signature
Parameters​
Name | Type |
---|---|
details | DeclareSignerDetails |
Returns​
Promise
<Signature
>
Implementation of​
SignerInterface.signDeclareTransaction