From 17756ee292f5c3e976820f275e3f8f251cee3f18 Mon Sep 17 00:00:00 2001 From: lgalende Date: Thu, 30 Jul 2026 10:48:56 -0400 Subject: [PATCH] examples: add swap and split --- examples/16-swap-and-split/.gitignore | 4 + examples/16-swap-and-split/.mocharc.json | 3 + examples/16-swap-and-split/.npmrc | 2 + examples/16-swap-and-split/eslint.config.mjs | 108 ++++++++++++++++++ examples/16-swap-and-split/manifest.yaml | 12 ++ examples/16-swap-and-split/package.json | 36 ++++++ .../scripts/create-trigger.ts | 52 +++++++++ .../16-swap-and-split/scripts/env.template | 2 + .../scripts/get-trigger-prefill-url.ts | 39 +++++++ .../16-swap-and-split/scripts/try-function.ts | 33 ++++++ .../16-swap-and-split/scripts/tsconfig.json | 17 +++ examples/16-swap-and-split/src/function.ts | 42 +++++++ .../16-swap-and-split/tests/function.spec.ts | 84 ++++++++++++++ .../16-swap-and-split/tests/tsconfig.json | 21 ++++ examples/16-swap-and-split/tsconfig.json | 6 + yarn.lock | 100 +++++++++++++++- 16 files changed, 560 insertions(+), 1 deletion(-) create mode 100644 examples/16-swap-and-split/.gitignore create mode 100644 examples/16-swap-and-split/.mocharc.json create mode 100644 examples/16-swap-and-split/.npmrc create mode 100644 examples/16-swap-and-split/eslint.config.mjs create mode 100644 examples/16-swap-and-split/manifest.yaml create mode 100644 examples/16-swap-and-split/package.json create mode 100644 examples/16-swap-and-split/scripts/create-trigger.ts create mode 100644 examples/16-swap-and-split/scripts/env.template create mode 100644 examples/16-swap-and-split/scripts/get-trigger-prefill-url.ts create mode 100644 examples/16-swap-and-split/scripts/try-function.ts create mode 100644 examples/16-swap-and-split/scripts/tsconfig.json create mode 100644 examples/16-swap-and-split/src/function.ts create mode 100644 examples/16-swap-and-split/tests/function.spec.ts create mode 100644 examples/16-swap-and-split/tests/tsconfig.json create mode 100644 examples/16-swap-and-split/tsconfig.json diff --git a/examples/16-swap-and-split/.gitignore b/examples/16-swap-and-split/.gitignore new file mode 100644 index 0000000..3036b19 --- /dev/null +++ b/examples/16-swap-and-split/.gitignore @@ -0,0 +1,4 @@ +node_modules +build +types +scripts/.env diff --git a/examples/16-swap-and-split/.mocharc.json b/examples/16-swap-and-split/.mocharc.json new file mode 100644 index 0000000..88e536a --- /dev/null +++ b/examples/16-swap-and-split/.mocharc.json @@ -0,0 +1,3 @@ +{ + "node-option": ["import=tsx/esm"] +} diff --git a/examples/16-swap-and-split/.npmrc b/examples/16-swap-and-split/.npmrc new file mode 100644 index 0000000..8f0c027 --- /dev/null +++ b/examples/16-swap-and-split/.npmrc @@ -0,0 +1,2 @@ +node-linker=hoisted +legacy-peer-deps=true \ No newline at end of file diff --git a/examples/16-swap-and-split/eslint.config.mjs b/examples/16-swap-and-split/eslint.config.mjs new file mode 100644 index 0000000..1d93d01 --- /dev/null +++ b/examples/16-swap-and-split/eslint.config.mjs @@ -0,0 +1,108 @@ +import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin" +import eslintParserTypeScript from "@typescript-eslint/parser" +import eslintPluginImport from "eslint-plugin-import" +import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort" +import eslintConfigPrettier from "eslint-config-prettier" +import eslintPluginPrettier from "eslint-plugin-prettier" + +export default [ + { + ignores: ["node_modules/**", "**/dist/**", "**/build/**", "**/.prettierrc.*", "./src/types/**"] + }, + { + files: ["**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + parser: eslintParserTypeScript, + parserOptions: { + project: "./tsconfig.json" + } + }, + plugins: { + "@typescript-eslint": eslintPluginTypeScript, + prettier: eslintPluginPrettier, + import: eslintPluginImport, + "simple-import-sort": eslintPluginSimpleImportSort + }, + rules: { + ...eslintPluginTypeScript.configs.recommended.rules, + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-unused-vars": ["error"], + "@typescript-eslint/explicit-function-return-type": "error", + "@typescript-eslint/no-explicit-any": "error", + + "prettier/prettier": [ + "error", + { + "semi": false, + "singleQuote": true, + "trailingComma": "es5", + "arrowParens": "always", + "bracketSpacing": true, + "printWidth": 120, + "tabWidth": 2, + "useTabs": false + } + ], + + "simple-import-sort/imports": [ + "error", + { + groups: [ + ["^@?\\w"], + ["^\\.\\.(?!/?$)", "^\\.\\./?$"], + ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"] + ] + } + ], + "simple-import-sort/exports": "error", + + "comma-spacing": ["error", { before: false, after: true }], + "no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }] + }, + settings: { + "import/resolver": { + typescript: { + alwaysTryTypes: true, + project: "./tsconfig.json" + } + } + } + }, + // configuration for test files + { + files: ["tests/**/*.{ts,tsx}", "**/*.spec.{ts,tsx}", "**/*.test.{ts,tsx}"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + parser: eslintParserTypeScript, + parserOptions: { + project: "./tests/tsconfig.json" + } + }, + rules: { + "@typescript-eslint/no-unused-expressions": "off" + } + }, + { + files: ["scripts/**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + parser: eslintParserTypeScript, + parserOptions: { + project: "./scripts/tsconfig.json" + } + }, + settings: { + "import/resolver": { + typescript: { + alwaysTryTypes: true, + project: "./scripts/tsconfig.json" + } + } + } + }, + eslintConfigPrettier +] \ No newline at end of file diff --git a/examples/16-swap-and-split/manifest.yaml b/examples/16-swap-and-split/manifest.yaml new file mode 100644 index 0000000..fb56bd0 --- /dev/null +++ b/examples/16-swap-and-split/manifest.yaml @@ -0,0 +1,12 @@ +version: 1.0.0 +name: Swap And Split Function +description: Swap tokens and transfer the output to multiple recipients +inputs: + - chainId: uint32 + - tokenIn: address + - tokenOut: address + - amount: string # e.g., '10.5' = 10.5 USDC + - slippageBps: uint16 # e.g., 50 = 0.50% + - user: address + - allocations: string # e.g., '0xab...c:6075,0xde...f:3925' (60.75% to 0xab...c and 39.25% to 0xde...f) + - maxFeeUsd: string # e.g., '0.01' = 0.01 USD \ No newline at end of file diff --git a/examples/16-swap-and-split/package.json b/examples/16-swap-and-split/package.json new file mode 100644 index 0000000..6812c5e --- /dev/null +++ b/examples/16-swap-and-split/package.json @@ -0,0 +1,36 @@ +{ + "name": "@mimicprotocol/16-swap-and-split", + "version": "0.0.1", + "license": "Unlicensed", + "private": true, + "type": "module", + "scripts": { + "deploy": "mimic deploy", + "build": "mimic build", + "codegen": "mimic codegen", + "compile": "mimic compile", + "test": "mimic test", + "lint": "eslint .", + "trigger": "tsx scripts/create-trigger.ts", + "prefill-url": "tsx scripts/get-trigger-prefill-url.ts", + "try-function": "tsx scripts/try-function.ts" + }, + "devDependencies": { + "@mimicprotocol/cli": "~1.0.0", + "@mimicprotocol/lib-ts": "~0.1.5", + "@mimicprotocol/sdk": "~0.1.3", + "@mimicprotocol/test-ts": "~0.1.0", + "@types/chai": "^5.2.2", + "@types/mocha": "^10.0.10", + "@types/node": "^22.10.5", + "assemblyscript": "0.27.36", + "chai": "^4.3.7", + "dotenv": "^17.2.3", + "eslint": "^9.10.0", + "json-as": "1.1.7", + "mocha": "^10.2.0", + "tsx": "^4.20.3", + "typescript": "^5.8.3", + "visitor-as": "0.11.4" + } +} \ No newline at end of file diff --git a/examples/16-swap-and-split/scripts/create-trigger.ts b/examples/16-swap-and-split/scripts/create-trigger.ts new file mode 100644 index 0000000..416c63f --- /dev/null +++ b/examples/16-swap-and-split/scripts/create-trigger.ts @@ -0,0 +1,52 @@ +import { Chains, Client, createExecuteOnceTriggerConfig, EthersSigner } from '@mimicprotocol/sdk' +import { config } from 'dotenv' + +// Load environment variables from .env file +config({ path: './scripts/.env' }) + +// TODO: Replace with your deployed function's CID +const FUNCTION_CID = 'YOUR_FUNCTION_CID_HERE' + +// TODO: Customize inputs to match your function's input structure +// This template uses the example function's inputs: chainId, token, amount, recipient, maxFee +const inputs = { + chainId: Chains.Optimism, + token: '0x0b2c639c533813f4aa9d7837caf62653d097ff85', // USDC on Optimism + amount: '1', + recipient: '0x...', // TODO: Replace with your recipient address + maxFee: '0.1', +} + +async function main(): Promise { + const client = new Client({ + signer: EthersSigner.fromPrivateKey(process.env.PRIVATE_KEY!), + }) + + // Get the manifest for the function + const manifest = await client.functions.getManifest(FUNCTION_CID) + + // TODO: Customize the version, description, and other parameters + // - version: Function version (e.g., '1.0.0') + // - description: Human-readable description for this trigger + // - config: When to execute the function (cron schedule, delta, endDate) + // - executionFeeLimit: Maximum fee for execution (use '0' for no limit) + // - minValidations: Minimum number of validations required + + await client.triggers.signAndCreate({ + functionCid: FUNCTION_CID, + manifest: manifest, + input: inputs, + version: '1.0.0', // TODO: Update to match your function version + description: `Default Transfer - ${inputs.chainId}`, + config: createExecuteOnceTriggerConfig(), + executionFeeLimit: '0', + minValidations: 1, + }) + + console.log(`Successfully created trigger`) +} + +main().catch((error) => { + console.error('Error creating trigger:', error) + process.exit(1) +}) diff --git a/examples/16-swap-and-split/scripts/env.template b/examples/16-swap-and-split/scripts/env.template new file mode 100644 index 0000000..1302ffa --- /dev/null +++ b/examples/16-swap-and-split/scripts/env.template @@ -0,0 +1,2 @@ +# Private key for signing triggers +PRIVATE_KEY=your_private_key_here diff --git a/examples/16-swap-and-split/scripts/get-trigger-prefill-url.ts b/examples/16-swap-and-split/scripts/get-trigger-prefill-url.ts new file mode 100644 index 0000000..64b9599 --- /dev/null +++ b/examples/16-swap-and-split/scripts/get-trigger-prefill-url.ts @@ -0,0 +1,39 @@ +import { Chains, getTriggerPrefillUrl, TriggerType } from '@mimicprotocol/sdk' + +// TODO: Replace with your deployed function's CID +const FUNCTION_CID = 'YOUR_FUNCTION_CID_HERE' + +// TODO: Customize inputs to match your function's input structure +const inputs = { + chainId: Chains.Optimism, + token: '0x0b2c639c533813f4aa9d7837caf62653d097ff85', // USDC on Optimism + amount: '1', + recipient: '0x...', + maxFee: '0.1', +} + +// TODO: Customize the trigger configuration +const config = { + type: TriggerType.Cron, + schedule: '0 2 * * *', // every day at 2am + delta: '2h', + endDate: Date.now() + 7 * 24 * 60 * 60 * 1000, // one week from now +} + +async function main(): Promise { + // TODO: Replace with your parameters + const prefillUrl = getTriggerPrefillUrl({ + functionCid: FUNCTION_CID, + input: inputs, + config, + description: 'Example trigger description', + version: '1.0.1', + }) + + console.log(`Trigger prefill URL: ${prefillUrl}`) +} + +main().catch((error) => { + console.error('Error getting trigger prefill URL:', error) + process.exit(1) +}) diff --git a/examples/16-swap-and-split/scripts/try-function.ts b/examples/16-swap-and-split/scripts/try-function.ts new file mode 100644 index 0000000..a9335d9 --- /dev/null +++ b/examples/16-swap-and-split/scripts/try-function.ts @@ -0,0 +1,33 @@ +import { Chains, randomEvmAddress } from '@mimicprotocol/sdk' +import { runFunction } from '@mimicprotocol/test-ts' + +// TODO: Replace with your function's directory +const FUNCTION_DIR = './build' +const ORACLE_URL = 'https://api-protocol.mimic.fi/oracle' + +const chainId = Chains.Optimism + +const context = { + user: randomEvmAddress(), + settlers: [{ address: randomEvmAddress(), chainId }], + timestamp: Date.now(), +} + +// TODO: Customize inputs to match your function's input structure +const inputs = { + chainId, + token: '0x0b2c639c533813f4aa9d7837caf62653d097ff85', // USDC on Optimism + amount: '1', + recipient: context.user, + maxFee: '0.1', +} + +async function main(): Promise { + const result = await runFunction(FUNCTION_DIR, context, { inputs }, ORACLE_URL) + console.log(JSON.stringify(result, null, 2)) +} + +main().catch((error) => { + console.error('Error running function:', error) + process.exit(1) +}) diff --git a/examples/16-swap-and-split/scripts/tsconfig.json b/examples/16-swap-and-split/scripts/tsconfig.json new file mode 100644 index 0000000..72eceb3 --- /dev/null +++ b/examples/16-swap-and-split/scripts/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2020", + "lib": ["ES2020"], + "module": "ESNext", + "moduleResolution": "bundler", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "rootDir": "." + }, + "include": ["./**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/examples/16-swap-and-split/src/function.ts b/examples/16-swap-and-split/src/function.ts new file mode 100644 index 0000000..3110232 --- /dev/null +++ b/examples/16-swap-and-split/src/function.ts @@ -0,0 +1,42 @@ +import { + Address, + Allocation, + buildSwapAndSplit, + DenominationToken, + ERC20Token, + TokenAmount, +} from '@mimicprotocol/lib-ts' + +import { inputs } from './types' + +export default function main(): void { + const chainId = inputs.chainId + + const tokenIn = ERC20Token.fromAddress(inputs.tokenIn, chainId) + const amountIn = TokenAmount.fromStringDecimal(tokenIn, inputs.amount) + + const tokenOut = ERC20Token.fromAddress(inputs.tokenOut, chainId) + const expectedOut = amountIn.toTokenAmount(tokenOut).unwrap() + const minAmountOut = expectedOut.applySlippageBps(inputs.slippageBps) + + const allocations: Allocation[] = inputs.allocations.split(',').map((s) => { + const fields = s.split(':') + const recipient = fields[0] + const pct = fields[1] + return new Allocation(Address.fromString(recipient), u16(parseInt(pct))) + }) + + const maxFee = TokenAmount.fromStringDecimal(DenominationToken.USD(), inputs.maxFeeUsd) + + // Creates a swap operation and multiple dynamic call operations to split the output token among multiple recipients. + // Each recipient receives the percentage of the output token specified in the allocations array. + // The last recipient receives its specified percentage plus any remaining balance caused by rounding. + const builder = buildSwapAndSplit( + chainId, + amountIn, + minAmountOut, + allocations, + inputs.user // Optional. If not provided, the context user will be used. + ) + builder.addMaxFee(maxFee).build().send() +} diff --git a/examples/16-swap-and-split/tests/function.spec.ts b/examples/16-swap-and-split/tests/function.spec.ts new file mode 100644 index 0000000..e885a72 --- /dev/null +++ b/examples/16-swap-and-split/tests/function.spec.ts @@ -0,0 +1,84 @@ +import { Chains, fp, OpType, randomEvmAddress } from '@mimicprotocol/sdk' +import { EvmCallQueryMock, runFunction, SwapOperation, TokenPriceQueryMock } from '@mimicprotocol/test-ts' +import { expect } from 'chai' + +describe('Function', () => { + const functionDir = './build' + + const chainId = Chains.Optimism + + const context = { + user: randomEvmAddress(), + settlers: [{ address: randomEvmAddress(), chainId }], + timestamp: Date.now(), + } + + const allocations = [ + { recipient: randomEvmAddress(), pctBps: 7500 }, // 75% + { recipient: randomEvmAddress(), pctBps: 2500 }, // 25% + ] + + const inputs = { + chainId, + tokenIn: randomEvmAddress(), + tokenOut: randomEvmAddress(), + amount: '1.5', // 1.5 tokenIn + slippageBps: 100, // 1% + user: context.user, + allocations: `${allocations[0].recipient}:${allocations[0].pctBps},${allocations[1].recipient}:${allocations[1].pctBps}`, + maxFeeUsd: '0.1', // 0.1 USD + } + + const calls: EvmCallQueryMock[] = [ + { + request: { to: inputs.tokenIn, chainId, fnSelector: '0x313ce567' }, // decimals + response: { value: '6', abiType: 'uint8' }, + }, + { + request: { to: inputs.tokenOut, chainId, fnSelector: '0x313ce567' }, // decimals + response: { value: '18', abiType: 'uint8' }, + }, + ] + + const prices: TokenPriceQueryMock[] = [ + { + request: { token: { address: inputs.tokenIn, chainId: inputs.chainId } }, + response: ['1000000000000000000'], // 1 tokenIn = 1 USD + }, + { + request: { token: { address: inputs.tokenOut, chainId: inputs.chainId } }, + response: ['250000000000000000'], // 1 tokenOut = 0.25 USD + }, + ] + + it('produces the expected swap operation', async () => { + const result = await runFunction(functionDir, context, { inputs, calls, prices }) + expect(result.success).to.be.true + expect(result.timestamp).to.be.equal(context.timestamp) + + expect(result.intents).to.have.lengthOf(1) + const intent = result.intents[0] + + expect(intent.feePayer).to.be.equal(context.user) + expect(intent.settler).to.be.equal(context.settlers[0].address) + expect(intent.maxFees).to.have.lengthOf(1) + expect(intent.maxFees[0].token).to.be.equal('0x0000000000000000000000000000000000000348') + expect(intent.maxFees[0].amount).to.be.equal(fp(inputs.maxFeeUsd).toString()) + + expect(intent.operations.length).to.be.greaterThan(1) + const swap = intent.operations[0] as SwapOperation + + expect(swap.opType).to.be.equal(OpType.Swap) + expect(swap.user).to.be.equal(inputs.user) + expect(swap.sourceChain).to.be.equal(inputs.chainId) + expect(swap.destinationChain).to.be.equal(inputs.chainId) + + expect(swap.tokensIn).to.have.lengthOf(1) + expect(swap.tokensIn[0].token).to.be.equal(inputs.tokenIn) + expect(swap.tokensIn[0].amount).to.be.equal(fp(inputs.amount, 6).toString()) + + expect(swap.tokensOut).to.have.lengthOf(1) + expect(swap.tokensOut[0].token).to.be.equal(inputs.tokenOut) + expect(swap.tokensOut[0].minAmount).to.be.equal(fp('5.94').toString()) + }) +}) diff --git a/examples/16-swap-and-split/tests/tsconfig.json b/examples/16-swap-and-split/tests/tsconfig.json new file mode 100644 index 0000000..821e603 --- /dev/null +++ b/examples/16-swap-and-split/tests/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "node", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "declaration": true, + "composite": true, + "outDir": "./dist", + "rootDir": "./", + "resolveJsonModule": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "lib": ["ES2020", "DOM"], + "types": ["mocha", "chai", "node"] + }, + "include": ["./**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/examples/16-swap-and-split/tsconfig.json b/examples/16-swap-and-split/tsconfig.json new file mode 100644 index 0000000..dd7ad20 --- /dev/null +++ b/examples/16-swap-and-split/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "assemblyscript/std/assembly.json", + "include": ["./src/**/*.ts"], + "exclude": ["tests/**/*"], + "references": [{ "path": "./tests" }] +} diff --git a/yarn.lock b/yarn.lock index eb7932b..359fbb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -447,6 +447,24 @@ simple-git "^3.30.0" zod "^3.24.1" +"@mimicprotocol/cli@~1.0.0": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@mimicprotocol/cli/-/cli-1.0.4.tgz#227e7f8ad9bb745f7a9a4e165579a0a47fc878e2" + integrity sha512-vl24gowjzWbjRD4Hnv4ZeHJzL1OLr7EqBuNevlnAbnvjwfQI4I/AV+iu8Ip2q7ti4nudUVk11bSyquYb0JNcbw== + dependencies: + "@inquirer/prompts" "^7.2.4" + "@mimicprotocol/sdk" "^0.1.7" + "@oclif/core" "^4.2.2" + "@oclif/plugin-not-found" "^3.2.38" + axios "^1.7.9" + cross-spawn "^7.0.6" + ethers "^6.13.5" + form-data "^4.0.1" + js-yaml "^4.1.0" + lodash "^4.17.21" + simple-git "^3.30.0" + zod "^3.24.1" + "@mimicprotocol/lib-ts@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/lib-ts/-/lib-ts-0.1.0.tgz#520a5677f7ae563b574dc5cc1f39360cd8d558c6" @@ -457,41 +475,86 @@ json-as "1.1.7" visitor-as "0.11.4" +"@mimicprotocol/lib-ts@~0.1.0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@mimicprotocol/lib-ts/-/lib-ts-0.1.4.tgz#bfad2213b5caaeeb3541d789ab896a405c663794" + integrity sha512-aZzcI4yAPXBPcuMD6Iy8XDK/4O4OeQvOQ5u31uYy1Y2kOxZ2Up3Uet/opcn4zHCHCZDUR/G/sj3i5NLrT0bfPA== + dependencies: + as-base58 "^0.1.1" + eslint-config-mimic "^0.0.4" + json-as "1.1.7" + visitor-as "0.11.4" + "@mimicprotocol/runner-node-darwin-arm64@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-darwin-arm64/-/runner-node-darwin-arm64-0.1.0.tgz#45548fa3fc51ec159734f2b420cfbdaf9d66a9a3" integrity sha512-J3ykKFmW6wMI63h3M4Njrt+XjCvX7oXgrzoVHbDsj/Jx9Pjg5akZFL6fEZ9ljjY6jrmlvCE8DwM2b6eVyG3kEQ== +"@mimicprotocol/runner-node-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-darwin-arm64/-/runner-node-darwin-arm64-0.1.1.tgz#9377fd020402f7461f7ceb7b10e3bc8810a291dd" + integrity sha512-DwInlHFvTi7M6FJsntV0TglJ0UovSw9f57+Mi59e/H9xrfzK/s2GEC/bAZTZJd4VkCzgTSK/H8vebc0oQUIBcw== + "@mimicprotocol/runner-node-darwin-x64@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-darwin-x64/-/runner-node-darwin-x64-0.1.0.tgz#60721cc66ad78f643b03e245d0e7c0eb68c72eeb" integrity sha512-07739siHMJndIsPBHY8nK0Uv00q62j1eybZ34QBEynoh8HniTCapEbTtU8H9ac9QBu2bdx2VfssLNQxE9mbCBQ== +"@mimicprotocol/runner-node-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-darwin-x64/-/runner-node-darwin-x64-0.1.1.tgz#48e5c4d3c11138ee8305d8c1b9172463374a6ed8" + integrity sha512-mGnq35OIjlcQluPWCWqnwDUB8mF1/KeL8rt/bQhRPnn6tO7CmkNFvS4XSIq08hbfzql6otYMWoh7jZSDXSWgXQ== + "@mimicprotocol/runner-node-linux-arm64-gnu@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-linux-arm64-gnu/-/runner-node-linux-arm64-gnu-0.1.0.tgz#7ae21a7b46009483608e6328fb5814980eaf1c60" integrity sha512-RUtegSQLZqvYVUtvHcXgGcqitPJMIAEpvPlB41WV6+z7HAU04i6OciIGzOpct1DWvaEKj5lRAGD2M0af17kIVA== +"@mimicprotocol/runner-node-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-linux-arm64-gnu/-/runner-node-linux-arm64-gnu-0.1.1.tgz#ffaf6027629035cb83e9454c143ab1c2868e820d" + integrity sha512-spYnR7wP5wZcX/rRyHUi7k1Gy7fZ3T6qn9I2EDm/u90ZtXW/HO1PobVGdhAo5NKQDYOCOPAQMoAs6X8C07UENA== + "@mimicprotocol/runner-node-linux-x64-gnu@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-linux-x64-gnu/-/runner-node-linux-x64-gnu-0.1.0.tgz#d0e0bd7b3d99071564f74f9a1cd9429fa7cb4c4e" integrity sha512-HfuVdaWJW1t2GWNLYhAIGh+bBskUz21MivJlq4tmYyAHbic+4e0BxCrvpsuAQoks9aJR3y7Snftrc7eSjIompw== +"@mimicprotocol/runner-node-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-linux-x64-gnu/-/runner-node-linux-x64-gnu-0.1.1.tgz#d854f05f3e95544b3f51a4f52dd251957020ad7e" + integrity sha512-Xzu9eVGTnSGvbfh8lssfNaTuFDlAnClA4y94IRZRCfTMsR2CYTcOJXp4t4/LOnS8nOPuzZM47FUtu4oDxGJvhw== + "@mimicprotocol/runner-node-linux-x64-musl@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-linux-x64-musl/-/runner-node-linux-x64-musl-0.1.0.tgz#d7de018fee7ac76094d6aee7ae6a28619eaf0dfe" integrity sha512-QUOqXbtTaruJu+MffmtqwK4+pKhG11uAZQpoV3IoNWOSCugu2PL8glDgn24NN0mN4fzzFy66xB/5zJJlhMEWtQ== +"@mimicprotocol/runner-node-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-linux-x64-musl/-/runner-node-linux-x64-musl-0.1.1.tgz#af877e33b45dab19ee4ce2768a744f02bb802c7f" + integrity sha512-NTU6m9Wi9o6P0B1tXXaIuayHXiC5f5fw1gFPoSX9DxGGyIPSE4dr5ovtzhhl4qKI2WobjqPW4C9D9roYmOzGjQ== + "@mimicprotocol/runner-node-win32-arm64-msvc@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-win32-arm64-msvc/-/runner-node-win32-arm64-msvc-0.1.0.tgz#991b4b930d857e7311c4b67d77210726ebde89f4" integrity sha512-BgzVfTPhuzeNLD3sUt1c3VTcgmWP3JLOsv+n/Op6SgZIfGsa84uw3peIPh4OZSBmqOpWTjvXLHxjI9D2scxnhg== +"@mimicprotocol/runner-node-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-win32-arm64-msvc/-/runner-node-win32-arm64-msvc-0.1.1.tgz#5fbac9d58719a5a9ca7a183ecadcd39d7a624eb1" + integrity sha512-O7mnWTcmNcPtnRI48Aq//yy04QohgbFmE/dsw68IiGMdM9SmR6Vy1UwMZRojvCbwO3ZWH0ByGA1qIO9UH+wg3Q== + "@mimicprotocol/runner-node-win32-x64-msvc@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-win32-x64-msvc/-/runner-node-win32-x64-msvc-0.1.0.tgz#640034312e7248ff178b33c01474ed0b44ed2585" integrity sha512-kCefqdkMWj3s2gT3DROFhKPwO4viA/ilIL11baAlQiZaab1SnvKyE+sm7mf9knj5NKSSAuah7XyeRoI9tlgZpA== +"@mimicprotocol/runner-node-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node-win32-x64-msvc/-/runner-node-win32-x64-msvc-0.1.1.tgz#6e19c17dd45232552b01501978e6bbcdc039b9e2" + integrity sha512-ESNR8IDkXl0kLuGyRxe4+PV6tbIA5pDa//+FNyinUhJP6zb9Lf9K+1HXDe97PvFq2H4PwIM/UXeIHUPpXKypGw== + "@mimicprotocol/runner-node@~0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node/-/runner-node-0.1.0.tgz#33fa8e8088e80083ad4506bfbc5b86838e9e9082" @@ -505,6 +568,19 @@ "@mimicprotocol/runner-node-win32-arm64-msvc" "0.1.0" "@mimicprotocol/runner-node-win32-x64-msvc" "0.1.0" +"@mimicprotocol/runner-node@~0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mimicprotocol/runner-node/-/runner-node-0.1.1.tgz#447e67634929a22dcddf053df69957009542923c" + integrity sha512-r9L/FF8q0T9qnmQ+2vkw4nauD1dT4sLtA77Hupjg1U0nEM8mM0KyIi0q8l+tzgvX7n4aNvbqxIfXIfCO2DmS6A== + optionalDependencies: + "@mimicprotocol/runner-node-darwin-arm64" "0.1.1" + "@mimicprotocol/runner-node-darwin-x64" "0.1.1" + "@mimicprotocol/runner-node-linux-arm64-gnu" "0.1.1" + "@mimicprotocol/runner-node-linux-x64-gnu" "0.1.1" + "@mimicprotocol/runner-node-linux-x64-musl" "0.1.1" + "@mimicprotocol/runner-node-win32-arm64-msvc" "0.1.1" + "@mimicprotocol/runner-node-win32-x64-msvc" "0.1.1" + "@mimicprotocol/sdk@0.1.0", "@mimicprotocol/sdk@~0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/sdk/-/sdk-0.1.0.tgz#a0bb3661cd0129bac253cba6c79dea7b6026b44e" @@ -517,6 +593,18 @@ ethers "^6.13.5" zod "^3.23.8" +"@mimicprotocol/sdk@^0.1.7", "@mimicprotocol/sdk@~0.1.3", "@mimicprotocol/sdk@~0.1.5": + version "0.1.7" + resolved "https://registry.yarnpkg.com/@mimicprotocol/sdk/-/sdk-0.1.7.tgz#a40be86f2cbbfb20eb98c2af580660f40459e9d0" + integrity sha512-gza2noCNPC8RLlMNwWdxRktd4l2h5ZttqPjvAuKaIHmkagZZqfCaBu1XrjlYkqSevpZEYnBSfc6Fj8KqcJn5zQ== + dependencies: + "@coral-xyz/anchor" "0.32.1" + "@solana/web3.js" "^1.98.4" + borsh "^2.0.0" + cron-parser "^5.3.1" + ethers "^6.13.5" + zod "^3.23.8" + "@mimicprotocol/test-ts@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mimicprotocol/test-ts/-/test-ts-0.1.0.tgz#aa4f0ea727f56e0e099bb22e34ef63e0d926088e" @@ -527,6 +615,16 @@ ethers "^6.15.0" zod "^3.24.1" +"@mimicprotocol/test-ts@~0.1.0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@mimicprotocol/test-ts/-/test-ts-0.1.4.tgz#98064c2090fb7fb19949364573752b5f0075cac9" + integrity sha512-tvDSuAWBux3lS/hnSRQ1BeeAlfRx3LMNi9qDvCaCLD1GhKpzo0cN5yIICHRHcuxwzl9dEdvr4R9ZfkDgxqSDfw== + dependencies: + "@mimicprotocol/runner-node" "~0.1.1" + "@mimicprotocol/sdk" "~0.1.5" + ethers "^6.15.0" + zod "^3.24.1" + "@noble/curves@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" @@ -1522,7 +1620,7 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -dotenv@^17.0.0: +dotenv@^17.0.0, dotenv@^17.2.3: version "17.4.2" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-17.4.2.tgz#c07e54a746e11eba021dd9e1047ced5afdc1c034" integrity sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==