Skip to content

Commit

Permalink
7202 account abstraction (#7311)
Browse files Browse the repository at this point in the history
* AA package structure

* pkg config

* aa types

* aa class

* utils

* exports

* readme chnglog and configs update

* allow local provider if different

* export

* tests

* updated tests

* package config

* docs update

* doc update

* doc update
  • Loading branch information
jdevcs authored Oct 22, 2024
1 parent ed85cce commit 331aa9c
Show file tree
Hide file tree
Showing 31 changed files with 2,628 additions and 22 deletions.
41 changes: 33 additions & 8 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const packages = [
'web3-providers-http',
'web3-providers-ws',
'web3-providers-ipc',
'web3-account-abstraction',
];

/** @type {import('@docusaurus/types').Config} */
Expand Down Expand Up @@ -109,7 +110,7 @@ const config = {
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'Web3.js Docs',
title: 'Web3.js Docs',
logo: {
src: 'img/web3js.svg',
},
Expand Down Expand Up @@ -184,19 +185,43 @@ const config = {
*/
playgroundPosition: 'bottom',
},
image:"https://pbs.twimg.com/profile_images/1746099108937363456/duG_Pqem_400x400.jpg",
image: 'https://pbs.twimg.com/profile_images/1746099108937363456/duG_Pqem_400x400.jpg',
metadata: [
{ name: 'keywords', content: 'web3.js, web3, web3js, ethereum, ethereum json rpc, blockchain development, smart contracts, dapps, dApp development' },
{ name: 'description', content: 'Collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.' },
{
name: 'keywords',
content:
'web3.js, web3, web3js, ethereum, ethereum json rpc, blockchain development, smart contracts, dapps, dApp development',
},
{
name: 'description',
content:
'Collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.',
},
{ name: 'og:title', content: 'Web3.js Documentation' },
{ name: 'og:description', content: 'Collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.' },
{
name: 'og:description',
content:
'Collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.',
},
{ name: 'og:type', content: 'website' },
{ name: 'og:url', content: 'https://docs.web3js.org' },
{ name: 'og:image', content: 'https://pbs.twimg.com/profile_images/1746099108937363456/duG_Pqem_400x400.jpg' },
{
name: 'og:image',
content:
'https://pbs.twimg.com/profile_images/1746099108937363456/duG_Pqem_400x400.jpg',
},
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:title', content: 'Web3.js Documentation' },
{ name: 'twitter:description', content: 'Official documentation for web3.js, the Type/JavaScript library for interacting with the Ethereum blockchain.' },
{ name: 'twitter:image', content: 'https://raw.githubusercontent.com/web3/web3.js/4.x/assets/logo/web3js.jpg' },
{
name: 'twitter:description',
content:
'Official documentation for web3.js, the Type/JavaScript library for interacting with the Ethereum blockchain.',
},
{
name: 'twitter:image',
content:
'https://raw.githubusercontent.com/web3/web3.js/4.x/assets/logo/web3js.jpg',
},
],
}),
};
Expand Down
1 change: 1 addition & 0 deletions packages/web3-account-abstraction/.eslintignore
7 changes: 7 additions & 0 deletions packages/web3-account-abstraction/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: '../../.eslintrc.js',
parserOptions: {
project: './tsconfig.esm.json',
tsconfigRootDir: __dirname,
},
};
Empty file.
1 change: 1 addition & 0 deletions packages/web3-account-abstraction/.npmignore
1 change: 1 addition & 0 deletions packages/web3-account-abstraction/.npmrc
1 change: 1 addition & 0 deletions packages/web3-account-abstraction/.prettierignore
1 change: 1 addition & 0 deletions packages/web3-account-abstraction/.prettierrc.json
38 changes: 38 additions & 0 deletions packages/web3-account-abstraction/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- EXAMPLE
## [1.0.0]
### Added
- I've added feature XY (#1000)
### Changed
- I've cleaned up XY (#1000)
### Deprecated
- I've deprecated XY (#1000)
### Removed
- I've removed XY (#1000)
### Fixed
- I've fixed XY (#1000)
### Security
- I've improved the security in XY (#1000)
-->

## [Unreleased]
59 changes: 59 additions & 0 deletions packages/web3-account-abstraction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<p align="center">
<img src="assets/logo/web3js.jpg" width="500" alt="web3.js" />
</p>

# web3.js - Account Abstraction

![ES Version](https://img.shields.io/badge/ES-2020-yellow)
![Node Version](https://img.shields.io/badge/node-14.x-green)
[![NPM Package][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]

This is a sub-package of [web3.js][repo].

`web3-account-abstraction` contains the ideal setup for a Web3.js package.

## Installation

You can install the package either using [NPM](https://www.npmjs.com/package/web3-account-abstraction) or using [Yarn](https://yarnpkg.com/package/web3-account-abstraction)

### Using NPM

```bash
npm install web3-account-abstraction
```

### Using Yarn

```bash
yarn add web3-account-abstraction
```

## Getting Started

- :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new) or join us on [Discord](https://discord.gg/yjyvFRP)
![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)

## Prerequisites

- :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium)
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/)

## Package.json Scripts

| Script | Description |
| ---------------- | -------------------------------------------------- |
| clean | Uses `rimraf` to remove `dist/` |
| build | Uses `tsc` to build package and dependent packages |
| lint | Uses `eslint` to lint package |
| lint:fix | Uses `eslint` to check and fix any warnings |
| format | Uses `prettier` to format the code |
| test | Uses `jest` to run unit tests |
| test:integration | Uses `jest` to run tests under `/test/integration` |
| test:unit | Uses `jest` to run tests under `/test/unit` |

[docs]: https://docs.web3js.org/
[repo]: https://github.com/web3/web3.js/tree/4.x/tools/web3-account-abstraction
[npm-image]: https://img.shields.io/github/package-json/v/web3/web3.js/4.x?filename=tools%2Fweb3-account-abstraction%2Fpackage.json
[npm-url]: https://npmjs.org/package/web3-account-abstraction
[downloads-image]: https://img.shields.io/npm/dm/web3-account-abstraction?label=npm%20downloads
Loading

1 comment on commit 331aa9c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 331aa9c Previous: ed85cce Ratio
processingTx 20042 ops/sec (±7.50%) 22475 ops/sec (±7.29%) 1.12
processingContractDeploy 38574 ops/sec (±5.63%) 37859 ops/sec (±7.67%) 0.98
processingContractMethodSend 14751 ops/sec (±9.38%) 16019 ops/sec (±6.80%) 1.09
processingContractMethodCall 28271 ops/sec (±6.08%) 27428 ops/sec (±6.22%) 0.97
abiEncode 41366 ops/sec (±7.53%) 42843 ops/sec (±7.53%) 1.04
abiDecode 28375 ops/sec (±8.41%) 29934 ops/sec (±7.71%) 1.05
sign 1500 ops/sec (±1.06%) 1501 ops/sec (±3.06%) 1.00
verify 356 ops/sec (±0.80%) 368 ops/sec (±0.51%) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.