Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Transaction Types #48

Merged
merged 26 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ jobs:
cache: yarn
- run: yarn install
- run: yarn build
- run: export PRIVATE_KEY=${{secrets.PRIVATE_KEY}} && yarn test:integration
- run: export PRIVATE_KEY=${{secrets.PRIVATE_KEY}}
- run: yarn test:unit
- run: yarn test test/integration/rpc test/integration/mainnet test/integration/zksync test/integration/utils
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
node-version: 20
cache: yarn
- run: yarn install
- run: npx typedoc src/index.ts
- run: yarn build:docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
Expand Down
74 changes: 38 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,47 @@ Use [Web3.js](https://web3js.org/) to interact with the [ZKsync Era](https://zks

Please refer to the comprehensive
[API documentation](https://chainsafe.github.io/web3-plugin-zksync/) for a complete overview of this
plugin's capabilities. Usage documentation that includes explanations and code samples is coming
soon to the [official ZKsync SDK docs](https://sdk.zksync.io/).
plugin's capabilities. Usage documentation that includes explanations and code samples is available
as part of the [official Web3.js plugin for ZKsync SDK docs](https://sdk.zksync.io/js/web3js).

## Plugin Components

- RPC methods:
The[`RpcMethods` class](https://chainsafe.github.io/web3-plugin-zksync/classes/RpcMethods.html)
implements the [ZKsync JSON-RPC API](https://docs.zksync.io/build/api-reference/zks-rpc).
- Constants: The
[`constants` package](https://chainsafe.github.io/web3-plugin-zksync/modules/constants.html)
includes well-known addresses, such as the address of the L1 ETH token.
- Types: The [`types` package](https://chainsafe.github.io/web3-plugin-zksync/modules/types.html)
defines enums, interfaces, and types that are used for interacting with the ZKsync Era network.
- Utilities: The
[`utils` package](https://chainsafe.github.io/web3-plugin-zksync/modules/utils.html) exposes
helpful functions and contract definitions that can be used with the Web3.js plugin for ZKsync.
- Wallet: The
[`ZKSyncWallet` class](https://chainsafe.github.io/web3-plugin-zksync/classes/ZKSyncWallet.html)
allows developers to create, manage, and use ZKsync accounts.
- Paymasters: The plugin includes a number of helpful utilities for working with
[ZKsync paymasters](https://docs.zksync.io/build/developer-reference/account-abstraction/paymasters),
including a
[`getPaymasterParams` function](https://chainsafe.github.io/web3-plugin-zksync/functions/getPaymasterParams.html)
for generating paymaster parameters to add to a transaction.
- Smart contracts: The
[`ContractFactory` class](https://chainsafe.github.io/web3-plugin-zksync/classes/ContractFactory.html)
can be used to deploy smart contracts to the ZKsync Era network. The return type of the
[`ContractFactory.deploy` method](https://chainsafe.github.io/web3-plugin-zksync/classes/ContractFactory.html#deploy)
is the standard
[Web3.js Contract class](https://docs.web3js.org/api/web3-eth-contract/class/Contract/).
- Smart accounts: The
[`SmartAccount` class](https://chainsafe.github.io/web3-plugin-zksync/classes/SmartAccount.html)
can be used to create
[ZKsync smart accounts](https://docs.zksync.io/build/developer-reference/account-abstraction/)
with custom logic for building and signing transactions. There are factory functions for
creating
[ECDSA smart accounts](https://chainsafe.github.io/web3-plugin-zksync/classes/ECDSASmartAccount.html#create)
and
[multi-signature ECDSA smart accounts](https://chainsafe.github.io/web3-plugin-zksync/classes/MultisigECDSASmartAccount.html#create).
- [RPC methods](https://sdk.zksync.io/js/web3js/rpc):
The[`RpcMethods` class](https://chainsafe.github.io/web3-plugin-zksync/classes/RpcMethods.html)
implements the [ZKsync JSON-RPC API](https://docs.zksync.io/build/api-reference/zks-rpc).
- [Constants](https://sdk.zksync.io/js/web3js/constants-types-utilities#constants): The
[`constants` package](https://chainsafe.github.io/web3-plugin-zksync/modules/constants.html)
includes well-known addresses, such as the address of the L1 ETH token.
- [Types](https://sdk.zksync.io/js/web3js/constants-types-utilities#types): The
[`types` package](https://chainsafe.github.io/web3-plugin-zksync/modules/types.html) defines
enums, interfaces, and types that are used for interacting with the ZKsync Era network.
- [Utilities](https://sdk.zksync.io/js/web3js/constants-types-utilities#utilities): The
[`utils` package](https://chainsafe.github.io/web3-plugin-zksync/modules/utils.html) exposes
helpful functions and contract definitions that can be used with the Web3.js plugin for ZKsync.
- [Wallet](https://sdk.zksync.io/js/web3js/wallet): The
[`ZKSyncWallet` class](https://chainsafe.github.io/web3-plugin-zksync/classes/ZKSyncWallet.html)
allows developers to create, manage, and use ZKsync accounts.
- [Paymasters](https://sdk.zksync.io/js/web3js/paymasters): The plugin includes a number of
helpful utilities for working with
[ZKsync paymasters](https://docs.zksync.io/build/developer-reference/account-abstraction/paymasters),
including a
[`getPaymasterParams` function](https://chainsafe.github.io/web3-plugin-zksync/functions/getPaymasterParams.html)
for generating paymaster parameters to add to a transaction.
- [Smart contracts](https://sdk.zksync.io/js/web3js/contracts): The
[`ContractFactory` class](https://chainsafe.github.io/web3-plugin-zksync/classes/ContractFactory.html)
can be used to deploy smart contracts to the ZKsync Era network. The return type of the
[`ContractFactory.deploy` method](https://chainsafe.github.io/web3-plugin-zksync/classes/ContractFactory.html#deploy)
is the standard
[Web3.js Contract class](https://docs.web3js.org/api/web3-eth-contract/class/Contract/).
- [Smart accounts](https://sdk.zksync.io/js/web3js/smart-accounts): The
[`SmartAccount` class](https://chainsafe.github.io/web3-plugin-zksync/classes/SmartAccount.html)
can be used to create
[ZKsync smart accounts](https://docs.zksync.io/build/developer-reference/account-abstraction/)
with custom logic for building and signing transactions. There are factory functions for
creating
[ECDSA smart accounts](https://chainsafe.github.io/web3-plugin-zksync/classes/ECDSASmartAccount.html#create)
and
[multi-signature ECDSA smart accounts](https://chainsafe.github.io/web3-plugin-zksync/classes/MultisigECDSASmartAccount.html#create).

## Contributing

Expand Down
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-plugin-zksync",
"version": "1.0.0-alpha.0",
"version": "1.0.6",
"description": "web3.js plugin for ZkSync",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -12,9 +12,12 @@
"lint": "eslint '{src,test}/**/*.ts'",
"lint:fix": "eslint '{src,test}/**/*.ts' --fix",
"build": "tsc --project tsconfig.build.json",
"build:docs": "npx -y typedoc src/index.ts",
"test": "jest --config=./test/jest.config.js",
"test:unit": "jest --config=./test/jest.config.js test/unit",
"test:local": "jest --config=./test/jest.config.js --runInBand --maxConcurrency=1 test/local",
"test:integration": "jest --config=./test/jest.config.js test/integration"
"test:integration": "jest --config=./test/jest.config.js --runInBand --maxConcurrency=1 test/integration",
"test:all": "jest --config=./test/jest.config.js --runInBand --maxConcurrency=1"
},
"contributors": [
"ChainSafe <[email protected]>"
Expand All @@ -27,20 +30,20 @@
"dependencies": {
"ethereum-cryptography": "^2.1.3",
"hardhat": "^2.19.4",
"web3": "^4.11.1"
"web3": "^4.12.1"
},
"devDependencies": {
"@chainsafe/eslint-config": "^2.1.1",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.10",
"@chainsafe/eslint-config": "^2.2.4",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.0",
"eslint": "8.56.0",
"jest": "^29.7.0",
"jest-extended": "^4.0.2",
"ts-jest": "^29.1.2",
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"typescript": "^5.5.4"
},
"peerDependencies": {
"web3": ">= 4.0.3"
"web3": ">= 4.12.0"
}
}
}
Loading