Skip to content

Commit

Permalink
Merge pull request #269 from bcnmy/development
Browse files Browse the repository at this point in the history
r4
  • Loading branch information
livingrockrises authored Aug 29, 2023
2 parents a327582 + 2497fb9 commit 1615f94
Show file tree
Hide file tree
Showing 25 changed files with 149 additions and 41 deletions.
8 changes: 8 additions & 0 deletions packages/account/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 3.0.0 (2023-08-28)

VERSION bump only

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



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


Expand Down
12 changes: 6 additions & 6 deletions packages/account/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/account",
"version": "3.1.1-alpha.0",
"version": "3.0.0",
"description": "This package provides apis for ERC-4337 based smart account implementations",
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down Expand Up @@ -34,10 +34,10 @@
"access": "public"
},
"devDependencies": {
"@biconomy/bundler": "^3.1.1-alpha.0",
"@biconomy/common": "^3.1.1-alpha.0",
"@biconomy/core-types": "^3.1.1-alpha.0",
"@biconomy/node-client": "^3.0.0-alpha.0",
"@biconomy/paymaster": "^3.1.1-alpha.0"
"@biconomy/bundler": "^3.0.0",
"@biconomy/common": "^3.0.0",
"@biconomy/core-types": "^3.0.0",
"@biconomy/node-client": "^3.0.0",
"@biconomy/paymaster": "^3.0.0"
}
}
10 changes: 10 additions & 0 deletions packages/account/src/BiconomySmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,16 @@ export class BiconomySmartAccount extends SmartAccount implements IBiconomySmart

// Requesting to update gas limits again (especially callGasLimit needs to be re-calculated)
try {
delete finalUserOp.callGasLimit
delete finalUserOp.verificationGasLimit
delete finalUserOp.preVerificationGas

// Maybe send paymasterAndData since we know it's for Token paymaster
/*finalUserOp.paymasterAndData =
'0x00000f7365ca6c59a2c93719ad53d567ed49c14c000000000000000000000000000000000000000000000000000000000064e3d3890000000000000000000000000000000000000000000000000000000064e3cc81000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000f7748595e46527413574a9327942e744e910000000000000000000000000000000000000000000000000000000063ac7f6c000000000000000000000000000000000000000000000000000000000010c8e07bf61410b71700f943499adfd23e50fb16040d587acb0a5e60ac8576cdbb4c8044f00579a1fc3f294e7dc4a5eb557a7193008343aa36225bddcfbd4fd15646031c'*/

// Review: and handle the case when mock pnd fails with AA31 during simulation.

finalUserOp = await this.estimateUserOpGas(finalUserOp)
const cgl = ethers.BigNumber.from(finalUserOp.callGasLimit)
if (finalUserOp.callGasLimit && cgl.lt(ethers.BigNumber.from('21000'))) {
Expand Down
22 changes: 14 additions & 8 deletions packages/account/src/SmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ export abstract class SmartAccount implements ISmartAccount {
(await this.provider.getGasPrice())
if (userOp.initCode)
userOp.verificationGasLimit =
userOp.verificationGasLimit ?? (await this.getVerificationGasLimit(userOp.initCode))
userOp.verificationGasLimit !== null || userOp.verificationGasLimit !== undefined
? userOp.verificationGasLimit
: await this.getVerificationGasLimit(userOp.initCode)
userOp.callGasLimit =
userOp.callGasLimit ??
(await this.provider.estimateGas({
from: this.smartAccountConfig.entryPointAddress,
to: userOp.sender,
data: userOp.callData
}))
userOp.preVerificationGas = userOp.preVerificationGas ?? this.getPreVerificationGas(userOp)
userOp.callGasLimit !== null || userOp.callGasLimit !== undefined
? userOp.callGasLimit
: await this.provider.estimateGas({
from: this.smartAccountConfig.entryPointAddress,
to: userOp.sender,
data: userOp.callData
})
userOp.preVerificationGas =
userOp.preVerificationGas !== null || userOp.preVerificationGas !== undefined
? userOp.preVerificationGas
: this.getPreVerificationGas(userOp)
return userOp
}

Expand Down
14 changes: 13 additions & 1 deletion packages/bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 3.1.1-alpha.0 (2023-08-02)
## 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))





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

VERSION bump only

Expand Down
6 changes: 3 additions & 3 deletions packages/bundler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/bundler",
"version": "3.1.1-alpha.0",
"version": "3.0.0",
"description": "Biconomy Bundler package to interact with any bundler node as per ERC4337 standard",
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down Expand Up @@ -37,7 +37,7 @@
"access": "public"
},
"devDependencies": {
"@biconomy/common": "^3.1.1-alpha.0",
"@biconomy/core-types": "^3.1.1-alpha.0"
"@biconomy/common": "^3.0.0",
"@biconomy/core-types": "^3.0.0"
}
}
10 changes: 9 additions & 1 deletion packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

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


### Features

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


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

### Features

Expand Down
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/common",
"version": "3.1.1-alpha.0",
"version": "3.0.0",
"description": "common utils to be used for aa transactions",
"keywords": [
"utils"
Expand Down Expand Up @@ -41,8 +41,8 @@
},
"dependencies": {
"@account-abstraction/contracts": "^0.6.0",
"@biconomy/core-types": "^3.1.1-alpha.0",
"@biconomy/node-client": "^3.0.0-alpha.0",
"@biconomy/core-types": "^3.0.0",
"@biconomy/node-client": "^3.0.0",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/httpRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@ export async function sendRequest<T>({ url, method, body, headers = {} }: HttpRe
}
// else
}
const errorObject = { code: response.status, message: response.statusText }
const errorObject = { code: response.status, message: response.statusText, data: undefined }

if (jsonResponse?.error) {
if (typeof jsonResponse.error === 'string') {
const error = jsonResponse.error
errorObject.code = response.status
errorObject.message = error
delete errorObject.data
throw errorObject
} else if (typeof jsonResponse.error === 'object') {
const error = jsonResponse.error
errorObject.code = error?.code
errorObject.message = error?.message
errorObject.data = error?.handleOpsCallData
throw errorObject
}
}
Expand Down
11 changes: 10 additions & 1 deletion packages/core-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

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


### Features

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



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

VERSION bump only

Expand Down
2 changes: 1 addition & 1 deletion packages/core-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/core-types",
"version": "3.1.1-alpha.0",
"version": "3.0.0",
"description": "Biconomy Client SDK types",
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/node-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 3.0.0 (2023-08-28)




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


Expand Down
2 changes: 1 addition & 1 deletion packages/node-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/node-client",
"version": "3.0.0-alpha.0",
"version": "3.0.0",
"description": "Node Client that comminucates with indexer service to fetch necessary details for the Smart Account",
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down
11 changes: 11 additions & 0 deletions packages/particle-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 3.0.0 (2023-08-28)


### Features

* particle auth integration ([7b8fb1d](https://github.com/bcnmy/biconomy-client-sdk/commit/7b8fb1d05e3cc0196bc15806fa48100701af181e))





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


Expand Down
2 changes: 1 addition & 1 deletion packages/particle-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/particle-auth",
"version": "3.0.0-alpha.0",
"version": "3.0.0",
"description": "Particle auth for Biconomy SDK",
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down
8 changes: 7 additions & 1 deletion packages/paymaster/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 3.1.1-alpha.0 (2023-08-02)
## 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

Expand Down
6 changes: 3 additions & 3 deletions packages/paymaster/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/paymaster",
"version": "3.1.1-alpha.0",
"version": "3.0.0",
"description": "Biconomy Paymaster to interact with Paymaster Services that interacts with ( veriying and token ) paymasters",
"main": "./dist/src/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down Expand Up @@ -37,7 +37,7 @@
"access": "public"
},
"devDependencies": {
"@biconomy/common": "^3.1.1-alpha.0",
"@biconomy/core-types": "^3.1.1-alpha.0"
"@biconomy/common": "^3.0.0",
"@biconomy/core-types": "^3.0.0"
}
}
18 changes: 14 additions & 4 deletions packages/paymaster/src/BiconomyPaymaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD
): Promise<Partial<UserOperation>> {
// Review
userOp = await resolveProperties(userOp)
if (userOp.nonce) {
if (userOp.nonce !== null || userOp.nonce !== undefined) {
userOp.nonce = BigNumber.from(userOp.nonce).toHexString()
}
if (userOp.callGasLimit) {
if (userOp.callGasLimit !== null || userOp.callGasLimit !== undefined) {
userOp.callGasLimit = BigNumber.from(userOp.callGasLimit).toString()
}
if (userOp.verificationGasLimit) {
if (userOp.verificationGasLimit !== null || userOp.verificationGasLimit !== undefined) {
userOp.verificationGasLimit = BigNumber.from(userOp.verificationGasLimit).toString()
}
if (userOp.preVerificationGas) {
if (userOp.preVerificationGas !== null || userOp.preVerificationGas !== undefined) {
userOp.preVerificationGas = BigNumber.from(userOp.preVerificationGas).toString()
}
userOp.maxFeePerGas = BigNumber.from(userOp.maxFeePerGas).toHexString()
Expand Down Expand Up @@ -144,6 +144,7 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD
}

let mode = null
let expiryDuration = null
const calculateGasLimits = paymasterServiceData.calculateGasLimits
? paymasterServiceData.calculateGasLimits
: false
Expand All @@ -163,6 +164,11 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD
// Validation on the mode passed / define allowed enums
}

if (paymasterServiceData.expiryDuration) {
Logger.log('Requested expiryDuration is ', paymasterServiceData.expiryDuration)
expiryDuration = paymasterServiceData.expiryDuration
}

preferredToken = paymasterServiceData?.preferredToken
? paymasterServiceData?.preferredToken
: preferredToken
Expand Down Expand Up @@ -190,6 +196,7 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD
{
...(mode !== null && { mode }),
calculateGasLimits: calculateGasLimits,
...(expiryDuration !== null && { expiryDuration }),
tokenInfo: {
tokenList: feeTokensArray,
...(preferredToken !== null && { preferredToken })
Expand Down Expand Up @@ -287,6 +294,7 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD
Logger.log('calculateGasLimits is ', calculateGasLimits)

let tokenInfo = null
let expiryDuration = null
// could make below null
let smartAccountInfo = {
name: 'BICONOMY',
Expand All @@ -308,6 +316,7 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD

webhookData = paymasterServiceData?.webhookData ?? webhookData
smartAccountInfo = paymasterServiceData?.smartAccountInfo ?? smartAccountInfo
expiryDuration = paymasterServiceData?.expiryDuration ?? expiryDuration

// Note: The idea is before calling this below rpc, userOp values presense and types should be in accordance with how we call eth_estimateUseropGas on the bundler

Expand All @@ -322,6 +331,7 @@ export class BiconomyPaymaster implements IHybridPaymaster<SponsorUserOperationD
{
mode: mode,
calculateGasLimits: calculateGasLimits,
...(expiryDuration !== null && { expiryDuration }),
...(tokenInfo !== null && { tokenInfo }),
sponsorshipInfo: {
...(webhookData !== null && { webhookData }),
Expand Down
2 changes: 2 additions & 0 deletions packages/paymaster/src/utils/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type PaymasterConfig = {
export type SponsorUserOperationDto = {
mode: PaymasterMode
calculateGasLimits?: boolean
expiryDuration?: number
webhookData?: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any
Expand All @@ -44,6 +45,7 @@ export type SponsorUserOperationDto = {
// meant for pm_getFeeQuoteOrData
export type FeeQuotesOrDataDto = {
mode?: PaymasterMode
expiryDuration?: number
calculateGasLimits?: boolean
tokenList?: string[]
preferredToken?: string
Expand Down
7 changes: 6 additions & 1 deletion packages/transak/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 3.0.0 (2023-08-28)

VERSION bump only



## 2.0.0 (2023-04-07)


Expand All @@ -20,4 +26,3 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
### Features

* transak wrapper module ([102e6eb](https://github.com/bcnmy/biconomy-client-sdk/commit/102e6eb5f179e4aff77d1e91973e0b32fa7b8f9a))

Loading

0 comments on commit 1615f94

Please sign in to comment.