Skip to main content
Version: Next

Class: Signer

Implements

Constructors

constructor

new Signer(pk?): Signer

Parameters

NameType
pkstring | Uint8Array

Returns

Signer

Defined in

src/signer/default.ts:33

Properties

pk

Protected pk: string | Uint8Array

Defined in

src/signer/default.ts:31

Methods

getPubKey

getPubKey(): Promise<string>

Method to get the public key of the signer

Returns

Promise<string>

format: hex-string

Implementation of

SignerInterface.getPubKey

Defined in

src/signer/default.ts:37


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

NameTypeDescription
typedDataTypedDataJSON object to be signed
accountAddressstring

Returns

Promise<Signature>

Implementation of

SignerInterface.signMessage

Defined in

src/signer/default.ts:41


signTransaction

signTransaction(transactions, details): Promise<Signature>

Signs transactions with the Starknet private key and returns the signature

Parameters

NameTypeDescription
transactionsCall[]Array of Call objects, each including:
- contractAddress
- entrypoint
- calldata
detailsInvocationsSignerDetailsInvocationsSignerDetails object with:
- walletAddress
- chainId
- cairoVersion
- maxFee
- version
- nonce

Returns

Promise<Signature>

Implementation of

SignerInterface.signTransaction

Defined in

src/signer/default.ts:46


signDeployAccountTransaction

signDeployAccountTransaction(details): Promise<Signature>

Signs a DEPLOY_ACCOUNT transaction with the Starknet private key and returns the signature

Parameters

NameTypeDescription
detailsDeployAccountSignerDetails
- contractAddress
- chainId
- classHash
- constructorCalldata
- addressSalt
- maxFee
- version
- nonce

Returns

Promise<Signature>

Implementation of

SignerInterface.signDeployAccountTransaction

Defined in

src/signer/default.ts:79


signDeclareTransaction

signDeclareTransaction(details): Promise<Signature>

Signs a DECLARE transaction with the Starknet private key and returns the signature

Parameters

NameTypeDescription
detailsDeclareSignerDetails
- classHash
- compiledClassHash? - used for Cairo1
- senderAddress
- chainId
- maxFee
- version
- nonce

Returns

Promise<Signature>

Implementation of

SignerInterface.signDeclareTransaction

Defined in

src/signer/default.ts:111


signRaw

signRaw(msgHash): Promise<Signature>

Parameters

NameType
msgHashstring

Returns

Promise<Signature>

Defined in

src/signer/default.ts:138