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
>
public key of signer as hex string with 0x prefix
Implementation of​
Defined in​
signMessage​
â–¸ signMessage(typedData
, accountAddress
): Promise
<Signature
>
Sign an JSON object for off-chain usage with the starknet private key and return the signature This adds a message prefix so it can't be interchanged with transactions
Throws
if the JSON object is not a valid JSON
Parameters​
Name | Type | Description |
---|---|---|
typedData | TypedData | JSON object to be signed |
accountAddress | string | account |
Returns​
Promise
<Signature
>
the signature of the JSON object
Implementation of​
Defined in​
signTransaction​
â–¸ signTransaction(transactions
, transactionsDetail
, abis?
): Promise
<Signature
>
Signs a transaction with the starknet private key and returns the signature
Parameters​
Name | Type |
---|---|
transactions | Call [] |
transactionsDetail | InvocationsSignerDetails |
abis? | Abi [] |
Returns​
Promise
<Signature
>
signature
Implementation of​
SignerInterface.signTransaction
Defined in​
signDeployAccountTransaction​
▸ signDeployAccountTransaction(«destructured»
): Promise
<Signature
>
Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature
Parameters​
Name | Type | Description |
---|---|---|
«destructured» | DeployAccountSignerDetails | contractAddress - the computed address of the contract - constructorCalldata - calldata to be passed in deploy constructor - addressSalt - contract address salt - chainId - the chainId to declare contract on - maxFee - maxFee for the declare transaction - version - transaction version - nonce - Nonce of the declare transaction |
Returns​
Promise
<Signature
>
signature
Implementation of​
SignerInterface.signDeployAccountTransaction
Defined in​
signDeclareTransaction​
▸ signDeclareTransaction(«destructured»
): Promise
<Signature
>
Signs a DECLARE transaction with the starknet private key and returns the signature
Parameters​
Name | Type | Description |
---|---|---|
«destructured» | DeclareSignerDetails | classHash - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract - senderAddress - the address of the sender - chainId - the chainId to declare contract on - maxFee - maxFee for the declare transaction - version - transaction version - nonce - Nonce of the declare transaction |
Returns​
Promise
<Signature
>
signature
Implementation of​
SignerInterface.signDeclareTransaction