Namespace: stark
Functions​
compressProgram​
â–¸ compressProgram(jsonProgram
): CompressedProgram
Compress compiled Cairo program
Parameters​
Name | Type | Description |
---|---|---|
jsonProgram | string | Program | Representing the compiled cairo program |
Returns​
Defined in​
decompressProgram​
â–¸ decompressProgram(base64
): any
Decompress compressed compiled Cairo program
Parameters​
Name | Type | Description |
---|---|---|
base64 | string | Compressed program |
Returns​
any
Parsed decompressed compiled Cairo program
Defined in​
randomAddress​
â–¸ randomAddress(): string
Random Address based on random keyPair
Returns​
string
Defined in​
makeAddress​
â–¸ makeAddress(input
): string
Lowercase and hex prefix string
Parameters​
Name | Type |
---|---|
input | string |
Returns​
string
Deprecated
Not used internally, naming is confusing based on functionality
Defined in​
formatSignature​
â–¸ formatSignature(sig?
): ArraySignatureType
Format Signature to standard type (hex array)
Parameters​
Name | Type |
---|---|
sig? | Signature |
Returns​
Custom hex array or weierstrass.SignatureType hex array
Defined in​
signatureToDecimalArray​
â–¸ signatureToDecimalArray(sig?
): ArraySignatureType
Format Signature to decimal string array
Parameters​
Name | Type |
---|---|
sig? | Signature |
Returns​
Defined in​
signatureToHexArray​
â–¸ signatureToHexArray(sig?
): ArraySignatureType
Format Signature to hex string array
Parameters​
Name | Type |
---|---|
sig? | Signature |
Returns​
Defined in​
estimatedFeeToMaxFee​
â–¸ estimatedFeeToMaxFee(estimatedFee
, overhead?
): bigint
Convert estimated fee to max fee with overhead
Parameters​
Name | Type | Default value |
---|---|---|
estimatedFee | BigNumberish | undefined |
overhead | number | feeMarginPercentage.MAX_FEE |
Returns​
bigint
Defined in​
estimateFeeToBounds​
â–¸ estimateFeeToBounds(estimate
, amountOverhead?
, priceOverhead?
): ResourceBounds
Parameters​
Name | Type | Default value |
---|---|---|
estimate | 0n | { unit : "WEI" | "FRI" ; gas_consumed : string ; gas_price : string ; overall_fee : string ; data_gas_consumed : undefined | string ; data_gas_price : undefined | string } | undefined |
amountOverhead | number | feeMarginPercentage.L1_BOUND_MAX_AMOUNT |
priceOverhead | number | feeMarginPercentage.L1_BOUND_MAX_PRICE_PER_UNIT |
Returns​
Defined in​
intDAM​
â–¸ intDAM(dam
): EDAMode
Parameters​
Name | Type |
---|---|
dam | EDataAvailabilityMode |
Returns​
EDAMode
Defined in​
toTransactionVersion​
â–¸ toTransactionVersion(defaultVersion
, providedVersion?
): ETransactionVersion
Convert to ETransactionVersion or throw an error. Return providedVersion is specified else return defaultVersion
Parameters​
Name | Type | Description |
---|---|---|
defaultVersion | BigNumberish | BigNumberish |
providedVersion? | BigNumberish | BigNumberish | undefined |
Returns​
ETransactionVersion
Defined in​
toFeeVersion​
â–¸ toFeeVersion(providedVersion?
): undefined
| F0
| F1
| F2
| F3
Convert Transaction version to Fee version or throw an error
Parameters​
Name | Type | Description |
---|---|---|
providedVersion? | BigNumberish | BigNumberish | undefined |
Returns​
Defined in​
v3Details​
â–¸ v3Details(details
): Object
Return provided or default v3 tx details
Parameters​
Name | Type |
---|---|
details | UniversalDetails |
Returns​
Object
Name | Type |
---|---|
tip | BigNumberish |
paymasterData | BigNumberish [] |
accountDeploymentData | BigNumberish [] |
nonceDataAvailabilityMode | EDataAvailabilityMode |
feeDataAvailabilityMode | EDataAvailabilityMode |
resourceBounds | RESOURCE_BOUNDS_MAPPING |
Defined in​
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​
Name | Type |
---|---|
providedVersion | ETransactionVersion |