From cdb4dc97d0e3efa8c8251d0347752b8cc4d828e0 Mon Sep 17 00:00:00 2001 From: Allen K Date: Tue, 5 Jul 2022 20:39:19 +0900 Subject: [PATCH 1/2] Add createAccessList type (#5146) * add createAccessList method type in web3.eth * add optional error field in CreateAccessList result type * update CHANGELOG.md Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com> --- CHANGELOG.md | 6 ++++-- packages/web3-eth/types/index.d.ts | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf5fa5cd0af..f48e1e4dc8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -561,6 +561,7 @@ Released with 1.0.0-beta.37 code base. ### Security - `npm audit fix` to address vulnerabilities and update libraries (#5014) + ## [Unreleased] ## [1.7.5] @@ -569,7 +570,8 @@ Released with 1.0.0-beta.37 code base. - Replace xhr2-cookies deps to cross-fetch for web3-providers-http (#5085) ### Added -- Documentation details about `maxFeePerGas` and `maxPriorityFeePerGas` (#5121) +- Documentation details about `maxFeePerGas` and `maxPriorityFeePerGas` (#5121) +- Added `createAccessList` types in web3.eth (#5146) ### Fixed - Fix typos in web3-eth-accounts.rst & TESTING.md (#5047) @@ -580,5 +582,5 @@ Released with 1.0.0-beta.37 code base. ### Security -- Updated `got` lib version and fixed other libs using npm audit fix +- Updated `got` lib version and fixed other libs using npm audit fix diff --git a/packages/web3-eth/types/index.d.ts b/packages/web3-eth/types/index.d.ts index 88953985734..b7499a0c49f 100644 --- a/packages/web3-eth/types/index.d.ts +++ b/packages/web3-eth/types/index.d.ts @@ -364,6 +364,17 @@ export class Eth { callback?: (error: Error, gas: number) => void ): Promise; + createAccessList( + transactionConfig: TransactionConfig, + callback?: (error: Error, result: CreateAccessList) => void + ): Promise; + + createAccessList( + transactionConfig: TransactionConfig, + defaultBlock: BlockNumber, + callback?: (error: Error, result: CreateAccessList) => void + ): Promise; + getPastLogs( options: PastLogsOptions, callback?: (error: Error, logs: Log[]) => void @@ -441,6 +452,17 @@ export interface BlockTransactionString extends BlockTransactionBase { transactions: string[]; } +export interface AccessTuple { + address: string; + storageKeys: string[]; +} + +export interface CreateAccessList { + accessList: AccessTuple[]; + error?: string; + gasUsed: string; +} + export interface GetProof { address: string; balance: string; From 3b54fd6f2fb4bd7e0dbd409ca08062a95a1f24dd Mon Sep 17 00:00:00 2001 From: Junaid <86780488+jdevcs@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:41:28 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f48e1e4dc8c..89dbfd1d0a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -561,7 +561,6 @@ Released with 1.0.0-beta.37 code base. ### Security - `npm audit fix` to address vulnerabilities and update libraries (#5014) - ## [Unreleased] ## [1.7.5] @@ -580,7 +579,6 @@ Released with 1.0.0-beta.37 code base. - Add optional hex formatting parameter for getTransactionrReceipt (#5153) - Fix transactionRoot -> transactionsRoot in BlockHeader (#5083) - ### Security - Updated `got` lib version and fixed other libs using npm audit fix