diff --git a/README.md b/README.md index 82ff0abcd..41aaa070d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Biconomy](https://img.shields.io/badge/Made_with_%F0%9F%8D%8A_by-Biconomy-ff4e17?style=flat)](https://biconomy.io) [![License MIT](https://img.shields.io/badge/License-MIT-blue?&style=flat)](./LICENSE) [![codecov](https://codecov.io/github/bcnmy/sdk/graph/badge.svg?token=DTdIR5aBDA)](https://codecov.io/github/bcnmy/sdk) -# SDK 🚀 +# abstractJS 🚀 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/bcnmy/sdk) diff --git a/src/sdk/account/decorators/build.test.ts b/src/sdk/account/decorators/build.test.ts index 58d88c116..6e8543318 100644 --- a/src/sdk/account/decorators/build.test.ts +++ b/src/sdk/account/decorators/build.test.ts @@ -34,11 +34,11 @@ describe("mee:build", () => { meeClient = createMeeClient({ account: mcNexus }) }) - it("should use the default action while building instructions", async () => { + it("should use the base option while building instructions", async () => { const instructions = await build( { account: mcNexus }, { - type: "default", + type: "base", data: { instructions: [ { @@ -89,7 +89,7 @@ describe("mee:build", () => { const instructions = await build( { account: mcNexus, currentInstructions }, { - type: "default", + type: "base", data: { instructions: [ { diff --git a/src/sdk/account/decorators/build.ts b/src/sdk/account/decorators/build.ts index dbf46818a..02cb04eb0 100644 --- a/src/sdk/account/decorators/build.ts +++ b/src/sdk/account/decorators/build.ts @@ -4,9 +4,10 @@ import type { BaseMultichainSmartAccount } from "../toMultiChainNexusAccount" import type { MultichainContract } from "../utils/getMultichainContract" import { type BuildBaseInstructionsParams, - buildBaseInstructions -} from "./instructions/buildBaseInstructions" -import { type BuildIntentParams, buildIntent } from "./instructions/buildIntent" + type BuildIntentParams, + buildBaseInstructions, + buildIntent +} from "./instructions" /** * Base parameters for building instructions @@ -20,27 +21,12 @@ export type BaseInstructionsParams = { currentInstructions?: Instruction[] } -/** - * Configuration for bridging tokens between chains - * @property amount - The amount of tokens to bridge - * @property mcToken - The multichain token contract to bridge - * @property chain - The destination chain for the bridge operation - */ -export type BridgeInstructionsForBridgeAction = { - /** The amount of tokens to require */ - amount: bigint - /** The token to require */ - mcToken: MultichainContract - /** The chain to require the token on */ - chain: Chain -} - /** * Default build action which is used to build instructions for a chain */ export type BuildBaseInstruction = { /** The type of action */ - type: "default" + type: "base" /** The parameters for the action */ data: BuildBaseInstructionsParams } @@ -67,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 ("default" | "intent") + * @param params.type - The type of build action ("base" | "intent") * @param params.parameters - {@link BuildBaseInstruction} | {@link BuildIntentInstruction} * * @returns Promise resolving to an array of {@link Instruction} @@ -87,7 +73,7 @@ export type BuildInstructionTypes = * @example * // Default action example * const defaultInstructions = await build({ - * type: "default", + * type: "base", * parameters: myExistingInstruction, * account: myMultichainAccount * }) @@ -96,15 +82,13 @@ export const build = async ( baseParams: BaseInstructionsParams, parameters: BuildInstructionTypes ): Promise => { - console.log({ baseParams, parameters }) - const { type, data } = parameters switch (type) { case "intent": { return buildIntent(baseParams, data) } - case "default": { + case "base": { return buildBaseInstructions(baseParams, data) } default: { diff --git a/src/sdk/clients/createMeeClient.test.ts b/src/sdk/clients/createMeeClient.test.ts index d0f3db819..55cf37a2e 100644 --- a/src/sdk/clients/createMeeClient.test.ts +++ b/src/sdk/clients/createMeeClient.test.ts @@ -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: "default", + type: "base", data: { instructions: [ { @@ -187,7 +187,7 @@ describe("mee.createMeeClient", async () => { }), // Second instruction: Execute a simple call on the Base network mcNexus.build({ - type: "default", + type: "base", data: { instructions: [ { diff --git a/src/sdk/clients/decorators/mee/getQuote.test.ts b/src/sdk/clients/decorators/mee/getQuote.test.ts index 57fc0b43c..7a55d443e 100644 --- a/src/sdk/clients/decorators/mee/getQuote.test.ts +++ b/src/sdk/clients/decorators/mee/getQuote.test.ts @@ -82,7 +82,7 @@ describe("mee.getQuote", () => { } }), mcNexus.build({ - type: "default", + type: "base", data: { instructions: [ {