{"_id":"@defi-wonderland/interop-cross-chain","_rev":"3-e8ab7d32a98a2b56336a852abe3fc546","name":"@defi-wonderland/interop-cross-chain","dist-tags":{"canary":"0.0.1","latest":"0.1.0","snapshot":"0.0.2"},"versions":{"0.0.1":{"name":"@defi-wonderland/interop-cross-chain","version":"0.0.1","author":{"name":"Wonderland"},"license":"MIT","_id":"@defi-wonderland/interop-cross-chain@0.0.1","maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"},{"name":"turtlemoji","email":"turtlemoji@protonmail.com"}],"homepage":"https://github.com/defi-wonderland/interop-sdk#readme","bugs":{"url":"https://github.com/defi-wonderland/interop-sdk/issues"},"dist":{"shasum":"64499b2cf3c91aa1690394539cf6a053330a1d43","tarball":"https://registry.npmjs.org/@defi-wonderland/interop-cross-chain/-/interop-cross-chain-0.0.1.tgz","fileCount":170,"integrity":"sha512-wsQxOWivv+nxElYVJxNW9sk+06pP2z9f9n4yFreYqjL2cppjeFJe5qm9/PTas4iW8SrLvJVsRKAZnteGj9O8KA==","signatures":[{"sig":"MEUCIAUPvWvlTPVT172/yfm2XYhay7AygB/1b06C+ginCd9RAiEAxQCkeSD6eK+1pAQ2A4VwB0vFOv5MH3/iX/p6ii6Leuw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":149027},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","gitHead":"12329cdd897deb31603960d4dcca0824952a7a6c","scripts":{"lint":"eslint \"{src,test}/**/*.{js,ts,json}\"","test":"vitest run --config vitest.config.ts --passWithNoTests","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist/","format":"prettier --check \"{src,test}/**/*.{js,ts,json}\"","lint:fix":"pnpm lint --fix","test:cov":"vitest run --config vitest.config.ts --coverage","format:fix":"prettier --write \"{src,test}/**/*.{js,ts,json}\"","check-types":"tsc --noEmit -p ./tsconfig.json"},"_npmUser":{"name":"wonderland-bot","email":"alice@wonderland.xyz"},"repository":{"url":"git+https://github.com/defi-wonderland/interop-sdk.git","type":"git","directory":"packages/cross-chain"},"_npmVersion":"10.8.2","description":"The cross-chain package provides a standardized interface for interacting with cross-chain bridges and protocols. It enables seamless token transfers and swaps between different blockchain networks through a unified API.","directories":{"src":"src"},"_nodeVersion":"20.19.4","dependencies":{"zod":"3.24.3","viem":"2.29.2","@across-protocol/app-sdk":"0.2.2","@defi-wonderland/interop-addresses":"0.0.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/interop-cross-chain_0.0.1_1753994436276_0.2680001211319518","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@defi-wonderland/interop-cross-chain","version":"0.0.2","author":{"name":"Wonderland"},"license":"MIT","_id":"@defi-wonderland/interop-cross-chain@0.0.2","maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"},{"name":"turtlemoji","email":"turtlemoji@protonmail.com"}],"homepage":"https://github.com/defi-wonderland/interop-sdk#readme","bugs":{"url":"https://github.com/defi-wonderland/interop-sdk/issues"},"dist":{"shasum":"d54d76f72c10587eab93b5ec4373788cd0d0edd6","tarball":"https://registry.npmjs.org/@defi-wonderland/interop-cross-chain/-/interop-cross-chain-0.0.2.tgz","fileCount":234,"integrity":"sha512-FpXRlbxBec/YbG+AWzsPkzVq9RhHNDdqNrA6EXjc7jQdGZeuoQ/lZ7VUa709Qsqzg/0ATzup2RObJpmP0SkctA==","signatures":[{"sig":"MEUCIQCudvFhzjZC0d99n1vuzZYLT4lDPdXsoHIYgVli5tW+jQIgU0Qd4i0Xin5z6FeWrnuJBB+B0djjPFIuxn+dWMwx/EI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@defi-wonderland%2finterop-cross-chain@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":251371},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","gitHead":"3a9a8b2cbd2fcdca075273ae2994c04f7d4b109b","scripts":{"lint":"eslint \"{src,test}/**/*.{js,ts,json}\"","test":"vitest run --config vitest.config.ts --passWithNoTests","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist/","format":"prettier --check \"{src,test}/**/*.{js,ts,json}\"","lint:fix":"pnpm lint --fix","test:cov":"vitest run --config vitest.config.ts --coverage","format:fix":"prettier --write \"{src,test}/**/*.{js,ts,json}\"","check-types":"tsc --noEmit -p ./tsconfig.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9947bc40-0113-4b9e-a72c-6885ff4e0480"}},"repository":{"url":"git+https://github.com/defi-wonderland/interop-sdk.git","type":"git","directory":"packages/cross-chain"},"_npmVersion":"11.5.2","description":"Cross-chain interoperability library with standardized provider interface","directories":{"src":"src"},"_nodeVersion":"20.19.5","dependencies":{"zod":"3.24.3","viem":"2.29.2","@across-protocol/app-sdk":"0.2.2","@defi-wonderland/interop-addresses":"0.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/interop-cross-chain_0.0.2_1762791734713_0.020097029076118655","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@defi-wonderland/interop-cross-chain","version":"0.1.0","description":"Cross-chain interoperability library with standardized provider interface","repository":{"type":"git","url":"git+https://github.com/defi-wonderland/interop-sdk.git","directory":"packages/cross-chain"},"license":"MIT","author":{"name":"Wonderland"},"type":"module","main":"./dist/src/index.js","types":"./dist/src/index.d.ts","directories":{"src":"src"},"scripts":{"build":"tsc -p tsconfig.build.json","check-types":"tsc --noEmit -p ./tsconfig.json","clean":"rm -rf dist/","format":"prettier --check \"{src,test}/**/*.{js,ts,json}\"","format:fix":"prettier --write \"{src,test}/**/*.{js,ts,json}\"","lint":"eslint \"{src,test}/**/*.{js,ts,json}\"","lint:fix":"pnpm lint --fix","test":"vitest run --config vitest.config.ts --passWithNoTests","test:cov":"vitest run --config vitest.config.ts --coverage"},"dependencies":{"@across-protocol/app-sdk":"0.2.2","@defi-wonderland/interop-addresses":"0.1.0","viem":"2.29.2","zod":"3.24.3"},"devDependencies":{"typescript":"5.5.4"},"_id":"@defi-wonderland/interop-cross-chain@0.1.0","gitHead":"5e6d70742d3b7363e6707217d4e5115283b028fe","bugs":{"url":"https://github.com/defi-wonderland/interop-sdk/issues"},"homepage":"https://github.com/defi-wonderland/interop-sdk#readme","_nodeVersion":"20.19.5","_npmVersion":"11.5.2","dist":{"integrity":"sha512-kWB2R5dGbTe+g6tI+VV1j/g6ORYxgfdF4wVWlRcpytiKdObNd2qpQS3BXzjlZ72Fp1h3oSMgiTl4GuRUjTP0RA==","shasum":"c541c0cc1201cc443e9ee34bc35cc8e91e2ecd89","tarball":"https://registry.npmjs.org/@defi-wonderland/interop-cross-chain/-/interop-cross-chain-0.1.0.tgz","fileCount":234,"unpackedSize":251371,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@defi-wonderland%2finterop-cross-chain@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEtO0gD4nS6w5V0SztjRX543N3NP0t4U+V8j5MTpYXt4AiBl9Bfl+fXBhcPqH0tuJASgjyjw9If++JT9qIrpOvtdBw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9947bc40-0113-4b9e-a72c-6885ff4e0480"}},"maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"},{"name":"turtlemoji","email":"turtlemoji@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/interop-cross-chain_0.1.0_1763135367593_0.3909089215871173"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-31T20:40:36.148Z","modified":"2025-11-14T15:49:28.333Z","0.0.1":"2025-07-31T20:40:36.536Z","0.0.2":"2025-11-10T16:22:14.914Z","0.1.0":"2025-11-14T15:49:27.805Z"},"bugs":{"url":"https://github.com/defi-wonderland/interop-sdk/issues"},"author":{"name":"Wonderland"},"license":"MIT","homepage":"https://github.com/defi-wonderland/interop-sdk#readme","repository":{"type":"git","url":"git+https://github.com/defi-wonderland/interop-sdk.git","directory":"packages/cross-chain"},"description":"Cross-chain interoperability library with standardized provider interface","maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"},{"name":"turtlemoji","email":"turtlemoji@protonmail.com"}],"readme":"# interop-sdk: cross-chain package\n\nThe cross-chain package provides a standardized interface for interacting with cross-chain bridges and protocols. It enables seamless token transfers and swaps between different blockchain networks through a unified API.\n\nKey features:\n\n-   Cross-chain token transfers between supported networks\n-   Cross-chain token swaps with customizable slippage\n-   Quote fetching for cross-chain operations\n-   Standardized provider interface for integrating different bridge protocols\n-   Type-safe interactions with comprehensive TypeScript support\n\n## Setup\n\n1. Install dependencies running `pnpm install`\n\n## Available Scripts\n\nAvailable scripts that can be run using `pnpm`:\n\n| Script        | Description                                             |\n| ------------- | ------------------------------------------------------- |\n| `build`       | Build library using tsc                                 |\n| `check-types` | Check types issues using tsc                            |\n| `clean`       | Remove `dist` folder                                    |\n| `lint`        | Run ESLint to check for coding standards                |\n| `lint:fix`    | Run linter and automatically fix code formatting issues |\n| `format`      | Check code formatting and style using Prettier          |\n| `format:fix`  | Run formatter and automatically fix issues              |\n| `test`        | Run tests using vitest                                  |\n| `test:cov`    | Run tests with coverage report                          |\n\n## Usage\n\n```typescript\nimport {\n    AcrossProvider,\n    createCrossChainProvider,\n    createProviderExecutor,\n    InteropAddressParamsParser,\n    ProviderExecutor,\n} from \"@interop-sdk/cross-chain\";\n\n// Create a provider for a specific protocol (e.g., Across)\nconst provider = createCrossChainProvider(\"across\");\n\n// Get a quote for a cross-chain transfer\nconst quote = await provider.getQuote(\"crossChainTransfer\", {\n    sender: \"0x...\", // sender address (hex)\n    recipient: \"0x...\", // recipient address (hex)\n    inputTokenAddress: \"0x...\", // input token address\n    outputTokenAddress: \"0x...\", // output token address\n    inputAmount: \"1000000000000000000\", // amount in wei\n    inputChainId: 11155111, // source chain ID\n    outputChainId: 84532, // destination chain ID\n});\n\n// Simulate the open transaction for the quote\nconst txs = await provider.simulateOpen(quote.openParams);\n\n// Batch quotes and execution using ProviderExecutor\nconst providers = [provider];\nconst executor = createProviderExecutor(providers);\nconst quotes = await executor.getQuotes(\"crossChainTransfer\", {\n    sender: \"0x...\",\n    recipient: \"0x...\",\n    inputTokenAddress: \"0x...\",\n    outputTokenAddress: \"0x...\",\n    inputAmount: \"1000000000000000000\",\n    inputChainId: 11155111,\n    outputChainId: 84532,\n});\n\n// Execute a quote (simulate open)\nconst txRequests = await executor.execute(quotes[0]);\n\n// Using InteropAddressParamsParser for human-readable or binary addresses\nconst paramParser = new InteropAddressParamsParser();\nconst executorWithParser = createProviderExecutor(providers, { paramParser });\nconst quotesWithInterop = await executorWithParser.getQuotes(\"crossChainTransfer\", {\n    sender: \"alice.eth@eip155:1#ABCD1234\", // human-readable interop address\n    recipient: \"0x...\", // hex address\n    amount: \"1000000000000000000\",\n    inputTokenAddress: \"0x...\",\n    outputTokenAddress: \"0x...\",\n});\n```\n\n## API\n\n### Providers\n\n-   `createCrossChainProvider(protocolName, config?, dependencies?)` – Create a provider for a supported protocol (e.g., \"across\").\n-   `CrossChainProvider` (abstract class)\n    -   `.getProtocolName()` – Returns the protocol name.\n    -   `.getQuote(action, params)` – Fetch a quote for a cross-chain action (\"crossChainTransfer\" or \"crossChainSwap\").\n    -   `.simulateOpen(openParams)` – Simulate the open transaction for a quote.\n    -   `.validateOpenParams(openParams)` – Validate open parameters.\n\n### Provider Executor\n\n-   `createProviderExecutor(providers, dependencies?)` – Create an executor for batch quoting and execution.\n-   `ProviderExecutor`\n    -   `.getQuotes(action, params)` – Get quotes from all providers.\n    -   `.execute(quote)` – Simulate the open transaction for a quote.\n\n### Param Parsers\n\n-   `InteropAddressParamsParser` – Parses human-readable or binary interop addresses for use in cross-chain actions.\n-   `ParamsParser` (interface) – Custom param parsers can be implemented for advanced use cases.\n\n### Types\n\n-   `GetQuoteParams<Action>` – Parameters for quoting (see `crossChainProvider.interface.ts`).\n-   `GetQuoteResponse<Action, OpenParams>` – Quote response structure.\n-   `BasicOpenParams`, `Fee`, and more (see exported types).\n\n### Supported Actions\n\n-   `crossChainTransfer` – Transfer tokens between chains.\n-   `crossChainSwap` – Swap tokens across chains (if supported by the protocol).\n\n## References\n\n-   [Viem Documentation](https://viem.sh/) - Low-level Ethereum interface used for transaction handling\n-   [Zod Documentation](https://zod.dev/) - TypeScript-first schema validation used for input validation\n-   [Cross-Chain Interoperability Standards](https://ethereum.org/en/developers/docs/bridges/) - Overview of cross-chain bridge concepts\n\nThe current SDK uses Across on testnet for demo purposes only. Performance may not reflect mainnet behavior and is not representative of the final production experience\n","readmeFilename":"README.md"}