{"_id":"@defi-wonderland/interop","_rev":"3-409d21c084c962a7f45c84589a98ee34","name":"@defi-wonderland/interop","dist-tags":{"canary":"0.0.1","latest":"0.1.0","snapshot":"0.0.2"},"versions":{"0.0.1":{"name":"@defi-wonderland/interop","version":"0.0.1","author":{"name":"Wonderland"},"license":"MIT","_id":"@defi-wonderland/interop@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":"7d8a716167641361750da3f431914fc4229130be","tarball":"https://registry.npmjs.org/@defi-wonderland/interop/-/interop-0.0.1.tgz","fileCount":6,"integrity":"sha512-SX1hHB02Sh+11UW4w6TeVDj9fEqx8LAF4qqg8OdSprm9EC8Gb+soeiQTOxmJw/gIYG6Khk2OOvOJaqgxWCTkhA==","signatures":[{"sig":"MEUCIQDUu+u/06hEBmT6YwCVaYnYoLUmsw6apm9SqNK8yyL9OwIgOBkY44uy4jWpV1cPUCXGvfTsT+nYO35R0H4Z+sdkG68=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6821},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","gitHead":"124c0ef758aedc61e4c29d2b539b8e4a6e01bead","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":"apps/sdk"},"_npmVersion":"10.8.2","description":"A TypeScript library for handling interoperable blockchain addresses and cross-chain operations across different networks.","directories":{"src":"src"},"_nodeVersion":"20.19.4","dependencies":{"@defi-wonderland/interop-addresses":"0.0.1","@defi-wonderland/interop-cross-chain":"0.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/interop_0.0.1_1753990143183_0.6072778551270039","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@defi-wonderland/interop","version":"0.0.2","author":{"name":"Wonderland"},"license":"MIT","_id":"@defi-wonderland/interop@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":"b99ee11d67b81b0f686642359304adc2cf5b4969","tarball":"https://registry.npmjs.org/@defi-wonderland/interop/-/interop-0.0.2.tgz","fileCount":6,"integrity":"sha512-B0cDU92UuG+tr0lD5l6Uflt8BVd5wSAuh+4J72EoisKB7F0pBFsjW81FJDWZvIEmAhK736itT9iNI3khBRdpdg==","signatures":[{"sig":"MEQCICob/wcUao8I6uQ++dD/j+AsuVMorseH3d+d9gh8nzz0AiB87QdcQF0eGu5V8H5H5JC8ZqbrMz+9HifhhB4e6BiYlA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@defi-wonderland%2finterop@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6915},"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:13b3bd1e-25f8-494a-839a-e543f1244c54"}},"repository":{"url":"git+https://github.com/defi-wonderland/interop-sdk.git","type":"git","directory":"apps/sdk"},"_npmVersion":"11.5.2","description":"Complete SDK for blockchain interoperability with cross-chain operations and address utilities","directories":{"src":"src"},"_nodeVersion":"20.19.5","dependencies":{"@defi-wonderland/interop-addresses":"0.0.1","@defi-wonderland/interop-cross-chain":"0.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/interop_0.0.2_1762791787727_0.005080120311712788","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@defi-wonderland/interop","version":"0.1.0","description":"Complete SDK for blockchain interoperability with cross-chain operations and address utilities","repository":{"type":"git","url":"git+https://github.com/defi-wonderland/interop-sdk.git","directory":"apps/sdk"},"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":{"@defi-wonderland/interop-addresses":"0.1.0","@defi-wonderland/interop-cross-chain":"0.1.0"},"_id":"@defi-wonderland/interop@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-WflN0xqCRAz5kJexEg0LvzesrlGgHWjQOyBM5sDdzhxUfFeQvqPcFVe4D3goE5D+9WEDcJiMIEPOIn5jjVOZGg==","shasum":"edc8704e4332bffcdd0788b3f706019341774e6d","tarball":"https://registry.npmjs.org/@defi-wonderland/interop/-/interop-0.1.0.tgz","fileCount":6,"unpackedSize":6915,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@defi-wonderland%2finterop@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD0PCxZmyrADwoSKOS0x1IcXM7pHxNgPnKu5m0LyGiO/wIhAOYFw83hgGNJ2xLzUNhidZuIfGQQ702lCKn1ufEIyRWG"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:13b3bd1e-25f8-494a-839a-e543f1244c54"}},"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_0.1.0_1763135430052_0.013548286051692005"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-31T19:29:03.126Z","modified":"2025-11-14T15:50:30.744Z","0.0.1":"2025-07-31T19:29:03.364Z","0.0.2":"2025-11-10T16:23:07.921Z","0.1.0":"2025-11-14T15:50:30.252Z"},"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":"apps/sdk"},"description":"Complete SDK for blockchain interoperability with cross-chain operations and address utilities","maintainers":[{"name":"0xgorilla","email":"gori@wonderland.xyz"},{"name":"wonderland-bot","email":"alice@wonderland.xyz"},{"name":"turtlemoji","email":"turtlemoji@protonmail.com"}],"readme":"# @defi-wonderland/interop\n\nA TypeScript library for handling interoperable blockchain addresses and cross-chain operations across different networks.\n\nThis package combines two powerful functionalities:\n\n1. **Interoperable Addresses**: Provides methods to convert between human-readable addresses and their binary string representation, following the [ERC-7930](https://ethereum-magicians.org/t/erc-7930-interoperable-addresses/23365) standard. For backward compatibility with existing smart contracts, the package includes utilities to extract individual components (chainId and address) from the binary representation.\n\n2. **Cross-Chain Operations**: Enables seamless token transfers and swaps between different blockchain networks through a unified API, supporting various bridge protocols.\n\n```mermaid\ngraph LR\n    A[humanReadable]\n    C[binaryRepresentation]\n    D[chainId]\n    E[address]\n    F[Cross-Chain Operations]\n    G[Token Transfers]\n\n    A -->|humanReadableToBinary| C\n    C -->|binaryToHumanReadable| A\n    C -->|getChainId| D\n    C -->|getAddress| E\n    F -->|Transfer| G\n```\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### Interoperable Addresses\n\n```typescript\n// Using the Provider\nimport { InteropAddressProvider } from '@defi-wonderland/interop';\n\nconst humanReadableAddress = \"alice.eth@eip155:1#ABCD1234\"\nconst binaryAddress = InteropAddressProvider.humanReadableToBinary(humanReadableAddress)\n\n// Or just importing the method\nimport { humanReadableToBinary } from '@defi-wonderland/interop';\nconst binaryAddress = humanReadableToBinary(humanReadableAddress)\n```\n\n### Cross-Chain Operations\n\n```typescript\nimport { createCrossChainProvider } from \"@defi-wonderland/interop\";\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    inputTokenAddress: \"0x...\",\n    outputTokenAddress: \"0x...\",\n    inputAmount: \"1000000000000000000\",\n    inputChainId: 1,\n    outputChainId: 137,\n    sender: \"0x...\",\n    recipient: \"0x...\",\n});\n\n// Simulate the transaction\nconst transactions = await provider.simulateOpen(quote.openParams);\n```\n\n## API\n\n### Interoperable Addresses\n\n#### [InteropAddressProvider](./src/providers/InteropAddressProvider.ts)\n\nAvailable methods:\n\n-   `humanReadableToBinary(humanReadableAddress: string)`\n-   `binaryToHumanReadable(binaryAddress: Hex)`\n-   `getChainId(binaryAddress: Hex)`\n-   `getAddress(binaryAddress: Hex)`\n-   `buildFromPayload(payload: InteropAddressFields)`\n-   `computeChecksum(humanReadableAddress: string)`\n\n### Cross-Chain Operations\n\n#### [CrossChainProviderFactory](./src/services/crossChainProviderFactory.ts)\n\nThe factory provides a standardized way to create and manage cross-chain providers for different protocols.\n\nAvailable methods:\n\n-   `build<Protocol>(protocolName: Protocol, config?: Config, dependencies?: Dependencies)`: Creates a new provider instance for the specified protocol\n-   `createCrossChainProvider<Protocol>(protocolName: Protocol, config?: Config, dependencies?: Dependencies)`: Helper function to create a provider instance\n\n#### [CrossChainExecutor](./src/services/crossChainExecutor.ts)\n\nThe executor handles the execution of cross-chain operations, providing a unified interface for different protocols.\n\nAvailable methods:\n\n-   `execute(params: ExecutionParams)`: Executes a cross-chain operation\n-   `getQuotes(params: QuoteParams)`: Gets a quote for a cross-chain operation\n\nSupported protocols:\n\n-   Across Protocol\n-   More protocols coming soon...\n\n## References\n\n-   [ERC 7930: Interoperable Addresses](https://ethereum-magicians.org/t/erc-7930-interoperable-addresses/23365)\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","readmeFilename":"README.md"}