This commit is contained in:
2025-05-19 20:36:21 -05:00
commit f5303487be
1865 changed files with 260387 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
import type { AccessList, AccessListish } from "./index.js";
/**
* Returns a [[AccessList]] from any ethers-supported access-list structure.
*/
export declare function accessListify(value: AccessListish): AccessList;
//# sourceMappingURL=accesslist.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"accesslist.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAuB9D"}
+37
View File
@@ -0,0 +1,37 @@
import { getAddress } from "../address/index.js";
import { assertArgument, isHexString } from "../utils/index.js";
function accessSetify(addr, storageKeys) {
return {
address: getAddress(addr),
storageKeys: storageKeys.map((storageKey, index) => {
assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey);
return storageKey.toLowerCase();
})
};
}
/**
* Returns a [[AccessList]] from any ethers-supported access-list structure.
*/
export function accessListify(value) {
if (Array.isArray(value)) {
return value.map((set, index) => {
if (Array.isArray(set)) {
assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set);
return accessSetify(set[0], set[1]);
}
assertArgument(set != null && typeof (set) === "object", "invalid address-slot set", "value", value);
return accessSetify(set.address, set.storageKeys);
});
}
assertArgument(value != null && typeof (value) === "object", "invalid access list", "value", value);
const result = Object.keys(value).map((addr) => {
const storageKeys = value[addr].reduce((accum, storageKey) => {
accum[storageKey] = true;
return accum;
}, {});
return accessSetify(addr, Object.keys(storageKeys).sort());
});
result.sort((a, b) => (a.address.localeCompare(b.address)));
return result;
}
//# sourceMappingURL=accesslist.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"accesslist.js","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhE,SAAS,YAAY,CAAC,IAAY,EAAE,WAA0B;IAC1D,OAAO;QACH,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;QACzB,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YAC/C,cAAc,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,cAAc,EAAE,eAAgB,KAAM,GAAG,EAAE,UAAU,CAAC,CAAC;YACnG,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC;QACpC,CAAC,CAAC;KACL,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAoB;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtB,OAA0F,KAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAChH,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACpB,cAAc,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,kBAAkB,EAAE,SAAU,KAAM,GAAG,EAAE,GAAG,CAAC,CAAC;gBAC/E,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;aACtC;YACD,cAAc,CAAC,GAAG,IAAI,IAAI,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,0BAA0B,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YACpG,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;KACN;IAED,cAAc,CAAC,KAAK,IAAI,IAAI,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAEnG,MAAM,MAAM,GAA2D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACnG,MAAM,WAAW,GAAyB,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/E,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;YACzB,OAAO,KAAK,CAAC;QACjB,CAAC,EAAwB,EAAG,CAAC,CAAC;QAC9B,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC;AAClB,CAAC"}
+15
View File
@@ -0,0 +1,15 @@
import { SigningKey } from "../crypto/index.js";
import type { SignatureLike } from "../crypto/index.js";
import type { BytesLike } from "../utils/index.js";
/**
* Returns the address for the %%key%%.
*
* The key may be any standard form of public key or a private key.
*/
export declare function computeAddress(key: string | SigningKey): string;
/**
* Returns the recovered address for the private key that was
* used to sign %%digest%% that resulted in %%signature%%.
*/
export declare function recoverAddress(digest: BytesLike, signature: SignatureLike): string;
//# sourceMappingURL=address.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAElF"}
+25
View File
@@ -0,0 +1,25 @@
import { getAddress } from "../address/index.js";
import { keccak256, SigningKey } from "../crypto/index.js";
/**
* Returns the address for the %%key%%.
*
* The key may be any standard form of public key or a private key.
*/
export function computeAddress(key) {
let pubkey;
if (typeof (key) === "string") {
pubkey = SigningKey.computePublicKey(key, false);
}
else {
pubkey = key.publicKey;
}
return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26));
}
/**
* Returns the recovered address for the private key that was
* used to sign %%digest%% that resulted in %%signature%%.
*/
export function recoverAddress(digest, signature) {
return computeAddress(SigningKey.recoverPublicKey(digest, signature));
}
//# sourceMappingURL=address.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK3D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC"}
+3
View File
@@ -0,0 +1,3 @@
import type { Authorization, AuthorizationLike } from "./index.js";
export declare function authorizationify(auth: AuthorizationLike): Authorization;
//# sourceMappingURL=authorization.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/authorization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAOvE"}
+12
View File
@@ -0,0 +1,12 @@
import { getAddress } from "../address/index.js";
import { Signature } from "../crypto/index.js";
import { getBigInt } from "../utils/index.js";
export function authorizationify(auth) {
return {
address: getAddress(auth.address),
nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0),
chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0),
signature: Signature.from(auth.signature)
};
}
//# sourceMappingURL=authorization.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src.ts/transaction/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,MAAM,UAAU,gBAAgB,CAAC,IAAuB;IACpD,OAAO;QACH,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC;QACtD,OAAO,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAA,CAAC,CAAC,IAAI,CAAC,OAAO,CAAA,CAAC,CAAC,CAAC,CAAC;QAC3D,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;KAC5C,CAAC;AACN,CAAC"}
+40
View File
@@ -0,0 +1,40 @@
/**
* Each state-changing operation on Ethereum requires a transaction.
*
* @_section api/transaction:Transactions [about-transactions]
*/
import type { BigNumberish } from "../utils/maths.js";
import type { Signature, SignatureLike } from "../crypto/index.js";
/**
* A single [[AccessList]] entry of storage keys (slots) for an address.
*/
export type AccessListEntry = {
address: string;
storageKeys: Array<string>;
};
/**
* An ordered collection of [[AccessList]] entries.
*/
export type AccessList = Array<AccessListEntry>;
/**
* Any ethers-supported access list structure.
*/
export type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
export interface Authorization {
address: string;
nonce: bigint;
chainId: bigint;
signature: Signature;
}
export type AuthorizationLike = {
address: string;
nonce: BigNumberish;
chainId: BigNumberish;
signature: SignatureLike;
};
export { accessListify } from "./accesslist.js";
export { authorizationify } from "./authorization.js";
export { computeAddress, recoverAddress } from "./address.js";
export { Transaction } from "./transaction.js";
export type { Blob, BlobLike, KzgLibrary, KzgLibraryLike, TransactionLike } from "./transaction.js";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GACV,KAAK,CAAC,CAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAE,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAG1D,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,aAAa,CAAA;CAC3B,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EACR,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAC9D,MAAM,kBAAkB,CAAC"}
+11
View File
@@ -0,0 +1,11 @@
/**
* Each state-changing operation on Ethereum requires a transaction.
*
* @_section api/transaction:Transactions [about-transactions]
*/
null;
export { accessListify } from "./accesslist.js";
export { authorizationify } from "./authorization.js";
export { computeAddress, recoverAddress } from "./address.js";
export { Transaction } from "./transaction.js";
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,CAAC;AAqCL,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
+400
View File
@@ -0,0 +1,400 @@
import { Signature } from "../crypto/index.js";
import type { BigNumberish, BytesLike } from "../utils/index.js";
import type { SignatureLike } from "../crypto/index.js";
import type { AccessList, AccessListish, Authorization, AuthorizationLike } from "./index.js";
/**
* A **TransactionLike** is an object which is appropriate as a loose
* input for many operations which will populate missing properties of
* a transaction.
*/
export interface TransactionLike<A = string> {
/**
* The type.
*/
type?: null | number;
/**
* The recipient address or ``null`` for an ``init`` transaction.
*/
to?: null | A;
/**
* The sender.
*/
from?: null | A;
/**
* The nonce.
*/
nonce?: null | number;
/**
* The maximum amount of gas that can be used.
*/
gasLimit?: null | BigNumberish;
/**
* The gas price for legacy and berlin transactions.
*/
gasPrice?: null | BigNumberish;
/**
* The maximum priority fee per gas for london transactions.
*/
maxPriorityFeePerGas?: null | BigNumberish;
/**
* The maximum total fee per gas for london transactions.
*/
maxFeePerGas?: null | BigNumberish;
/**
* The data.
*/
data?: null | string;
/**
* The value (in wei) to send.
*/
value?: null | BigNumberish;
/**
* The chain ID the transaction is valid on.
*/
chainId?: null | BigNumberish;
/**
* The transaction hash.
*/
hash?: null | string;
/**
* The signature provided by the sender.
*/
signature?: null | SignatureLike;
/**
* The access list for berlin and london transactions.
*/
accessList?: null | AccessListish;
/**
* The maximum fee per blob gas (see [[link-eip-4844]]).
*/
maxFeePerBlobGas?: null | BigNumberish;
/**
* The versioned hashes (see [[link-eip-4844]]).
*/
blobVersionedHashes?: null | Array<string>;
/**
* The blobs (if any) attached to this transaction (see [[link-eip-4844]]).
*/
blobs?: null | Array<BlobLike>;
/**
* An external library for computing the KZG commitments and
* proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]).
*
* This is generally ``null``, unless you are creating BLOb
* transactions.
*/
kzg?: null | KzgLibraryLike;
/**
* The [[link-eip-7702]] authorizations (if any).
*/
authorizationList?: null | Array<Authorization>;
}
/**
* A full-valid BLOb object for [[link-eip-4844]] transactions.
*
* The commitment and proof should have been computed using a
* KZG library.
*/
export interface Blob {
data: string;
proof: string;
commitment: string;
}
/**
* A BLOb object that can be passed for [[link-eip-4844]]
* transactions.
*
* It may have had its commitment and proof already provided
* or rely on an attached [[KzgLibrary]] to compute them.
*/
export type BlobLike = BytesLike | {
data: BytesLike;
proof: BytesLike;
commitment: BytesLike;
};
/**
* A KZG Library with the necessary functions to compute
* BLOb commitments and proofs.
*/
export interface KzgLibrary {
blobToKzgCommitment: (blob: Uint8Array) => Uint8Array;
computeBlobKzgProof: (blob: Uint8Array, commitment: Uint8Array) => Uint8Array;
}
/**
* A KZG Library with any of the various API configurations.
* As the library is still experimental and the API is not
* stable, depending on the version used the method names and
* signatures are still in flux.
*
* This allows any of the versions to be passed into Transaction
* while providing a stable external API.
*/
export type KzgLibraryLike = KzgLibrary | {
blobToKZGCommitment: (blob: string) => string;
computeBlobKZGProof: (blob: string, commitment: string) => string;
} | {
blobToKzgCommitment: (blob: string) => string | Uint8Array;
computeBlobProof: (blob: string, commitment: string) => string | Uint8Array;
};
/**
* A **Transaction** describes an operation to be executed on
* Ethereum by an Externally Owned Account (EOA). It includes
* who (the [[to]] address), what (the [[data]]) and how much (the
* [[value]] in ether) the operation should entail.
*
* @example:
* tx = new Transaction()
* //_result:
*
* tx.data = "0x1234";
* //_result:
*/
export declare class Transaction implements TransactionLike<string> {
#private;
/**
* The transaction type.
*
* If null, the type will be automatically inferred based on
* explicit properties.
*/
get type(): null | number;
set type(value: null | number | string);
/**
* The name of the transaction type.
*/
get typeName(): null | string;
/**
* The ``to`` address for the transaction or ``null`` if the
* transaction is an ``init`` transaction.
*/
get to(): null | string;
set to(value: null | string);
/**
* The transaction nonce.
*/
get nonce(): number;
set nonce(value: BigNumberish);
/**
* The gas limit.
*/
get gasLimit(): bigint;
set gasLimit(value: BigNumberish);
/**
* The gas price.
*
* On legacy networks this defines the fee that will be paid. On
* EIP-1559 networks, this should be ``null``.
*/
get gasPrice(): null | bigint;
set gasPrice(value: null | BigNumberish);
/**
* The maximum priority fee per unit of gas to pay. On legacy
* networks this should be ``null``.
*/
get maxPriorityFeePerGas(): null | bigint;
set maxPriorityFeePerGas(value: null | BigNumberish);
/**
* The maximum total fee per unit of gas to pay. On legacy
* networks this should be ``null``.
*/
get maxFeePerGas(): null | bigint;
set maxFeePerGas(value: null | BigNumberish);
/**
* The transaction data. For ``init`` transactions this is the
* deployment code.
*/
get data(): string;
set data(value: BytesLike);
/**
* The amount of ether (in wei) to send in this transactions.
*/
get value(): bigint;
set value(value: BigNumberish);
/**
* The chain ID this transaction is valid on.
*/
get chainId(): bigint;
set chainId(value: BigNumberish);
/**
* If signed, the signature for this transaction.
*/
get signature(): null | Signature;
set signature(value: null | SignatureLike);
/**
* The access list.
*
* An access list permits discounted (but pre-paid) access to
* bytecode and state variable access within contract execution.
*/
get accessList(): null | AccessList;
set accessList(value: null | AccessListish);
get authorizationList(): null | Array<Authorization>;
set authorizationList(auths: null | Array<AuthorizationLike>);
/**
* The max fee per blob gas for Cancun transactions.
*/
get maxFeePerBlobGas(): null | bigint;
set maxFeePerBlobGas(value: null | BigNumberish);
/**
* The BLOb versioned hashes for Cancun transactions.
*/
get blobVersionedHashes(): null | Array<string>;
set blobVersionedHashes(value: null | Array<string>);
/**
* The BLObs for the Transaction, if any.
*
* If ``blobs`` is non-``null``, then the [[seriailized]]
* will return the network formatted sidecar, otherwise it
* will return the standard [[link-eip-2718]] payload. The
* [[unsignedSerialized]] is unaffected regardless.
*
* When setting ``blobs``, either fully valid [[Blob]] objects
* may be specified (i.e. correctly padded, with correct
* committments and proofs) or a raw [[BytesLike]] may
* be provided.
*
* If raw [[BytesLike]] are provided, the [[kzg]] property **must**
* be already set. The blob will be correctly padded and the
* [[KzgLibrary]] will be used to compute the committment and
* proof for the blob.
*
* A BLOb is a sequence of field elements, each of which must
* be within the BLS field modulo, so some additional processing
* may be required to encode arbitrary data to ensure each 32 byte
* field is within the valid range.
*
* Setting this automatically populates [[blobVersionedHashes]],
* overwriting any existing values. Setting this to ``null``
* does **not** remove the [[blobVersionedHashes]], leaving them
* present.
*/
get blobs(): null | Array<Blob>;
set blobs(_blobs: null | Array<BlobLike>);
get kzg(): null | KzgLibrary;
set kzg(kzg: null | KzgLibraryLike);
/**
* Creates a new Transaction with default values.
*/
constructor();
/**
* The transaction hash, if signed. Otherwise, ``null``.
*/
get hash(): null | string;
/**
* The pre-image hash of this transaction.
*
* This is the digest that a [[Signer]] must sign to authorize
* this transaction.
*/
get unsignedHash(): string;
/**
* The sending address, if signed. Otherwise, ``null``.
*/
get from(): null | string;
/**
* The public key of the sender, if signed. Otherwise, ``null``.
*/
get fromPublicKey(): null | string;
/**
* Returns true if signed.
*
* This provides a Type Guard that properties requiring a signed
* transaction are non-null.
*/
isSigned(): this is (Transaction & {
type: number;
typeName: string;
from: string;
signature: Signature;
});
/**
* The serialized transaction.
*
* This throws if the transaction is unsigned. For the pre-image,
* use [[unsignedSerialized]].
*/
get serialized(): string;
/**
* The transaction pre-image.
*
* The hash of this is the digest which needs to be signed to
* authorize this transaction.
*/
get unsignedSerialized(): string;
/**
* Return the most "likely" type; currently the highest
* supported transaction type.
*/
inferType(): number;
/**
* Validates the explicit properties and returns a list of compatible
* transaction types.
*/
inferTypes(): Array<number>;
/**
* Returns true if this transaction is a legacy transaction (i.e.
* ``type === 0``).
*
* This provides a Type Guard that the related properties are
* non-null.
*/
isLegacy(): this is (Transaction & {
type: 0;
gasPrice: bigint;
});
/**
* Returns true if this transaction is berlin hardform transaction (i.e.
* ``type === 1``).
*
* This provides a Type Guard that the related properties are
* non-null.
*/
isBerlin(): this is (Transaction & {
type: 1;
gasPrice: bigint;
accessList: AccessList;
});
/**
* Returns true if this transaction is london hardform transaction (i.e.
* ``type === 2``).
*
* This provides a Type Guard that the related properties are
* non-null.
*/
isLondon(): this is (Transaction & {
type: 2;
accessList: AccessList;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
});
/**
* Returns true if this transaction is an [[link-eip-4844]] BLOB
* transaction.
*
* This provides a Type Guard that the related properties are
* non-null.
*/
isCancun(): this is (Transaction & {
type: 3;
to: string;
accessList: AccessList;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
maxFeePerBlobGas: bigint;
blobVersionedHashes: Array<string>;
});
/**
* Create a copy of this transaciton.
*/
clone(): Transaction;
/**
* Return a JSON-friendly object.
*/
toJSON(): any;
/**
* Create a **Transaction** from a serialized transaction or a
* Transaction-like object.
*/
static from(tx?: string | TransactionLike<string>): Transaction;
}
//# sourceMappingURL=transaction.d.ts.map
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long