Skip to main content
Version: Next

Class: Signer

Implements​

Constructors​

constructor​

• new Signer(pk?)

Parameters​

NameType
pkstring | Uint8Array

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​

NameType
detailsDeployAccountSignerDetails

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​

NameType
detailsDeclareSignerDetails

Returns​

Promise<Signature>

Implementation of​

SignerInterface.signDeclareTransaction

Defined in​

src/signer/default.ts:111