Skip to main content
Version: Next

Namespace: stark

Functions

compressProgram

compressProgram(jsonProgram): CompressedProgram

Compress compiled Cairo program

Reference

Parameters

NameTypeDescription
jsonProgramstring | ProgramRepresenting the compiled cairo program

Returns

CompressedProgram

Defined in

src/utils/stark.ts:35


decompressProgram

decompressProgram(base64): any

Decompress compressed compiled Cairo program

Parameters

NameTypeDescription
base64stringCompressed program

Returns

any

Parsed decompressed compiled Cairo program

Defined in

src/utils/stark.ts:46


randomAddress

randomAddress(): string

Random Address based on random keyPair

Returns

string

Defined in

src/utils/stark.ts:55


makeAddress

makeAddress(input): string

Lowercase and hex prefix string

Parameters

NameType
inputstring

Returns

string

Deprecated

Not used internally, naming is confusing based on functionality

Defined in

src/utils/stark.ts:65


formatSignature

formatSignature(sig?): ArraySignatureType

Format Signature to standard type (hex array)

Parameters

NameType
sig?Signature

Returns

ArraySignatureType

Custom hex array or weierstrass.SignatureType hex array

Defined in

src/utils/stark.ts:73


signatureToDecimalArray

signatureToDecimalArray(sig?): ArraySignatureType

Format Signature to decimal string array

Parameters

NameType
sig?Signature

Returns

ArraySignatureType

Defined in

src/utils/stark.ts:89


signatureToHexArray

signatureToHexArray(sig?): ArraySignatureType

Format Signature to hex string array

Parameters

NameType
sig?Signature

Returns

ArraySignatureType

Defined in

src/utils/stark.ts:96


estimatedFeeToMaxFee

estimatedFeeToMaxFee(estimatedFee, overhead?): bigint

Convert estimated fee to max fee with overhead

Parameters

NameTypeDefault value
estimatedFeeBigNumberishundefined
overheadnumber0.5

Returns

bigint

Defined in

src/utils/stark.ts:103


estimateFeeToBounds

estimateFeeToBounds(estimate, amountOverhead?, priceOverhead?): ResourceBounds

Parameters

NameTypeDefault value
estimate0n | FEE_ESTIMATEundefined
amountOverheadnumber10
priceOverheadnumber50

Returns

ResourceBounds

Defined in

src/utils/stark.ts:107


intDAM

intDAM(dam): EDAMode

Parameters

NameType
damEDataAvailabilityMode

Returns

EDAMode

Defined in

src/utils/stark.ts:130


toTransactionVersion

toTransactionVersion(defaultVersion, providedVersion?): ETransactionVersion

Convert to ETransactionVersion or throw an error. Return providedVersion is specified else return defaultVersion

Parameters

NameTypeDescription
defaultVersionBigNumberishBigNumberish
providedVersion?BigNumberishBigNumberish | undefined

Returns

ETransactionVersion

ETransactionVersion

Defined in

src/utils/stark.ts:143


toFeeVersion

toFeeVersion(providedVersion?): undefined | F0 | F1 | F2 | F3

Convert Transaction version to Fee version or throw an error

Parameters

NameTypeDescription
providedVersion?BigNumberishBigNumberish | undefined

Returns

undefined | F0 | F1 | F2 | F3

Defined in

src/utils/stark.ts:161


v3Details

v3Details(details): Object

Return provided or default v3 tx details

Parameters

NameType
detailsUniversalDetails

Returns

Object

NameType
tipBigNumberish
paymasterDataBigNumberish[]
accountDeploymentDataBigNumberish[]
nonceDataAvailabilityModeEDataAvailabilityMode
feeDataAvailabilityModeEDataAvailabilityMode
resourceBoundsRESOURCE_BOUNDS_MAPPING

Defined in

src/utils/stark.ts:176


reduceV2

reduceV2(providedVersion): V0 | V1 | V3 | F0 | F1 | F3

It will reduce V2 to V1, else (V3) stay the same F2 -> F1 V2 -> V1 F3 -> F3 V3 -> V3

Parameters

NameType
providedVersionETransactionVersion

Returns

V0 | V1 | V3 | F0 | F1 | F3

Defined in

src/utils/stark.ts:194