Skip to content

Commit

Permalink
Merge branch 'develop' into feat/add_mee
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Jan 16, 2025
2 parents b26c193 + 3b6a9a1 commit 5baa467
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 16 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @biconomy/sdk

## 0.0.28

### Patch Changes

- Sudo fallback for empty rules

## 0.0.27

### Patch Changes

- useRegistry false attestation fix

## 0.0.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/sdk",
"version": "0.0.26",
"version": "0.0.28",
"author": "Biconomy",
"repository": "github:bcnmy/sdk",
"main": "./dist/_cjs/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/account/decorators/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("mee:build", () => {
const instructions = await build(
{ account: mcNexus },
{
type: "base",
type: "default",
data: {
instructions: [
{
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("mee:build", () => {
const instructions = await build(
{ account: mcNexus, currentInstructions },
{
type: "base",
type: "default",
data: {
instructions: [
{
Expand Down
8 changes: 4 additions & 4 deletions src/sdk/account/decorators/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type BaseInstructionsParams = {
*/
export type BuildBaseInstruction = {
/** The type of action */
type: "base"
type: "default"
/** The parameters for the action */
data: BuildBaseInstructionsParams
}
Expand All @@ -53,7 +53,7 @@ export type BuildInstructionTypes =
* @param params - The build instructions configuration
* @param params.account - {@link BaseMultichainSmartAccount} The multichain smart account to check balances for
* @param params.currentInstructions - {@link Instruction[]} Optional array of existing instructions to append to
* @param params.type - The type of build action ("base" | "intent")
* @param params.type - The type of build action ("default" | "intent")
* @param params.parameters - {@link BuildBaseInstruction} | {@link BuildIntentInstruction}
*
* @returns Promise resolving to an array of {@link Instruction}
Expand All @@ -73,7 +73,7 @@ export type BuildInstructionTypes =
* @example
* // Default action example
* const defaultInstructions = await build({
* type: "base",
* type: "default",
* parameters: myExistingInstruction,
* account: myMultichainAccount
* })
Expand All @@ -88,7 +88,7 @@ export const build = async (
case "intent": {
return buildIntent(baseParams, data)
}
case "base": {
case "default": {
return buildBaseInstructions(baseParams, data)
}
default: {
Expand Down
3 changes: 2 additions & 1 deletion src/sdk/clients/createBicoPaymasterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
createSmartAccountClient
} from "./createSmartAccountClient"

describe("bico.paymaster", async () => {
describe.skip("bico.paymaster", async () => {
// describe.runIf(paymasterTruthy())("bico.paymaster", async () => {
let network: NetworkConfig

Expand Down Expand Up @@ -163,6 +163,7 @@ describe("bico.paymaster", async () => {
})
const receipt = await nexusClient.waitForUserOperationReceipt({ hash })

console.log(receipt, "receipt")
expect(receipt.success).toBe("true")

// Get final balance
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/clients/createMeeClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe("mee.createMeeClient", async () => {
// These can be any 'Instruction', or any helper method that resolves to a 'Instruction',
// including 'build'. They all are resolved in the 'getQuote' method under the hood.
const currentInstructions = await meeClient.account.build({
type: "base",
type: "default",
data: {
instructions: [
{
Expand Down Expand Up @@ -187,7 +187,7 @@ describe("mee.createMeeClient", async () => {
}),
// Second instruction: Execute a simple call on the Base network
mcNexus.build({
type: "base",
type: "default",
data: {
instructions: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/clients/decorators/mee/getQuote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("mee.getQuote", () => {
}
}),
mcNexus.build({
type: "base",
type: "default",
data: {
instructions: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export const getPermissionAction = async ({
// })
// policyData.push(timeFramePolicyData)

if (actionPolicyInfo.rules && actionPolicyInfo.rules.length > 0) {
const hasValidRules =
actionPolicyInfo?.rules && actionPolicyInfo?.rules?.length > 0

if (hasValidRules) {
const actionConfig = createActionConfig(
actionPolicyInfo.rules ?? [],
actionPolicyInfo.valueLimit
Expand All @@ -100,7 +103,7 @@ export const getPermissionAction = async ({
}

// create sudo policy here..
if (actionPolicyInfo.sudo) {
if (actionPolicyInfo.sudo || !hasValidRules) {
const sudoPolicy = getSudoPolicy()
policyData.push(sudoPolicy)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ describe.skip("modules.smartSessions.enable.mode.dx", async () => {
})

test("full smart sessions enable mode example", async () => {
const uninitializedSmartSessions = getSmartSessionsValidator({})
const uninitializedSmartSessions = getSmartSessionsValidator({
useRegistry: false
})

const isInstalled = await nexusClient.isModuleInstalled({
module: uninitializedSmartSessions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export const toSmartSessionsValidator = (
} = parameters

const initData = initData_ ?? getUsePermissionInitData(initArgs_)
const moduleInitData = moduleInitData_ ?? getSmartSessionsValidator({})
const moduleInitData =
moduleInitData_ ?? getSmartSessionsValidator({ useRegistry: false })

return toModule({
...parameters,
Expand Down
2 changes: 1 addition & 1 deletion src/test/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import type { TestFileNetworkType } from "./testSetup"
config()

const BASE_SEPOLIA_RPC_URL =
"https://virtual.base-sepolia.rpc.tenderly.co/6ccdd33d-d8f4-4476-8d37-63ba0ed0ea8f"
"https://virtual.base-sepolia.rpc.tenderly.co/25344426-d008-45d9-ac9f-93910c696110"

type AnvilInstance = ReturnType<typeof anvil>
type BundlerInstance = ReturnType<typeof alto>
Expand Down

0 comments on commit 5baa467

Please sign in to comment.