Skip to content

FUZD / fuzd-chain-protocol / starknet / StarknetChainProtocol

Class: StarknetChainProtocol

Implements

Constructors

new StarknetChainProtocol()

new StarknetChainProtocol(url, config, account): StarknetChainProtocol

Parameters

url: string | RequestRPC<Methods>

config

config.accountContractClassHash: String0x

config.contractTimestamp?: String0x

config.expectedFinality: number

config.tokenContractAddress: String0x

config.worstCaseBlockTime: number

account: ETHAccount

Returns

StarknetChainProtocol

Defined in

starknet/index.ts:97

Properties

account

account: ETHAccount

Defined in

starknet/index.ts:106


config

readonly config: object

accountContractClassHash

accountContractClassHash: String0x

contractTimestamp?

optional contractTimestamp: String0x

expectedFinality

expectedFinality: number

tokenContractAddress

tokenContractAddress: String0x

worstCaseBlockTime

worstCaseBlockTime: number

Implementation of

ChainProtocol.config

Defined in

starknet/index.ts:99


offset

offset: number = 0

Defined in

starknet/index.ts:448


url

readonly url: string | RequestRPC<Methods>

Defined in

starknet/index.ts:98

Methods

_createFullTransaction()

_createFullTransaction(chainId, transactionData, broadcaster, transactionParameters): object

Parameters

chainId: String0x

transactionData: StarknetTransactionData

broadcaster: BroadcasterSignerData

transactionParameters: TransactionParametersUsed

Returns

object

hash

hash: String0x

rawTx

rawTx: FullStarknetTransactionData

transactionData

transactionData: StarknetTransactionData

Defined in

starknet/index.ts:539


_getStarknetSigner()

_getStarknetSigner(account, forAddress): Promise<object>

Parameters

account: ETHAccount

forAddress: String0x

Returns

Promise<object>

private_key

private_key: string

public_key

public_key: string

Defined in

starknet/index.ts:519


_validateDerivationParameters()

_validateDerivationParameters(parameters): Promise<object | object>

Parameters

parameters: DerivationParameters

Returns

Promise<object | object>

Defined in

starknet/index.ts:479


broadcastSignedTransaction()

broadcastSignedTransaction(tx): Promise<String0x>

Parameters

tx: any

Returns

Promise<String0x>

Implementation of

ChainProtocol.broadcastSignedTransaction

Defined in

starknet/index.ts:212


checkValidity()

checkValidity(chainId, transactionData, broadcaster, transactionParameters): Promise<object | object>

Parameters

chainId: String0x

transactionData: StarknetTransactionData

broadcaster: BroadcasterSignerData

transactionParameters: TransactionParametersUsed

Returns

Promise<object | object>

Implementation of

ChainProtocol.checkValidity

Defined in

starknet/index.ts:308


generatePaymentTransaction()

generatePaymentTransaction(transactionData, maxFeePerGas, from, diffToCover): object

Parameters

transactionData: StarknetTransactionData

maxFeePerGas: bigint

from: String0x

diffToCover: bigint

Returns

object

cost

cost: bigint

transaction

transaction: StarknetTransactionData

Implementation of

ChainProtocol.generatePaymentTransaction

Defined in

starknet/index.ts:413


getBalance()

getBalance(account): Promise<bigint>

Parameters

account: String0x

Returns

Promise<bigint>

Implementation of

ChainProtocol.getBalance

Defined in

starknet/index.ts:197


getBroadcaster()

getBroadcaster(parameters, forAddress): Promise<BroadcasterSignerData>

Parameters

parameters: DerivationParameters

forAddress: String0x

Returns

Promise<BroadcasterSignerData>

Implementation of

ChainProtocol.getBroadcaster

Defined in

starknet/index.ts:289


getCurrentDerivationParameters()

getCurrentDerivationParameters(): Promise<DerivationParameters>

Returns

Promise<DerivationParameters>

Implementation of

ChainProtocol.getCurrentDerivationParameters

Defined in

starknet/index.ts:280


getGasFee()

getGasFee(executionData): Promise<GasEstimate>

Parameters

executionData

executionData.maxFeePerGasAuthorized: String0x

Returns

Promise<GasEstimate>

Implementation of

ChainProtocol.getGasFee

Defined in

starknet/index.ts:247


getNonce()

getNonce(account): Promise<String0x>

Parameters

account: String0x

Returns

Promise<String0x>

Implementation of

ChainProtocol.getNonce

Defined in

starknet/index.ts:233


getTimestamp()

getTimestamp(): Promise<number>

Returns

Promise<number>

Implementation of

ChainProtocol.getTimestamp

Defined in

starknet/index.ts:449


getTransactionStatus()

getTransactionStatus(transaction): Promise<TransactionStatus>

Parameters

transaction: Transaction

Returns

Promise<TransactionStatus>

Implementation of

ChainProtocol.getTransactionStatus

Defined in

starknet/index.ts:111


increaseTime()

increaseTime(amount): Promise<void>

Parameters

amount: number

Returns

Promise<void>

Implementation of

ChainProtocol.increaseTime

Defined in

starknet/index.ts:471


isTransactionPending()

isTransactionPending(txHash): Promise<boolean>

Parameters

txHash: String0x

Returns

Promise<boolean>

Implementation of

ChainProtocol.isTransactionPending

Defined in

starknet/index.ts:184


requiredPreliminaryTransaction()

requiredPreliminaryTransaction(chainId, broadcaster, account): StarknetTransactionData

Parameters

chainId: string

broadcaster: BroadcasterSignerData

account: String0x

Returns

StarknetTransactionData

Implementation of

ChainProtocol.requiredPreliminaryTransaction

Defined in

starknet/index.ts:380


signTransaction()

signTransaction(chainId, data, broadcaster, transactionParameters): Promise<object>

Parameters

chainId: String0x

data: StarknetTransactionData

broadcaster: BroadcasterSignerData

transactionParameters: TransactionParametersUsed

Returns

Promise<object>

hash

hash: String0x

rawTx

rawTx: any

Implementation of

ChainProtocol.signTransaction

Defined in

starknet/index.ts:348


validateDerivationParameters()

validateDerivationParameters(parameters): Promise<object | object>

Parameters

parameters: DerivationParameters

Returns

Promise<object | object>

Implementation of

ChainProtocol.validateDerivationParameters

Defined in

starknet/index.ts:269