Skip to content

Commit

Permalink
Make package exports consistent (#411)
Browse files Browse the repository at this point in the history
* Make package exports consistent

* Update README.md s

* type comment fix

* Move default to end of exports

* LightSigner

* export LightSigner

* export type
  • Loading branch information
joepegler authored Feb 9, 2024
1 parent 80a90f1 commit ebff7e3
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 99 deletions.
4 changes: 2 additions & 2 deletions packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
Expand Down
13 changes: 11 additions & 2 deletions packages/account/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ export {
type PaymasterFeeQuote,
type SponsorUserOperationDto,
type FeeQuotesOrDataResponse,
createPaymaster,
} from "@biconomy/paymaster";
export { EthersSigner, convertSigner } from "@biconomy/common";
export { Bundler, type IBundler, extractChainIdFromBundlerUrl, type UserOpResponse, type UserOpStatus, type UserOpReceipt } from "@biconomy/bundler";
export { EthersSigner, convertSigner, type LightSigner } from "@biconomy/common";
export {
Bundler,
type IBundler,
extractChainIdFromBundlerUrl,
type UserOpResponse,
type UserOpStatus,
type UserOpReceipt,
createBundler,
} from "@biconomy/bundler";
export {
createECDSAOwnershipValidationModule,
createERC20SessionValidationModule,
Expand Down
58 changes: 19 additions & 39 deletions packages/bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 4.0.0 (2023-07-02)

Export createBundler alias for static Bundler.create call

## 3.1.3 (2023-12-28)

VERSION Bump Only.
Expand All @@ -11,84 +15,60 @@ VERSION Bump Only.

### Features

* Make entrypoint address optional in bundler config ([547724a](https://github.com/bcnmy/biconomy-client-sdk/pull/337/commits/547724a15366ee1e63aee80fdee0edc128a84c41))
- Make entrypoint address optional in bundler config ([547724a](https://github.com/bcnmy/biconomy-client-sdk/pull/337/commits/547724a15366ee1e63aee80fdee0edc128a84c41))

### Bug Fixes

* use undefined in place of ! + check on limits returned by paymaster and throw ([0376901](https://github.com/bcnmy/biconomy-client-sdk/commit/0376901b7aec8c268a6a3c654d147335974d78f3))
- use undefined in place of ! + check on limits returned by paymaster and throw ([0376901](https://github.com/bcnmy/biconomy-client-sdk/commit/0376901b7aec8c268a6a3c654d147335974d78f3))

## 3.1.1 (2023-11-09)


### Bug Fixes

* resolve comments ([34fd6a3](https://github.com/bcnmy/biconomy-client-sdk/commit/34fd6a308805061d9faf408f1ce6da9cac0ee819))

- resolve comments ([34fd6a3](https://github.com/bcnmy/biconomy-client-sdk/commit/34fd6a308805061d9faf408f1ce6da9cac0ee819))

### Features

* add linea mainnet ([c3d1283](https://github.com/bcnmy/biconomy-client-sdk/commit/c3d12832002c18e187f910b5f7dac5ef5b797abf))
* chain integration ([ddc5d91](https://github.com/bcnmy/biconomy-client-sdk/commit/ddc5d91d5df10a10266f4500644d24e0bc1ea684))
* chain integration ([738556e](https://github.com/bcnmy/biconomy-client-sdk/commit/738556efcfda70fedc652befc0b35f8835c5e360))




- add linea mainnet ([c3d1283](https://github.com/bcnmy/biconomy-client-sdk/commit/c3d12832002c18e187f910b5f7dac5ef5b797abf))
- chain integration ([ddc5d91](https://github.com/bcnmy/biconomy-client-sdk/commit/ddc5d91d5df10a10266f4500644d24e0bc1ea684))
- chain integration ([738556e](https://github.com/bcnmy/biconomy-client-sdk/commit/738556efcfda70fedc652befc0b35f8835c5e360))

## 3.1.0 (2023-09-20)

Modular Account Abstraction is here.

### Bug Fixes

* lint warning and errors ([2135498](https://github.com/bcnmy/biconomy-client-sdk/commit/2135498896beb54d25add820c1521ffa22d5db7c))
* linting ([563befe](https://github.com/bcnmy/biconomy-client-sdk/commit/563befedcc37aee4c531e01809b47e559a33f526))
* more lint issues ([10df908](https://github.com/bcnmy/biconomy-client-sdk/commit/10df90821b473fd668907cf3e447dfe3825317fc))

- lint warning and errors ([2135498](https://github.com/bcnmy/biconomy-client-sdk/commit/2135498896beb54d25add820c1521ffa22d5db7c))
- linting ([563befe](https://github.com/bcnmy/biconomy-client-sdk/commit/563befedcc37aee4c531e01809b47e559a33f526))
- more lint issues ([10df908](https://github.com/bcnmy/biconomy-client-sdk/commit/10df90821b473fd668907cf3e447dfe3825317fc))

### Features

* base mainnet integration ([c17f5d6](https://github.com/bcnmy/biconomy-client-sdk/commit/c17f5d6c2fe34b106e6d9755f54fab2493db6fbe))
* chain integration ([ddc5d91](https://github.com/bcnmy/biconomy-client-sdk/commit/ddc5d91d5df10a10266f4500644d24e0bc1ea684))
* chain integration ([738556e](https://github.com/bcnmy/biconomy-client-sdk/commit/738556efcfda70fedc652befc0b35f8835c5e360))




- base mainnet integration ([c17f5d6](https://github.com/bcnmy/biconomy-client-sdk/commit/c17f5d6c2fe34b106e6d9755f54fab2493db6fbe))
- chain integration ([ddc5d91](https://github.com/bcnmy/biconomy-client-sdk/commit/ddc5d91d5df10a10266f4500644d24e0bc1ea684))
- chain integration ([738556e](https://github.com/bcnmy/biconomy-client-sdk/commit/738556efcfda70fedc652befc0b35f8835c5e360))

## 3.0.0 (2023-08-28)

Modular SDK - consists stable version of below updates done in Alphas.

### Features

* base mainnet integration ([c17f5d6](https://github.com/bcnmy/biconomy-client-sdk/commit/c17f5d6c2fe34b106e6d9755f54fab2493db6fbe))




- base mainnet integration ([c17f5d6](https://github.com/bcnmy/biconomy-client-sdk/commit/c17f5d6c2fe34b106e6d9755f54fab2493db6fbe))

## 3.0.0-alpha.0 (2023-08-02)

VERSION Bump Only.




# 3.1.0-alpha.0 (2023-07-24)


### Features

* chain integration ([738556e](https://github.com/bcnmy/biconomy-client-sdk/commit/738556efcfda70fedc652befc0b35f8835c5e360))




- chain integration ([738556e](https://github.com/bcnmy/biconomy-client-sdk/commit/738556efcfda70fedc652befc0b35f8835c5e360))

## 3.0.0-alpha.0 (2023-07-12)


### Bug Fixes

* linting ([563befe](https://github.com/bcnmy/biconomy-client-sdk/commit/563befedcc37aee4c531e01809b47e559a33f526))
- linting ([563befe](https://github.com/bcnmy/biconomy-client-sdk/commit/563befedcc37aee4c531e01809b47e559a33f526))
16 changes: 6 additions & 10 deletions packages/bundler/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ yarn add @biconomy/bundler

```typescript
// This is how you create bundler instance in your dapp's
import { IBundler, Bundler } from "@biconomy/bundler";
import { IBundler, createBundler } from "@biconomy/bundler";

// Make use of core-types package
import { ChainId } from "@biconomy/core-types";

const bundler: IBundler = new Bundler({
bundlerUrl: "",
chainId: ChainId.POLYGON_MAINNET,
entryPointAddress: "",
});
const bundler: IBundler = await createBundler({ bundlerUrl: "" }); // you can get this value from biconomy dashboard. https://dashboard.biconomy.io
```

Following are the methods that can be call on bundler instance
Expand All @@ -51,7 +47,7 @@ export interface IBundler {
}
```

**estimateUserOpGas**
**[estimateUserOpGas](https://bcnmy.github.io/biconomy-client-sdk/classes/Bundler.html#estimateUserOpGas)**
Estimate the gas values for a UserOperation. Given UserOperation optionally without gas limits and gas prices, return the needed gas limits. The signature field is ignored by the wallet, so that the operation will not require user's approval. Still, it might require putting a "semi-valid" signature (e.g. a signature in the right length)

**Return Values**
Expand All @@ -62,7 +58,7 @@ Estimate the gas values for a UserOperation. Given UserOperation optionally with

--------------------------------

**sendUserOp**
**[sendUserOp](https://bcnmy.github.io/biconomy-client-sdk/classes/Bundler.html#sendUserOp)**
it submits a User Operation object to the User Operation pool of the client. The client MUST validate the UserOperation, and return a result accordingly.

The result SHOULD be set to the userOpHash if and only if the request passed simulation and was accepted in the client's User Operation pool. If the validation, simulation, or User Operation pool inclusion fails, result SHOULD NOT be returned. Rather, the client SHOULD return the failure reason.
Expand All @@ -72,7 +68,7 @@ If the UserOperation is valid, the client MUST return the calculated userOpHash

--------------------------------

**getUserOpByHash**
**[getUserOpByHash](https://bcnmy.github.io/biconomy-client-sdk/classes/Bundler.html#getUserOpByHash)**
Return a UserOperation based on a hash (userOpHash) returned by sendUserOp (eth_sendUserOperation)

**Return Values**
Expand All @@ -81,7 +77,7 @@ null in case the UserOperation is not yet included in a block, or a full UserOpe

--------------------------------

**getUserOpReceipt**
**[getUserOpReceipt](https://bcnmy.github.io/biconomy-client-sdk/classes/Bundler.html#getUserOpReceipt)**

Return a UserOperation receipt based on a hash (userOpHash) returned by eth_sendUserOperation

Expand Down
4 changes: 2 additions & 2 deletions packages/bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
Expand Down
8 changes: 6 additions & 2 deletions packages/bundler/src/Bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
UserOpStatus,
GetUserOperationStatusResponse,
SimulationType,
BunderConfigWithChainId,
BundlerConfigWithChainId,
} from "./utils/Types.js";
import { transformUserOP, getTimestampInSeconds } from "./utils/HelperFunction.js";
import {
Expand All @@ -35,7 +35,7 @@ import { sendRequest, HttpMethod } from "@biconomy/common";
* Checkout the proposal for more details on Bundlers.
*/
export class Bundler implements IBundler {
private bundlerConfig: BunderConfigWithChainId;
private bundlerConfig: BundlerConfigWithChainId;

// eslint-disable-next-line no-unused-vars
UserOpReceiptIntervals!: { [key in number]?: number };
Expand Down Expand Up @@ -325,4 +325,8 @@ export class Bundler implements IBundler {
);
return response.result;
}

public static async create(config: Bundlerconfig): Promise<Bundler> {
return new Bundler(config);
}
}
4 changes: 4 additions & 0 deletions packages/bundler/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Bundler } from "./Bundler.js";

export * from "./interfaces/IBundler.js";
export * from "./Bundler.js";
export * from "./utils/Types.js";
export * from "./utils/Utils.js";

export const createBundler = Bundler.create;
2 changes: 1 addition & 1 deletion packages/bundler/src/utils/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type Bundlerconfig = {
userOpReceiptMaxDurationIntervals?: { [key in number]?: number };

Check warning on line 11 in packages/bundler/src/utils/Types.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

'key' is defined but never used
userOpWaitForTxHashMaxDurationIntervals?: { [key in number]?: number };

Check warning on line 12 in packages/bundler/src/utils/Types.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

'key' is defined but never used
};
export type BunderConfigWithChainId = Bundlerconfig & { chainId: number };
export type BundlerConfigWithChainId = Bundlerconfig & { chainId: number };

export type UserOpReceipt = {
/* The request hash of the UserOperation. */
Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/utils/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Signer } from "@ethersproject/abstract-signer";
import { SmartAccountSigner } from "@alchemy/aa-core";

export type SupportedSignerName = "alchemy" | "ethers" | "viem";
export type SupportedSigner = SmartAccountSigner | WalletClient | Signer | EthersV6Signer;
export type SupportedSigner = SmartAccountSigner | WalletClient | Signer | LightSigner;

export type Service = "Bundler" | "Paymaster";

export interface EthersV6Signer {
export interface LightSigner {
getAddress(): Promise<string>;
signMessage(message: string | Uint8Array): Promise<string>;
}
4 changes: 2 additions & 2 deletions packages/modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/particle-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
Expand Down
40 changes: 17 additions & 23 deletions packages/paymaster/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 4.0.0 (2023-07-02)

Export createPaymaster alias for static Paymaster.create call

## 3.1.3 (2023-12-28)

VERSION Bump Only.
Expand All @@ -13,52 +17,42 @@ VERSION Bump Only.

## 3.1.1 (2023-11-09)


### Bug Fixes

* lint warning and errors ([2135498](https://github.com/bcnmy/biconomy-client-sdk/commit/2135498896beb54d25add820c1521ffa22d5db7c))


- lint warning and errors ([2135498](https://github.com/bcnmy/biconomy-client-sdk/commit/2135498896beb54d25add820c1521ffa22d5db7c))

## 3.1.0 (2023-09-20)
Version Bump Only.

Version Bump Only.

## 3.0.0 (2023-08-28)

Modular SDK - consists stable version of below updates done in Alphas.



## 3.0.0-alpha.0 (2023-08-02)

### Features

* letting maxFee and maxPriority not be undefined([46b985c](https://github.com/bcnmy/biconomy-client-sdk/commit/46b985c75fd135f151c9ac4380a65438cccc6f39))
* passing on paymasterAndData([ae267f1])(https://github.com/bcnmy/biconomy-client-sdk/commit/ae267f1a103f37856eb233a38db7063bfcc4cb45)
* handle undefined values([e53d4a7])(https://github.com/bcnmy/biconomy-client-sdk/commit/e53d4a78aded8c8802786173daf12b27d445d4a0)
* handling userOp null values([c89ac42])(https://github.com/bcnmy/biconomy-client-sdk/commit/c89ac42ae1d7fd985ef2396d925cc63ec5cf926b)
* using signature provided by userop([0c40641])(https://github.com/bcnmy/biconomy-client-sdk/commit/0c40641e4cd6133f7348bb3e3022f8ab78fe299b)


- letting maxFee and maxPriority not be undefined([46b985c](https://github.com/bcnmy/biconomy-client-sdk/commit/46b985c75fd135f151c9ac4380a65438cccc6f39))
- passing on paymasterAndData([ae267f1])(https://github.com/bcnmy/biconomy-client-sdk/commit/ae267f1a103f37856eb233a38db7063bfcc4cb45)
- handle undefined values([e53d4a7])(https://github.com/bcnmy/biconomy-client-sdk/commit/e53d4a78aded8c8802786173daf12b27d445d4a0)
- handling userOp null values([c89ac42])(https://github.com/bcnmy/biconomy-client-sdk/commit/c89ac42ae1d7fd985ef2396d925cc63ec5cf926b)
- using signature provided by userop([0c40641])(https://github.com/bcnmy/biconomy-client-sdk/commit/0c40641e4cd6133f7348bb3e3022f8ab78fe299b)

# 3.1.0-alpha.0 (2023-07-24)

VERSION Bump Only.


## 3.0.0-alpha.0 (2023-07-12)


### Bug Fixes

* linting ([563befe](https://github.com/bcnmy/biconomy-client-sdk/commit/563befedcc37aee4c531e01809b47e559a33f526))
* linting ([d2f5f1a](https://github.com/bcnmy/biconomy-client-sdk/commit/d2f5f1afadc2a561c4ef01c0821a25b9d7fe776e))

- linting ([563befe](https://github.com/bcnmy/biconomy-client-sdk/commit/563befedcc37aee4c531e01809b47e559a33f526))
- linting ([d2f5f1a](https://github.com/bcnmy/biconomy-client-sdk/commit/d2f5f1afadc2a561c4ef01c0821a25b9d7fe776e))

### Features

* covert gas limits to numbers for making pm service call ([b1fe96f](https://github.com/bcnmy/biconomy-client-sdk/commit/b1fe96f7a312ceaf7aa689939b7c69718c710dd1))
* get fee quote or data method in biconomy paymaster ([47748a6](https://github.com/bcnmy/biconomy-client-sdk/commit/47748a6384c2b74e1d9be4d570554098e1ac02e7))
* update responses to support calculateGasLimits flag + update interfaces ([55bbd38](https://github.com/bcnmy/biconomy-client-sdk/commit/55bbd38b4ef8acaf8da1d52e36846557b134aba4))
* using hybrid paymaster interface ([5fc56a7](https://github.com/bcnmy/biconomy-client-sdk/commit/5fc56a7db2de4a3f4bb87cd4d75584e79010b206))
- covert gas limits to numbers for making pm service call ([b1fe96f](https://github.com/bcnmy/biconomy-client-sdk/commit/b1fe96f7a312ceaf7aa689939b7c69718c710dd1))
- get fee quote or data method in biconomy paymaster ([47748a6](https://github.com/bcnmy/biconomy-client-sdk/commit/47748a6384c2b74e1d9be4d570554098e1ac02e7))
- update responses to support calculateGasLimits flag + update interfaces ([55bbd38](https://github.com/bcnmy/biconomy-client-sdk/commit/55bbd38b4ef8acaf8da1d52e36846557b134aba4))
- using hybrid paymaster interface ([5fc56a7](https://github.com/bcnmy/biconomy-client-sdk/commit/5fc56a7db2de4a3f4bb87cd4d75584e79010b206))
Loading

0 comments on commit ebff7e3

Please sign in to comment.