From 16d8041a5b4cb640f0dc9374382f45deb50f9cc1 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 31 Jul 2026 14:30:51 -0400 Subject: [PATCH 01/48] feat(sdk-outpost): establish package and validated deployment model --- CLAUDE.md | 11 +- README.md | 2 + etc/tsconfig/tsconfig.base.json | 6 + jest.config.ts | 1 + packages/sdk-outpost/README.md | 28 + packages/sdk-outpost/jest.config.ts | 25 + packages/sdk-outpost/package.json | 55 + .../sdk-outpost/src/deployments/Schema.ts | 92 ++ packages/sdk-outpost/src/deployments/Types.ts | 23 + packages/sdk-outpost/src/deployments/index.ts | 2 + packages/sdk-outpost/src/index.ts | 1 + .../tests/deployments/Schema.test.ts | 87 ++ packages/sdk-outpost/tsconfig.cjs.jest.json | 25 + packages/sdk-outpost/tsconfig.cjs.json | 16 + packages/sdk-outpost/tsconfig.esm.json | 13 + packages/sdk-outpost/tsconfig.json | 10 + pnpm-lock.yaml | 964 +++++++++++++++++- tsconfig.json | 5 +- 18 files changed, 1349 insertions(+), 17 deletions(-) create mode 100644 packages/sdk-outpost/README.md create mode 100644 packages/sdk-outpost/jest.config.ts create mode 100644 packages/sdk-outpost/package.json create mode 100644 packages/sdk-outpost/src/deployments/Schema.ts create mode 100644 packages/sdk-outpost/src/deployments/Types.ts create mode 100644 packages/sdk-outpost/src/deployments/index.ts create mode 100644 packages/sdk-outpost/src/index.ts create mode 100644 packages/sdk-outpost/tests/deployments/Schema.test.ts create mode 100644 packages/sdk-outpost/tsconfig.cjs.jest.json create mode 100644 packages/sdk-outpost/tsconfig.cjs.json create mode 100644 packages/sdk-outpost/tsconfig.esm.json create mode 100644 packages/sdk-outpost/tsconfig.json diff --git a/CLAUDE.md b/CLAUDE.md index a6eac91..d6e0060 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,6 +36,7 @@ pnpm workspaces with TypeScript composite project references. No Lerna/Nx. | `@wireio/shared-web` | Web-specific utilities | No | ESM | | `@wireio/shared-node` | Node.js utilities | Yes | Hybrid ESM+CJS | | `@wireio/sdk-core` | Wire blockchain SDK types/primitives | Yes | Hybrid ESM+CJS | +| `@wireio/sdk-outpost` | Typed, versioned external-chain outpost artifacts and clients | Yes | Hybrid ESM+CJS | | `@wireio/wallet-ext-sdk` | Wallet extension client SDK | Yes | ESM | | `@wireio/wallet-browser-ext` | Chrome extension developer wallet | No | Webpack bundle | @@ -45,7 +46,8 @@ pnpm workspaces with TypeScript composite project references. No Lerna/Nx. shared ──→ shared-web ──→ shared-node -sdk-core ──→ wallet-ext-sdk ──→ wallet-browser-ext +sdk-core ──→ sdk-outpost + ──→ wallet-ext-sdk ──→ wallet-browser-ext ``` Protoc plugins and bundler are standalone (no internal deps). @@ -68,7 +70,7 @@ Root `tsconfig.json` has project references to all packages. Build order is reso ## Hybrid ESM/CJS Build Pattern -Packages that publish both ESM and CJS (`shared`, `sdk-core`, `shared-node`) use: +Packages that publish both ESM and CJS (`shared`, `sdk-core`, `sdk-outpost`, `shared-node`) use: 1. Two tsconfig files: one for `lib/esm/`, one for `lib/cjs/` 2. Post-build: `scripts/fix-hybrid-output.mjs` patches relative imports with `.js` extensions and creates `lib/cjs/package.json` with `{"type":"commonjs"}` @@ -191,6 +193,8 @@ Every new/modified symbol ships unit tests in the same change. Tests never assum ## CI/CD +- Use product- or change-focused branch names, commit messages, pull-request titles, and pull-request descriptions. Do not add automated-authoring labels or attribution to repository history or review metadata. + GitHub Actions (`.github/workflows/publish-npm.yaml`): - Triggers on push to `master` (skips if `[skip release]` in commit message) - Bumps all packages patch version (`pnpm -r exec -- pnpm version patch`) @@ -216,6 +220,9 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. +- `packages/sdk-outpost` owns external-chain ABI/IDL assets, their deployment provenance, and strictly typed Ethereum/Solana clients. It extends `sdk-core`; it must not duplicate Wire-chain contract types or import generated OPP model packages. +- `sdk-outpost` deployment documents are untrusted JSON boundaries validated with Zod. ABI/IDL-derived contract and program types remain generator-owned and must never be re-declared as Zod schemas. +- Add a deployment bundle only with its source revisions, archive/artifact digests, and verified on-chain identities. A checked-in artifact does not by itself prove a contract or program is deployed. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/README.md b/README.md index dedfcf2..30e31ae 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi | [`@wireio/shared-web`](packages/shared-web/) | Web-specific utilities | *private* | | [`@wireio/shared-node`](packages/shared-node/) | Node.js-specific utilities | *private* | | [`@wireio/sdk-core`](packages/sdk-core/) | Wire blockchain SDK core types, primitives, signing helpers, generated `sysio` contract proxy, and domain workflows such as multisig and reserves | [![npm](https://img.shields.io/npm/v/@wireio/sdk-core)](https://www.npmjs.com/package/@wireio/sdk-core) | +| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed, versioned Ethereum and Solana outpost artifacts and clients | [![npm](https://img.shields.io/npm/v/@wireio/sdk-outpost)](https://www.npmjs.com/package/@wireio/sdk-outpost) | | [`@wireio/wallet-ext-sdk`](packages/wallet-ext-sdk/) | Client SDK for the Wire Wallet browser extension | [![npm](https://img.shields.io/npm/v/@wireio/wallet-ext-sdk)](https://www.npmjs.com/package/@wireio/wallet-ext-sdk) | | [`@wireio/wallet-browser-ext`](packages/wallet-browser-ext/) | Chrome extension developer wallet for Wire | *private* | @@ -56,6 +57,7 @@ wire-libraries-ts/ │ ├── shared-web/ # Web-specific utilities │ ├── shared-node/ # Node.js-specific utilities │ ├── sdk-core/ # Wire blockchain SDK core +│ ├── sdk-outpost/ # Typed external-chain outpost SDK │ ├── wallet-ext-sdk/ # Wallet extension client SDK │ ├── wallet-browser-ext/ # Chrome extension wallet │ ├── protoc-gen-solana/ # protoc plugin → Rust/Solana diff --git a/etc/tsconfig/tsconfig.base.json b/etc/tsconfig/tsconfig.base.json index 491de49..a79aea6 100755 --- a/etc/tsconfig/tsconfig.base.json +++ b/etc/tsconfig/tsconfig.base.json @@ -59,6 +59,12 @@ "@wireio/sdk-core/*": [ "./packages/sdk-core/src/*" ], + "@wireio/sdk-outpost": [ + "./packages/sdk-outpost/src" + ], + "@wireio/sdk-outpost/*": [ + "./packages/sdk-outpost/src/*" + ], "@wireio/wallet-ext-sdk": [ "./packages/wallet-ext-sdk/src" ], diff --git a/jest.config.ts b/jest.config.ts index 0679654..69d99f0 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -6,6 +6,7 @@ const config: Config = { "packages/shared-node", "packages/shared-web", "packages/sdk-core", + "packages/sdk-outpost", "packages/wallet-browser-ext", "packages/wallet-ext-sdk" ] diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md new file mode 100644 index 0000000..2400e8a --- /dev/null +++ b/packages/sdk-outpost/README.md @@ -0,0 +1,28 @@ +# `@wireio/sdk-outpost` + +Strictly typed access to the Ethereum contracts and Solana programs that form a +Wire outpost. + +The package extends `@wireio/sdk-core`: core owns Wire-chain identity, signing, +and `sysio.*` contract workflows; this package owns external-chain deployment +artifacts and their typed clients. Product orchestration remains in consuming +applications. + +## Status + +This is a preview package. Its first deployment bundle is sourced from the +sim2 artifacts generated on July 31, 2026 and records the compatible Wire +platform release and every source revision. A deployment is exposed only when +the supplied artifacts and live chain state prove it exists. + +## Development + +```bash +pnpm --dir packages/sdk-outpost run compile +pnpm --dir packages/sdk-outpost run test +pnpm --dir packages/sdk-outpost run generate:ethereum +pnpm --dir packages/sdk-outpost run generate:solana +``` + +Generated contract and program types must be regenerated from checked-in +artifacts. Do not hand-edit generated files or re-declare their shapes. diff --git a/packages/sdk-outpost/jest.config.ts b/packages/sdk-outpost/jest.config.ts new file mode 100644 index 0000000..80dce34 --- /dev/null +++ b/packages/sdk-outpost/jest.config.ts @@ -0,0 +1,25 @@ +import type { Config } from "jest" + +const config: Config = { + displayName: "@wireio/sdk-outpost", + testEnvironment: "node", + roots: ["/tests"], + testMatch: ["**/*.test.ts"], + transform: { + "^.+\\.[tj]s$": [ + "ts-jest", + { + tsconfig: "/tsconfig.cjs.jest.json" + } + ] + }, + moduleNameMapper: { + "^@wireio/sdk-core$": "/../sdk-core/src/index", + "^@wireio/sdk-core/(.*)$": "/../sdk-core/src/$1", + "^@wireio/sdk-outpost$": "/src/index", + "^@wireio/sdk-outpost/(.*)$": "/src/$1", + "^(\\.\\.?/.*)\\.js$": "$1" + } +} + +export default config diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json new file mode 100644 index 0000000..26043fe --- /dev/null +++ b/packages/sdk-outpost/package.json @@ -0,0 +1,55 @@ +{ + "name": "@wireio/sdk-outpost", + "description": "Strictly typed Ethereum and Solana clients for Wire outposts.", + "version": "0.0.0", + "private": false, + "repository": { + "type": "git", + "url": "https://github.com/Wire-Network/wire-libraries-ts", + "directory": "packages/sdk-outpost" + }, + "publishConfig": { + "access": "public" + }, + "files": [ + "lib", + "README.md" + ], + "types": "lib/esm/index.d.ts", + "main": "lib/cjs/index.js", + "module": "lib/esm/index.js", + "exports": { + ".": { + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js", + "types": "./lib/esm/index.d.ts" + }, + "./*": { + "import": "./lib/esm/*.js", + "require": "./lib/cjs/*.js", + "types": "./lib/esm/*.d.ts" + } + }, + "access": "public", + "license": "FSL-1.1-Apache-2.0", + "scripts": { + "compile": "tsc -b tsconfig.json", + "compile:watch": "tsc -b tsconfig.json -w", + "test": "jest", + "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", + "generate:ethereum": "typechain --target ethers-v5 --out-dir src/contracts/ethereum/generated 'src/assets/ethereum/**/*.json'", + "generate:solana": "node scripts/generate-solana-types.mjs" + }, + "dependencies": { + "@coral-xyz/anchor": "^0.32.1", + "@solana/web3.js": "^1.98.4", + "@wireio/sdk-core": "workspace:*", + "ethers": "^5.8.0", + "zod": "^4.4.3" + }, + "devDependencies": { + "@typechain/ethers-v5": "^11.1.2", + "typechain": "^8.3.2", + "typescript": "6.0.2" + } +} diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts new file mode 100644 index 0000000..d5a6b60 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -0,0 +1,92 @@ +import { utils as ethersUtils } from "ethers" +import { z } from "zod" + +import { ChainId } from "@wireio/sdk-core" + +import { + EthereumContractName, + OutpostDeploymentId, + SolanaProgramName +} from "./Types.js" + +const SourceRevisionSchema = z.string().regex(/^[0-9a-f]{8,40}$/), + Sha256Schema = z.string().regex(/^[0-9a-f]{64}$/), + WireChainIdSchema = z + .string() + .regex(/^[0-9a-f]{64}$/) + .transform(value => ChainId.from(value)), + EthereumAddressSchema = z + .string() + .refine(ethersUtils.isAddress, "Invalid Ethereum address") + +/** Source repository identity embedded in an artifact bundle. */ +export const ArtifactSourceSchema = z.object({ + repository: z.string().regex(/^Wire-Network\/[a-z0-9-]+$/), + revision: SourceRevisionSchema +}) + +/** Metadata proving where an SDK artifact bundle came from. */ +export const ArtifactBundleSchema = z.object({ + generatedAt: z.iso.datetime(), + sourceArchiveSha256: Sha256Schema, + platformRelease: z.object({ + tag: z.string().regex(/^v\d+\.\d+\.\d+$/), + url: z.url() + }), + sources: z.object({ + wireTools: ArtifactSourceSchema, + wireSysio: ArtifactSourceSchema, + wireEthereum: ArtifactSourceSchema, + wireSolana: ArtifactSourceSchema + }) +}) + +/** Runtime metadata for one deployed Ethereum contract. */ +export const EthereumContractDeploymentSchema = z.object({ + address: EthereumAddressSchema, + artifactSha256: Sha256Schema +}) + +/** Runtime metadata for one deployed Solana program. */ +export const SolanaProgramDeploymentSchema = z.object({ + address: z.string().min(32).max(44), + artifactSha256: Sha256Schema +}) + +/** Complete deployment schema for a Wire network group. */ +export const OutpostDeploymentSchema = z.object({ + schemaVersion: z.literal(1), + id: z.enum(OutpostDeploymentId), + artifactBundle: ArtifactBundleSchema, + wire: z.object({ + chainId: WireChainIdSchema + }), + ethereum: z.object({ + chainId: z.number().int().positive(), + contracts: z.object({ + [EthereumContractName.OPP]: EthereumContractDeploymentSchema, + [EthereumContractName.OPPInbound]: EthereumContractDeploymentSchema, + [EthereumContractName.OperatorRegistry]: EthereumContractDeploymentSchema, + [EthereumContractName.ReserveManager]: EthereumContractDeploymentSchema + }) + }), + solana: z.object({ + programs: z.object({ + [SolanaProgramName.liqsolCore]: SolanaProgramDeploymentSchema + }) + }) +}) + +/** Parsed source-repository identity. */ +export type ArtifactSource = z.infer + +/** Parsed artifact-bundle provenance. */ +export type ArtifactBundle = z.infer + +/** Parsed, runtime-safe outpost deployment. */ +export type OutpostDeployment = z.infer + +/** Validate an untrusted deployment document at its JSON boundary. */ +export function parseOutpostDeployment(value: unknown): OutpostDeployment { + return OutpostDeploymentSchema.parse(value) +} diff --git a/packages/sdk-outpost/src/deployments/Types.ts b/packages/sdk-outpost/src/deployments/Types.ts new file mode 100644 index 0000000..c77fc0f --- /dev/null +++ b/packages/sdk-outpost/src/deployments/Types.ts @@ -0,0 +1,23 @@ +/** Supported external-chain client families. */ +export enum OutpostChainFamily { + ethereum = "ethereum", + solana = "solana" +} + +/** Versioned deployment bundles shipped by the SDK. */ +export enum OutpostDeploymentId { + sim2 = "sim2" +} + +/** Ethereum contracts owned by the current outpost deployment. */ +export enum EthereumContractName { + OPP = "OPP", + OPPInbound = "OPPInbound", + OperatorRegistry = "OperatorRegistry", + ReserveManager = "ReserveManager" +} + +/** Solana programs owned by the current outpost deployment. */ +export enum SolanaProgramName { + liqsolCore = "liqsolCore" +} diff --git a/packages/sdk-outpost/src/deployments/index.ts b/packages/sdk-outpost/src/deployments/index.ts new file mode 100644 index 0000000..29919be --- /dev/null +++ b/packages/sdk-outpost/src/deployments/index.ts @@ -0,0 +1,2 @@ +export * from "./Schema.js" +export * from "./Types.js" diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts new file mode 100644 index 0000000..58d373a --- /dev/null +++ b/packages/sdk-outpost/src/index.ts @@ -0,0 +1 @@ +export * from "./deployments/index.js" diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts new file mode 100644 index 0000000..effe529 --- /dev/null +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -0,0 +1,87 @@ +import { + EthereumContractName, + OutpostDeploymentId, + parseOutpostDeployment +} from "@wireio/sdk-outpost" + +const Hash = "a".repeat(64), + Revision = "b".repeat(40), + WireChainId = "c".repeat(64), + EthereumAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + SolanaAddress = "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH" + +function createDeploymentFixture() { + const ethereumContract = { + address: EthereumAddress, + artifactSha256: Hash + } + return { + schemaVersion: 1, + id: OutpostDeploymentId.sim2, + artifactBundle: { + generatedAt: "2026-07-31T15:47:46Z", + sourceArchiveSha256: Hash, + platformRelease: { + tag: "v1.0.0", + url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0" + }, + sources: { + wireTools: { + repository: "Wire-Network/wire-tools-ts", + revision: Revision + }, + wireSysio: { + repository: "Wire-Network/wire-sysio", + revision: Revision + }, + wireEthereum: { + repository: "Wire-Network/wire-ethereum", + revision: Revision + }, + wireSolana: { + repository: "Wire-Network/wire-solana", + revision: Revision + } + } + }, + wire: { chainId: WireChainId }, + ethereum: { + chainId: 31_337, + contracts: { + OPP: ethereumContract, + OPPInbound: ethereumContract, + OperatorRegistry: ethereumContract, + ReserveManager: ethereumContract + } + }, + solana: { + programs: { + liqsolCore: { + address: SolanaAddress, + artifactSha256: Hash + } + } + } + } +} + +describe("OutpostDeploymentSchema", () => { + it("parses a valid deployment into sdk-core chain identity", () => { + const deployment = parseOutpostDeployment(createDeploymentFixture()) + + expect(deployment.id).toBe(OutpostDeploymentId.sim2) + expect(deployment.wire.chainId.hexString).toBe(WireChainId) + expect( + deployment.ethereum.contracts[EthereumContractName.ReserveManager].address + ).toBe(EthereumAddress) + }) + + it("rejects an invalid contract address", () => { + const fixture = createDeploymentFixture() + fixture.ethereum.contracts.OPP.address = "not-an-address" + + expect(() => parseOutpostDeployment(fixture)).toThrow( + "Invalid Ethereum address" + ) + }) +}) diff --git a/packages/sdk-outpost/tsconfig.cjs.jest.json b/packages/sdk-outpost/tsconfig.cjs.jest.json new file mode 100644 index 0000000..1138dc0 --- /dev/null +++ b/packages/sdk-outpost/tsconfig.cjs.jest.json @@ -0,0 +1,25 @@ +{ + "extends": "../../etc/tsconfig/tsconfig.base.jest.json", + "compilerOptions": { + "rootDir": "tests", + "outDir": "lib/test-cjs", + "module": "commonjs", + "moduleResolution": "node", + "ignoreDeprecations": "6.0", + "composite": true, + "incremental": true, + "strict": true, + "noImplicitAny": true, + "paths": { + "@wireio/sdk-core": ["../sdk-core/src"], + "@wireio/sdk-core/*": ["../sdk-core/src/*"], + "@wireio/sdk-outpost": ["./src"], + "@wireio/sdk-outpost/*": ["./src/*"] + } + }, + "references": [ + { "path": "../sdk-core/tsconfig.cjs.json" }, + { "path": "./tsconfig.cjs.json" } + ], + "include": ["tests"] +} diff --git a/packages/sdk-outpost/tsconfig.cjs.json b/packages/sdk-outpost/tsconfig.cjs.json new file mode 100644 index 0000000..9134e1b --- /dev/null +++ b/packages/sdk-outpost/tsconfig.cjs.json @@ -0,0 +1,16 @@ +{ + "extends": "../../etc/tsconfig/tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib/cjs", + "module": "commonjs", + "moduleResolution": "node", + "ignoreDeprecations": "6.0", + "strict": true, + "noImplicitAny": true + }, + "references": [ + { "path": "../sdk-core/tsconfig.cjs.json" } + ], + "include": ["src"] +} diff --git a/packages/sdk-outpost/tsconfig.esm.json b/packages/sdk-outpost/tsconfig.esm.json new file mode 100644 index 0000000..ef92c2e --- /dev/null +++ b/packages/sdk-outpost/tsconfig.esm.json @@ -0,0 +1,13 @@ +{ + "extends": "../../etc/tsconfig/tsconfig.base.esm.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib/esm", + "strict": true, + "noImplicitAny": true + }, + "references": [ + { "path": "../sdk-core/tsconfig.esm.json" } + ], + "include": ["src"] +} diff --git a/packages/sdk-outpost/tsconfig.json b/packages/sdk-outpost/tsconfig.json new file mode 100644 index 0000000..480b117 --- /dev/null +++ b/packages/sdk-outpost/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../etc/tsconfig/tsconfig.base.json", + "files": [], + "references": [ + { "path": "../sdk-core/tsconfig.json" }, + { "path": "./tsconfig.esm.json" }, + { "path": "./tsconfig.cjs.json" }, + { "path": "./tsconfig.cjs.jest.json" } + ] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d76961..7ba3413 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,10 @@ pnpmfileChecksum: sha256-aSegbCvK5TyBUeMcgQLjFgZgcFmq1CMqHT+lQb93Qks= importers: .: + dependencies: + '@wireio/opp-typescript-models': + specifier: ^1.0.26 + version: 1.0.47 devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -52,7 +56,7 @@ importers: version: 30.4.2(@types/node@25.5.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)) jest-environment-jsdom: specifier: ^30.3.0 - version: 30.4.1 + version: 30.4.1(bufferutil@4.1.0)(utf-8-validate@6.0.6) jest-junit: specifier: ^17.0.0 version: 17.0.0 @@ -98,7 +102,7 @@ importers: version: 6.0.1(webpack-dev-server@6.0.0)(webpack@5.104.1) webpack-dev-server: specifier: ^6.0.0 - version: 6.0.0(tslib@2.8.1)(webpack-cli@6.0.1)(webpack@5.104.1) + version: 6.0.0(bufferutil@4.1.0)(tslib@2.8.1)(utf-8-validate@6.0.6)(webpack-cli@6.0.1)(webpack@5.104.1) packages/sdk-core: dependencies: @@ -135,6 +139,9 @@ importers: '@noble/curves': specifier: 1.9.7 version: 1.9.7 + '@wireio/opp-typescript-models': + specifier: ^1.0.26 + version: 1.0.47 '@wireio/shared': specifier: workspace:* version: link:../shared @@ -185,6 +192,34 @@ importers: specifier: 6.0.2 version: 6.0.2 + packages/sdk-outpost: + dependencies: + '@coral-xyz/anchor': + specifier: ^0.32.1 + version: 0.32.1(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + '@solana/web3.js': + specifier: ^1.98.4 + version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + '@wireio/sdk-core': + specifier: workspace:* + version: link:../sdk-core + ethers: + specifier: ^5.8.0 + version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + zod: + specifier: ^4.4.3 + version: 4.4.3 + devDependencies: + '@typechain/ethers-v5': + specifier: ^11.1.2 + version: 11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2) + typechain: + specifier: ^8.3.2 + version: 8.3.2(typescript@6.0.2) + typescript: + specifier: 6.0.2 + version: 6.0.2 + packages/shared: dependencies: '@3fv/prelude-ts': @@ -556,6 +591,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/runtime@7.29.7': + resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==} + engines: {node: '>=6.9.0'} + '@babel/template@7.29.7': resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} engines: {node: '>=6.9.0'} @@ -571,6 +610,20 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@coral-xyz/anchor-errors@0.31.1': + resolution: {integrity: sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==} + engines: {node: '>=10'} + + '@coral-xyz/anchor@0.32.1': + resolution: {integrity: sha512-zAyxFtfeje2FbMA1wzgcdVs7Hng/MijPKpRijoySPCicnvcTQs/+dnPZ/cR+LcXM9v9UYSyW81uRNYZtN5G4yg==} + engines: {node: '>=17'} + + '@coral-xyz/borsh@0.31.1': + resolution: {integrity: sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==} + engines: {node: '>=10'} + peerDependencies: + '@solana/web3.js': ^1.69.0 + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -655,6 +708,9 @@ packages: resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} + '@ethersproject/abi@5.8.0': + resolution: {integrity: sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==} + '@ethersproject/abstract-provider@5.8.0': resolution: {integrity: sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==} @@ -679,12 +735,18 @@ packages: '@ethersproject/constants@5.8.0': resolution: {integrity: sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==} + '@ethersproject/contracts@5.8.0': + resolution: {integrity: sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==} + '@ethersproject/hash@5.8.0': resolution: {integrity: sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==} '@ethersproject/hdnode@5.8.0': resolution: {integrity: sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==} + '@ethersproject/json-wallets@5.8.0': + resolution: {integrity: sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==} + '@ethersproject/keccak256@5.8.0': resolution: {integrity: sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==} @@ -700,6 +762,12 @@ packages: '@ethersproject/properties@5.8.0': resolution: {integrity: sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==} + '@ethersproject/providers@5.8.0': + resolution: {integrity: sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==} + + '@ethersproject/random@5.8.0': + resolution: {integrity: sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==} + '@ethersproject/rlp@5.8.0': resolution: {integrity: sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==} @@ -709,12 +777,21 @@ packages: '@ethersproject/signing-key@5.8.0': resolution: {integrity: sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==} + '@ethersproject/solidity@5.8.0': + resolution: {integrity: sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==} + '@ethersproject/strings@5.8.0': resolution: {integrity: sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==} '@ethersproject/transactions@5.8.0': resolution: {integrity: sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==} + '@ethersproject/units@5.8.0': + resolution: {integrity: sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==} + + '@ethersproject/wallet@5.8.0': + resolution: {integrity: sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==} + '@ethersproject/web@5.8.0': resolution: {integrity: sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==} @@ -1053,6 +1130,9 @@ packages: resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} engines: {node: ^14.18.0 || >=16.0.0} + '@protobuf-ts/runtime@2.11.1': + resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==} + '@reduxjs/toolkit@2.12.0': resolution: {integrity: sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==} peerDependencies: @@ -1097,12 +1177,41 @@ packages: resolution: {integrity: sha512-0JFs3V2y2M9tKW5na/qxe69Zv+uxLMO7QBbhxF/FHu/Gp2NFZAAL9tWl9PU02xxo07pb3G9FTyjNc6D5uZrJIg==} engines: {node: '>=18.0.0'} + '@solana/buffer-layout@4.0.1': + resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} + engines: {node: '>=5.10'} + + '@solana/codecs-core@2.3.0': + resolution: {integrity: sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + + '@solana/codecs-numbers@2.3.0': + resolution: {integrity: sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + + '@solana/errors@2.3.0': + resolution: {integrity: sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==} + engines: {node: '>=20.18.0'} + hasBin: true + peerDependencies: + typescript: '>=5.3.3' + + '@solana/web3.js@1.98.4': + resolution: {integrity: sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==} + '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} '@standard-schema/utils@0.3.0': resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==} + '@swc/helpers@0.5.23': + resolution: {integrity: sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==} + '@tsconfig/node10@1.0.12': resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} @@ -1118,6 +1227,15 @@ packages: '@tybys/wasm-util@0.10.3': resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} + '@typechain/ethers-v5@11.1.2': + resolution: {integrity: sha512-ID6pqWkao54EuUQa0P5RgjvfA3MYqxUQKpbGKERbsjBW5Ra7EIXvbMlPp2pcP5IAdUkyMCFYsP2SN5q7mPdLDQ==} + peerDependencies: + '@ethersproject/abi': ^5.0.0 + '@ethersproject/providers': ^5.0.0 + ethers: ^5.1.3 + typechain: ^8.3.2 + typescript: '>=4.3.0' + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -1217,12 +1335,18 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/node@12.20.55': + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + '@types/node@22.20.0': resolution: {integrity: sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==} '@types/node@25.5.0': resolution: {integrity: sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==} + '@types/prettier@2.7.3': + resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} + '@types/qs@6.15.1': resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==} @@ -1255,6 +1379,12 @@ packages: '@types/use-sync-external-store@0.0.6': resolution: {integrity: sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==} + '@types/uuid@10.0.0': + resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + + '@types/ws@7.4.7': + resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} + '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} @@ -1516,6 +1646,9 @@ packages: webpack-dev-server: optional: true + '@wireio/opp-typescript-models@1.0.47': + resolution: {integrity: sha512-YmeRvOSXUgNtG6S2ASIs/5UDz4BbkGOv3B58yVvRkV/OoSoQhQSe1my9+evG8gKb126VxmgJ/n9OS4Zh0Ifcjw==} + '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -1550,10 +1683,17 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + aes-js@3.0.0: + resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} + agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} + agentkeepalive@4.6.0: + resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==} + engines: {node: '>= 8.0.0'} + ajv-formats@2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -1590,6 +1730,10 @@ packages: resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -1612,6 +1756,14 @@ packages: argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + array-back@3.1.0: + resolution: {integrity: sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==} + engines: {node: '>=6'} + + array-back@4.0.2: + resolution: {integrity: sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==} + engines: {node: '>=8'} + asn1js@3.0.10: resolution: {integrity: sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==} engines: {node: '>=12.0.0'} @@ -1648,6 +1800,12 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} + base-x@3.0.11: + resolution: {integrity: sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + baseline-browser-mapping@2.10.42: resolution: {integrity: sha512-c/jurFrDLyui7o1J86yLkRu4LMsTYcBohveus7/I2Hzdn9KIP2bdJPTue/lR1KH46enoPbD77GKeSYNdyPoD3Q==} engines: {node: '>=6.0.0'} @@ -1656,6 +1814,9 @@ packages: batch@0.6.1: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} + bech32@1.1.4: + resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} @@ -1675,6 +1836,9 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + borsh@0.7.0: + resolution: {integrity: sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==} + bowser@2.14.1: resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==} @@ -1704,12 +1868,26 @@ packages: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} + bs58@4.0.1: + resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} + bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + buffer-layout@1.2.2: + resolution: {integrity: sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==} + engines: {node: '>=4.5'} + + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + + bufferutil@4.1.0: + resolution: {integrity: sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==} + engines: {node: '>=6.14.2'} + bundle-name@4.1.0: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} @@ -1748,10 +1926,18 @@ packages: caniuse-lite@1.0.30001803: resolution: {integrity: sha512-g/uHREV2ZpK9qMalCsWaxmA6ol+DX8GYhuf3T40RKoP+oL7vhRJh8LNt73PCjpnR6l14FzfPrB5Yux4PKm2meg==} + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -1790,10 +1976,16 @@ packages: collect-v8-coverage@1.0.3: resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -1804,10 +1996,22 @@ packages: resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} engines: {node: '>=0.1.90'} + command-line-args@5.2.1: + resolution: {integrity: sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==} + engines: {node: '>=4.0.0'} + + command-line-usage@6.1.3: + resolution: {integrity: sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==} + engines: {node: '>=8.0.0'} + commander@12.1.0: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} + commander@14.0.3: + resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} + engines: {node: '>=20'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -1867,6 +2071,9 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cross-fetch@3.2.0: + resolution: {integrity: sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -1946,6 +2153,10 @@ packages: babel-plugin-macros: optional: true + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -1965,6 +2176,10 @@ packages: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} + delay@5.0.0: + resolution: {integrity: sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==} + engines: {node: '>=10'} + depd@1.1.2: resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} engines: {node: '>= 0.6'} @@ -2068,6 +2283,12 @@ packages: resolution: {integrity: sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==} engines: {node: '>= 0.4'} + es6-promise@4.2.8: + resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} + + es6-promisify@5.0.0: + resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -2075,6 +2296,10 @@ packages: escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} @@ -2148,6 +2373,12 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} + ethers@5.8.0: + resolution: {integrity: sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==} + + eventemitter3@4.0.7: + resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + eventemitter3@5.0.4: resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==} @@ -2171,6 +2402,10 @@ packages: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} + eyes@0.1.8: + resolution: {integrity: sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==} + engines: {node: '> 0.1.90'} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -2180,6 +2415,9 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + fast-stable-stringify@1.0.0: + resolution: {integrity: sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==} + fast-uri@3.1.3: resolution: {integrity: sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==} @@ -2211,6 +2449,10 @@ packages: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} + find-replace@3.0.0: + resolution: {integrity: sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==} + engines: {node: '>=4.0.0'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -2242,6 +2484,10 @@ packages: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} + fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -2295,6 +2541,10 @@ packages: deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true + glob@7.1.7: + resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me @@ -2314,6 +2564,10 @@ packages: engines: {node: '>=0.4.7'} hasBin: true + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -2390,6 +2644,9 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + humanize-ms@1.2.1: + resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} @@ -2413,6 +2670,9 @@ packages: peerDependencies: postcss: ^8.1.0 + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -2526,6 +2786,11 @@ packages: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} + isomorphic-ws@4.0.1: + resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} + peerDependencies: + ws: '*' + istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -2549,6 +2814,11 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jayson@4.3.0: + resolution: {integrity: sha512-AauzHcUcqs8OBnCHOkJY280VaTiCm57AbuO7lqzcw7JapGj50BisE3xhksye4zlTSR1+1tAz67wLTl8tEH1obQ==} + engines: {node: '>=8'} + hasBin: true + jest-changed-files@30.4.1: resolution: {integrity: sha512-IuctmYrxi21iOSOaIXpJWalHyPAsVv0GeBHKDn8C1CA4W5htHn7INL+wdnL4Bo0+olEndvAFkmb++tIQJG+vvg==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} @@ -2736,11 +3006,17 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + json-stringify-safe@5.0.1: + resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true + jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -2777,6 +3053,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -2925,6 +3204,19 @@ packages: no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} + hasBin: true + node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} @@ -3108,6 +3400,11 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + prettier@3.8.1: resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} engines: {node: '>=14'} @@ -3185,6 +3482,10 @@ packages: resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} engines: {node: '>= 10.13.0'} + reduce-flatten@2.0.0: + resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} + engines: {node: '>=6'} + redux-thunk@3.1.0: resolution: {integrity: sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==} peerDependencies: @@ -3231,6 +3532,9 @@ packages: resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} engines: {node: '>= 18'} + rpc-websockets@9.3.9: + resolution: {integrity: sha512-2iQDaTB4g5fDB2ihrTFSJSibCEuxaRi1q7qTW7ZO9/M5/TC+ToHA4D9/ffNLEbAoHNNrcdeP05oATNk44SKZXA==} + rrweb-cssom@0.8.0: resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} @@ -3258,6 +3562,9 @@ packages: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} + scrypt-js@3.0.1: + resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} + selfsigned@5.5.0: resolution: {integrity: sha512-ftnu3TW4+3eBfLRFnDEkzGxSF/10BJBkaLJuBHZX0kiPS7bRdlpZGu6YGt4KngMkdTwJE6MbjavFpqHvqVt+Ew==} engines: {node: '>=18'} @@ -3370,6 +3677,15 @@ packages: resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} + stream-chain@2.2.5: + resolution: {integrity: sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==} + + stream-json@1.9.1: + resolution: {integrity: sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==} + + string-format@2.0.0: + resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} + string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} @@ -3408,6 +3724,17 @@ packages: peerDependencies: webpack: ^5.27.0 + superstruct@0.15.5: + resolution: {integrity: sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==} + + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} + engines: {node: '>=14.0.0'} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -3427,6 +3754,10 @@ packages: resolution: {integrity: sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==} engines: {node: ^14.18.0 || >=16.0.0} + table-layout@1.0.2: + resolution: {integrity: sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==} + engines: {node: '>=8.0.0'} + tapable@2.3.3: resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} @@ -3483,6 +3814,9 @@ packages: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} + text-encoding-utf-8@1.0.2: + resolution: {integrity: sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==} + thingies@2.6.0: resolution: {integrity: sha512-rMHRjmlFLM1R96UYPvpmnc3LYtdFrT33JIB7L9hetGue1qAPfn1N2LJeEjxUSidu1Iku+haLZXDuEXUHNGO/lg==} engines: {node: '>=10.18'} @@ -3518,10 +3852,16 @@ packages: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} + toml@3.0.0: + resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} + tough-cookie@5.1.2: resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} engines: {node: '>=16'} + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + tr46@5.1.1: resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} engines: {node: '>=18'} @@ -3546,6 +3886,15 @@ packages: peerDependencies: typescript: '>=4.8.4' + ts-command-line-args@2.5.1: + resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} + hasBin: true + + ts-essentials@7.0.3: + resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} + peerDependencies: + typescript: '>=3.7.0' + ts-jest@29.4.11: resolution: {integrity: sha512-IrFl7l9AuB/qrNw5quqvAv/hmKMb8dhWOH4jQOGo0Oq8tCeo1O86/iTFG1FaRimgUkF13l4PcepO8ATFT6Ns4g==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -3634,6 +3983,12 @@ packages: resolution: {integrity: sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==} engines: {node: '>= 18'} + typechain@8.3.2: + resolution: {integrity: sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==} + hasBin: true + peerDependencies: + typescript: '>=4.3.0' + typescript-eslint@8.64.0: resolution: {integrity: sha512-0qg+pDNMnqYzqH9AnNK+39tejHvsShUOUUoRUgtnTGE7QuMZhiFDnozq8nHJVq+Wae6NMLKNWLg5WmkcC/ndyQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3646,6 +4001,14 @@ packages: engines: {node: '>=14.17'} hasBin: true + typical@4.0.0: + resolution: {integrity: sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==} + engines: {node: '>=8'} + + typical@5.2.0: + resolution: {integrity: sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==} + engines: {node: '>=8'} + uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} @@ -3657,6 +4020,10 @@ packages: undici-types@7.18.2: resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -3678,6 +4045,10 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + utf-8-validate@6.0.6: + resolution: {integrity: sha512-q3l3P9UtEEiAHcsgsqTgf9PPjctrDWoIXW3NpOHFdRDbLvu4DLIcxHangJ4RLrWkBcKjmcs/6NkerI8T/rE4LA==} + engines: {node: '>=6.14.2'} + util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -3688,6 +4059,11 @@ packages: resolution: {integrity: sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==} hasBin: true + uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). + hasBin: true + v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -3710,6 +4086,9 @@ packages: resolution: {integrity: sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==} engines: {node: '>=10.13.0'} + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -3781,6 +4160,9 @@ packages: resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} engines: {node: '>=18'} + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3796,6 +4178,10 @@ packages: wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wordwrapjs@4.0.1: + resolution: {integrity: sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==} + engines: {node: '>=8.0.0'} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -3811,6 +4197,30 @@ packages: resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ws@7.5.13: + resolution: {integrity: sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.21.0: resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} engines: {node: '>=10.0.0'} @@ -3864,6 +4274,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + snapshots: '@3fv/guard@1.4.39': @@ -4205,6 +4618,8 @@ snapshots: '@babel/core': 7.29.7 '@babel/helper-plugin-utils': 7.29.7 + '@babel/runtime@7.29.7': {} + '@babel/template@7.29.7': dependencies: '@babel/code-frame': 7.29.7 @@ -4230,6 +4645,35 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} + '@coral-xyz/anchor-errors@0.31.1': {} + + '@coral-xyz/anchor@0.32.1(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6)': + dependencies: + '@coral-xyz/anchor-errors': 0.31.1 + '@coral-xyz/borsh': 0.31.1(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6)) + '@noble/hashes': 1.8.0 + '@solana/web3.js': 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + bn.js: 5.2.4 + bs58: 4.0.1 + buffer-layout: 1.2.2 + camelcase: 6.3.0 + cross-fetch: 3.2.0 + eventemitter3: 4.0.7 + pako: 2.2.0 + superstruct: 0.15.5 + toml: 3.0.0 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + + '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6))': + dependencies: + '@solana/web3.js': 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + bn.js: 5.2.4 + buffer-layout: 1.2.2 + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -4306,6 +4750,18 @@ snapshots: '@eslint/core': 1.2.1 levn: 0.4.1 + '@ethersproject/abi@5.8.0': + dependencies: + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/abstract-provider@5.8.0': dependencies: '@ethersproject/bignumber': 5.8.0 @@ -4355,6 +4811,19 @@ snapshots: dependencies: '@ethersproject/bignumber': 5.8.0 + '@ethersproject/contracts@5.8.0': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/hash@5.8.0': dependencies: '@ethersproject/abstract-signer': 5.8.0 @@ -4382,6 +4851,22 @@ snapshots: '@ethersproject/transactions': 5.8.0 '@ethersproject/wordlists': 5.8.0 + '@ethersproject/json-wallets@5.8.0': + dependencies: + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + aes-js: 3.0.0 + scrypt-js: 3.0.1 + '@ethersproject/keccak256@5.8.0': dependencies: '@ethersproject/bytes': 5.8.0 @@ -4402,6 +4887,37 @@ snapshots: dependencies: '@ethersproject/logger': 5.8.0 + '@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/web': 5.8.0 + bech32: 1.1.4 + ws: 8.18.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@ethersproject/random@5.8.0': + dependencies: + '@ethersproject/bytes': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/rlp@5.8.0': dependencies: '@ethersproject/bytes': 5.8.0 @@ -4422,6 +4938,15 @@ snapshots: elliptic: 6.6.1 hash.js: 1.1.7 + '@ethersproject/solidity@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/strings@5.8.0': dependencies: '@ethersproject/bytes': 5.8.0 @@ -4440,6 +4965,30 @@ snapshots: '@ethersproject/rlp': 5.8.0 '@ethersproject/signing-key': 5.8.0 + '@ethersproject/units@5.8.0': + dependencies: + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/logger': 5.8.0 + + '@ethersproject/wallet@5.8.0': + dependencies: + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/json-wallets': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/random': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + '@ethersproject/web@5.8.0': dependencies: '@ethersproject/base64': 5.8.0 @@ -4538,7 +5087,7 @@ snapshots: '@jest/diff-sequences@30.4.0': {} - '@jest/environment-jsdom-abstract@30.4.1(jsdom@26.1.0)': + '@jest/environment-jsdom-abstract@30.4.1(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': dependencies: '@jest/environment': 30.4.1 '@jest/fake-timers': 30.4.1 @@ -4547,7 +5096,7 @@ snapshots: '@types/node': 25.5.0 jest-mock: 30.4.1 jest-util: 30.4.1 - jsdom: 26.1.0 + jsdom: 26.1.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) '@jest/environment@30.4.1': dependencies: @@ -4952,6 +5501,8 @@ snapshots: '@pkgr/core@0.3.6': {} + '@protobuf-ts/runtime@2.11.1': {} + '@reduxjs/toolkit@2.12.0(react-redux@9.3.0(@types/react@19.2.17)(react@19.2.7)(redux@5.0.1))(react@19.2.7)': dependencies: '@standard-schema/spec': 1.1.0 @@ -5007,10 +5558,58 @@ snapshots: dependencies: tslib: 2.8.1 + '@solana/buffer-layout@4.0.1': + dependencies: + buffer: 6.0.3 + + '@solana/codecs-core@2.3.0(typescript@6.0.2)': + dependencies: + '@solana/errors': 2.3.0(typescript@6.0.2) + typescript: 6.0.2 + + '@solana/codecs-numbers@2.3.0(typescript@6.0.2)': + dependencies: + '@solana/codecs-core': 2.3.0(typescript@6.0.2) + '@solana/errors': 2.3.0(typescript@6.0.2) + typescript: 6.0.2 + + '@solana/errors@2.3.0(typescript@6.0.2)': + dependencies: + chalk: 5.6.2 + commander: 14.0.3 + typescript: 6.0.2 + + '@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6)': + dependencies: + '@babel/runtime': 7.29.7 + '@noble/curves': 1.9.7 + '@noble/hashes': 1.8.0 + '@solana/buffer-layout': 4.0.1 + '@solana/codecs-numbers': 2.3.0(typescript@6.0.2) + agentkeepalive: 4.6.0 + bn.js: 5.2.4 + borsh: 0.7.0 + bs58: 4.0.1 + buffer: 6.0.3 + fast-stable-stringify: 1.0.0 + jayson: 4.3.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + node-fetch: 2.7.0 + rpc-websockets: 9.3.9 + superstruct: 2.0.2 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + '@standard-schema/spec@1.1.0': {} '@standard-schema/utils@0.3.0': {} + '@swc/helpers@0.5.23': + dependencies: + tslib: 2.8.1 + '@tsconfig/node10@1.0.12': {} '@tsconfig/node12@1.0.11': {} @@ -5024,6 +5623,16 @@ snapshots: tslib: 2.8.1 optional: true + '@typechain/ethers-v5@11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2)': + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/providers': 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + ethers: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + lodash: 4.18.1 + ts-essentials: 7.0.3(typescript@6.0.2) + typechain: 8.3.2(typescript@6.0.2) + typescript: 6.0.2 + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.29.7 @@ -5150,6 +5759,8 @@ snapshots: '@types/ms@2.1.0': {} + '@types/node@12.20.55': {} + '@types/node@22.20.0': dependencies: undici-types: 6.21.0 @@ -5158,6 +5769,8 @@ snapshots: dependencies: undici-types: 7.18.2 + '@types/prettier@2.7.3': {} + '@types/qs@6.15.1': {} '@types/range-parser@1.2.7': {} @@ -5189,6 +5802,12 @@ snapshots: '@types/use-sync-external-store@0.0.6': {} + '@types/uuid@10.0.0': {} + + '@types/ws@7.4.7': + dependencies: + '@types/node': 25.5.0 + '@types/ws@8.18.1': dependencies: '@types/node': 22.20.0 @@ -5453,13 +6072,17 @@ snapshots: webpack: 5.104.1(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack-dev-server@6.0.0)(webpack@5.104.1) optionalDependencies: - webpack-dev-server: 6.0.0(tslib@2.8.1)(webpack-cli@6.0.1)(webpack@5.104.1) + webpack-dev-server: 6.0.0(bufferutil@4.1.0)(tslib@2.8.1)(utf-8-validate@6.0.6)(webpack-cli@6.0.1)(webpack@5.104.1) '@webpack-cli/serve@3.0.1(webpack-cli@6.0.1)(webpack@5.104.1)': dependencies: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.104.1) + '@wireio/opp-typescript-models@1.0.47': + dependencies: + '@protobuf-ts/runtime': 2.11.1 + '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} @@ -5488,8 +6111,14 @@ snapshots: acorn@8.17.0: {} + aes-js@3.0.0: {} + agent-base@7.1.4: {} + agentkeepalive@4.6.0: + dependencies: + humanize-ms: 1.2.1 + ajv-formats@2.1.1(ajv@8.20.0): optionalDependencies: ajv: 8.20.0 @@ -5523,6 +6152,10 @@ snapshots: ansi-regex@6.2.2: {} + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -5542,6 +6175,10 @@ snapshots: dependencies: sprintf-js: 1.0.3 + array-back@3.1.0: {} + + array-back@4.0.2: {} + asn1js@3.0.10: dependencies: pvtsutils: 1.3.6 @@ -5604,10 +6241,18 @@ snapshots: balanced-match@4.0.4: {} + base-x@3.0.11: + dependencies: + safe-buffer: 5.2.1 + + base64-js@1.5.1: {} + baseline-browser-mapping@2.10.42: {} batch@0.6.1: {} + bech32@1.1.4: {} + bluebird@3.7.2: {} bn.js@4.12.4: {} @@ -5635,6 +6280,12 @@ snapshots: boolbase@1.0.0: {} + borsh@0.7.0: + dependencies: + bn.js: 5.2.4 + bs58: 4.0.1 + text-encoding-utf-8: 1.0.2 + bowser@2.14.1: {} brace-expansion@1.1.15: @@ -5668,12 +6319,28 @@ snapshots: dependencies: fast-json-stable-stringify: 2.1.0 + bs58@4.0.1: + dependencies: + base-x: 3.0.11 + bser@2.1.1: dependencies: node-int64: 0.4.0 buffer-from@1.1.2: {} + buffer-layout@1.2.2: {} + + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + bufferutil@4.1.0: + dependencies: + node-gyp-build: 4.8.4 + optional: true + bundle-name@4.1.0: dependencies: run-applescript: 7.1.0 @@ -5705,11 +6372,19 @@ snapshots: caniuse-lite@1.0.30001803: {} + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + chalk@5.6.2: {} + char-regex@1.0.2: {} chokidar@5.0.0: @@ -5742,18 +6417,40 @@ snapshots: collect-v8-coverage@1.0.3: {} + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + color-convert@2.0.1: dependencies: color-name: 1.1.4 + color-name@1.1.3: {} + color-name@1.1.4: {} colorette@2.0.20: {} colors@1.4.0: {} + command-line-args@5.2.1: + dependencies: + array-back: 3.1.0 + find-replace: 3.0.0 + lodash.camelcase: 4.3.0 + typical: 4.0.0 + + command-line-usage@6.1.3: + dependencies: + array-back: 4.0.2 + chalk: 2.4.2 + table-layout: 1.0.2 + typical: 5.2.0 + commander@12.1.0: {} + commander@14.0.3: {} + commander@2.20.3: {} commander@8.3.0: {} @@ -5810,6 +6507,12 @@ snapshots: create-require@1.1.1: {} + cross-fetch@3.2.0: + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -5871,6 +6574,8 @@ snapshots: dedent@1.7.2: {} + deep-extend@0.6.0: {} + deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -5884,6 +6589,8 @@ snapshots: define-lazy-prop@3.0.0: {} + delay@5.0.0: {} + depd@1.1.2: {} depd@2.0.0: {} @@ -5978,10 +6685,18 @@ snapshots: dependencies: es-errors: 1.3.0 + es6-promise@4.2.8: {} + + es6-promisify@5.0.0: + dependencies: + es6-promise: 4.2.8 + escalade@3.2.0: {} escape-html@1.0.3: {} + escape-string-regexp@1.0.5: {} + escape-string-regexp@2.0.0: {} escape-string-regexp@4.0.0: {} @@ -6065,6 +6780,44 @@ snapshots: etag@1.8.1: {} + ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + dependencies: + '@ethersproject/abi': 5.8.0 + '@ethersproject/abstract-provider': 5.8.0 + '@ethersproject/abstract-signer': 5.8.0 + '@ethersproject/address': 5.8.0 + '@ethersproject/base64': 5.8.0 + '@ethersproject/basex': 5.8.0 + '@ethersproject/bignumber': 5.8.0 + '@ethersproject/bytes': 5.8.0 + '@ethersproject/constants': 5.8.0 + '@ethersproject/contracts': 5.8.0 + '@ethersproject/hash': 5.8.0 + '@ethersproject/hdnode': 5.8.0 + '@ethersproject/json-wallets': 5.8.0 + '@ethersproject/keccak256': 5.8.0 + '@ethersproject/logger': 5.8.0 + '@ethersproject/networks': 5.8.0 + '@ethersproject/pbkdf2': 5.8.0 + '@ethersproject/properties': 5.8.0 + '@ethersproject/providers': 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + '@ethersproject/random': 5.8.0 + '@ethersproject/rlp': 5.8.0 + '@ethersproject/sha2': 5.8.0 + '@ethersproject/signing-key': 5.8.0 + '@ethersproject/solidity': 5.8.0 + '@ethersproject/strings': 5.8.0 + '@ethersproject/transactions': 5.8.0 + '@ethersproject/units': 5.8.0 + '@ethersproject/wallet': 5.8.0 + '@ethersproject/web': 5.8.0 + '@ethersproject/wordlists': 5.8.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + eventemitter3@4.0.7: {} + eventemitter3@5.0.4: {} events@3.3.0: {} @@ -6125,12 +6878,16 @@ snapshots: transitivePeerDependencies: - supports-color + eyes@0.1.8: {} + fast-deep-equal@3.1.3: {} fast-json-stable-stringify@2.1.0: {} fast-levenshtein@2.0.6: {} + fast-stable-stringify@1.0.0: {} + fast-uri@3.1.3: {} fastest-levenshtein@1.0.16: {} @@ -6162,6 +6919,10 @@ snapshots: transitivePeerDependencies: - supports-color + find-replace@3.0.0: + dependencies: + array-back: 3.1.0 + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -6190,6 +6951,12 @@ snapshots: fresh@2.0.0: {} + fs-extra@7.0.1: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -6242,6 +7009,15 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@7.1.7: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.5 + once: 1.4.0 + path-is-absolute: 1.0.1 + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -6266,6 +7042,8 @@ snapshots: optionalDependencies: uglify-js: 3.19.3 + has-flag@3.0.0: {} + has-flag@4.0.0: {} has-symbols@1.1.0: {} @@ -6364,6 +7142,10 @@ snapshots: human-signals@2.1.0: {} + humanize-ms@1.2.1: + dependencies: + ms: 2.1.3 + husky@9.1.7: {} hyperdyperid@1.2.0: {} @@ -6380,6 +7162,8 @@ snapshots: dependencies: postcss: 8.5.16 + ieee754@1.2.1: {} + ignore@5.3.2: {} ignore@7.0.6: {} @@ -6454,6 +7238,10 @@ snapshots: isobject@3.0.1: {} + isomorphic-ws@4.0.1(ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6)): + dependencies: + ws: 7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6) + istanbul-lib-coverage@3.2.2: {} istanbul-lib-instrument@6.0.3: @@ -6491,6 +7279,24 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jayson@4.3.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + dependencies: + '@types/connect': 3.4.38 + '@types/node': 12.20.55 + '@types/ws': 7.4.7 + commander: 2.20.3 + delay: 5.0.0 + es6-promisify: 5.0.0 + eyes: 0.1.8 + isomorphic-ws: 4.0.1(ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + json-stringify-safe: 5.0.1 + stream-json: 1.9.1 + uuid: 8.3.2 + ws: 7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + jest-changed-files@30.4.1: dependencies: execa: 5.1.1 @@ -6593,11 +7399,11 @@ snapshots: jest-util: 30.4.1 pretty-format: 30.4.1 - jest-environment-jsdom@30.4.1: + jest-environment-jsdom@30.4.1(bufferutil@4.1.0)(utf-8-validate@6.0.6): dependencies: '@jest/environment': 30.4.1 - '@jest/environment-jsdom-abstract': 30.4.1(jsdom@26.1.0) - jsdom: 26.1.0 + '@jest/environment-jsdom-abstract': 30.4.1(jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + jsdom: 26.1.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - supports-color @@ -6837,7 +7643,7 @@ snapshots: argparse: 1.0.10 esprima: 4.0.1 - jsdom@26.1.0: + jsdom@26.1.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): dependencies: cssstyle: 4.6.0 data-urls: 5.0.0 @@ -6857,7 +7663,7 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.2.0 - ws: 8.21.0 + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -6876,8 +7682,14 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} + json-stringify-safe@5.0.1: {} + json5@2.2.3: {} + jsonfile@4.0.0: + optionalDependencies: + graceful-fs: 4.2.11 + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -6910,6 +7722,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash.camelcase@4.3.0: {} + lodash.memoize@4.1.2: {} lodash@4.18.1: {} @@ -7036,6 +7850,13 @@ snapshots: lower-case: 2.0.2 tslib: 2.8.1 + node-fetch@2.7.0: + dependencies: + whatwg-url: 5.0.0 + + node-gyp-build@4.8.4: + optional: true + node-int64@0.4.0: {} node-releases@2.0.50: {} @@ -7209,6 +8030,8 @@ snapshots: prelude-ls@1.2.1: {} + prettier@2.8.8: {} + prettier@3.8.1: {} pretty-error@4.0.0: @@ -7278,6 +8101,8 @@ snapshots: dependencies: resolve: 1.22.12 + reduce-flatten@2.0.0: {} + redux-thunk@3.1.0(redux@5.0.1): dependencies: redux: 5.0.1 @@ -7325,6 +8150,19 @@ snapshots: transitivePeerDependencies: - supports-color + rpc-websockets@9.3.9: + dependencies: + '@swc/helpers': 0.5.23 + '@types/uuid': 10.0.0 + '@types/ws': 8.18.1 + buffer: 6.0.3 + eventemitter3: 5.0.4 + uuid: 14.0.1 + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 + rrweb-cssom@0.8.0: {} run-applescript@7.1.0: {} @@ -7350,6 +8188,8 @@ snapshots: ajv-formats: 2.1.1(ajv@8.20.0) ajv-keywords: 5.1.0(ajv@8.20.0) + scrypt-js@3.0.1: {} + selfsigned@5.5.0: dependencies: '@peculiar/x509': 1.14.3 @@ -7474,6 +8314,14 @@ snapshots: statuses@2.0.2: {} + stream-chain@2.2.5: {} + + stream-json@1.9.1: + dependencies: + stream-chain: 2.2.5 + + string-format@2.0.0: {} + string-length@4.0.2: dependencies: char-regex: 1.0.2 @@ -7509,6 +8357,14 @@ snapshots: dependencies: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) + superstruct@0.15.5: {} + + superstruct@2.0.2: {} + + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -7525,6 +8381,13 @@ snapshots: dependencies: '@pkgr/core': 0.3.6 + table-layout@1.0.2: + dependencies: + array-back: 4.0.2 + deep-extend: 0.6.0 + typical: 5.2.0 + wordwrapjs: 4.0.1 + tapable@2.3.3: {} terser-webpack-plugin@5.6.1(postcss@8.5.16)(webpack@5.104.1): @@ -7558,6 +8421,8 @@ snapshots: glob: 7.2.3 minimatch: 3.1.5 + text-encoding-utf-8@1.0.2: {} + thingies@2.6.0(tslib@2.8.1): dependencies: tslib: 2.8.1 @@ -7585,10 +8450,14 @@ snapshots: toidentifier@1.0.1: {} + toml@3.0.0: {} + tough-cookie@5.1.2: dependencies: tldts: 6.1.86 + tr46@0.0.3: {} + tr46@5.1.1: dependencies: punycode: 2.3.1 @@ -7610,6 +8479,17 @@ snapshots: dependencies: typescript: 6.0.2 + ts-command-line-args@2.5.1: + dependencies: + chalk: 4.1.2 + command-line-args: 5.2.1 + command-line-usage: 6.1.3 + string-format: 2.0.0 + + ts-essentials@7.0.3(typescript@6.0.2): + dependencies: + typescript: 6.0.2 + ts-jest@29.4.11(@babel/core@7.29.7)(@jest/transform@30.4.1)(@jest/types@30.4.1)(babel-jest@30.4.1(@babel/core@7.29.7))(jest-util@30.4.1)(jest@30.4.2(@types/node@25.5.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)))(typescript@6.0.2): dependencies: bs-logger: 0.2.6 @@ -7684,6 +8564,22 @@ snapshots: media-typer: 1.1.0 mime-types: 3.0.2 + typechain@8.3.2(typescript@6.0.2): + dependencies: + '@types/prettier': 2.7.3 + debug: 4.3.4 + fs-extra: 7.0.1 + glob: 7.1.7 + js-sha3: 0.8.0 + lodash: 4.18.1 + mkdirp: 1.0.4 + prettier: 2.8.8 + ts-command-line-args: 2.5.1 + ts-essentials: 7.0.3(typescript@6.0.2) + typescript: 6.0.2 + transitivePeerDependencies: + - supports-color + typescript-eslint@8.64.0(eslint@10.7.0)(typescript@6.0.2): dependencies: '@typescript-eslint/eslint-plugin': 8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0)(typescript@6.0.2))(eslint@10.7.0)(typescript@6.0.2) @@ -7697,6 +8593,10 @@ snapshots: typescript@6.0.2: {} + typical@4.0.0: {} + + typical@5.2.0: {} + uglify-js@3.19.3: optional: true @@ -7704,6 +8604,8 @@ snapshots: undici-types@7.18.2: {} + universalify@0.1.2: {} + unpipe@1.0.0: {} unrs-resolver@1.12.2: @@ -7747,12 +8649,19 @@ snapshots: dependencies: react: 19.2.7 + utf-8-validate@6.0.6: + dependencies: + node-gyp-build: 4.8.4 + optional: true + util-deprecate@1.0.2: {} utila@0.4.0: {} uuid@14.0.1: {} + uuid@8.3.2: {} + v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.3.0: @@ -7775,6 +8684,8 @@ snapshots: dependencies: graceful-fs: 4.2.11 + webidl-conversions@3.0.1: {} + webidl-conversions@7.0.0: {} webpack-cli@6.0.1(webpack-dev-server@6.0.0)(webpack@5.104.1): @@ -7794,7 +8705,7 @@ snapshots: webpack: 5.104.1(webpack-cli@6.0.1) webpack-merge: 6.0.1 optionalDependencies: - webpack-dev-server: 6.0.0(tslib@2.8.1)(webpack-cli@6.0.1)(webpack@5.104.1) + webpack-dev-server: 6.0.0(bufferutil@4.1.0)(tslib@2.8.1)(utf-8-validate@6.0.6)(webpack-cli@6.0.1)(webpack@5.104.1) webpack-cli@6.0.1(webpack@5.104.1): dependencies: @@ -7825,7 +8736,7 @@ snapshots: transitivePeerDependencies: - tslib - webpack-dev-server@6.0.0(tslib@2.8.1)(webpack-cli@6.0.1)(webpack@5.104.1): + webpack-dev-server@6.0.0(bufferutil@4.1.0)(tslib@2.8.1)(utf-8-validate@6.0.6)(webpack-cli@6.0.1)(webpack@5.104.1): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -7851,7 +8762,7 @@ snapshots: serve-index: 1.9.2 tinyglobby: 0.2.17 webpack-dev-middleware: 8.0.3(tslib@2.8.1)(webpack@5.104.1) - ws: 8.21.0 + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) optionalDependencies: webpack: 5.104.1(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack-dev-server@6.0.0)(webpack@5.104.1) @@ -7966,6 +8877,11 @@ snapshots: tr46: 5.1.1 webidl-conversions: 7.0.0 + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + which@2.0.2: dependencies: isexe: 2.0.0 @@ -7976,6 +8892,11 @@ snapshots: wordwrap@1.0.0: {} + wordwrapjs@4.0.1: + dependencies: + reduce-flatten: 2.0.0 + typical: 5.2.0 + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -7995,7 +8916,20 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.1.0 - ws@8.21.0: {} + ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6): + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 + + ws@8.18.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 + + ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 wsl-utils@0.3.1: dependencies: @@ -8037,3 +8971,5 @@ snapshots: yn@3.1.1: {} yocto-queue@0.1.0: {} + + zod@4.4.3: {} diff --git a/tsconfig.json b/tsconfig.json index 4e7e765..670cf71 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,6 +26,9 @@ { "path": "./packages/sdk-core/tsconfig.json" }, + { + "path": "./packages/sdk-outpost/tsconfig.json" + }, { "path": "./packages/wallet-ext-sdk/tsconfig.json" }, @@ -36,4 +39,4 @@ "path": "./examples/web-logging-example/tsconfig.json" } ] -} \ No newline at end of file +} From 7c67510f44394ed1aad87a4972d470596df6ea0f Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 31 Jul 2026 14:41:51 -0400 Subject: [PATCH 02/48] feat(sdk-outpost): add verified sim2 artifacts and generated chain types --- eslint.config.mjs | 2 + packages/sdk-outpost/README.md | 2 + packages/sdk-outpost/package.json | 5 +- .../scripts/generate-solana-types.mjs | 39 + .../src/assets/ethereum/sim2/OPP.json | 1081 ++ .../src/assets/ethereum/sim2/OPPInbound.json | 1414 +++ .../ethereum/sim2/OperatorRegistry.json | 1657 +++ .../assets/ethereum/sim2/ReserveManager.json | 2456 ++++ .../src/assets/solana/sim2/liqsol_core.json | 10161 ++++++++++++++++ .../src/contracts/ethereum/generated/OPP.ts | 1084 ++ .../ethereum/generated/OPPInbound.ts | 1660 +++ .../ethereum/generated/OperatorRegistry.ts | 1433 +++ .../ethereum/generated/ReserveManager.ts | 2323 ++++ .../contracts/ethereum/generated/common.ts | 44 + .../factories/OPPInbound__factory.ts | 1431 +++ .../generated/factories/OPP__factory.ts | 1095 ++ .../factories/OperatorRegistry__factory.ts | 1677 +++ .../factories/ReserveManager__factory.ts | 2476 ++++ .../ethereum/generated/factories/index.ts | 7 + .../src/contracts/ethereum/generated/index.ts | 12 + .../src/contracts/ethereum/index.ts | 1 + packages/sdk-outpost/src/contracts/index.ts | 1 + .../sdk-outpost/src/deployments/Schema.ts | 21 +- packages/sdk-outpost/src/deployments/Sim2.ts | 86 + packages/sdk-outpost/src/deployments/index.ts | 1 + packages/sdk-outpost/src/index.ts | 2 + packages/sdk-outpost/src/programs/index.ts | 1 + .../programs/solana/generated/LiqsolCore.ts | 8509 +++++++++++++ .../src/programs/solana/generated/index.ts | 1 + .../sdk-outpost/src/programs/solana/index.ts | 1 + .../tests/assets/Artifacts.test.ts | 48 + .../tests/deployments/Schema.test.ts | 19 +- pnpm-lock.yaml | 9 + pnpm-workspace.yaml | 2 + 34 files changed, 38756 insertions(+), 5 deletions(-) create mode 100644 packages/sdk-outpost/scripts/generate-solana-types.mjs create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2/OPP.json create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2/OPPInbound.json create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2/OperatorRegistry.json create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2/ReserveManager.json create mode 100644 packages/sdk-outpost/src/assets/solana/sim2/liqsol_core.json create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/common.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/index.ts create mode 100644 packages/sdk-outpost/src/contracts/ethereum/index.ts create mode 100644 packages/sdk-outpost/src/contracts/index.ts create mode 100644 packages/sdk-outpost/src/deployments/Sim2.ts create mode 100644 packages/sdk-outpost/src/programs/index.ts create mode 100644 packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts create mode 100644 packages/sdk-outpost/src/programs/solana/generated/index.ts create mode 100644 packages/sdk-outpost/src/programs/solana/index.ts create mode 100644 packages/sdk-outpost/tests/assets/Artifacts.test.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index 99d692a..1a302b9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -424,6 +424,8 @@ export default tseslint.config( "**/node_modules/**", "**/coverage/**", "**/*.d.ts", + "packages/sdk-outpost/src/contracts/ethereum/generated/**", + "packages/sdk-outpost/src/programs/solana/generated/**", // TypeScript is the enforcement target: the style laws + tsconfig // govern .ts/.tsx. Plain JS (configs, .pnpmfile.cjs, Node CLI scripts — // whose console IS their user interface per the use-logging-framework.md diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 2400e8a..2e1320a 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -26,3 +26,5 @@ pnpm --dir packages/sdk-outpost run generate:solana Generated contract and program types must be regenerated from checked-in artifacts. Do not hand-edit generated files or re-declare their shapes. +Generated outputs live under each chain's `generated/` directory and are +excluded from handwritten-code lint rules. diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 26043fe..52b2255 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -37,11 +37,13 @@ "compile:watch": "tsc -b tsconfig.json -w", "test": "jest", "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", - "generate:ethereum": "typechain --target ethers-v5 --out-dir src/contracts/ethereum/generated 'src/assets/ethereum/**/*.json'", + "generate:ethereum": "typechain --target ethers-v5 --node16-modules --out-dir src/contracts/ethereum/generated 'src/assets/ethereum/**/*.json'", "generate:solana": "node scripts/generate-solana-types.mjs" }, "dependencies": { "@coral-xyz/anchor": "^0.32.1", + "@ethersproject/abi": "^5.8.0", + "@ethersproject/providers": "^5.8.0", "@solana/web3.js": "^1.98.4", "@wireio/sdk-core": "workspace:*", "ethers": "^5.8.0", @@ -49,6 +51,7 @@ }, "devDependencies": { "@typechain/ethers-v5": "^11.1.2", + "prettier": "3.8.1", "typechain": "^8.3.2", "typescript": "6.0.2" } diff --git a/packages/sdk-outpost/scripts/generate-solana-types.mjs b/packages/sdk-outpost/scripts/generate-solana-types.mjs new file mode 100644 index 0000000..1f73cda --- /dev/null +++ b/packages/sdk-outpost/scripts/generate-solana-types.mjs @@ -0,0 +1,39 @@ +import Fs from "node:fs/promises" +import Path from "node:path" +import { fileURLToPath } from "node:url" + +import { convertIdlToCamelCase } from "@coral-xyz/anchor/dist/cjs/idl.js" +import { format } from "prettier" + +const packagePath = Path.resolve( + Path.dirname(fileURLToPath(import.meta.url)), + ".." + ), + idlFile = Path.join(packagePath, "src/assets/solana/sim2/liqsol_core.json"), + outputFile = Path.join( + packagePath, + "src/programs/solana/generated/LiqsolCore.ts" + ), + rawIdl = JSON.parse(await Fs.readFile(idlFile, "utf8")), + idl = convertIdlToCamelCase(rawIdl), + source = ` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + import type { Idl } from "@coral-xyz/anchor" + + const liqsolCoreIdlValue = ${JSON.stringify(idl, null, 2)} as const + + /** Strict Anchor IDL type generated from the checked-in liqsol_core artifact. */ + export type LiqsolCore = Idl & typeof liqsolCoreIdlValue + + /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ + export const liqsolCoreIdl = liqsolCoreIdlValue as LiqsolCore + `, + formattedSource = await format(source, { + parser: "typescript", + semi: false, + singleQuote: false, + trailingComma: "none" + }) + +await Fs.writeFile(outputFile, formattedSource) diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/OPP.json b/packages/sdk-outpost/src/assets/ethereum/sim2/OPP.json new file mode 100644 index 0000000..e82f293 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2/OPP.json @@ -0,0 +1,1081 @@ +{ + "contractName": "OPP", + "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionCatchUpPruned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "previousRetentionEpochs", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OPPEnvelope", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_ENVELOPE_BYTES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "addAttestation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allAuthorizedSenders", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "authorizedSenders", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "wireEpochIndex", + "type": "uint32" + } + ], + "name": "emitOutboundEnvelope", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tag", + "type": "uint256" + } + ], + "name": "enterSendMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tag", + "type": "uint256" + } + ], + "name": "exitSendMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getLatestOutboundEnvelope", + "outputs": [ + { + "internalType": "uint32", + "name": "epoch_", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data_", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "getOutboundEnvelope", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inSendMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastMessageID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastMessageTimestamp", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestOutboundEnvelope", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestOutboundEpoch", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "outboundEnvelopes", + "outputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outboundRetentionConfig", + "outputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAttestationCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "pruneOutboundEnvelope", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "queuedMessageCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sendModeTag", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "start", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "end", + "type": "tuple" + } + ], + "internalType": "struct Endpoints", + "name": "endpoints", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "messageId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousMessageId", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "payloadSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "payloadChecksum", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "headerChecksum", + "type": "bytes" + } + ], + "internalType": "struct MessageHeader", + "name": "header", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "version", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "AttestationType", + "name": "type_", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "dataSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct AttestationEntry[]", + "name": "attestations", + "type": "tuple[]" + } + ], + "internalType": "struct MessagePayload", + "name": "payload", + "type": "tuple" + } + ], + "name": "serializeMessage", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "start", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "end", + "type": "tuple" + } + ], + "internalType": "struct Endpoints", + "name": "endpoints", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "messageId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousMessageId", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "payloadSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "payloadChecksum", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "headerChecksum", + "type": "bytes" + } + ], + "internalType": "struct MessageHeader", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "setEnvelopeRetentionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/OPPInbound.json b/packages/sdk-outpost/src/assets/ethereum/sim2/OPPInbound.json new file mode 100644 index 0000000..ac08035 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2/OPPInbound.json @@ -0,0 +1,1414 @@ +{ + "contractName": "OPPInbound", + "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "messageID", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + } + ], + "name": "AttestationBlackholed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "handler", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "messageID", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + } + ], + "name": "AttestationDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "address", + "name": "handler", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldHandler", + "type": "address" + } + ], + "name": "AttestationHandlerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionCatchUpPruned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "previousRetentionEpochs", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "EpochComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "epochHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "deliveryCount", + "type": "uint32" + } + ], + "name": "EpochConsensus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator_", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "epochHash", + "type": "bytes32" + } + ], + "name": "EpochDelivery", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "epochHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "messageCount", + "type": "uint256" + } + ], + "name": "EpochReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReserveManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldReserveManager", + "type": "address" + } + ], + "name": "ReserveManagerAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_ENVELOPE_BYTES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_SIG_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "activeGroupIndex", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "name": "attestationHandlers", + "outputs": [ + { + "internalType": "contract IOPPReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "batchOpGroups", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "consensusReached", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochStartedAt", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "epochDeliveries", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "epochDeliveryCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "epochDigestCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochDurationSec", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "epochIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "getInboundEnvelope", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "inboundEnvelopes", + "outputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inboundRetentionConfig", + "outputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oppManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator_", + "type": "address" + } + ], + "name": "isActiveOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastMessageID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextEpochIndex", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "operatorEthAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppContract", + "outputs": [ + { + "internalType": "contract IOPP", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingConsensus", + "outputs": [ + { + "internalType": "uint32", + "name": "nextEpoch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "deliveries", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "groupSize", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "currentEpochStartedAtTs", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "epochDurationSec_", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "pendingConsensusForDigest", + "outputs": [ + { + "internalType": "uint32", + "name": "nextEpoch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "agreeing", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "groupSize", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "currentEpochStartedAtTs", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "epochDurationSec_", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingEpoch", + "outputs": [ + { + "internalType": "bytes", + "name": "envelopeHash", + "type": "bytes" + }, + { + "components": [ + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "start", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "end", + "type": "tuple" + } + ], + "internalType": "struct Endpoints", + "name": "endpoints", + "type": "tuple" + }, + { + "internalType": "uint64", + "name": "epochTimestamp", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "epochEnvelopeIndex", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingEpochHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingMessageCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "previousEpochHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "pruneInboundEnvelope", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pubkeyAddressCache", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserveManagerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rosterInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "address", + "name": "handler", + "type": "address" + } + ], + "name": "setAttestationHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "setEnvelopeRetentionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "durationSec", + "type": "uint32" + } + ], + "name": "setEpochDurationSec", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "opp", + "type": "address" + } + ], + "name": "setOPPContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newReserveManager", + "type": "address" + } + ], + "name": "setReserveManagerAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/OperatorRegistry.json b/packages/sdk-outpost/src/assets/ethereum/sim2/OperatorRegistry.json new file mode 100644 index 0000000..9a933b2 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2/OperatorRegistry.json @@ -0,0 +1,1657 @@ +{ + "contractName": "OperatorRegistry", + "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "provided", + "type": "address" + } + ], + "name": "WIRE_BadContractAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "bps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBps", + "type": "uint256" + } + ], + "name": "WIRE_BasisPointsTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20DepositValueNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20TransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_EthSendFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_FeeOnTransferUnsupported", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_GoLiveInProgress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + } + ], + "name": "WIRE_InsufficientEthBalance", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_InvalidPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_LiqEthTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_MultipleNativeTrackedCodes", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NativeDepositValueMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + } + ], + "name": "WIRE_NoBonds", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoPricesRecorded", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoYield", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_NotReceiptOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_OnlyOPPInboundLib", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OppInboundCallerUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OutpostChainCodeUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "innerRevert", + "type": "bytes" + } + ], + "name": "WIRE_PermitFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_PrecisionOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_PrecisionUnsetForRefund", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "WIRE_PriceOutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + } + ], + "name": "WIRE_ReceiptNotWithdrawable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingInProgress", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveBadParam", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveCancelNotCreator", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveNotCancellable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapEmptyRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceNotNative", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceReserveUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_SwapSourceTokenNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapUnknownSlugName", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapZeroSourceAmount", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TokenAddressUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "provided", + "type": "uint8" + } + ], + "name": "WIRE_TokenPrecisionOutOfRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_TokenPrecisionUnset", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TrackedCodeZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "WIRE_UnexpectedError", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ZeroAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "refundedToDepositor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "penaltyToReserve", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "originalMessageId", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "DepositReverted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "LiqTokenCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "NativeTokenCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "OperatorDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "reserveTarget", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "OperatorSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "OutpostChainCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underwriter", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "uicBytes", + "type": "bytes" + } + ], + "name": "UnderwriteCommitRelayed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "requestId", + "type": "uint64" + } + ], + "name": "WithdrawRemitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "requestId", + "type": "uint64" + } + ], + "name": "WithdrawRequested", + "type": "event" + }, + { + "inputs": [], + "name": "DEPOSIT_REVERT_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEPOSIT_REVERT_GAS_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OPERATOR_ACTION_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OPPAttestationIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERWRITE_INTENT_COMMIT_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "__OPPEndpointManaged_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "uicBytes", + "type": "bytes" + } + ], + "name": "commit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "compressedPubkey", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "compressedPubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositNonNative", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "depositedByCode", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSummaryAttestations", + "outputs": [ + { + "components": [ + { + "internalType": "AttestationType", + "name": "type_", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "dataSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct AttestationEntry[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liqToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liqTokenCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeTokenCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "operators", + "outputs": [ + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "internalType": "OperatorStatus", + "name": "status", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppInboundAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outpostChainCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outpostId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserveManagerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_liqToken", + "type": "address" + } + ], + "name": "setLiqToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "setLiqTokenCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "setNativeTokenCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oppAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_oppInboundAddress", + "type": "address" + } + ], + "name": "setOPPAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "setOutpostChainCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_outpostId", + "type": "uint64" + } + ], + "name": "setOutpostId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_reserveManager", + "type": "address" + } + ], + "name": "setReserveManagerAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "compressedPubkey", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/ReserveManager.json b/packages/sdk-outpost/src/assets/ethereum/sim2/ReserveManager.json new file mode 100644 index 0000000..6d60a0f --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2/ReserveManager.json @@ -0,0 +1,2456 @@ +{ + "contractName": "ReserveManager", + "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "provided", + "type": "address" + } + ], + "name": "WIRE_BadContractAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "bps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBps", + "type": "uint256" + } + ], + "name": "WIRE_BasisPointsTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20DepositValueNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20TransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_EthSendFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_FeeOnTransferUnsupported", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_GoLiveInProgress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + } + ], + "name": "WIRE_InsufficientEthBalance", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_InvalidPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_LiqEthTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_MultipleNativeTrackedCodes", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NativeDepositValueMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + } + ], + "name": "WIRE_NoBonds", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoPricesRecorded", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoYield", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_NotReceiptOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_OnlyOPPInboundLib", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OppInboundCallerUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OutpostChainCodeUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "innerRevert", + "type": "bytes" + } + ], + "name": "WIRE_PermitFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_PrecisionOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_PrecisionUnsetForRefund", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "WIRE_PriceOutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + } + ], + "name": "WIRE_ReceiptNotWithdrawable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingInProgress", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveBadParam", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveCancelNotCreator", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveNotCancellable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapEmptyRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceNotNative", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceReserveUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_SwapSourceTokenNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapUnknownSlugName", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapZeroSourceAmount", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TokenAddressUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "provided", + "type": "uint8" + } + ], + "name": "WIRE_TokenPrecisionOutOfRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_TokenPrecisionUnset", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TrackedCodeZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "WIRE_UnexpectedError", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ZeroAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "BalanceSheetEmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Deposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "OutpostChainCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "ReserveActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "name": "ReserveCancelRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "refundedAmount", + "type": "uint256" + } + ], + "name": "ReserveCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + } + ], + "name": "ReserveCreateRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "id", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "name": "SwapDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalMessageId", + "type": "bytes32" + } + ], + "name": "SwapRemitPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "depotAmount", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "SwapRemitUnpayable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "name": "SwapRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalSwapMessageId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "errData", + "type": "bytes" + } + ], + "name": "SwapRevertError", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalSwapMessageId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "SwapReverted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "TokenAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TrackedCodesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [], + "name": "BALANCE_SHEET_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OPPAttestationIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_CREATE_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_CREATE_CANCEL_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SWAP_REQUEST_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "__OPPEndpointManaged_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_payRemit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "cancel_create_reserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "bool", + "name": "isPrivate", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "creatorPubKey", + "type": "bytes" + } + ], + "name": "create_reserve", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "emitBalanceSheet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "getReserve", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "enum ReserveManager.LocalReserveStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "bool", + "name": "exists", + "type": "bool" + } + ], + "internalType": "struct ReserveManager.ReserveRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSummaryAttestations", + "outputs": [ + { + "components": [ + { + "internalType": "AttestationType", + "name": "type_", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "dataSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct AttestationEntry[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeTokenCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "onReserveCreateCancelled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "onReserveReady", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "depotAmount", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "originalSwapMessageId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "onSwapRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oppAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppInboundAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outpostChainCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "bool", + "name": "isPrivate", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "creatorPubKey", + "type": "bytes" + } + ], + "internalType": "struct ReserveManagerLib.ReserveCreateArgs", + "name": "args", + "type": "tuple" + } + ], + "name": "requestReserveCreateErc20WithApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "bool", + "name": "isPrivate", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "creatorPubKey", + "type": "bytes" + } + ], + "internalType": "struct ReserveManagerLib.ReserveCreateArgs", + "name": "args", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct ReserveManagerLib.PermitSig", + "name": "permitSig", + "type": "tuple" + } + ], + "name": "requestReserveCreateErc20WithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "name": "requestSwap", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "internalType": "struct ReserveManagerLib.SwapArgs", + "name": "args", + "type": "tuple" + } + ], + "name": "requestSwapErc20WithApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "internalType": "struct ReserveManagerLib.SwapArgs", + "name": "args", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct ReserveManagerLib.PermitSig", + "name": "permitSig", + "type": "tuple" + } + ], + "name": "requestSwapErc20WithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "reserves", + "outputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "enum ReserveManager.LocalReserveStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "bool", + "name": "exists", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oppAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_oppInboundAddress", + "type": "address" + } + ], + "name": "setOPPAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "setOutpostChainCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "address", + "name": "tokenAddr", + "type": "address" + }, + { + "internalType": "uint8", + "name": "precision", + "type": "uint8" + } + ], + "internalType": "struct ReserveManager.TrackedCodeEntry[]", + "name": "entries", + "type": "tuple[]" + } + ], + "name": "setTrackedCodes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapDepositCounter", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "tokenAddressesByCode", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "tokenPrecisionByCode", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "trackedCodesCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "trackedReserveCodes", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "trackedTokenCodes", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/solana/sim2/liqsol_core.json b/packages/sdk-outpost/src/assets/solana/sim2/liqsol_core.json new file mode 100644 index 0000000..0e01656 --- /dev/null +++ b/packages/sdk-outpost/src/assets/solana/sim2/liqsol_core.json @@ -0,0 +1,10161 @@ +{ + "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + "metadata": { + "name": "liqsol_core", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "add_attestation", + "discriminator": [ + 206, + 82, + 129, + 170, + 54, + 159, + 161, + 156 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "outbound_message_buffer", + "writable": true + } + ], + "args": [ + { + "name": "attestation_type", + "type": "i32" + }, + { + "name": "data", + "type": "bytes" + } + ] + }, + { + "name": "add_top_performers_batch", + "docs": [ + "Process batch of ranks for addition (top performers from leaderboard)" + ], + "discriminator": [ + 152, + 7, + 241, + 69, + 197, + 73, + 32, + 12 + ], + "accounts": [ + { + "name": "allocation_state", + "writable": true + }, + { + "name": "active_list", + "writable": true + }, + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "leaderboard_state" + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for threshold parameters" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "admin_force_unbond_role", + "discriminator": [ + 80, + 107, + 27, + 49, + 126, + 25, + 31, + 238 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state" + }, + { + "name": "user", + "docs": [ + "The user whose role bond is being force-unbonded" + ] + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "aggregate_stake_metrics", + "docs": [ + "V2: Aggregate stake metrics across all validators using PDA architecture" + ], + "discriminator": [ + 13, + 245, + 47, + 202, + 170, + 73, + 98, + 207 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list" + } + ], + "args": [] + }, + { + "name": "bond_role", + "discriminator": [ + 143, + 136, + 20, + 230, + 136, + 103, + 107, + 167 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state" + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "calculate_unstake_allocations", + "docs": [ + "Calculate unstake allocations across validators (batched, up to 10 per call)", + "Distributes the FROZEN processing amount proportionally based on active stake", + "Call this after accumulating requests via accumulate_unstake_request" + ], + "discriminator": [ + 156, + 232, + 48, + 116, + 107, + 60, + 136, + 140 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - to track unstake allocation batching" + ], + "writable": true + }, + { + "name": "stake_metrics", + "docs": [ + "Stake metrics - to validate total unstake amount is available" + ] + }, + { + "name": "active_list", + "docs": [ + "Active validator list - to verify validators are in active list" + ] + }, + { + "name": "maintenance_ledger", + "docs": [ + "Maintenance ledger - to track last unstake allocation epoch" + ], + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + } + ], + "args": [] + }, + { + "name": "calculate_validator_allocations", + "discriminator": [ + 48, + 217, + 8, + 168, + 228, + 221, + 140, + 112 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - to track rebalancing progress" + ], + "writable": true + }, + { + "name": "stake_metrics", + "docs": [ + "Stake metrics - to get current total active stake" + ] + }, + { + "name": "active_list", + "docs": [ + "Active validator list - to verify validators are in active list" + ] + }, + { + "name": "reserve_pool", + "docs": [ + "Reserve pool - to read current balance" + ], + "writable": true + }, + { + "name": "maintenance_ledger", + "docs": [ + "Maintenance ledger - to track last rebalance epoch" + ], + "writable": true + }, + { + "name": "clock" + }, + { + "name": "global", + "docs": [ + "Global withdraw operator state - to read total_encumbered_funds" + ] + }, + { + "name": "global_config", + "docs": [ + "Global config for rebalancing thresholds" + ] + } + ], + "args": [] + }, + { + "name": "cancel_create_reserve", + "discriminator": [ + 218, + 158, + 127, + 156, + 61, + 162, + 19, + 255 + ], + "accounts": [ + { + "name": "creator", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve" + }, + { + "name": "outbound_message_buffer", + "writable": true + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + } + ] + }, + { + "name": "claim_rewards", + "discriminator": [ + 4, + 144, + 132, + 71, + 116, + 23, + 151, + 80 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_mint" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account holding liqSOL" + ], + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "claim_withdraw", + "docs": [ + "Pay user (stub) and close/burn the receipt via CPI to nft_factory." + ], + "discriminator": [ + 232, + 89, + 154, + 117, + 16, + 204, + 182, + 224 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global", + "docs": [ + "Global operator state" + ], + "writable": true + }, + { + "name": "mint_authority" + }, + { + "name": "receipt_data", + "writable": true + }, + { + "name": "mint_account", + "writable": true + }, + { + "name": "owner_ata", + "writable": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "global_config", + "docs": [ + "Global config for claim_withdrawals_enabled check" + ] + }, + { + "name": "token_program" + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "associated_token_program" + } + ], + "args": [] + }, + { + "name": "cleanup_envelope_chunks", + "discriminator": [ + 224, + 118, + 156, + 99, + 9, + 136, + 14, + 207 + ], + "accounts": [ + { + "name": "reaper", + "signer": true + }, + { + "name": "config" + }, + { + "name": "latest_outbound_envelope" + }, + { + "name": "chunk_buffer", + "writable": true + }, + { + "name": "uploader", + "writable": true + } + ], + "args": [ + { + "name": "epoch_index", + "type": "u32" + } + ] + }, + { + "name": "cleanup_graveyard_batch", + "docs": [ + "Cleanup graveyard validators batch: remove validators that have been NotDelegated for > 10 epochs", + "This function should be called after aggregate_stake_metrics.", + "Validators meeting the cleanup criteria will have their PDAs closed and rent returned to admin." + ], + "discriminator": [ + 241, + 120, + 180, + 4, + 160, + 109, + 206, + 71 + ], + "accounts": [ + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "global_config" + }, + { + "name": "clock" + }, + { + "name": "cranky", + "writable": true, + "signer": true + } + ], + "args": [] + }, + { + "name": "commit_underwrite", + "discriminator": [ + 88, + 172, + 141, + 118, + 9, + 74, + 188, + 117 + ], + "accounts": [ + { + "name": "underwriter", + "writable": true, + "signer": true + }, + { + "name": "operator_registry" + }, + { + "name": "outbound_message_buffer", + "writable": true + } + ], + "args": [ + { + "name": "uic_bytes", + "type": "bytes" + } + ] + }, + { + "name": "complete_unbond_role", + "discriminator": [ + 204, + 50, + 36, + 17, + 192, + 156, + 246, + 64 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state" + }, + { + "name": "user", + "docs": [ + "The user whose unbond is being completed" + ] + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "complete_withdraw", + "discriminator": [ + 172, + 129, + 141, + 17, + 95, + 253, + 251, + 98 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "user", + "writable": true + }, + { + "name": "outpost_account", + "writable": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "user_key", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "conclude_merge_activating", + "docs": [ + "Conclude merge activating - marks merge complete if all validators processed or 0 validators" + ], + "discriminator": [ + 207, + 32, + 222, + 98, + 243, + 188, + 38, + 67 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "graveyard_list" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "conclude_merge_deactivating", + "docs": [ + "Conclude merge deactivating - marks merge complete if all validators processed or 0 validators" + ], + "discriminator": [ + 66, + 206, + 43, + 71, + 122, + 97, + 33, + 24 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "withdraw_global", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "graveyard_list" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "conclude_sync_stakes", + "docs": [ + "Conclude sync stakes - marks sync complete if all validators processed or 0 validators" + ], + "discriminator": [ + 77, + 127, + 231, + 78, + 151, + 23, + 237, + 207 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "graveyard_list" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "create_reserve", + "discriminator": [ + 26, + 161, + 211, + 19, + 90, + 218, + 112, + 235 + ], + "accounts": [ + { + "name": "creator", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "reserve_vault", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "creator_ata", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "description", + "type": "string" + }, + { + "name": "is_private", + "type": "bool" + } + ] + }, + { + "name": "create_reserve_native", + "discriminator": [ + 124, + 173, + 189, + 251, + 64, + 230, + 215, + 6 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "description", + "type": "string" + } + ] + }, + { + "name": "create_reserve_spl_authority", + "discriminator": [ + 168, + 158, + 192, + 109, + 179, + 81, + 156, + 173 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "reserve_vault", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "authority_ata", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "description", + "type": "string" + } + ] + }, + { + "name": "deposit", + "discriminator": [ + 242, + 35, + 198, + 137, + 82, + 225, + 242, + 182 + ], + "accounts": [ + { + "name": "depositor", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "operator_type", + "type": "u32" + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "deposit_non_native", + "discriminator": [ + 75, + 182, + 44, + 132, + 167, + 101, + 31, + 138 + ], + "accounts": [ + { + "name": "depositor", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "depositor_ata", + "writable": true + }, + { + "name": "collateral_vault", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "chain_code", + "type": "u64" + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "operator_type", + "type": "u32" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "deposit_to_reserve", + "discriminator": [ + 8, + 79, + 123, + 129, + 146, + 140, + 178, + 128 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "depositor", + "writable": true, + "signer": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "ephemeral_stake", + "writable": true + }, + { + "name": "controller_state" + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "seed", + "type": "u32" + } + ] + }, + { + "name": "desynd", + "discriminator": [ + 12, + 71, + 102, + 46, + 8, + 179, + 29, + 190 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "outpost_account", + "docs": [ + "User's outpost account" + ], + "writable": true + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "discard_envelope_chunks", + "discriminator": [ + 180, + 10, + 216, + 16, + 101, + 165, + 10, + 70 + ], + "accounts": [ + { + "name": "uploader", + "docs": [ + "The operator that uploaded (and rent-paid) the buffer. Authorization is", + "structural: the buffer PDA's third seed is this signer's key, so the", + "account constraint can only ever resolve the signer's OWN buffer —", + "no other operator's in-flight upload is reachable from here." + ], + "writable": true, + "signer": true + }, + { + "name": "chunk_buffer", + "writable": true + } + ], + "args": [ + { + "name": "epoch_index", + "type": "u32" + } + ] + }, + { + "name": "emit_outbound_envelope", + "discriminator": [ + 142, + 109, + 163, + 152, + 3, + 80, + 224, + 157 + ], + "accounts": [ + { + "name": "authority", + "docs": [ + "The outpost authority. The standalone emit is a recovery escape hatch", + "only — an open signer here could advance the outbound chain tip to a", + "digest the depot never accepted, so it is gated exactly like the other", + "admin instructions. Even the authority is bound by the guards in", + "`emit_outbound_inner`: the emitted epoch must be exactly the next", + "outbound slot AND already accepted by the inbound cursor, so a", + "recovery emit can only fill an accepted-but-unemitted gap and can", + "never preempt a pending epoch's consensus-triggered emit." + ], + "writable": true, + "signer": true + }, + { + "name": "config", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "outbound_envelopes", + "writable": true + }, + { + "name": "latest_outbound_envelope", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "wire_epoch_index", + "type": "u32" + } + ] + }, + { + "name": "epoch_in", + "discriminator": [ + 85, + 70, + 55, + 132, + 50, + 198, + 135, + 115 + ], + "accounts": [ + { + "name": "operator", + "writable": true, + "signer": true + }, + { + "name": "config", + "writable": true + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "epoch_deliveries", + "writable": true + }, + { + "name": "chunk_buffer", + "writable": true + }, + { + "name": "inbound_envelopes", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "outbound_envelopes", + "writable": true + }, + { + "name": "latest_outbound_envelope", + "writable": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "reserve_aggregate", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "chunk_index", + "type": "u16" + }, + { + "name": "total_chunks", + "type": "u16" + }, + { + "name": "total_bytes", + "type": "u32" + }, + { + "name": "chunk_data", + "type": "bytes" + } + ] + }, + { + "name": "finalize_outpost_account", + "discriminator": [ + 181, + 14, + 39, + 201, + 210, + 148, + 241, + 187 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "pool_authority" + }, + { + "name": "outpost_account", + "writable": true + }, + { + "name": "pretoken_purchase_history" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "get_min_max_resolved_epoch_deactivations", + "docs": [ + "Get minimum max_resolved_epoch_deactivations from MaintenanceLedger", + "This is designed to be called via CPI from other programs" + ], + "discriminator": [ + 171, + 169, + 39, + 207, + 181, + 67, + 86, + 73 + ], + "accounts": [ + { + "name": "epoch_state" + } + ], + "args": [], + "returns": "u16" + }, + { + "name": "has_role", + "discriminator": [ + 218, + 136, + 44, + 87, + 142, + 247, + 141, + 195 + ], + "accounts": [ + { + "name": "user", + "docs": [ + "User whose role status is being checked." + ] + }, + { + "name": "outpost_account" + }, + { + "name": "global_state" + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ], + "returns": "bool" + }, + { + "name": "init_bucket", + "docs": [ + "Done///" + ], + "discriminator": [ + 237, + 69, + 61, + 218, + 18, + 60, + 21, + 236 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "liqsol_mint" + }, + { + "name": "system_program" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + } + ], + "args": [] + }, + { + "name": "init_reserve", + "discriminator": [ + 138, + 245, + 71, + 225, + 153, + 4, + 3, + 43 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve_aggregate", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "init_tranche_state", + "discriminator": [ + 87, + 134, + 47, + 11, + 241, + 14, + 118, + 201 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "chainlink_feed" + }, + { + "name": "chainlink_program" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "init_wire_config", + "discriminator": [ + 109, + 159, + 158, + 174, + 192, + 150, + 14, + 34 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize", + "discriminator": [ + 175, + 175, + 109, + 31, + 13, + 152, + 155, + 237 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint" + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "pool_authority" + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [] + }, + { + "name": "initialize_active_list", + "docs": [ + "Initialize the active validator list (zero-copy)" + ], + "discriminator": [ + 222, + 123, + 57, + 119, + 223, + 4, + 150, + 36 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "active_list", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_epoch_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 139, + 122, + 53, + 254, + 85, + 205, + 138, + 245 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_global_config", + "discriminator": [ + 113, + 216, + 122, + 131, + 225, + 209, + 22, + 55 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "program" + }, + { + "name": "program_data" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_graveyard_list", + "docs": [ + "Initialize the graveyard validator list (zero-copy)" + ], + "discriminator": [ + 178, + 8, + 179, + 111, + 75, + 19, + 130, + 176 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_outpost", + "discriminator": [ + 9, + 54, + 169, + 104, + 32, + 218, + 81, + 11 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "config", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "inbound_envelopes", + "writable": true + }, + { + "name": "outbound_envelopes", + "writable": true + }, + { + "name": "latest_outbound_envelope", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "chain_code", + "type": "u64" + } + ] + }, + { + "name": "initialize_pay_rate_history", + "docs": [ + "Done///" + ], + "discriminator": [ + 157, + 190, + 74, + 135, + 91, + 232, + 250, + 122 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "pay_rate_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_payout_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 105, + 120, + 7, + 121, + 238, + 221, + 62, + 160 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "payout_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_pretoken_purchase_history", + "docs": [ + "Admin-only: initialize PretokenPurchaseHistory PDA for a pool" + ], + "discriminator": [ + 140, + 166, + 196, + 128, + 189, + 240, + 159, + 1 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "pool_pretoken_record", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_processing_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 228, + 202, + 164, + 194, + 29, + 134, + 125, + 242 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_reserve_pool", + "docs": [ + "Done///" + ], + "discriminator": [ + 4, + 7, + 171, + 131, + 156, + 172, + 150, + 220 + ], + "accounts": [ + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "controller_state", + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [] + }, + { + "name": "initialize_stake_allocation_state", + "discriminator": [ + 159, + 99, + 175, + 136, + 251, + 241, + 88, + 82 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "writable": true + }, + { + "name": "clock" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_stake_controller_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 220, + 247, + 13, + 165, + 202, + 250, + 102, + 197 + ], + "accounts": [ + { + "name": "controller_state", + "writable": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_stake_metrics", + "docs": [ + "Done///" + ], + "discriminator": [ + 203, + 209, + 129, + 123, + 12, + 17, + 20, + 175 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_vault", + "docs": [ + "Done///" + ], + "discriminator": [ + 48, + 191, + 163, + 44, + 71, + 129, + 63, + 164 + ], + "accounts": [ + { + "name": "vault", + "writable": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "controller_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_withdraw_global", + "discriminator": [ + 110, + 0, + 210, + 101, + 59, + 75, + 224, + 158 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "docs": [ + "liqSOL Token-2022 mint" + ] + }, + { + "name": "global", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [] + }, + { + "name": "initialize_withdraw_metadata", + "discriminator": [ + 0, + 170, + 135, + 3, + 35, + 58, + 213, + 75 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "metadata", + "writable": true + }, + { + "name": "global_config" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": { + "name": "MetadataArgs" + } + } + } + ] + }, + { + "name": "merge_activating_stakes", + "docs": [ + "V2: Merge activating transient stakes using PDA architecture", + "Returns the number of epochs successfully merged" + ], + "discriminator": [ + 181, + 183, + 76, + 92, + 57, + 11, + 212, + 189 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "treasury", + "docs": [ + "(treasury funded it at creation), closing the rent loop within the protocol." + ], + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validators list (zero-copy)" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validators list (zero-copy) - needed to check validators in cooldown" + ] + }, + { + "name": "validator_info", + "docs": [ + "Validator info PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "validator_transient", + "docs": [ + "Validator transient tracking PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + } + ], + "args": [ + { + "name": "vote_account", + "type": "pubkey" + } + ], + "returns": "u16" + }, + { + "name": "merge_deactivated_stakes", + "docs": [ + "V2: Merge fully deactivated stakes back to reserve" + ], + "discriminator": [ + 160, + 255, + 180, + 104, + 216, + 98, + 248, + 73 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "cranky", + "signer": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validators list (zero-copy)" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validators list (zero-copy) - needed to check validators in cooldown" + ] + }, + { + "name": "validator_info", + "docs": [ + "Validator info PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "validator_transient", + "docs": [ + "Validator transient tracking PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "withdraw_global", + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "reserve_pool", + "docs": [ + "(principal stays). The merged-in rent is then withdrawn to treasury." + ], + "writable": true + }, + { + "name": "treasury", + "docs": [ + "back from reserve, closing the rent loop (treasury funded it at creation)." + ], + "writable": true + } + ], + "args": [ + { + "name": "vote_account", + "type": "pubkey" + } + ] + }, + { + "name": "migrate_batch_orchestrator", + "docs": [ + "One-shot migration: realloc BatchOrchestrator for the four per-op", + "`*_started_epoch: u16` fields + restored `_reserved` buffer.", + "Idempotent, ungated. `payer` covers the rent delta." + ], + "discriminator": [ + 130, + 240, + 40, + 175, + 53, + 209, + 232, + 11 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "batch_orchestrator", + "docs": [ + "is the only authorization needed; the op is idempotent." + ], + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "migrate_batch_orchestrator_v1_6", + "docs": [ + "One-shot migration: stamp BatchOrchestrator's v1.6.0 epoch pins", + "(unstake_started_epoch + cursors_epoch) to the current epoch so a", + "mid-epoch upgrade doesn't wipe live cursors. Admin-gated, idempotent", + "within an epoch; refuses re-runs after an epoch boundary (a late", + "re-stamp would bless dead cursors as live)." + ], + "discriminator": [ + 124, + 12, + 96, + 155, + 218, + 4, + 229, + 56 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "batch_orchestrator", + "writable": true + } + ], + "args": [] + }, + { + "name": "migrate_stake_allocation_state", + "docs": [ + "One-shot migration: explicitly zero StakeAllocationState.rebalance_started_epoch", + "(repurposed from the deprecated addition_target_rank slot). Admin-gated, idempotent." + ], + "discriminator": [ + 40, + 175, + 21, + 85, + 88, + 249, + 223, + 73 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "writable": true + } + ], + "args": [] + }, + { + "name": "migrate_stake_metrics", + "docs": [ + "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)" + ], + "discriminator": [ + 183, + 154, + 168, + 221, + 78, + 179, + 112, + 165 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "migrate_user_record", + "discriminator": [ + 6, + 118, + 249, + 178, + 209, + 106, + 197, + 25 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "user_ata" + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "migrate_validator_info_batch", + "docs": [ + "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)", + "Pass validator_info PDAs via remaining_accounts" + ], + "discriminator": [ + 250, + 77, + 53, + 116, + 38, + 22, + 12, + 100 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "process_graveyard_validators_batch", + "docs": [ + "Process graveyard validators batch: check transient resolution, queue main stake deactivation", + "Validators in graveyard with resolved transients will have their main stake queued for deactivation" + ], + "discriminator": [ + 141, + 178, + 8, + 118, + 133, + 183, + 86, + 233 + ], + "accounts": [ + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "clock" + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "process_pay_cycle", + "docs": [ + "Done///" + ], + "discriminator": [ + 98, + 183, + 240, + 247, + 39, + 248, + 198, + 224 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "payout_state", + "writable": true + }, + { + "name": "pay_rate_history", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "stake_controller_authority", + "writable": true + }, + { + "name": "mint_authority" + }, + { + "name": "liqsol_program" + }, + { + "name": "token_program" + }, + { + "name": "instructions" + }, + { + "name": "global_config", + "docs": [ + "Global config for process_pay_cycle_enabled check" + ] + } + ], + "args": [] + }, + { + "name": "process_stake_orders", + "docs": [ + "V2: Process stake orders using PDA architecture with pre-calculated allocations", + "Validators must be sent contiguously from the active list starting at validators_processed_this_epoch" + ], + "discriminator": [ + 92, + 161, + 223, + 219, + 54, + 232, + 40, + 16 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "treasury", + "docs": [ + "(system transfer, treasury signs). Falls back to admin only if treasury is dry." + ], + "writable": true + }, + { + "name": "vault" + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validator list - used to get total validator count" + ] + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - to verify allocations have been calculated for current epoch" + ], + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "stake_config" + }, + { + "name": "rent" + }, + { + "name": "global_config", + "docs": [ + "Global config for process_stake_orders_enabled check" + ] + } + ], + "args": [ + { + "name": "caller_funds_rent", + "type": "bool" + } + ] + }, + { + "name": "process_transfer_hook", + "discriminator": [ + 167, + 45, + 151, + 64, + 209, + 186, + 192, + 78 + ], + "accounts": [ + { + "name": "source_token" + }, + { + "name": "destination_token" + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_token_account" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "process_unstake_orders", + "docs": [ + "V2: Process unstake orders by splitting and deactivating stakes", + "Validators must be sent contiguously: first from active list, then graveyard list" + ], + "discriminator": [ + 44, + 122, + 251, + 185, + 253, + 193, + 250, + 191 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "treasury", + "docs": [ + "here (system transfer, treasury signs). Falls back to admin only if dry.", + "Reserve no longer sources rent, so it's not needed by this instruction." + ], + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validator list - used to get total validator count" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validator list - allows unstaking from graveyard validators" + ] + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "stake_config" + }, + { + "name": "rent" + }, + { + "name": "system_program" + }, + { + "name": "stake_program" + }, + { + "name": "global_config", + "docs": [ + "Global config for process_unstake_orders_enabled check" + ] + } + ], + "args": [ + { + "name": "caller_funds_rent", + "type": "bool" + } + ] + }, + { + "name": "purchase", + "discriminator": [ + 21, + 93, + 113, + 154, + 193, + 160, + 242, + 168 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "buyer_ata", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "outpost_account", + "docs": [ + "User's pretoken deposit record" + ], + "writable": true + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "user_pretoken_record", + "writable": true + }, + { + "name": "chainlink_feed" + }, + { + "name": "chainlink_program" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + }, + { + "name": "pretoken_purchase_history", + "writable": true + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "purchase_from_yield", + "discriminator": [ + 232, + 143, + 47, + 77, + 246, + 113, + 31, + 202 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "liqsol_mint" + }, + { + "name": "pool_authority", + "docs": [ + "Pool authority PDA" + ] + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "liqsol_pool_ata", + "docs": [ + "Pool's liqSOL ATA - deterministically derived from pool_authority + liqsol_mint" + ], + "writable": true + }, + { + "name": "liqsol_pool_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "pool_pretoken_record", + "writable": true + }, + { + "name": "chainlink_feed" + }, + { + "name": "chainlink_program" + }, + { + "name": "pretoken_purchase_history", + "writable": true + } + ], + "args": [] + }, + { + "name": "record_price", + "discriminator": [ + 210, + 113, + 46, + 101, + 107, + 218, + 83, + 51 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "tranche_state" + }, + { + "name": "price_history", + "writable": true + }, + { + "name": "chainlink_program" + }, + { + "name": "chainlink_feed" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "refresh_stake_metrics_post_late_epoch", + "docs": [ + "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)", + "Requires Distribution + UnstakeOrder as prerequisites", + "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch" + ], + "discriminator": [ + 11, + 226, + 87, + 114, + 47, + 159, + 99, + 157 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + } + ], + "args": [] + }, + { + "name": "refresh_stake_metrics_post_sync", + "docs": [ + "V2: Refresh stake metrics after removal selection + PDA setup", + "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites", + "Tracks completion in last_post_sync_stake_metrics_refresh_epoch" + ], + "discriminator": [ + 177, + 250, + 32, + 155, + 196, + 199, + 199, + 249 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + } + ], + "args": [] + }, + { + "name": "refund", + "discriminator": [ + 2, + 96, + 183, + 251, + 63, + 208, + 46, + 46 + ], + "accounts": [ + { + "name": "associated_token_program" + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "outpost_account", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "refund_liqsol_ata", + "writable": true + }, + { + "name": "liqsol_pool_user_record", + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_mint" + }, + { + "name": "token_program" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "register_system_pda", + "discriminator": [ + 110, + 93, + 36, + 156, + 179, + 69, + 54, + 210 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "pda_owner", + "docs": [ + "The PDA whose user record we're creating — must be system-owned (no program data)." + ] + }, + { + "name": "pda_ata" + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account holding liqSOL (for index sync)" + ], + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "register_user", + "discriminator": [ + 2, + 241, + 150, + 223, + 99, + 214, + 116, + 97 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "user_ata" + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account holding liqSOL (for index sync)" + ], + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "remove_low_performers_batch", + "docs": [ + "Process batch of validators for removal (below exit threshold)" + ], + "discriminator": [ + 91, + 142, + 166, + 98, + 245, + 245, + 159, + 44 + ], + "accounts": [ + { + "name": "active_list", + "writable": true + }, + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "allocation_state" + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "request_swap", + "discriminator": [ + 170, + 167, + 97, + 14, + 88, + 175, + 39, + 108 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "source_token_code", + "type": "u64" + }, + { + "name": "source_reserve_code", + "type": "u64" + }, + { + "name": "source_amount", + "type": "u64" + }, + { + "name": "target_chain_code", + "type": "u64" + }, + { + "name": "target_token_code", + "type": "u64" + }, + { + "name": "target_reserve_code", + "type": "u64" + }, + { + "name": "target_recipient", + "type": "bytes" + }, + { + "name": "target_amount", + "type": "u64" + }, + { + "name": "target_tolerance_bps", + "type": "u32" + } + ] + }, + { + "name": "request_swap_spl", + "discriminator": [ + 119, + 83, + 153, + 185, + 164, + 202, + 45, + 38 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "reserve_vault", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "source_token_code", + "type": "u64" + }, + { + "name": "source_reserve_code", + "type": "u64" + }, + { + "name": "source_amount", + "type": "u64" + }, + { + "name": "target_chain_code", + "type": "u64" + }, + { + "name": "target_token_code", + "type": "u64" + }, + { + "name": "target_reserve_code", + "type": "u64" + }, + { + "name": "target_recipient", + "type": "bytes" + }, + { + "name": "target_amount", + "type": "u64" + }, + { + "name": "target_tolerance_bps", + "type": "u32" + } + ] + }, + { + "name": "request_unbond_role", + "discriminator": [ + 223, + 225, + 84, + 83, + 115, + 183, + 80, + 33 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state" + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "request_withdraw", + "discriminator": [ + 137, + 95, + 187, + 96, + 250, + 138, + 31, + 182 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "owner", + "docs": [ + "Recipient of the NFT receipt (can be user)" + ], + "writable": true + }, + { + "name": "global", + "docs": [ + "Global operator state" + ], + "writable": true + }, + { + "name": "liqsol_mint", + "docs": [ + "liqSOL mint reference (must match Global.liqsol_mint so we can read decimals)" + ], + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "docs": [ + "Distribution state for index tracking" + ], + "writable": true + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's token account holding liqSOL (for sync_index balance)" + ], + "writable": true + }, + { + "name": "reserve_pool", + "docs": [ + "Reserve pool - to check available balance for instant withdrawals" + ], + "writable": true + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - for accumulate_unstake_request" + ], + "writable": true + }, + { + "name": "stake_metrics", + "docs": [ + "Stake metrics - for accumulate_unstake_request" + ] + }, + { + "name": "maintenance_ledger", + "docs": [ + "Maintenance ledger - for accumulate_unstake_request" + ] + }, + { + "name": "global_config", + "docs": [ + "Global config for min_unstake_request setting" + ] + }, + { + "name": "clock" + }, + { + "name": "mint_authority" + }, + { + "name": "receipt_data", + "writable": true + }, + { + "name": "metadata", + "writable": true + }, + { + "name": "nft_mint", + "docs": [ + "Uses global.next_receipt_id for deterministic, collision-free address generation" + ], + "writable": true + }, + { + "name": "nft_ata", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "token_interface" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "set_admin", + "discriminator": [ + 251, + 163, + 0, + 52, + 91, + 194, + 187, + 92 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + }, + { + "name": "new_authority" + } + ], + "args": [] + }, + { + "name": "set_cranky", + "discriminator": [ + 232, + 48, + 178, + 74, + 194, + 60, + 143, + 164 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + }, + { + "name": "new_authority" + } + ], + "args": [] + }, + { + "name": "set_paused", + "discriminator": [ + 91, + 60, + 125, + 192, + 176, + 225, + 166, + 218 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "paused", + "type": "bool" + } + ] + }, + { + "name": "set_retention_config", + "discriminator": [ + 224, + 115, + 230, + 164, + 16, + 100, + 30, + 234 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config", + "writable": true + } + ], + "args": [ + { + "name": "retention_epochs", + "type": "u32" + } + ] + }, + { + "name": "set_role_principal", + "discriminator": [ + 33, + 199, + 203, + 50, + 60, + 167, + 90, + 92 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + }, + { + "name": "principal", + "type": "u64" + } + ] + }, + { + "name": "set_role_warmup_duration", + "discriminator": [ + 229, + 188, + 179, + 162, + 56, + 173, + 228, + 68 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "duration_seconds", + "type": "i64" + } + ] + }, + { + "name": "set_token_address", + "discriminator": [ + 231, + 130, + 7, + 149, + 155, + 155, + 110, + 53 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config", + "writable": true + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + } + ] + }, + { + "name": "set_token_precision", + "discriminator": [ + 202, + 218, + 56, + 157, + 228, + 15, + 175, + 107 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config", + "writable": true + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "decimals", + "type": "u8" + } + ] + }, + { + "name": "set_wire_state", + "discriminator": [ + 62, + 194, + 254, + 126, + 251, + 69, + 35, + 228 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "wire_state", + "type": { + "defined": { + "name": "WireState" + } + } + } + ] + }, + { + "name": "setup_validator_pdas_batch", + "discriminator": [ + 115, + 37, + 9, + 246, + 144, + 224, + 178, + 79 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "active_list", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "allocation_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "system_program", + "docs": [ + "Needed for manual PDA creation" + ] + } + ], + "args": [] + }, + { + "name": "slash_bond", + "discriminator": [ + 143, + 246, + 51, + 243, + 88, + 198, + 217, + 48 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "user", + "docs": [ + "The user being slashed" + ] + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [] + }, + { + "name": "sol_to_liqsol", + "discriminator": [ + 250, + 110, + 1, + 100, + 71, + 3, + 235, + 113 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "deposit_authority", + "writable": true + }, + { + "name": "system_program" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "liqsol_program" + }, + { + "name": "pay_rate_history" + }, + { + "name": "stake_program" + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "liqsol_mint_authority" + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "ephemeral_stake", + "writable": true + }, + { + "name": "controller_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for deposit settings" + ] + }, + { + "name": "payout_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account" + ], + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "instructions_sysvar" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "seed", + "type": "u32" + } + ] + }, + { + "name": "sync_active_scores", + "discriminator": [ + 38, + 188, + 30, + 93, + 139, + 1, + 140, + 168 + ], + "accounts": [ + { + "name": "active_list", + "writable": true + }, + { + "name": "leaderboard_state" + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "sync_leaderboard_scores_batch", + "docs": [ + "region: Validator Leaderboard Syncing" + ], + "discriminator": [ + 52, + 11, + 210, + 173, + 90, + 5, + 48, + 50 + ], + "accounts": [ + { + "name": "leaderboard_state" + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "sync_main_stake_accounts", + "docs": [ + "V2: Sync main stake accounts using PDA architecture (batched)", + "Processes validators in batches via remaining_accounts (batch size is enforced client-side)", + "Note: Only syncs primary delegated stakes, not transient stakes" + ], + "discriminator": [ + 159, + 17, + 201, + 39, + 89, + 62, + 65, + 135 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "docs": [ + "Processing state for tracking batch progress" + ], + "writable": true + }, + { + "name": "epoch_state", + "docs": [ + "Epoch state to mark completion" + ], + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validator list - to check validator counts and membership" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validator list - graveyard validators also need syncing for merge operations" + ] + }, + { + "name": "stake_history" + }, + { + "name": "vault", + "writable": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "sync_validator_selection_thresholds", + "docs": [ + "Calculate and store entry/exit thresholds from validator leaderboard" + ], + "discriminator": [ + 102, + 171, + 32, + 136, + 205, + 105, + 208, + 225 + ], + "accounts": [ + { + "name": "leaderboard_state" + }, + { + "name": "allocation_state", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for min_vpp_entry and min_vpp_exit" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "synd", + "discriminator": [ + 153, + 175, + 231, + 40, + 44, + 65, + 175, + 172 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "outpost_account", + "docs": [ + "User's pretoken deposit record" + ], + "writable": true + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "update_config_bool", + "discriminator": [ + 79, + 36, + 65, + 239, + 188, + 35, + 13, + 160 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyBool" + } + } + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "update_config_u16", + "discriminator": [ + 149, + 9, + 244, + 25, + 46, + 136, + 59, + 173 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyU16" + } + } + }, + { + "name": "value", + "type": "u16" + } + ] + }, + { + "name": "update_config_u64", + "discriminator": [ + 120, + 43, + 124, + 106, + 97, + 80, + 208, + 123 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyU64" + } + } + }, + { + "name": "value", + "type": "u64" + } + ] + }, + { + "name": "update_config_u8", + "discriminator": [ + 17, + 160, + 31, + 134, + 222, + 250, + 229, + 253 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyU8" + } + } + }, + { + "name": "value", + "type": "u8" + } + ] + }, + { + "name": "update_growth_parameters", + "discriminator": [ + 172, + 187, + 237, + 233, + 250, + 160, + 115, + 239 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "price_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "supply_growth_bps", + "type": "u16" + }, + { + "name": "price_growth_cents", + "type": "u16" + } + ] + }, + { + "name": "update_price_bounds", + "discriminator": [ + 241, + 116, + 141, + 65, + 61, + 95, + 232, + 28 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "price_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "min_price_usd", + "type": "u64" + }, + { + "name": "max_price_usd", + "type": "u64" + }, + { + "name": "max_staleness_seconds", + "type": "i64" + } + ] + } + ], + "accounts": [ + { + "name": "BatchOrchestrator", + "discriminator": [ + 70, + 163, + 206, + 225, + 7, + 189, + 73, + 94 + ] + }, + { + "name": "DistributionState", + "discriminator": [ + 7, + 25, + 94, + 15, + 208, + 170, + 4, + 103 + ] + }, + { + "name": "EnvelopeChunks", + "discriminator": [ + 51, + 126, + 62, + 161, + 85, + 175, + 66, + 63 + ] + }, + { + "name": "EnvelopeLog", + "discriminator": [ + 73, + 107, + 128, + 29, + 76, + 210, + 155, + 113 + ] + }, + { + "name": "EpochDeliveries", + "discriminator": [ + 134, + 83, + 77, + 28, + 26, + 189, + 174, + 190 + ] + }, + { + "name": "Global", + "discriminator": [ + 167, + 232, + 232, + 177, + 200, + 108, + 114, + 127 + ] + }, + { + "name": "GlobalConfig", + "discriminator": [ + 149, + 8, + 156, + 202, + 160, + 252, + 176, + 217 + ] + }, + { + "name": "GlobalState", + "discriminator": [ + 163, + 46, + 74, + 168, + 216, + 123, + 133, + 98 + ] + }, + { + "name": "LatestOutboundEnvelope", + "discriminator": [ + 74, + 80, + 163, + 159, + 178, + 236, + 249, + 15 + ] + }, + { + "name": "LeaderboardState", + "discriminator": [ + 211, + 181, + 29, + 120, + 189, + 4, + 106, + 111 + ] + }, + { + "name": "LiqReceiptData", + "discriminator": [ + 75, + 119, + 90, + 79, + 25, + 200, + 9, + 46 + ] + }, + { + "name": "MaintenanceLedger", + "discriminator": [ + 140, + 250, + 92, + 173, + 147, + 65, + 26, + 39 + ] + }, + { + "name": "OperatorRegistry", + "discriminator": [ + 194, + 188, + 172, + 240, + 220, + 209, + 36, + 100 + ] + }, + { + "name": "OutboundMessageBuffer", + "discriminator": [ + 133, + 145, + 100, + 61, + 28, + 106, + 209, + 197 + ] + }, + { + "name": "OutpostAccount", + "discriminator": [ + 87, + 205, + 242, + 192, + 212, + 51, + 26, + 93 + ] + }, + { + "name": "OutpostConfig", + "discriminator": [ + 211, + 233, + 11, + 174, + 26, + 119, + 188, + 182 + ] + }, + { + "name": "PayRateHistory", + "discriminator": [ + 139, + 8, + 65, + 111, + 71, + 41, + 187, + 218 + ] + }, + { + "name": "PayoutState", + "discriminator": [ + 106, + 54, + 13, + 167, + 203, + 44, + 168, + 150 + ] + }, + { + "name": "PretokenPurchaseHistory", + "discriminator": [ + 33, + 71, + 113, + 206, + 33, + 180, + 236, + 131 + ] + }, + { + "name": "PriceHistory", + "discriminator": [ + 38, + 241, + 40, + 19, + 42, + 228, + 93, + 152 + ] + }, + { + "name": "Reserve", + "discriminator": [ + 43, + 242, + 204, + 202, + 26, + 247, + 59, + 127 + ] + }, + { + "name": "ReserveAggregate", + "discriminator": [ + 46, + 66, + 28, + 2, + 223, + 209, + 19, + 45 + ] + }, + { + "name": "StakeAllocationState", + "discriminator": [ + 23, + 238, + 120, + 198, + 156, + 165, + 151, + 119 + ] + }, + { + "name": "StakeControllerState", + "discriminator": [ + 218, + 168, + 114, + 136, + 80, + 186, + 29, + 218 + ] + }, + { + "name": "StakeMetrics", + "discriminator": [ + 91, + 84, + 217, + 97, + 98, + 38, + 18, + 143 + ] + }, + { + "name": "TokenMetadata", + "discriminator": [ + 237, + 215, + 132, + 182, + 24, + 127, + 175, + 173 + ] + }, + { + "name": "TrancheState", + "discriminator": [ + 212, + 231, + 254, + 24, + 238, + 63, + 92, + 105 + ] + }, + { + "name": "UserPretokenRecord", + "discriminator": [ + 117, + 99, + 159, + 251, + 98, + 253, + 6, + 238 + ] + }, + { + "name": "UserRecord", + "discriminator": [ + 210, + 252, + 132, + 218, + 191, + 85, + 173, + 167 + ] + }, + { + "name": "ValidatorInfoAccount", + "discriminator": [ + 195, + 243, + 81, + 187, + 172, + 232, + 57, + 59 + ] + }, + { + "name": "ValidatorList", + "discriminator": [ + 131, + 181, + 125, + 127, + 46, + 36, + 40, + 167 + ] + }, + { + "name": "ValidatorTransientAccount", + "discriminator": [ + 97, + 207, + 155, + 142, + 86, + 170, + 118, + 161 + ] + } + ], + "events": [ + { + "name": "EpochResolved", + "discriminator": [ + 62, + 81, + 212, + 223, + 209, + 104, + 51, + 65 + ] + }, + { + "name": "GraveyardDeactivationQueuedEvent", + "discriminator": [ + 131, + 241, + 122, + 229, + 108, + 21, + 67, + 37 + ] + }, + { + "name": "GraveyardValidatorCleanedEvent", + "discriminator": [ + 3, + 252, + 58, + 228, + 135, + 135, + 104, + 34 + ] + }, + { + "name": "PretokenPurchased", + "discriminator": [ + 39, + 1, + 143, + 191, + 8, + 14, + 80, + 41 + ] + }, + { + "name": "StakesMerged", + "discriminator": [ + 3, + 16, + 51, + 153, + 152, + 186, + 19, + 97 + ] + }, + { + "name": "ValidatorAddedEvent", + "discriminator": [ + 71, + 123, + 103, + 213, + 174, + 178, + 82, + 130 + ] + }, + { + "name": "ValidatorRemovedEvent", + "discriminator": [ + 49, + 23, + 179, + 208, + 124, + 3, + 231, + 59 + ] + }, + { + "name": "ValidatorSwappedEvent", + "discriminator": [ + 33, + 50, + 10, + 35, + 69, + 113, + 96, + 180 + ] + }, + { + "name": "ValidatorsSyncedEvent", + "discriminator": [ + 119, + 121, + 49, + 120, + 230, + 132, + 109, + 214 + ] + }, + { + "name": "WithdrawClaimed", + "discriminator": [ + 77, + 130, + 89, + 38, + 239, + 172, + 174, + 85 + ] + }, + { + "name": "WithdrawRequested", + "discriminator": [ + 114, + 16, + 240, + 206, + 93, + 128, + 151, + 39 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "EnvelopeDecodeFailed", + "msg": "Envelope protobuf decode failed" + }, + { + "code": 6001, + "name": "AttestationDecodeFailed", + "msg": "Attestation protobuf decode failed" + }, + { + "code": 6002, + "name": "NonSequentialEpoch", + "msg": "Non-sequential epoch index" + }, + { + "code": 6003, + "name": "EpochHashMismatch", + "msg": "Previous envelope hash mismatch" + }, + { + "code": 6004, + "name": "OperatorAlreadyDelivered", + "msg": "Operator already delivered this epoch" + }, + { + "code": 6005, + "name": "NotActiveOperator", + "msg": "Caller is not an active batch operator" + }, + { + "code": 6006, + "name": "EmptyOperatorGroups", + "msg": "Operator group list cannot be empty while roster is initialized" + }, + { + "code": 6007, + "name": "OutboundMessageBufferOverflow", + "msg": "Outbound message buffer capacity exceeded" + }, + { + "code": 6008, + "name": "Unauthorized", + "msg": "Unauthorized caller for attestation" + }, + { + "code": 6009, + "name": "OperatorRegistryFull", + "msg": "Operator registry is full; cannot add another operator" + }, + { + "code": 6010, + "name": "OperatorGroupListFull", + "msg": "Operator group count exceeds configured maximum" + }, + { + "code": 6011, + "name": "OperatorGroupFull", + "msg": "Operator group member count exceeds configured maximum" + }, + { + "code": 6012, + "name": "InvalidSolanaAddressLength", + "msg": "Solana address in Operators entry is not 32 bytes" + }, + { + "code": 6013, + "name": "EpochDeliveryListFull", + "msg": "Epoch delivery count exceeds configured maximum" + }, + { + "code": 6014, + "name": "UnsupportedAttestationType", + "msg": "Attestation type not supported by this outpost" + }, + { + "code": 6015, + "name": "ZeroAmount", + "msg": "Amount must be greater than zero" + }, + { + "code": 6016, + "name": "InvalidOperatorType", + "msg": "Invalid OperatorType for Solana outpost" + }, + { + "code": 6017, + "name": "InvalidTokenKind", + "msg": "Invalid TokenKind for deposit" + }, + { + "code": 6018, + "name": "InvalidWireNameLength", + "msg": "WIRE account name exceeds 13 characters" + }, + { + "code": 6019, + "name": "EnvelopeTooLarge", + "msg": "Envelope data exceeds MAX_ENVELOPE_BYTES" + }, + { + "code": 6020, + "name": "InvalidRetentionConfig", + "msg": "Retention config invalid: full_retention_seconds < data_retention_epochs * epoch_duration_seconds" + }, + { + "code": 6021, + "name": "InvalidEpochDuration", + "msg": "Epoch duration must be non-zero" + }, + { + "code": 6022, + "name": "EnvelopeKindMismatch", + "msg": "Envelope kind does not match account type" + }, + { + "code": 6023, + "name": "EnvelopeStillInRetention", + "msg": "Envelope pruning attempted on record still inside retention window" + }, + { + "code": 6024, + "name": "InvalidChunkCount", + "msg": "Chunk count must be in 1..=MAX_CHUNKS" + }, + { + "code": 6025, + "name": "ChunkIndexOutOfRange", + "msg": "Chunk index out of range for declared total_chunks" + }, + { + "code": 6026, + "name": "ChunkTooLarge", + "msg": "Chunk payload exceeds MAX_CHUNK_BYTES" + }, + { + "code": 6027, + "name": "ChunkSizeMismatch", + "msg": "Chunk size does not match the declared envelope shape" + }, + { + "code": 6028, + "name": "ChunkOutOfOrder", + "msg": "Chunk arrived out of order; chunks must be submitted sequentially" + }, + { + "code": 6029, + "name": "ChunkBufferEpochMismatch", + "msg": "Chunk buffer header locked to a different epoch" + }, + { + "code": 6030, + "name": "ChunkBufferShapeMismatch", + "msg": "Chunk buffer header locked to a different total_chunks/total_bytes" + }, + { + "code": 6031, + "name": "ChunkBufferOperatorMismatch", + "msg": "Chunk buffer was opened by a different operator" + }, + { + "code": 6032, + "name": "ChunkCleanupNotYetEligible", + "msg": "Chunk cleanup is not eligible until the epoch has advanced" + }, + { + "code": 6033, + "name": "OversizedQueuedMessage", + "msg": "A single queued outbound message exceeds MAX_ENVELOPE_BYTES; cannot pack into an envelope" + }, + { + "code": 6034, + "name": "CollateralLedgerOverflow", + "msg": "Collateral ledger has reached MAX_COLLATERAL_ENTRIES capacity" + }, + { + "code": 6035, + "name": "CallerNotRegistered", + "msg": "Caller is not present in the operator registry" + }, + { + "code": 6036, + "name": "WrongOperatorType", + "msg": "Caller's operator role does not match the action's required role" + }, + { + "code": 6037, + "name": "OperatorNotActive", + "msg": "Caller's operator status is not ACTIVE" + }, + { + "code": 6038, + "name": "ReserveNotFound", + "msg": "Reserve PDA not found for the supplied (token_code, reserve_code)" + }, + { + "code": 6039, + "name": "ReserveWrongStatus", + "msg": "Reserve is not in the status required by the action" + }, + { + "code": 6040, + "name": "ReserveNotCreator", + "msg": "Caller does not match the reserve's creator" + }, + { + "code": 6041, + "name": "TokenCodeNotConfigured", + "msg": "Token code is not configured in outpost_config.token_addresses_by_code" + }, + { + "code": 6042, + "name": "BadConnectorWeight", + "msg": "Connector weight must be in 1..=10_000 basis points" + }, + { + "code": 6043, + "name": "ReserveNameTooLong", + "msg": "Reserve name exceeds RESERVE_NAME_MAX_BYTES" + }, + { + "code": 6044, + "name": "ReserveDescriptionTooLong", + "msg": "Reserve description exceeds RESERVE_DESCRIPTION_MAX_BYTES" + }, + { + "code": 6045, + "name": "TokenAddressesFull", + "msg": "Token addresses table is full; cannot register another entry" + }, + { + "code": 6046, + "name": "ZeroReserveAmount", + "msg": "Reserve external_token_amount must be greater than zero" + }, + { + "code": 6047, + "name": "SwapUnknownSlugName", + "msg": "requestSwap: slug_name parameter is UNKNOWN (zero)" + }, + { + "code": 6048, + "name": "SwapEmptyRecipient", + "msg": "requestSwap: target_recipient is empty" + }, + { + "code": 6049, + "name": "SwapZeroSourceAmount", + "msg": "requestSwap: source_amount must be > 0" + }, + { + "code": 6050, + "name": "SwapSourceNotNative", + "msg": "requestSwap: source token must be native (this pass)" + }, + { + "code": 6051, + "name": "SwapSourceReserveUnavailable", + "msg": "requestSwap: source reserve unavailable" + }, + { + "code": 6052, + "name": "ArithmeticOverflow", + "msg": "arithmetic overflow during reserve accounting" + }, + { + "code": 6053, + "name": "SwapSourceIsNative", + "msg": "requestSwapSpl: source token must be SPL, not native" + }, + { + "code": 6054, + "name": "SwapSplMintMismatch", + "msg": "SPL mint does not match outpost_config binding for this token_code" + }, + { + "code": 6055, + "name": "PrecisionUnconfigured", + "msg": "token precision not configured — call set_token_precision first" + }, + { + "code": 6056, + "name": "RecipientAtaCreationFailed", + "msg": "handle_swap_remit: recipient ATA creation failed on-chain" + }, + { + "code": 6057, + "name": "TerminalChunkNotEmpty", + "msg": "epoch_in: the terminal finalize call must carry no chunk data" + }, + { + "code": 6058, + "name": "TerminalChunkBeforeDataComplete", + "msg": "epoch_in: terminal finalize before every data chunk was uploaded" + }, + { + "code": 6059, + "name": "EnvelopeEpochMismatch", + "msg": "Decoded envelope epoch does not match the epoch_in instruction epoch" + }, + { + "code": 6060, + "name": "NonCanonicalPreviousEnvelopeHash", + "msg": "previous_envelope_hash is not in canonical form" + }, + { + "code": 6061, + "name": "ReserveCreatorAtaNotCanonical", + "msg": "createReserve: creator ATA is not the canonical account for this mint" + }, + { + "code": 6062, + "name": "EmitBeforeEpochAccepted", + "msg": "Outbound emit for an epoch the inbound cursor has not accepted" + }, + { + "code": 6063, + "name": "EnvelopeWrongDestination", + "msg": "envelope destination is not an SVM chain" + }, + { + "code": 7000, + "name": "DestinationAccountDoesNotExist", + "msg": "Destination stake account does not exist" + }, + { + "code": 7001, + "name": "SourceAccountDoesNotExist", + "msg": "Source stake account does not exist" + }, + { + "code": 7002, + "name": "InvalidDestinationOwner", + "msg": "Destination account not owned by stake program" + }, + { + "code": 7003, + "name": "InvalidSourceOwner", + "msg": "Source account not owned by stake program" + }, + { + "code": 7004, + "name": "ClockBorrowFailed", + "msg": "Failed to borrow clock data" + }, + { + "code": 7005, + "name": "ClockDeserializeFailed", + "msg": "Failed to deserialize clock" + }, + { + "code": 7006, + "name": "DestinationAnalysisFailed", + "msg": "Failed to analyze destination stake account" + }, + { + "code": 7007, + "name": "SourceAnalysisFailed", + "msg": "Failed to analyze source stake account" + }, + { + "code": 7008, + "name": "DestinationStillActivating", + "msg": "Destination stake is still activating" + }, + { + "code": 7009, + "name": "DestinationDeactivating", + "msg": "Destination stake is deactivating" + }, + { + "code": 7010, + "name": "SourceStillActivating", + "msg": "Source stake is still activating" + }, + { + "code": 7011, + "name": "SourceDeactivating", + "msg": "Source stake is deactivating" + }, + { + "code": 7012, + "name": "DestinationBorrowFailed", + "msg": "Failed to borrow destination account data" + }, + { + "code": 7013, + "name": "DestinationParseFailed", + "msg": "Failed to parse destination stake state" + }, + { + "code": 7014, + "name": "SourceBorrowFailed", + "msg": "Failed to borrow source account data" + }, + { + "code": 7015, + "name": "SourceParseFailed", + "msg": "Failed to parse source stake state" + }, + { + "code": 7016, + "name": "DifferentValidators", + "msg": "Stakes are delegated to different validators" + }, + { + "code": 7017, + "name": "DifferentStakers", + "msg": "Stakes have different staker authorities" + }, + { + "code": 7018, + "name": "DifferentWithdrawers", + "msg": "Stakes have different withdrawer authorities" + }, + { + "code": 7019, + "name": "AuthoritiesNotFound", + "msg": "Could not extract authorities from accounts" + }, + { + "code": 7020, + "name": "MergeInstructionFailed", + "msg": "Merge instruction failed" + }, + { + "code": 7021, + "name": "EpochRewardsActive", + "msg": "Epoch rewards distribution is active - stake operations blocked" + }, + { + "code": 7022, + "name": "DifferentCreditsObserved", + "msg": "Stakes have different credits_observed - cannot merge until both earn same rewards" + }, + { + "code": 7100, + "name": "AccountBorrowFailed", + "msg": "Util Acc borrow Failed" + }, + { + "code": 7200, + "name": "InvalidAuthority", + "msg": "Only the configured admin may perform this action" + }, + { + "code": 7201, + "name": "InvalidAccountOwner", + "msg": "OutpostAccount does not belong to the signer" + }, + { + "code": 7202, + "name": "RoleNotEnabled", + "msg": "Role is not enabled (principal is 0)" + }, + { + "code": 7203, + "name": "AlreadyBondedForRole", + "msg": "Already bonded for this role" + }, + { + "code": 7204, + "name": "NotBondedForRole", + "msg": "Not bonded for this role" + }, + { + "code": 7205, + "name": "InsufficientStakedLiqsol", + "msg": "Insufficient staked liqSOL for bonding" + }, + { + "code": 7206, + "name": "BondStillInWarmup", + "msg": "Bond still in warmup period" + }, + { + "code": 7207, + "name": "AlreadyUnbonding", + "msg": "Unbond already requested for this role" + }, + { + "code": 7208, + "name": "NotUnbonding", + "msg": "Unbond not requested for this role" + }, + { + "code": 7209, + "name": "NotBonded", + "msg": "User has no active bonds" + }, + { + "code": 7210, + "name": "MissingRole", + "msg": "Actor does not have required role" + }, + { + "code": 7211, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7212, + "name": "Underflow", + "msg": "Arithmetic underflow" + }, + { + "code": 7213, + "name": "InvalidWarmupDuration", + "msg": "Invalid warmup duration" + }, + { + "code": 7300, + "name": "DepositTooSmall", + "msg": "Deposit amount is below minimum required" + }, + { + "code": 7301, + "name": "NotInitialized", + "msg": "Deposit Router not initialized" + }, + { + "code": 7302, + "name": "InvalidAuthority", + "msg": "Invalid authority" + }, + { + "code": 7303, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 7304, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7305, + "name": "CalculationFailure", + "msg": "Calculation failure" + }, + { + "code": 7306, + "name": "NothingToMint", + "msg": "Cannot mint zero tokens" + }, + { + "code": 7307, + "name": "InvalidAccount", + "msg": "Invalid account provided" + }, + { + "code": 7308, + "name": "InsufficientFundsForStake", + "msg": "Insufficient funds remaining after reserving fees to proceed with staking" + }, + { + "code": 7309, + "name": "UnauthorizedProgram", + "msg": "Unauthorized program attempting to call this instruction" + }, + { + "code": 7310, + "name": "DepositsDisabled", + "msg": "Deposits are currently disabled" + }, + { + "code": 7400, + "name": "NoRewardsToClaim", + "msg": "No rewards to claim" + }, + { + "code": 7401, + "name": "InsufficientBalance", + "msg": "Insufficient balance" + }, + { + "code": 7402, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 7403, + "name": "Unauthorized", + "msg": "Unauthorized - caller is not the distribution authority" + }, + { + "code": 7404, + "name": "InvalidMint", + "msg": "Invalid mint" + }, + { + "code": 7405, + "name": "InvalidOwner", + "msg": "Invalid owner" + }, + { + "code": 7406, + "name": "InvalidBucketAccount", + "msg": "Invalid bucket token account" + }, + { + "code": 7407, + "name": "InvalidUserRecord", + "msg": "Invalid user record" + }, + { + "code": 7408, + "name": "InvalidWithdrawal", + "msg": "Invalid withdrawal - balance increased instead of decreased" + }, + { + "code": 7409, + "name": "InvalidWithdrawalAmount", + "msg": "Invalid withdrawal - request must be greater than 0" + }, + { + "code": 7410, + "name": "InvalidProgramId", + "msg": "Invalid program ID" + }, + { + "code": 7411, + "name": "InstructionIntrospectionFailed", + "msg": "Instruction introspection failed" + }, + { + "code": 7412, + "name": "TransferNotInProgress", + "msg": "Transfer hook not active for this token account" + }, + { + "code": 7413, + "name": "ShareZeroTransfer", + "msg": "Amount too small resulting in zero share transfer" + }, + { + "code": 7414, + "name": "ReceiptFulfilled", + "msg": "Receipt already fulfilled" + }, + { + "code": 7415, + "name": "InsufficientBucketBalance", + "msg": "Insufficient bucket balance to fulfill claim" + }, + { + "code": 7416, + "name": "ClaimCalculationError", + "msg": "Claim calculation error" + }, + { + "code": 7417, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7418, + "name": "Underflow", + "msg": "Arithmetic underflow" + }, + { + "code": 7419, + "name": "BalanceBelowTracked", + "msg": "Balance below tracked amount — possible token burn detected" + }, + { + "code": 7420, + "name": "LegacyUserRecordMigrationRequired", + "msg": "Legacy user record must be migrated via register_user or migrate_user_record before claiming or transfers" + }, + { + "code": 7421, + "name": "AmountExceedsEntitled", + "msg": "Requested amount exceeds share-backed entitlement — cap at max_withdrawable or use full-ATA withdraw" + }, + { + "code": 7500, + "name": "Unauthorized", + "msg": "Unauthorized: The authority does not match the controller state's authority." + }, + { + "code": 7501, + "name": "NoUpgradeAuthority", + "msg": "Program has no upgrade authority (immutable)." + }, + { + "code": 7502, + "name": "PercentOutOfRange", + "msg": "Percent config value must be in 0..=100" + }, + { + "code": 7503, + "name": "PercentInversion", + "msg": "Percent config would invert hysteresis: entry must be <= exit" + }, + { + "code": 7504, + "name": "UnstakeDeltaBelowSplitMinimum", + "msg": "min_rebalance_unstake_delta must be >= MIN_STAKE_DELEGATION (1 SOL)" + }, + { + "code": 7600, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 7601, + "name": "InvalidValidator", + "msg": "Invalid validator" + }, + { + "code": 7602, + "name": "NoSuitableValidator", + "msg": "No suitable validator found" + }, + { + "code": 7603, + "name": "TicketNotFound", + "msg": "Unstake ticket not found" + }, + { + "code": 7604, + "name": "TicketNotClaimable", + "msg": "Ticket not claimable yet" + }, + { + "code": 7605, + "name": "Unauthorized", + "msg": "Unauthorized" + }, + { + "code": 7606, + "name": "ArithmeticOverflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7607, + "name": "AccountAlreadyExists", + "msg": "Account already exists" + }, + { + "code": 7608, + "name": "InvalidStakeAccount", + "msg": "Invalid stake account" + }, + { + "code": 7609, + "name": "InvalidThreshold", + "msg": "Invalid threshold value" + }, + { + "code": 7610, + "name": "InvalidAccountData", + "msg": "Invalid account data" + }, + { + "code": 7611, + "name": "InvalidVoteAccount", + "msg": "Invalid vote account" + }, + { + "code": 7612, + "name": "StakesNotYetActive", + "msg": "Stakes not yet active" + }, + { + "code": 7613, + "name": "EpochDistributionAlreadyDone", + "msg": "Invalid epoch" + }, + { + "code": 7614, + "name": "EpochAlreadyResolved", + "msg": "Epoch already resolved" + }, + { + "code": 7615, + "name": "MergeFailed", + "msg": "Merge failed" + }, + { + "code": 7616, + "name": "ReservePoolNotInitialized", + "msg": "Reserve pool not initialized" + }, + { + "code": 7617, + "name": "InvalidEphemeralAccount", + "msg": "Invalid ephemeral account" + }, + { + "code": 7618, + "name": "InvalidStakeAccount0", + "msg": "Invalid stake account 0" + }, + { + "code": 7619, + "name": "EpochNotReadyForResolution", + "msg": "Epoch Table Not Ready To be resolved" + }, + { + "code": 7620, + "name": "InsufficientSlotsElapsed", + "msg": "Function called too soon in epoch, should be called close to epoch boundary" + }, + { + "code": 7621, + "name": "EpochRewardsActive", + "msg": "Epoch rewards distribution is active - stake operations blocked" + }, + { + "code": 7622, + "name": "ValidatorSyncRequired", + "msg": "Validator sync required - please call sync_validator_stakes first" + }, + { + "code": 7623, + "name": "TooSmallDeposit", + "msg": "Deposit amount too small" + }, + { + "code": 7624, + "name": "AllocationsNotCalculated", + "msg": "Allocations not calculated for current epoch - please run rebalance_validators first" + }, + { + "code": 7625, + "name": "InvalidAccountCount", + "msg": "Invalid account count - expected different number of accounts" + }, + { + "code": 7626, + "name": "InvalidValidatorInfo", + "msg": "Invalid ValidatorInfo account" + }, + { + "code": 7627, + "name": "UnstakeAllocationsNotCalculated", + "msg": "Unstake allocations must be calculated before validator allocations - please run calculate_unstake_allocations first" + }, + { + "code": 7628, + "name": "InvalidReservePoolAccount", + "msg": "Invalid reserve pool account" + }, + { + "code": 7629, + "name": "PreReqsUnmet", + "msg": "Some Pre Req Not Met, Look at Solana Logs for details" + }, + { + "code": 7630, + "name": "SystemBusy", + "msg": "System busy: stake metrics are stale from a recent unstake — please retry shortly" + }, + { + "code": 7631, + "name": "UpdateInProgress", + "msg": "Update in progress: stake metrics are being refreshed for this epoch — please retry shortly" + }, + { + "code": 7632, + "name": "MaintenanceMergeRequired", + "msg": "Maintenance Merge Transients Failed - please run merge_activating_stakes first" + }, + { + "code": 7633, + "name": "UnstakeTooSMall", + "msg": "Unstake Request Too Small" + }, + { + "code": 7634, + "name": "OperationInProgress", + "msg": "Operation already in progress" + }, + { + "code": 7635, + "name": "NoOperationInProgress", + "msg": "No operation currently in progress" + }, + { + "code": 7636, + "name": "InvalidSequence", + "msg": "Invalid sequence - expected different index or rank" + }, + { + "code": 7637, + "name": "ValidatorNotFound", + "msg": "Validator not found in leaderboard" + }, + { + "code": 7638, + "name": "InvalidRank", + "msg": "Invalid rank - exceeds validator count" + }, + { + "code": 7639, + "name": "NoValidatorsInLeaderboard", + "msg": "No validators in leaderboard" + }, + { + "code": 7640, + "name": "NoValidatorsFound", + "msg": "No validators found in active list" + }, + { + "code": 7641, + "name": "GraveyardFull", + "msg": "Graveyard list is full" + }, + { + "code": 7642, + "name": "ValidatorHasActiveStake", + "msg": "Validator still has active stake - cannot cleanup until stake is repatriated" + }, + { + "code": 7643, + "name": "ValidatorHasPendingDeactivations", + "msg": "Validator has pending deactivations - cannot cleanup until all deactivations complete" + }, + { + "code": 7644, + "name": "ValidatorNotUndelegated", + "msg": "Validator is not in NotDelegated state - stake must be fully deactivated before cleanup" + }, + { + "code": 7645, + "name": "BatchSizeTooLarge", + "msg": "Batch size exceeds maximum allowed" + }, + { + "code": 7646, + "name": "StakingDisabled", + "msg": "Staking is currently disabled" + }, + { + "code": 7647, + "name": "WithdrawalsDisabled", + "msg": "Withdrawals are currently disabled" + }, + { + "code": 7648, + "name": "EmergencyModeActive", + "msg": "Emergency mode is active" + }, + { + "code": 7649, + "name": "ProcessStakeOrdersDisabled", + "msg": "Process stake orders is currently disabled" + }, + { + "code": 7650, + "name": "ProcessUnstakeOrdersDisabled", + "msg": "Process unstake orders is currently disabled" + }, + { + "code": 7651, + "name": "ProcessPayCycleDisabled", + "msg": "Process pay cycle is currently disabled" + }, + { + "code": 7652, + "name": "ValidatorRecordNotUpdated", + "msg": "Validator record not updated for current epoch" + }, + { + "code": 7653, + "name": "LateEpochSlotGateNotMet", + "msg": "Late epoch operation called too early - minimum slots not yet elapsed" + }, + { + "code": 7654, + "name": "IndexOutOfBounds", + "msg": "Index out of bounds" + }, + { + "code": 7655, + "name": "AccountAlreadyMigrated", + "msg": "Account already at target size, migration not needed" + }, + { + "code": 7656, + "name": "TreasuryRentUnfunded", + "msg": "Treasury can't cover stake-account rent and caller opted out of fronting it" + }, + { + "code": 7700, + "name": "InvalidChainlinkProgram", + "msg": "Invalid Chainlink program account" + }, + { + "code": 7701, + "name": "InvalidChainlinkFeed", + "msg": "Invalid Chainlink feed account" + }, + { + "code": 7702, + "name": "ArithmeticOverflow", + "msg": "Arithmetic overflow in calculation" + }, + { + "code": 7703, + "name": "InvalidCalculation", + "msg": "Invalid calculation result" + }, + { + "code": 7704, + "name": "DecimalPrecisionMismatch", + "msg": "Decimal precision mismatch" + }, + { + "code": 7705, + "name": "MissingNextTranche", + "msg": "Next tranche account required but not provided" + }, + { + "code": 7706, + "name": "InsufficientNextTrancheSupply", + "msg": "Insufficient pretokens in next tranche" + }, + { + "code": 7707, + "name": "TrancheExhausted", + "msg": "Current tranche exhausted" + }, + { + "code": 7708, + "name": "InvalidPretokenPrice", + "msg": "Invalid pretoken price" + }, + { + "code": 7709, + "name": "ChainlinkPriceFetchFailed", + "msg": "Failed to fetch SOL price from Chainlink" + }, + { + "code": 7710, + "name": "StalePrice", + "msg": "Chainlink price data is stale" + }, + { + "code": 7711, + "name": "PriceOutOfBounds", + "msg": "Price out of valid bounds" + }, + { + "code": 7712, + "name": "InvalidGrowthBps", + "msg": "Invalid growth BPS value (must be <= 10000)" + }, + { + "code": 7713, + "name": "Unauthorized", + "msg": "Unauthorized: caller is not admin" + }, + { + "code": 7714, + "name": "EmptyPriceHistory", + "msg": "Price history is empty" + }, + { + "code": 7715, + "name": "InsufficientFunds", + "msg": "Insufficient funds for pretoken purchase" + }, + { + "code": 7716, + "name": "ExceededTrancheLimit", + "msg": "Exceeded tranche limit, split purchase into multiple transactions" + }, + { + "code": 7717, + "name": "ZeroPretokensPurchased", + "msg": "Deposit too small to purchase any pretokens at current tranche price" + }, + { + "code": 7718, + "name": "InvalidRoundData", + "msg": "Invalid round data from Chainlink feed" + }, + { + "code": 7719, + "name": "InvalidStaleness", + "msg": "max_staleness_seconds must be > 0 - any non-positive value would brick price reads" + }, + { + "code": 7800, + "name": "Unauthorized", + "msg": "Unauthorized access" + }, + { + "code": 7801, + "name": "MaxValidatorsReached", + "msg": "Maximum validators reached" + }, + { + "code": 7802, + "name": "ValidatorAlreadyExists", + "msg": "Validator already exists" + }, + { + "code": 7803, + "name": "ValidatorNotFound", + "msg": "Validator not found" + }, + { + "code": 7804, + "name": "InvalidStakeUpdateType", + "msg": "Invalid stake update type" + }, + { + "code": 7805, + "name": "InvalidVoteAccount", + "msg": "Invalid vote account provided" + }, + { + "code": 7806, + "name": "InvalidInputLength", + "msg": "Invalid input length - all vectors must have same length" + }, + { + "code": 7807, + "name": "InvalidStakeAccount", + "msg": "Invalid Stake Account" + }, + { + "code": 7808, + "name": "ArithmeticOverflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7809, + "name": "InsufficientTransientStake", + "msg": "Insufficient transient stake" + }, + { + "code": 7810, + "name": "TransientTrackingFull", + "msg": "Transient tracking is full (100 entries max)" + }, + { + "code": 7811, + "name": "ValidatorStillInCooldown", + "msg": "Validator is still in cooldown period" + }, + { + "code": 7812, + "name": "InvalidVppScore", + "msg": "VPP score must be between 0 and 100" + }, + { + "code": 7900, + "name": "Unauthorized", + "msg": "Unauthorized admin attempting to call this instruction" + }, + { + "code": 7901, + "name": "InvalidAmount", + "msg": "Invalid amount" + }, + { + "code": 7902, + "name": "DDayNotSet", + "msg": "D-Day is not set" + }, + { + "code": 7903, + "name": "DDayActive", + "msg": "D-Day is active - stakes not allowed" + }, + { + "code": 7904, + "name": "InvalidLiqsolMint", + "msg": "Invalid liqSOL mint address" + }, + { + "code": 7905, + "name": "InsufficientFunds", + "msg": "Insufficient funds in user account" + }, + { + "code": 7906, + "name": "InsufficientStake", + "msg": "Insufficient staked amount for withdrawal" + }, + { + "code": 7907, + "name": "InsufficientShares", + "msg": "Insufficient shares for withdrawal" + }, + { + "code": 7908, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7909, + "name": "Underflow", + "msg": "Arithmetic underflow" + }, + { + "code": 7910, + "name": "EmptyLiqsolPool", + "msg": "No liqSOL deposits registered in the pool" + }, + { + "code": 7911, + "name": "NoLiqsolPosition", + "msg": "No liqSOL position recorded for this user" + }, + { + "code": 7912, + "name": "NoStakeDeposit", + "msg": "No stake deposit found (only pretoken purchases exist)" + }, + { + "code": 7913, + "name": "RawSolBucketUnimplemented", + "msg": "Raw SOL bucket handling is not implemented yet" + }, + { + "code": 7914, + "name": "NoAccumulatedYield", + "msg": "No accumulated yield available to consume" + }, + { + "code": 7915, + "name": "RefundsNotActive", + "msg": "Refunds are not active" + }, + { + "code": 7916, + "name": "NoRefundablePosition", + "msg": "No refundable position found for this user" + }, + { + "code": 7917, + "name": "SystemPaused", + "msg": "System is currently paused" + }, + { + "code": 7918, + "name": "RefundsActive", + "msg": "Refunds are active - operation not allowed" + }, + { + "code": 7919, + "name": "ReceiptLocked", + "msg": "OutpostAccount is locked by an active bond" + }, + { + "code": 7920, + "name": "InvalidWireState", + "msg": "Invalid wire state for this operation" + }, + { + "code": 8000, + "name": "InvalidUserRecord", + "msg": "Invalid user record" + }, + { + "code": 8001, + "name": "InsufficientBalance", + "msg": "Insufficient balance" + }, + { + "code": 8002, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 8003, + "name": "ArithmeticUnderflow", + "msg": "Arithmetic underflow" + }, + { + "code": 8004, + "name": "AlreadyFulfilled", + "msg": "Receipt already fulfilled" + }, + { + "code": 8005, + "name": "NotYetServiceable", + "msg": "Receipt not yet serviceable" + }, + { + "code": 8006, + "name": "BadFrontierOrder", + "msg": "Frontier receipts out of order or unexpected id" + }, + { + "code": 8007, + "name": "MissingNftToken", + "msg": "User does not hold the NFT receipt token" + }, + { + "code": 8008, + "name": "WithdrawalsDisabled", + "msg": "Withdrawals are currently disabled" + }, + { + "code": 8009, + "name": "ClaimWithdrawalsDisabled", + "msg": "Claim withdrawals are currently disabled" + } + ], + "types": [ + { + "name": "AttestationData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "attestation_type", + "type": "i32" + }, + { + "name": "data", + "type": "bytes" + } + ] + } + }, + { + "name": "BatchOrchestrator", + "docs": [ + "Holds resume positions for batched ops - cursors only, no value.", + "", + "Rule of thumb for what lives here vs StakeAllocationState: this account is", + "for WIPEABLE positions. Completion truth is in MaintenanceLedger, so a stale", + "cursor's staleness response is just \"zero it\" (sweep_stale_cursors does that", + "blanket at every epoch boundary). Anything that carries money/accounting and", + "needs abort/recover on staleness belongs on StakeAllocationState next to its", + "cycle, not here. The aggregation temps are the one grandfathered exception -", + "they carry value, so they sit outside the sweep behind their own mode-tag +", + "started_epoch guard.", + "", + "On liveness: ops here have no in_progress bools - a nonzero cursor/mode-tag", + "IS the liveness signal (see graveyard_locked, WIN-60). That inference works", + "because zero is out-of-band by construction for these fields: cursor at 0 =", + "no progress = idle, same state. Don't copy this pattern to fields where zero", + "is a real value (epochs, amounts) - those need an explicit bool." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "validators_processed_this_epoch", + "type": "u8" + }, + { + "name": "validators_merge_processed_this_epoch", + "type": "u16" + }, + { + "name": "validators_deactivating_merge_processed", + "type": "u16" + }, + { + "name": "validators_sync_processed_this_epoch", + "type": "u16" + }, + { + "name": "validators_unstake_processed_this_epoch", + "type": "u16" + }, + { + "name": "validators_aggregate_processed_this_epoch", + "type": "u16" + }, + { + "name": "temp_total_active_stake", + "type": "u64" + }, + { + "name": "temp_total_transient_stake", + "type": "u64" + }, + { + "name": "temp_total_reward", + "type": "u64" + }, + { + "name": "temp_total_unstakeable_stake", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "infra_next_index", + "docs": [ + "Next active_list index to process for PDA setup" + ], + "type": "u16" + }, + { + "name": "infos_next_index", + "docs": [ + "Next active_list index to process for infos sync" + ], + "type": "u16" + }, + { + "name": "leaderboard_scores_next_index", + "docs": [ + "Next leaderboard registry index to process for score sync" + ], + "type": "u16" + }, + { + "name": "removal_next_index", + "docs": [ + "Next index in active list to check for removal" + ], + "type": "u16" + }, + { + "name": "addition_next_rank", + "docs": [ + "Next rank in leaderboard to check for addition" + ], + "type": "u16" + }, + { + "name": "addition_target_rank", + "docs": [ + "Target (inclusive) leaderboard rank to process up to" + ], + "type": "u16" + }, + { + "name": "graveyard_next_index", + "docs": [ + "Next index in graveyard list to process" + ], + "type": "u16" + }, + { + "name": "graveyard_cleanup_next_index", + "docs": [ + "Next index in graveyard list to check for cleanup" + ], + "type": "u16" + }, + { + "name": "aggregate_mode_tag", + "docs": [ + "Tracks which aggregation mode currently owns the shared temp fields.", + "0 = idle,", + "1 = Normal,", + "2 = PostSync,", + "3 = PostLateEpoch.", + "Prevents cross-mode state contamination when modes share the same vars." + ], + "type": "u8" + }, + { + "name": "aggregation_started_epoch", + "docs": [ + "The epoch when the current aggregation batch started.", + "Prevents stale partial accumulators from being committed if an epoch boundary is crossed mid-aggregation." + ], + "type": "u64" + }, + { + "name": "mev_claims_next_index", + "docs": [ + "Next active_list index to process for MEV tip claims" + ], + "type": "u16" + }, + { + "name": "temp_total_mev_reward", + "docs": [ + "Temporary accumulator for MEV rewards across batches" + ], + "type": "u64" + }, + { + "name": "temp_total_outstanding_amount_to_unstake", + "docs": [ + "Temporary accumulator for sum of validators' amount_to_unstake across batches" + ], + "type": "u64" + }, + { + "name": "validators_sync_started_epoch", + "docs": [ + "Owns validators_sync_processed_this_epoch." + ], + "type": "u16" + }, + { + "name": "leaderboard_scores_started_epoch", + "docs": [ + "Owns leaderboard_scores_next_index." + ], + "type": "u16" + }, + { + "name": "graveyard_cleanup_started_epoch", + "docs": [ + "Owns graveyard_cleanup_next_index." + ], + "type": "u16" + }, + { + "name": "addition_started_epoch", + "docs": [ + "Owns addition_next_rank + addition_target_rank." + ], + "type": "u16" + }, + { + "name": "unstake_started_epoch", + "docs": [ + "Owns validators_unstake_processed_this_epoch. A nonzero cursor from a", + "dead epoch is not a real lock — this pin lets consumers tell stale", + "leftovers apart from a live in-epoch traversal." + ], + "type": "u16" + }, + { + "name": "cursors_epoch", + "docs": [ + "Every cursor on this account is a per-epoch resume position — at an", + "epoch boundary any nonzero one is stale garbage. The first batch op to", + "touch this account in a new epoch wipes them all in one swing via", + "sweep_stale_cursors, so no op ever resumes against a list that", + "selection reshuffled since. Backstop for the per-op pins above." + ], + "type": "u16" + }, + { + "name": "_reserved", + "type": { + "array": [ + "u8", + 60 + ] + } + } + ] + } + }, + { + "name": "CollateralEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "ConfigKeyBool", + "docs": [ + "Keys for bool config values (feature flags) - stored as bits in a u16", + "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,", + "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "DepositsEnabled" + }, + { + "name": "WithdrawalsEnabled" + }, + { + "name": "ClaimWithdrawalsEnabled" + }, + { + "name": "ProcessStakeOrdersEnabled" + }, + { + "name": "ProcessUnstakeOrdersEnabled" + }, + { + "name": "ProcessPayCycleEnabled" + }, + { + "name": "RebalancingEnabled" + } + ] + } + }, + { + "name": "ConfigKeyU16", + "docs": [ + "Keys for u16 config values (small counts, thresholds, ranks)" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "CooldownEpochs" + }, + { + "name": "DepositFeeEpochsMultiplier" + }, + { + "name": "MinVppEntry" + }, + { + "name": "MinVppExit" + }, + { + "name": "TinyNetworkThreshold" + }, + { + "name": "SmallNetworkThreshold" + }, + { + "name": "MediumNetworkThreshold" + }, + { + "name": "LargeNetworkEntryRank" + }, + { + "name": "LargeNetworkExitRank" + } + ] + } + }, + { + "name": "ConfigKeyU64", + "docs": [ + "Keys for u64 config values (large amounts, rates)" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "MinUserDeposit" + }, + { + "name": "MinUnstakeRequest" + }, + { + "name": "MinRebalanceStakeDelta" + }, + { + "name": "MinRebalanceUnstakeDelta" + }, + { + "name": "TransientThreshold" + }, + { + "name": "MinLateEpochSlotGate" + } + ] + } + }, + { + "name": "ConfigKeyU8", + "docs": [ + "Keys for u8 config values (percentages 0-100)" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "SmallNetworkEntryPercent" + }, + { + "name": "SmallNetworkExitPercent" + }, + { + "name": "MediumNetworkEntryPercent" + }, + { + "name": "MediumNetworkExitPercent" + } + ] + } + }, + { + "name": "DistributionState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liqsol_mint", + "type": "pubkey" + }, + { + "name": "current_index", + "type": "u64" + }, + { + "name": "total_shares", + "docs": [ + "Sum of all user shares across the system" + ], + "type": "u64" + }, + { + "name": "last_bucket_balance", + "docs": [ + "Last observed bucket balance used for incremental index updates" + ], + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "bucket_bump", + "docs": [ + "Cached bucket authority bump to avoid repeated find_program_address calls" + ], + "type": "u8" + }, + { + "name": "pool_bump", + "docs": [ + "Cached pool authority bump to avoid repeated find_program_address calls" + ], + "type": "u8" + }, + { + "name": "bucket_authority", + "docs": [ + "Cached bucket authority pubkey for transfer-hook optimization" + ], + "type": "pubkey" + }, + { + "name": "pool_authority", + "docs": [ + "Cached pool authority pubkey for transfer-hook optimization" + ], + "type": "pubkey" + } + ] + } + }, + { + "name": "EnvelopeChunks", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "operator", + "type": "pubkey" + }, + { + "name": "total_chunks", + "type": "u16" + }, + { + "name": "total_bytes", + "type": "u32" + }, + { + "name": "received_chunks", + "type": "u16" + }, + { + "name": "data", + "type": "bytes" + } + ] + } + }, + { + "name": "EnvelopeLog", + "type": { + "kind": "struct", + "fields": [ + { + "name": "envelopes", + "type": { + "vec": { + "defined": { + "name": "EnvelopeRecord" + } + } + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "EnvelopeRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "emitted_at", + "type": "u64" + }, + { + "name": "checksum", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "EpochDeliveries", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "deliveries", + "type": { + "vec": { + "defined": { + "name": "OperatorDelivery" + } + } + } + }, + { + "name": "consensus_reached", + "type": "bool" + }, + { + "name": "consensus_hash", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "EpochResolved", + "type": { + "kind": "struct", + "fields": [ + { + "name": "validator", + "type": "pubkey" + }, + { + "name": "epoch", + "type": "u64" + }, + { + "name": "total_stake_amount", + "type": "u64" + }, + { + "name": "max_index", + "type": "u32" + } + ] + } + }, + { + "name": "FailedSwapRemit", + "type": { + "kind": "struct", + "fields": [ + { + "name": "original_swap_remit_id", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "recipient_address", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "reason_len", + "type": "u8" + }, + { + "name": "reason", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "Global", + "docs": [ + "Global operator state. Epoch-based model: receipts are serviceable", + "when `epoch <= serviceable_epoch` as reported by an external runtime." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "authority", + "docs": [ + "DEPRECATED: Originally intended as authority for serviceable_epoch updates,", + "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.", + "Retained to preserve account layout." + ], + "type": "pubkey" + }, + { + "name": "liqsol_mint", + "docs": [ + "Token-2022 liqSOL mint burned on withdraw." + ], + "type": "pubkey" + }, + { + "name": "serviceable_epoch", + "docs": [ + "Highest epoch that is currently claimable." + ], + "type": "u64" + }, + { + "name": "total_encumbered_funds", + "docs": [ + "Total SOL encumbered for pending withdrawal requests.", + "This amount is reserved from the reserve pool and will be paid out when receipts are claimed." + ], + "type": "u64" + }, + { + "name": "next_receipt_id", + "docs": [ + "Monotonic counter for generating unique receipt IDs" + ], + "type": "u64" + } + ] + } + }, + { + "name": "GlobalConfig", + "docs": [ + "Zero-copy global config PDA" + ], + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "_padding", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "cranky", + "type": "pubkey" + }, + { + "name": "_reserved_pubkey", + "type": { + "array": [ + "pubkey", + 1 + ] + } + }, + { + "name": "min_user_deposit", + "docs": [ + "Minimum SOL amount a user can deposit" + ], + "type": "u64" + }, + { + "name": "min_unstake_request", + "docs": [ + "Minimum SOL amount for an unstake/withdrawal request" + ], + "type": "u64" + }, + { + "name": "min_rebalance_stake_delta", + "docs": [ + "Minimum stake delta to trigger a stake rebalance order" + ], + "type": "u64" + }, + { + "name": "min_rebalance_unstake_delta", + "docs": [ + "Minimum unstake delta to trigger an unstake rebalance order" + ], + "type": "u64" + }, + { + "name": "transient_threshold", + "docs": [ + "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.", + "Rebalance now counts all transient stake on both sides of the delta equation,", + "so the per-validator threshold gate was removed." + ], + "type": "u64" + }, + { + "name": "min_late_epoch_slot_gate", + "docs": [ + "Minimum slots that must have elapsed in the epoch before late epoch operations can execute" + ], + "type": "u64" + }, + { + "name": "_reserved_u64", + "type": { + "array": [ + "u64", + 2 + ] + } + }, + { + "name": "cooldown_epochs", + "docs": [ + "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change" + ], + "type": "u16" + }, + { + "name": "deposit_fee_multiplier", + "docs": [ + "Multiplier for deposit fee calculation, this would be average \"pay rate x number of epochs we expect the stake to warm up\"" + ], + "type": "u16" + }, + { + "name": "min_vpp_entry", + "docs": [ + "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small" + ], + "type": "u16" + }, + { + "name": "min_vpp_exit", + "docs": [ + "VPP score threshold below which a validator is removed from active set, again a fall back" + ], + "type": "u16" + }, + { + "name": "tiny_network_threshold", + "docs": [ + "Max validators for \"tiny\" network band (uses fixed VPP thresholds) as above" + ], + "type": "u16" + }, + { + "name": "small_network_threshold", + "docs": [ + "Max validators for \"small\" network band (uses percentile-based selection)" + ], + "type": "u16" + }, + { + "name": "medium_network_threshold", + "docs": [ + "Max validators for \"medium\" network band (uses percentile-based selection)" + ], + "type": "u16" + }, + { + "name": "large_network_entry_rank", + "docs": [ + "Fixed rank threshold to enter active set in large networks (0-indexed)" + ], + "type": "u16" + }, + { + "name": "large_network_exit_rank", + "docs": [ + "Fixed rank threshold to exit active set in large networks (0-indexed)" + ], + "type": "u16" + }, + { + "name": "_reserved_u16", + "type": { + "array": [ + "u16", + 3 + ] + } + }, + { + "name": "small_network_entry_percent", + "docs": [ + "Percentile rank required to enter active set in small networks" + ], + "type": "u8" + }, + { + "name": "small_network_exit_percent", + "docs": [ + "Percentile rank below which validators exit in small networks" + ], + "type": "u8" + }, + { + "name": "medium_network_entry_percent", + "docs": [ + "Percentile rank required to enter active set in medium networks" + ], + "type": "u8" + }, + { + "name": "medium_network_exit_percent", + "docs": [ + "Percentile rank below which validators exit in medium networks" + ], + "type": "u8" + }, + { + "name": "_reserved_u8", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "feature_flags", + "docs": [ + "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,", + "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,", + "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved" + ], + "type": "u16" + }, + { + "name": "_reserved_flags", + "type": { + "array": [ + "u16", + 1 + ] + } + }, + { + "name": "_reserved_trailing", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "GlobalState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "deployed_at", + "docs": [ + "Legacy refund timer fields retained to preserve account layout.", + "Refund activation is controlled exclusively through `wire_state`." + ], + "type": "i64" + }, + { + "name": "refund_delay_seconds", + "type": "i64" + }, + { + "name": "paused", + "docs": [ + "Global pause flag - when true, all operations except refunds are disabled" + ], + "type": "bool" + }, + { + "name": "total_staked_liqsol", + "docs": [ + "Aggregate liqSOL staked through pretokens (maps to distribution tracked balance)" + ], + "type": "u64" + }, + { + "name": "total_purchased_liqsol", + "docs": [ + "Aggregate liqSOL pretoken purchases (part of distribution tracked balance)" + ], + "type": "u64" + }, + { + "name": "total_shares", + "docs": [ + "Total shares issued to all users (for share/index yield isolation)" + ], + "type": "u64" + }, + { + "name": "protocol_shares", + "docs": [ + "Total shares issued to protocol (for share/index yield isolation)" + ], + "type": "u64" + }, + { + "name": "current_index", + "docs": [ + "Current share-to-token exchange rate (scaled by INDEX_SCALE = 1e12)", + "Starts at INDEX_SCALE (1.0) and grows as yield accrues" + ], + "type": "u64" + }, + { + "name": "expected_pool_balance", + "docs": [ + "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).", + "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield." + ], + "type": "u64" + }, + { + "name": "yield_accumulated_liqsol", + "docs": [ + "Accumulated liqSOL yield available for protocol pretoken purchases" + ], + "type": "u64" + }, + { + "name": "role_principals", + "docs": [ + "Required principal (liqSOL) per role [YieldOp, BatchOp, Underwriter, PoolOp]" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + }, + { + "name": "role_warmup_duration", + "docs": [ + "Warmup duration in seconds (applies when ANY new role is bonded)" + ], + "type": "i64" + }, + { + "name": "wire_state", + "type": { + "defined": { + "name": "WireState" + } + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "GraveyardDeactivationQueuedEvent", + "docs": [ + "Event emitted when a graveyard validator's main stake deactivation is queued" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "amount_to_unstake", + "type": "u64" + } + ] + } + }, + { + "name": "GraveyardValidatorCleanedEvent", + "docs": [ + "Event emitted when a graveyard validator is cleaned up" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "epochs_since_state_change", + "type": "u16" + } + ] + } + }, + { + "name": "LatestOutboundEnvelope", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "checksum", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "data", + "type": "bytes" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "LeaderboardState", + "docs": [ + "Central leaderboard state using parallel arrays for efficient ranking and CPI access", + "Stores VPP scores and sorted rankings for up to 1024 validators", + "Uses zero-copy for efficient access from other programs via CPI" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "scores", + "docs": [ + "VPP scores indexed by registry_index (0-100 range)", + "registry_index is assigned on first validator registration and never changes" + ], + "type": { + "array": [ + "u8", + 1024 + ] + } + }, + { + "name": "sorted_indices", + "docs": [ + "Validator indices sorted by VPP score descending", + "sorted_indices[0] = registry_index of highest VPP validator", + "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc." + ], + "type": { + "array": [ + "u16", + 1024 + ] + } + }, + { + "name": "vote_accounts", + "docs": [ + "Vote account pubkeys indexed by registry_index", + "Allows CPI callers to get vote accounts for top N validators" + ], + "type": { + "array": [ + { + "defined": { + "name": "PubkeyBytes" + } + }, + 1024 + ] + } + }, + { + "name": "num_validators", + "docs": [ + "Number of active validators currently in the leaderboard" + ], + "type": "u16" + }, + { + "name": "bump", + "docs": [ + "PDA bump seed" + ], + "type": "u8" + }, + { + "name": "_align", + "docs": [ + "Alignment byte (keeps u16 fields below properly aligned)" + ], + "type": "u8" + }, + { + "name": "crank_next_index", + "docs": [ + "Next validator index to process during crank_update_scores" + ], + "type": "u16" + }, + { + "name": "last_crank_epoch", + "docs": [ + "Last epoch when crank_update_scores completed all validators" + ], + "type": "u16" + }, + { + "name": "crank_started_epoch", + "docs": [ + "Epoch when start_crank was called (signals an active crank cycle)" + ], + "type": "u16" + } + ] + } + }, + { + "name": "LiqReceiptData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "receipt_id", + "type": "u64" + }, + { + "name": "liqports", + "type": "u64" + }, + { + "name": "epoch", + "type": "u64" + }, + { + "name": "fulfilled", + "type": "bool" + } + ] + } + }, + { + "name": "MaintenanceLedger", + "type": { + "kind": "struct", + "fields": [ + { + "name": "last_sync_epoch", + "type": "u16" + }, + { + "name": "last_validator_score_sync_epoch", + "type": "u16" + }, + { + "name": "last_leaderboard_scores_sync_epoch", + "type": "u16" + }, + { + "name": "last_active_infos_synced_epoch", + "docs": [ + "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout." + ], + "type": "u16" + }, + { + "name": "last_updated_stake_metrics_epoch", + "type": "u64" + }, + { + "name": "last_distribution_epoch", + "type": { + "option": "u64" + } + }, + { + "name": "last_distribution_slot", + "docs": [ + "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout." + ], + "type": { + "option": "u64" + } + }, + { + "name": "last_merge_deactivating_transients_epoch", + "type": "u64" + }, + { + "name": "last_rebalance_allocation_epoch", + "type": "u64" + }, + { + "name": "last_merge_activating_transients_epoch", + "type": "u64" + }, + { + "name": "last_unstake_epoch", + "type": { + "option": "u64" + } + }, + { + "name": "last_unstake_allocation_epoch", + "type": "u64" + }, + { + "name": "min_max_resolved_epoch_deactivations", + "type": "u16" + }, + { + "name": "last_threshold_sync_epoch", + "type": "u16" + }, + { + "name": "last_validator_removal_selection_epoch", + "type": "u16" + }, + { + "name": "last_validator_addition_selection_epoch", + "type": "u16" + }, + { + "name": "last_validator_pda_setup_epoch", + "type": "u16" + }, + { + "name": "last_graveyard_processing_epoch", + "type": "u16" + }, + { + "name": "last_post_sync_stake_metrics_refresh_epoch", + "type": "u16" + }, + { + "name": "last_graveyard_cleanup_epoch", + "type": "u16" + }, + { + "name": "last_post_late_epoch_stake_metrics_refresh_epoch", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "MetadataArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "OperatorDelivery", + "type": { + "kind": "struct", + "fields": [ + { + "name": "operator", + "type": "pubkey" + }, + { + "name": "envelope_hash", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "OperatorGroup", + "type": { + "kind": "struct", + "fields": [ + { + "name": "members", + "type": { + "vec": "pubkey" + } + } + ] + } + }, + { + "name": "OperatorMapping", + "type": { + "kind": "struct", + "fields": [ + { + "name": "wire_name", + "type": "u64" + }, + { + "name": "sol_address", + "type": "pubkey" + }, + { + "name": "role", + "type": "u32" + }, + { + "name": "status", + "type": "u32" + }, + { + "name": "slashed_at", + "type": "i64" + }, + { + "name": "terminated_at", + "type": "i64" + } + ] + } + }, + { + "name": "OperatorRegistry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "active_group_index", + "type": "u32" + }, + { + "name": "groups", + "type": { + "vec": { + "defined": { + "name": "OperatorGroup" + } + } + } + }, + { + "name": "operators", + "type": { + "vec": { + "defined": { + "name": "OperatorMapping" + } + } + } + }, + { + "name": "collateral_by_code", + "type": { + "vec": { + "defined": { + "name": "CollateralEntry" + } + } + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "OutboundMessageBuffer", + "type": { + "kind": "struct", + "fields": [ + { + "name": "attestation_count", + "type": "u16" + }, + { + "name": "used_data_bytes", + "type": "u32" + }, + { + "name": "entries", + "type": { + "vec": { + "defined": { + "name": "AttestationData" + } + } + } + }, + { + "name": "next_swap_id", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "OutpostAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "staked_liqsol", + "docs": [ + "STAKE deposits (withdrawable pre-D-Day)", + "Principal amount staked (for display/tracking)" + ], + "type": "u64" + }, + { + "name": "staked_shares", + "docs": [ + "Shares from staking (actual accounting for yield isolation)" + ], + "type": "u64" + }, + { + "name": "purchased_liqsol", + "docs": [ + "WARRANT_PURCHASE deposits with liqSOL (permanent)", + "Principal amount spent on pretokens (for display/tracking)" + ], + "type": "u64" + }, + { + "name": "purchased_shares", + "docs": [ + "Shares from liqSOL pretoken purchases (actual accounting for yield isolation)" + ], + "type": "u64" + }, + { + "name": "bonded_principals", + "docs": [ + "LiqSOL locked by bonds per role" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + }, + { + "name": "bonded_roles", + "docs": [ + "Bitmap of bonded roles (bits 0-3 for YieldOp, BatchOp, Underwriter, PoolOp)" + ], + "type": "u8" + }, + { + "name": "unbond_requested", + "docs": [ + "Bitmap of roles with pending unbond requests (bits 0-3)" + ], + "type": "u8" + }, + { + "name": "warmup_ends_at", + "docs": [ + "Warmup end timestamp - has_role returns false until this time" + ], + "type": "i64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "accumulated_pretoken_yield", + "type": { + "option": "u64" + } + }, + { + "name": "last_epoch_synd_liqsol", + "type": { + "option": "u64" + } + }, + { + "name": "last_synd_epoch", + "type": { + "option": "u64" + } + } + ] + } + }, + { + "name": "OutpostConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "chain_code", + "type": "u64" + }, + { + "name": "next_epoch_index", + "type": "u32" + }, + { + "name": "previous_epoch_hash", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "previous_outbound_epoch_hash", + "docs": [ + "Chain tip for the OUTBOUND (outpost → depot) stream: the canonical", + "epoch digest (`keccak256(encoded envelope)`, `envelope_hash` empty) of", + "this outpost's own previous emit. Stamped into each outbound", + "envelope's `previous_envelope_hash` and advanced after every emit —", + "SEC-114 per-stream chaining; the depot's inbound verification drops a", + "cross-stream link (the inbound tip `previous_epoch_hash`) as a chain", + "break. All-zero = genesis (no emit on this stream yet)." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "epoch_duration_sec", + "type": "u32" + }, + { + "name": "current_epoch_started_at", + "type": "i64" + }, + { + "name": "registry_initialized", + "type": "bool" + }, + { + "name": "last_message_id", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "last_message_timestamp", + "type": "u64" + }, + { + "name": "envelope_retention_epochs", + "type": "u32" + }, + { + "name": "token_addresses_by_code", + "type": { + "vec": { + "defined": { + "name": "TokenAddressEntry" + } + } + } + }, + { + "name": "precision_by_token_code", + "type": { + "vec": { + "defined": { + "name": "TokenPrecisionEntry" + } + } + } + }, + { + "name": "config_version", + "type": "u8" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PayRateEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "scaled_rate", + "type": "u64" + } + ] + } + }, + { + "name": "PayRateHistory", + "type": { + "kind": "struct", + "fields": [ + { + "name": "current_index", + "type": "u16" + }, + { + "name": "total_entries_added", + "type": "u64" + }, + { + "name": "entries", + "type": { + "vec": { + "defined": { + "name": "PayRateEntry" + } + } + } + }, + { + "name": "max_entries", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PayoutState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_yield_paid_out_epoch", + "type": "u64" + }, + { + "name": "fees_remaining_to_distribute", + "type": "u64" + }, + { + "name": "total_fees_deposited", + "type": "u64" + }, + { + "name": "total_cumulative_payout_alltime", + "type": "u128" + }, + { + "name": "total_cumulative_payout_epoch", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "epoch", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PretokenPurchaseHistory", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "starting_epoch", + "type": "u64" + }, + { + "name": "latest_epoch", + "type": "u64" + }, + { + "name": "purchased_per_epoch", + "type": { + "array": [ + "u64", + 100 + ] + } + }, + { + "name": "synd_per_epoch", + "type": { + "array": [ + "u64", + 100 + ] + } + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "_padding", + "type": { + "array": [ + "u8", + 7 + ] + } + } + ] + } + }, + { + "name": "PretokenPurchased", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "tranche_number", + "type": "u64" + }, + { + "name": "pretokens_purchased", + "type": "u64" + } + ] + } + }, + { + "name": "PriceHistory", + "docs": [ + "Price history for windowed moving average calculations", + "All prices stored in 8-decimal precision" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "window_size", + "docs": [ + "Number of prices to keep in the moving average window" + ], + "type": "u8" + }, + { + "name": "prices", + "docs": [ + "Circular buffer of recent prices (fixed size, 8-dec each)" + ], + "type": { + "array": [ + "u64", + 10 + ] + } + }, + { + "name": "count", + "docs": [ + "Number of valid entries in the prices array (0-10)" + ], + "type": "u8" + }, + { + "name": "next_index", + "type": "u8" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PubkeyBytes", + "docs": [ + "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.", + "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`." + ], + "serialization": "bytemuck", + "repr": { + "kind": "transparent" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "bytes", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "Reserve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "status", + "type": { + "defined": { + "name": "ReserveStatus" + } + } + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "custody_mint", + "docs": [ + "Mint/native mode pinned at reserve creation. `NATIVE_TOKEN_MARKER`", + "means the reserve custodies lamports; any other pubkey is the SPL mint", + "held by the `reserve_vault`. Terminal handlers (SwapRemit, SwapRevert,", + "ReserveCreateCancelled) read this instead of the mutable", + "`OutpostConfig.token_addresses_by_code`, so an admin re-point of a", + "token_code between creation and dispatch cannot change how an", + "already-created reserve settles." + ], + "type": "pubkey" + }, + { + "name": "custody_decimals", + "docs": [ + "Chain-side decimals pinned at reserve creation. Native reserves use", + "`DEPOT_PRECISION_DECIMALS`; SPL reserves use the source mint's", + "`decimals` at creation time." + ], + "type": "u8" + }, + { + "name": "name_len", + "type": "u8" + }, + { + "name": "name_bytes", + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "description_len", + "type": "u16" + }, + { + "name": "description_bytes", + "type": { + "array": [ + "u8", + 256 + ] + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "ReserveAggregate", + "type": { + "kind": "struct", + "fields": [ + { + "name": "failed_remits", + "type": { + "array": [ + { + "defined": { + "name": "FailedSwapRemit" + } + }, + 8 + ] + } + }, + { + "name": "failed_remits_head", + "type": "u8" + }, + { + "name": "failed_remits_total", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "ReserveStatus", + "docs": [ + "Local Borsh enum (NOT the proto enum): tags Pending=0, Active=1, Cancelled=2." + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Pending" + }, + { + "name": "Active" + }, + { + "name": "Cancelled" + } + ] + } + }, + { + "name": "Role", + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "YieldOperator" + }, + { + "name": "BatchOperator" + }, + { + "name": "Underwriter" + }, + { + "name": "PoolOperator" + } + ] + } + }, + { + "name": "StakeAllocationState", + "docs": [ + "Stake allocation state tracking for validator stake distribution and unstake orders", + "Tracks both staking allocations (VPP-based) and unstake order batching", + "", + "Rule of thumb for what lives here vs BatchOrchestrator: this account holds", + "CONSERVED-VALUE cycles (frozen amounts, distributed totals, snapshots) - you", + "can never blanket-zero these, a stale cycle gets aborted/recovered instead", + "(see start_unstake_allocation's remainder recovery and abort_rebalance).", + "That's also why the *_started_epoch pins live here and not on BO: the pin is", + "part of its cycle record and must be stamped/cleared atomically with it by", + "the cycle's own start/abort methods, so pin and cycle can't desync. Pure", + "resume cursors with no value attached belong on BatchOrchestrator, where the", + "epoch sweep can wipe them for free.", + "", + "The in_progress bools here are deliberately explicit, NOT inferred like BO", + "does with its cursors. Inference needs a signal whose zero is out-of-band,", + "and every candidate here has a meaningful zero: epoch 0 is real (localnet),", + "an unstake-only rebalance legitimately distributes 0, and the processed", + "counter being nonzero-while-open is an accident of call sites, not a", + "guarantee. Plus these cycles have a state BO ops don't: open-but-stale with", + "recoverable frozen value - stale here means recover, not wipe, so it must", + "stay distinguishable from idle." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_active_vpp", + "docs": [ + "Sum of all VPP scores (0-100 each) for Trusted validators in the active list.", + "Max with 200 validators at 100 each = 20,000, fits in u32.", + "", + "Authoritatively recomputed by `conclude_addition_selection` from the active", + "list's `vpp` fields at the end of every addition-selection cycle, so any", + "intra-cycle drift from removals/score updates is wiped before allocation", + "uses this as a denominator. Do not maintain incrementally." + ], + "type": "u32" + }, + { + "name": "bump", + "docs": [ + "Bump seed for PDA" + ], + "type": "u8" + }, + { + "name": "initial_reserve_balance", + "docs": [ + "Initial reserve balance when distribution cycle started (for batched distribution)" + ], + "type": "u64" + }, + { + "name": "pending_unstake_amount_this_epoch", + "docs": [ + "Accumulates unstake requests during the epoch (before allocation starts)", + "Resets to 0 when allocation cycle begins" + ], + "type": "u64" + }, + { + "name": "unstake_allocation_in_progress", + "docs": [ + "Whether unstake allocation is currently in progress (batched processing)" + ], + "type": "bool" + }, + { + "name": "validators_processed_this_unstake_allocation", + "docs": [ + "Number of validators processed in the current unstake allocation batch" + ], + "type": "u16" + }, + { + "name": "processing_unstake_amount_this_allocation", + "docs": [ + "FROZEN amount being allocated across all batches this cycle", + "Set at start of allocation, prevents race conditions with new requests" + ], + "type": "u64" + }, + { + "name": "amount_distributed_this_unstake_allocation", + "docs": [ + "Tracks cumulative amount distributed across all batches in current unstake allocation cycle" + ], + "type": "u64" + }, + { + "name": "rebalance_in_progress", + "docs": [ + "Whether rebalancing is currently in progress (batched processing)" + ], + "type": "bool" + }, + { + "name": "validators_processed_this_rebalance", + "docs": [ + "Number of validators processed in the current rebalance cycle" + ], + "type": "u16" + }, + { + "name": "total_amount_to_distribute_this_rebalance", + "docs": [ + "Total amount to distribute for this rebalance cycle (after subtracting encumbered funds and buffer)", + "Saved at the start to ensure consistency across all batches" + ], + "type": "u64" + }, + { + "name": "cumulative_stake_requested_this_rebalance", + "docs": [ + "Tracks cumulative stake requested (sum of positive deltas) across all batches in current rebalance cycle" + ], + "type": "u64" + }, + { + "name": "rebalance_stake_scale_factor", + "docs": [ + "Scale factor to apply during process_stake_orders (uses PAY_RATE_SCALE_FACTOR precision)", + "Set to PAY_RATE_SCALE_FACTOR (1.0) if no scaling needed, or lower if cumulative > available" + ], + "type": "u64" + }, + { + "name": "is_small_distribution_mode", + "docs": [ + "Whether we're in small distribution mode (not enough for VPP-based distribution)", + "In this mode, we distribute evenly to first N validators instead of using VPP ratios" + ], + "type": "bool" + }, + { + "name": "validators_to_fund_this_rebalance", + "docs": [ + "Number of validators to fund in small distribution mode", + "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)" + ], + "type": "u16" + }, + { + "name": "amount_per_validator_this_rebalance", + "docs": [ + "Amount each validator gets in small distribution mode", + "Calculated as total_to_distribute / validators_to_fund" + ], + "type": "u64" + }, + { + "name": "selection_entry_threshold_vpp", + "docs": [ + "Entry threshold VPP from leaderboard (validators must meet this to be added, 0-100)" + ], + "type": "u8" + }, + { + "name": "selection_exit_threshold_vpp", + "docs": [ + "Exit threshold VPP from leaderboard (validators below this are removed, 0-100)" + ], + "type": "u8" + }, + { + "name": "addition_in_progress", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always false." + ], + "type": "bool" + }, + { + "name": "unstake_allocation_started_epoch", + "docs": [ + "Epoch in which the current unstake allocation cycle was started.", + "Used to detect stale cycles that span epoch boundaries — if the epoch", + "has advanced, the cycle is reset and restarted to avoid resuming", + "against a mutated validator active list.", + "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)" + ], + "type": "u16" + }, + { + "name": "rebalance_started_epoch", + "docs": [ + "Epoch in which the current rebalance cycle was started. Same job as", + "unstake_allocation_started_epoch above — a cycle whose epoch no longer", + "matches is stale (active list may have been reshuffled by selection)", + "and gets aborted + restarted instead of resumed.", + "(Repurposed from the deprecated addition_target_rank field — always 0 on mainnet.)" + ], + "type": "u16" + }, + { + "name": "validators_added_this_selection", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always 0." + ], + "type": "u16" + }, + { + "name": "removal_in_progress", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always false." + ], + "type": "bool" + }, + { + "name": "removal_next_index", + "docs": [ + "DEPRECATED — see BatchOrchestrator.removal_next_index. Always 0." + ], + "type": "u16" + }, + { + "name": "removal_active_list_snapshot", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always 0." + ], + "type": "u16" + }, + { + "name": "validators_removed_this_selection", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always 0." + ], + "type": "u16" + } + ] + } + }, + { + "name": "StakeControllerState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "vault_initialized", + "type": "bool" + }, + { + "name": "reserve_pool_initialized", + "type": "bool" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "StakeMetrics", + "type": { + "kind": "struct", + "fields": [ + { + "name": "current_active_stake", + "type": "u64" + }, + { + "name": "transient_active_stake", + "type": "u64" + }, + { + "name": "actual_system_yield_received", + "type": "u64" + }, + { + "name": "sol_system_pay_rate", + "type": "u64" + }, + { + "name": "unstakeable_stake", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "mev_reward", + "docs": [ + "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)" + ], + "type": "u64" + }, + { + "name": "total_outstanding_amount_to_unstake", + "docs": [ + "WNS-16: total amount_to_unstake across all validators at last metrics refresh.", + "Represents allocated-but-not-yet-deactivated unstake obligations.", + "Subtracted from unstakeable_stake in admission control to prevent double-promising." + ], + "type": "u64" + }, + { + "name": "_reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 24 + ] + } + } + ] + } + }, + { + "name": "StakesMerged", + "type": { + "kind": "struct", + "fields": [ + { + "name": "validator", + "type": "pubkey" + }, + { + "name": "epoch", + "type": "u64" + }, + { + "name": "count", + "type": "u32" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "TokenAddressEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "TokenMetadata", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "TokenPrecisionEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "decimals", + "type": "u8" + } + ] + } + }, + { + "name": "TrancheState", + "docs": [ + "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)", + "Example: $193.32 is stored as 19332000000" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "current_tranche_number", + "type": "u64" + }, + { + "name": "current_tranche_supply", + "type": "u64" + }, + { + "name": "current_tranche_price_usd", + "type": "u64" + }, + { + "name": "total_pretokens_sold", + "type": "u64" + }, + { + "name": "initial_tranche_supply", + "type": "u64" + }, + { + "name": "supply_growth_bps", + "docs": [ + "Supply growth in basis points (e.g., 100 = 1%, max 10000)" + ], + "type": "u16" + }, + { + "name": "price_growth_cents", + "docs": [ + "Price growth in cents per tranche (0.01 USD units)" + ], + "type": "u16" + }, + { + "name": "min_price_usd", + "docs": [ + "Minimum valid SOL/USD price for validation (8-dec)" + ], + "type": "u64" + }, + { + "name": "max_price_usd", + "docs": [ + "Maximum valid SOL/USD price for validation (8-dec)" + ], + "type": "u64" + }, + { + "name": "max_staleness_seconds", + "docs": [ + "Maximum staleness in seconds for Chainlink data" + ], + "type": "i64" + }, + { + "name": "chainlink_program", + "docs": [ + "Chainlink program address" + ], + "type": "pubkey" + }, + { + "name": "chainlink_feed", + "docs": [ + "Chainlink price feed PDA" + ], + "type": "pubkey" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "UserPretokenRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "total_sol_deposited", + "type": "u64" + }, + { + "name": "total_pretokens_purchased", + "type": "u64" + }, + { + "name": "last_tranche_number", + "type": "u64" + }, + { + "name": "last_tranche_price_usd", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "UserRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "shares", + "docs": [ + "User's share of the distribution pool", + "entitled_balance = shares * current_index / INDEX_SCALE" + ], + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "tracked_balance", + "docs": [ + "Last reconciled liqSOL token balance for this user ATA" + ], + "type": "u64" + } + ] + } + }, + { + "name": "ValidatorAddedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "vpp", + "type": "u8" + } + ] + } + }, + { + "name": "ValidatorInfoAccount", + "docs": [ + "Per-validator information account", + "Seed: [\"validator_info\", vote_account]" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "docs": [ + "Vote account this info belongs to" + ], + "type": "pubkey" + }, + { + "name": "vpp", + "docs": [ + "Validator Performance Points (0-100 score)" + ], + "type": "u8" + }, + { + "name": "bump", + "docs": [ + "Bump seed for PDA" + ], + "type": "u8" + }, + { + "name": "current_active_stake", + "docs": [ + "Fully active stake earning rewards" + ], + "type": "u64" + }, + { + "name": "epoch_reward", + "docs": [ + "Rewards earned in the last epoch", + "This is update in the function: sync_validator_stakes_v2 and is a simple subtraction of current - previous active stake. This does cater for deactivations etc. so", + "no worries" + ], + "type": "u64" + }, + { + "name": "transient_active_stake", + "docs": [ + "Stake warming up (activating), not fully active yet" + ], + "type": "u64" + }, + { + "name": "transient_deactivating_stake", + "docs": [ + "Stake cooling down (deactivating), no longer earning rewards" + ], + "type": "u64" + }, + { + "name": "last_chain_sync_epoch", + "docs": [ + "When was this entry last updated from the chain?", + "This is update in the function: sync_validator_stakes_v2" + ], + "type": "u16" + }, + { + "name": "last_score_sync_epoch", + "docs": [ + "When was this VPP score last updated from our Validator Leaderboard program?" + ], + "type": "u16" + }, + { + "name": "last_state_change_epoch", + "docs": [ + "When was the validator state last changed? (helps determine cooldowns)" + ], + "type": "u16" + }, + { + "name": "amount_to_stake", + "docs": [ + "The amount of stake to stake" + ], + "type": "u64" + }, + { + "name": "amount_to_unstake", + "docs": [ + "The amount of stake to unstake" + ], + "type": "u64" + }, + { + "name": "validator_repute", + "docs": [ + "State of the validator" + ], + "type": { + "defined": { + "name": "ValidatorReputation" + } + } + }, + { + "name": "validator_state", + "type": { + "defined": { + "name": "ValidatorState" + } + } + }, + { + "name": "state_transition_trigger_stake_amount", + "type": "u64" + }, + { + "name": "mev_earned", + "docs": [ + "MEV reward swept for this validator in the current epoch" + ], + "type": "u64" + }, + { + "name": "rebalance_unstake_pending", + "docs": [ + "The share of amount_to_unstake that came from rebalance this epoch.", + "amount_to_unstake mixes two things with different rules: user-withdrawal", + "shares are DEBT (back receipts, never resettable) while the rebalance", + "share is INTENT (recomputed from target-vs-effective every cycle,", + "replaceable). This field makes the intent part separable so a new", + "rebalance cycle can drop a dead cycle's contribution instead of adding", + "on top of it, without ever touching user debt.", + "(Carved from _reserved - those bytes are structurally zero: introduced", + "via realloc(len, true) in migrate_validator_info_batch and zeroed by", + "initialize() on fresh PDAs, never written since. Zero = \"all existing", + "amount_to_unstake is debt\", which is exactly today's safe behavior.)" + ], + "type": "u64" + }, + { + "name": "rebalance_unstake_epoch", + "docs": [ + "Epoch the rebalance component was stamped. A mismatch with the current", + "epoch means the component is a dead cycle's intent - subtract and re-add." + ], + "type": "u16" + }, + { + "name": "_reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 14 + ] + } + } + ] + } + }, + { + "name": "ValidatorList", + "docs": [ + "Zero-copy validator list account", + "Stores a fixed-capacity array of validator vote account pubkeys" + ], + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "count", + "docs": [ + "Current number of validators in the list" + ], + "type": "u32" + }, + { + "name": "capacity", + "docs": [ + "Maximum capacity of the list" + ], + "type": "u32" + }, + { + "name": "bump", + "docs": [ + "PDA bump seed" + ], + "type": "u8" + }, + { + "name": "_padding", + "docs": [ + "Padding for alignment" + ], + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "validators", + "docs": [ + "Fixed array of validator vote account pubkeys", + "Using Option to allow for empty slots (None = empty)" + ], + "type": { + "array": [ + { + "defined": { + "name": "ValidatorListEntry" + } + }, + 200 + ] + } + } + ] + } + }, + { + "name": "ValidatorListEntry", + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "docs": [ + "Vote account pubkey (all zeros = empty slot)" + ], + "type": "pubkey" + }, + { + "name": "registry_index", + "docs": [ + "Immutable index into the validator leaderboard arrays (u16::MAX = unknown)" + ], + "type": "u16" + }, + { + "name": "pdas_initialized", + "docs": [ + "Whether per-validator PDAs (info/transient) are initialized" + ], + "type": "bool" + }, + { + "name": "vpp", + "docs": [ + "Cached VPP score (0-100) refreshed at the start of a maintenance run" + ], + "type": "u8" + }, + { + "name": "_pad", + "docs": [ + "Padding to keep 8-byte alignment (32 + 2 + 1 + 1 + 4 = 40 bytes)" + ], + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, + { + "name": "ValidatorRemovedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "vpp", + "type": "u8" + } + ] + } + }, + { + "name": "ValidatorReputation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Trusted" + }, + { + "name": "Blacklisted" + }, + { + "name": "UnderPerforming" + } + ] + } + }, + { + "name": "ValidatorState", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Warming" + }, + { + "name": "NotDelegated" + }, + { + "name": "Cooling" + }, + { + "name": "Warm" + }, + { + "name": "ReadyToCool" + } + ] + } + }, + { + "name": "ValidatorSwappedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "removed_vote", + "type": "pubkey" + }, + { + "name": "removed_vpp", + "type": "u8" + }, + { + "name": "added_vote", + "type": "pubkey" + }, + { + "name": "added_vpp", + "type": "u8" + } + ] + } + }, + { + "name": "ValidatorTransientAccount", + "docs": [ + "Per-validator transient stake tracking account", + "Seed: [\"validator_transient\", vote_account]", + "", + "This account tracks the resolution status of transient stake accounts", + "(both activating and deactivating) for a specific validator." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "docs": [ + "Vote account this transient tracking belongs to" + ], + "type": "pubkey" + }, + { + "name": "bump", + "docs": [ + "Bump seed for PDA" + ], + "type": "u8" + }, + { + "name": "_padding", + "docs": [ + "Padding for alignment" + ], + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "max_resolved_epoch_deactivations", + "docs": [ + "The epoch number for which we have resolved the deactivating stakes", + "(resolved = deactivated and merged into the stake pool reserve)" + ], + "type": "u16" + }, + { + "name": "max_resolved_activating_stake", + "docs": [ + "The epoch number for which we have resolved the activating stakes", + "(resolved = fully activated and merged into the main stake account)" + ], + "type": "u16" + }, + { + "name": "last_updated_epoch_activations", + "docs": [ + "When did we last check if there are pending activated transient stakes that need to be merged in" + ], + "type": "u16" + }, + { + "name": "last_updated_epoch_deactivations", + "docs": [ + "When did we last check if there were pending deactivated stakes that need to be merged into the reserve pool" + ], + "type": "u16" + } + ] + } + }, + { + "name": "ValidatorsSyncedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "updated_count", + "type": "u32" + }, + { + "name": "not_found_count", + "type": "u32" + }, + { + "name": "epoch", + "type": "u64" + } + ] + } + }, + { + "name": "WireState", + "type": { + "kind": "enum", + "variants": [ + { + "name": "PreLaunch" + }, + { + "name": "PostLaunch" + }, + { + "name": "Refund" + } + ] + } + }, + { + "name": "WithdrawClaimed", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "user", + "type": "pubkey" + } + ] + } + }, + { + "name": "WithdrawRequested", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "receipt_id", + "type": "u64" + } + ] + } + } + ] +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts new file mode 100644 index 0000000..ce639bd --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts @@ -0,0 +1,1084 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common.js"; + +export type ChainIdStruct = { kind: BigNumberish; id: BigNumberish }; + +export type ChainIdStructOutput = [number, number] & { + kind: number; + id: number; +}; + +export type EndpointsStruct = { start: ChainIdStruct; end: ChainIdStruct }; + +export type EndpointsStructOutput = [ + ChainIdStructOutput, + ChainIdStructOutput +] & { start: ChainIdStructOutput; end: ChainIdStructOutput }; + +export type MessageHeaderStruct = { + endpoints: EndpointsStruct; + messageId: BytesLike; + previousMessageId: BytesLike; + payloadSize: BigNumberish; + payloadChecksum: BytesLike; + timestamp: BigNumberish; + headerChecksum: BytesLike; +}; + +export type MessageHeaderStructOutput = [ + EndpointsStructOutput, + string, + string, + number, + string, + BigNumber, + string +] & { + endpoints: EndpointsStructOutput; + messageId: string; + previousMessageId: string; + payloadSize: number; + payloadChecksum: string; + timestamp: BigNumber; + headerChecksum: string; +}; + +export type AttestationEntryStruct = { + type_: BigNumberish; + dataSize: BigNumberish; + data: BytesLike; +}; + +export type AttestationEntryStructOutput = [number, number, string] & { + type_: number; + dataSize: number; + data: string; +}; + +export type MessagePayloadStruct = { + version: BigNumberish; + attestations: AttestationEntryStruct[]; +}; + +export type MessagePayloadStructOutput = [ + number, + AttestationEntryStructOutput[] +] & { version: number; attestations: AttestationEntryStructOutput[] }; + +export declare namespace OPPEnvelopeRetention { + export type EnvelopeRecordStruct = { + epochIndex: BigNumberish; + emittedAt: BigNumberish; + checksum: BytesLike; + }; + + export type EnvelopeRecordStructOutput = [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + }; +} + +export interface OPPInterface extends utils.Interface { + functions: { + "MAX_ENVELOPE_BYTES()": FunctionFragment; + "UPGRADE_INTERFACE_VERSION()": FunctionFragment; + "addAttestation(uint16,bytes)": FunctionFragment; + "allAuthorizedSenders(uint256)": FunctionFragment; + "authority()": FunctionFragment; + "authorizedSenders(bytes32)": FunctionFragment; + "emitOutboundEnvelope(uint32)": FunctionFragment; + "enterSendMode(uint256)": FunctionFragment; + "exitSendMode(uint256)": FunctionFragment; + "getLatestOutboundEnvelope()": FunctionFragment; + "getOutboundEnvelope(uint32)": FunctionFragment; + "inSendMode()": FunctionFragment; + "initialize(address)": FunctionFragment; + "isConsumingScheduledOp()": FunctionFragment; + "lastMessageID()": FunctionFragment; + "lastMessageTimestamp()": FunctionFragment; + "latestOutboundEnvelope()": FunctionFragment; + "latestOutboundEpoch()": FunctionFragment; + "outboundEnvelopes(uint32)": FunctionFragment; + "outboundRetentionConfig()": FunctionFragment; + "pendingAttestationCount()": FunctionFragment; + "proxiableUUID()": FunctionFragment; + "pruneOutboundEnvelope(uint32)": FunctionFragment; + "queuedMessageCount()": FunctionFragment; + "sendModeTag()": FunctionFragment; + "serializeMessage((((uint8,uint32),(uint8,uint32)),bytes,bytes,uint32,bytes,uint64,bytes),(uint32,(uint16,uint32,bytes)[]))": FunctionFragment; + "setAuthority(address)": FunctionFragment; + "setEnvelopeRetentionConfig(uint32)": FunctionFragment; + "upgradeToAndCall(address,bytes)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "MAX_ENVELOPE_BYTES" + | "UPGRADE_INTERFACE_VERSION" + | "addAttestation" + | "allAuthorizedSenders" + | "authority" + | "authorizedSenders" + | "emitOutboundEnvelope" + | "enterSendMode" + | "exitSendMode" + | "getLatestOutboundEnvelope" + | "getOutboundEnvelope" + | "inSendMode" + | "initialize" + | "isConsumingScheduledOp" + | "lastMessageID" + | "lastMessageTimestamp" + | "latestOutboundEnvelope" + | "latestOutboundEpoch" + | "outboundEnvelopes" + | "outboundRetentionConfig" + | "pendingAttestationCount" + | "proxiableUUID" + | "pruneOutboundEnvelope" + | "queuedMessageCount" + | "sendModeTag" + | "serializeMessage" + | "setAuthority" + | "setEnvelopeRetentionConfig" + | "upgradeToAndCall" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "MAX_ENVELOPE_BYTES", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "UPGRADE_INTERFACE_VERSION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "addAttestation", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "allAuthorizedSenders", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "authority", values?: undefined): string; + encodeFunctionData( + functionFragment: "authorizedSenders", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "emitOutboundEnvelope", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "enterSendMode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "exitSendMode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getLatestOutboundEnvelope", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getOutboundEnvelope", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "inSendMode", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; + encodeFunctionData( + functionFragment: "isConsumingScheduledOp", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastMessageID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastMessageTimestamp", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "latestOutboundEnvelope", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "latestOutboundEpoch", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "outboundEnvelopes", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "outboundRetentionConfig", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pendingAttestationCount", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pruneOutboundEnvelope", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "queuedMessageCount", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "sendModeTag", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "serializeMessage", + values: [MessageHeaderStruct, MessagePayloadStruct] + ): string; + encodeFunctionData( + functionFragment: "setAuthority", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setEnvelopeRetentionConfig", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [string, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "MAX_ENVELOPE_BYTES", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "UPGRADE_INTERFACE_VERSION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "addAttestation", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "allAuthorizedSenders", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "authorizedSenders", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "emitOutboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "enterSendMode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "exitSendMode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLatestOutboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getOutboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "inSendMode", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isConsumingScheduledOp", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastMessageID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastMessageTimestamp", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "latestOutboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "latestOutboundEpoch", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "outboundEnvelopes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "outboundRetentionConfig", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingAttestationCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pruneOutboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "queuedMessageCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "sendModeTag", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "serializeMessage", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAuthority", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setEnvelopeRetentionConfig", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; + + events: { + "AuthorityUpdated(address)": EventFragment; + "EnvelopeRetentionCatchUpPruned(uint32)": EventFragment; + "EnvelopeRetentionConfigUpdated(uint32,uint32)": EventFragment; + "Initialized(uint64)": EventFragment; + "OPPEnvelope(bytes)": EventFragment; + "Upgraded(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "EnvelopeRetentionCatchUpPruned" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "EnvelopeRetentionConfigUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OPPEnvelope"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; +} + +export interface AuthorityUpdatedEventObject { + authority: string; +} +export type AuthorityUpdatedEvent = TypedEvent< + [string], + AuthorityUpdatedEventObject +>; + +export type AuthorityUpdatedEventFilter = + TypedEventFilter; + +export interface EnvelopeRetentionCatchUpPrunedEventObject { + epochIndex: number; +} +export type EnvelopeRetentionCatchUpPrunedEvent = TypedEvent< + [number], + EnvelopeRetentionCatchUpPrunedEventObject +>; + +export type EnvelopeRetentionCatchUpPrunedEventFilter = + TypedEventFilter; + +export interface EnvelopeRetentionConfigUpdatedEventObject { + previousRetentionEpochs: number; + retentionEpochs: number; +} +export type EnvelopeRetentionConfigUpdatedEvent = TypedEvent< + [number, number], + EnvelopeRetentionConfigUpdatedEventObject +>; + +export type EnvelopeRetentionConfigUpdatedEventFilter = + TypedEventFilter; + +export interface InitializedEventObject { + version: BigNumber; +} +export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; + +export type InitializedEventFilter = TypedEventFilter; + +export interface OPPEnvelopeEventObject { + data: string; +} +export type OPPEnvelopeEvent = TypedEvent<[string], OPPEnvelopeEventObject>; + +export type OPPEnvelopeEventFilter = TypedEventFilter; + +export interface UpgradedEventObject { + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface OPP extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OPPInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; + + addAttestation( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + allAuthorizedSenders( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + authority(overrides?: CallOverrides): Promise<[string]>; + + authorizedSenders( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[boolean]>; + + emitOutboundEnvelope( + wireEpochIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + enterSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exitSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getLatestOutboundEnvelope( + overrides?: CallOverrides + ): Promise<[number, string] & { epoch_: number; data_: string }>; + + getOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise<[OPPEnvelopeRetention.EnvelopeRecordStructOutput]>; + + inSendMode(overrides?: CallOverrides): Promise<[boolean]>; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; + + lastMessageID(overrides?: CallOverrides): Promise<[string]>; + + lastMessageTimestamp(overrides?: CallOverrides): Promise<[BigNumber]>; + + latestOutboundEnvelope(overrides?: CallOverrides): Promise<[string]>; + + latestOutboundEpoch(overrides?: CallOverrides): Promise<[number]>; + + outboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + } + >; + + outboundRetentionConfig( + overrides?: CallOverrides + ): Promise<[number] & { retentionEpochs: number }>; + + pendingAttestationCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + proxiableUUID(overrides?: CallOverrides): Promise<[string]>; + + pruneOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + queuedMessageCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + sendModeTag(overrides?: CallOverrides): Promise<[BigNumber]>; + + serializeMessage( + header: MessageHeaderStruct, + payload: MessagePayloadStruct, + overrides?: CallOverrides + ): Promise<[MessageHeaderStructOutput]>; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + addAttestation( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + allAuthorizedSenders( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + authorizedSenders( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + emitOutboundEnvelope( + wireEpochIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + enterSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exitSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getLatestOutboundEnvelope( + overrides?: CallOverrides + ): Promise<[number, string] & { epoch_: number; data_: string }>; + + getOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inSendMode(overrides?: CallOverrides): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + lastMessageTimestamp(overrides?: CallOverrides): Promise; + + latestOutboundEnvelope(overrides?: CallOverrides): Promise; + + latestOutboundEpoch(overrides?: CallOverrides): Promise; + + outboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + } + >; + + outboundRetentionConfig(overrides?: CallOverrides): Promise; + + pendingAttestationCount(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + queuedMessageCount(overrides?: CallOverrides): Promise; + + sendModeTag(overrides?: CallOverrides): Promise; + + serializeMessage( + header: MessageHeaderStruct, + payload: MessagePayloadStruct, + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + callStatic: { + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + addAttestation( + attestationType: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + allAuthorizedSenders( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + authorizedSenders( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + emitOutboundEnvelope( + wireEpochIndex: BigNumberish, + overrides?: CallOverrides + ): Promise; + + enterSendMode(tag: BigNumberish, overrides?: CallOverrides): Promise; + + exitSendMode(tag: BigNumberish, overrides?: CallOverrides): Promise; + + getLatestOutboundEnvelope( + overrides?: CallOverrides + ): Promise<[number, string] & { epoch_: number; data_: string }>; + + getOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inSendMode(overrides?: CallOverrides): Promise; + + initialize(_authority: string, overrides?: CallOverrides): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + lastMessageTimestamp(overrides?: CallOverrides): Promise; + + latestOutboundEnvelope(overrides?: CallOverrides): Promise; + + latestOutboundEpoch(overrides?: CallOverrides): Promise; + + outboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + } + >; + + outboundRetentionConfig(overrides?: CallOverrides): Promise; + + pendingAttestationCount(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + queuedMessageCount(overrides?: CallOverrides): Promise; + + sendModeTag(overrides?: CallOverrides): Promise; + + serializeMessage( + header: MessageHeaderStruct, + payload: MessagePayloadStruct, + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: CallOverrides + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: CallOverrides + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; + AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; + + "EnvelopeRetentionCatchUpPruned(uint32)"( + epochIndex?: BigNumberish | null + ): EnvelopeRetentionCatchUpPrunedEventFilter; + EnvelopeRetentionCatchUpPruned( + epochIndex?: BigNumberish | null + ): EnvelopeRetentionCatchUpPrunedEventFilter; + + "EnvelopeRetentionConfigUpdated(uint32,uint32)"( + previousRetentionEpochs?: null, + retentionEpochs?: null + ): EnvelopeRetentionConfigUpdatedEventFilter; + EnvelopeRetentionConfigUpdated( + previousRetentionEpochs?: null, + retentionEpochs?: null + ): EnvelopeRetentionConfigUpdatedEventFilter; + + "Initialized(uint64)"(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; + + "OPPEnvelope(bytes)"(data?: null): OPPEnvelopeEventFilter; + OPPEnvelope(data?: null): OPPEnvelopeEventFilter; + + "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; + Upgraded(implementation?: string | null): UpgradedEventFilter; + }; + + estimateGas: { + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + addAttestation( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + allAuthorizedSenders( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + authorizedSenders( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + emitOutboundEnvelope( + wireEpochIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + enterSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exitSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getLatestOutboundEnvelope(overrides?: CallOverrides): Promise; + + getOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inSendMode(overrides?: CallOverrides): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + lastMessageTimestamp(overrides?: CallOverrides): Promise; + + latestOutboundEnvelope(overrides?: CallOverrides): Promise; + + latestOutboundEpoch(overrides?: CallOverrides): Promise; + + outboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + outboundRetentionConfig(overrides?: CallOverrides): Promise; + + pendingAttestationCount(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + queuedMessageCount(overrides?: CallOverrides): Promise; + + sendModeTag(overrides?: CallOverrides): Promise; + + serializeMessage( + header: MessageHeaderStruct, + payload: MessagePayloadStruct, + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + MAX_ENVELOPE_BYTES( + overrides?: CallOverrides + ): Promise; + + UPGRADE_INTERFACE_VERSION( + overrides?: CallOverrides + ): Promise; + + addAttestation( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + allAuthorizedSenders( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + authorizedSenders( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + emitOutboundEnvelope( + wireEpochIndex: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + enterSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + exitSendMode( + tag: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + getLatestOutboundEnvelope( + overrides?: CallOverrides + ): Promise; + + getOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inSendMode(overrides?: CallOverrides): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp( + overrides?: CallOverrides + ): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + lastMessageTimestamp( + overrides?: CallOverrides + ): Promise; + + latestOutboundEnvelope( + overrides?: CallOverrides + ): Promise; + + latestOutboundEpoch( + overrides?: CallOverrides + ): Promise; + + outboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + outboundRetentionConfig( + overrides?: CallOverrides + ): Promise; + + pendingAttestationCount( + overrides?: CallOverrides + ): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneOutboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + queuedMessageCount( + overrides?: CallOverrides + ): Promise; + + sendModeTag(overrides?: CallOverrides): Promise; + + serializeMessage( + header: MessageHeaderStruct, + payload: MessagePayloadStruct, + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts new file mode 100644 index 0000000..761db9a --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts @@ -0,0 +1,1660 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common.js"; + +export type ChainIdStruct = { kind: BigNumberish; id: BigNumberish }; + +export type ChainIdStructOutput = [number, number] & { + kind: number; + id: number; +}; + +export type EndpointsStruct = { start: ChainIdStruct; end: ChainIdStruct }; + +export type EndpointsStructOutput = [ + ChainIdStructOutput, + ChainIdStructOutput +] & { start: ChainIdStructOutput; end: ChainIdStructOutput }; + +export declare namespace OPPEnvelopeRetention { + export type EnvelopeRecordStruct = { + epochIndex: BigNumberish; + emittedAt: BigNumberish; + checksum: BytesLike; + }; + + export type EnvelopeRecordStructOutput = [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + }; +} + +export interface OPPInboundInterface extends utils.Interface { + functions: { + "MAX_ENVELOPE_BYTES()": FunctionFragment; + "MIN_SIG_WEIGHT()": FunctionFragment; + "UPGRADE_INTERFACE_VERSION()": FunctionFragment; + "activeGroupIndex()": FunctionFragment; + "attestationHandlers(uint16)": FunctionFragment; + "authority()": FunctionFragment; + "batchOpGroups(uint256,uint256)": FunctionFragment; + "consensusReached()": FunctionFragment; + "currentEpochStartedAt()": FunctionFragment; + "epochDeliveries(uint32,address)": FunctionFragment; + "epochDeliveryCount(uint32)": FunctionFragment; + "epochDigestCount(uint32,bytes32)": FunctionFragment; + "epochDurationSec()": FunctionFragment; + "epochIn(bytes)": FunctionFragment; + "getInboundEnvelope(uint32)": FunctionFragment; + "inboundEnvelopes(uint32)": FunctionFragment; + "inboundRetentionConfig()": FunctionFragment; + "initialize(address)": FunctionFragment; + "isActiveOperator(address)": FunctionFragment; + "isConsumingScheduledOp()": FunctionFragment; + "lastMessageID()": FunctionFragment; + "nextEpochIndex()": FunctionFragment; + "operatorEthAddress(bytes32)": FunctionFragment; + "oppContract()": FunctionFragment; + "pendingConsensus()": FunctionFragment; + "pendingConsensusForDigest(bytes32)": FunctionFragment; + "pendingEpoch()": FunctionFragment; + "pendingEpochHash()": FunctionFragment; + "pendingMessageCount()": FunctionFragment; + "previousEpochHash()": FunctionFragment; + "proxiableUUID()": FunctionFragment; + "pruneInboundEnvelope(uint32)": FunctionFragment; + "pubkeyAddressCache(bytes32)": FunctionFragment; + "reserveManagerAddress()": FunctionFragment; + "rosterInitialized()": FunctionFragment; + "setAttestationHandler(uint16,address)": FunctionFragment; + "setAuthority(address)": FunctionFragment; + "setEnvelopeRetentionConfig(uint32)": FunctionFragment; + "setEpochDurationSec(uint32)": FunctionFragment; + "setOPPContract(address)": FunctionFragment; + "setReserveManagerAddress(address)": FunctionFragment; + "upgradeToAndCall(address,bytes)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "MAX_ENVELOPE_BYTES" + | "MIN_SIG_WEIGHT" + | "UPGRADE_INTERFACE_VERSION" + | "activeGroupIndex" + | "attestationHandlers" + | "authority" + | "batchOpGroups" + | "consensusReached" + | "currentEpochStartedAt" + | "epochDeliveries" + | "epochDeliveryCount" + | "epochDigestCount" + | "epochDurationSec" + | "epochIn" + | "getInboundEnvelope" + | "inboundEnvelopes" + | "inboundRetentionConfig" + | "initialize" + | "isActiveOperator" + | "isConsumingScheduledOp" + | "lastMessageID" + | "nextEpochIndex" + | "operatorEthAddress" + | "oppContract" + | "pendingConsensus" + | "pendingConsensusForDigest" + | "pendingEpoch" + | "pendingEpochHash" + | "pendingMessageCount" + | "previousEpochHash" + | "proxiableUUID" + | "pruneInboundEnvelope" + | "pubkeyAddressCache" + | "reserveManagerAddress" + | "rosterInitialized" + | "setAttestationHandler" + | "setAuthority" + | "setEnvelopeRetentionConfig" + | "setEpochDurationSec" + | "setOPPContract" + | "setReserveManagerAddress" + | "upgradeToAndCall" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "MAX_ENVELOPE_BYTES", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "MIN_SIG_WEIGHT", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "UPGRADE_INTERFACE_VERSION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "activeGroupIndex", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "attestationHandlers", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "authority", values?: undefined): string; + encodeFunctionData( + functionFragment: "batchOpGroups", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "consensusReached", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "currentEpochStartedAt", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "epochDeliveries", + values: [BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "epochDeliveryCount", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "epochDigestCount", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "epochDurationSec", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "epochIn", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "getInboundEnvelope", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "inboundEnvelopes", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "inboundRetentionConfig", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; + encodeFunctionData( + functionFragment: "isActiveOperator", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "isConsumingScheduledOp", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "lastMessageID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nextEpochIndex", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "operatorEthAddress", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "oppContract", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pendingConsensus", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pendingConsensusForDigest", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "pendingEpoch", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pendingEpochHash", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pendingMessageCount", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "previousEpochHash", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "pruneInboundEnvelope", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "pubkeyAddressCache", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "reserveManagerAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "rosterInitialized", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setAttestationHandler", + values: [BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "setAuthority", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setEnvelopeRetentionConfig", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setEpochDurationSec", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOPPContract", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setReserveManagerAddress", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [string, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "MAX_ENVELOPE_BYTES", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "MIN_SIG_WEIGHT", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "UPGRADE_INTERFACE_VERSION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "activeGroupIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "attestationHandlers", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "batchOpGroups", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "consensusReached", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "currentEpochStartedAt", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "epochDeliveries", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "epochDeliveryCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "epochDigestCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "epochDurationSec", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "epochIn", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getInboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "inboundEnvelopes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "inboundRetentionConfig", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isActiveOperator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isConsumingScheduledOp", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "lastMessageID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nextEpochIndex", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "operatorEthAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "oppContract", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingConsensus", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingConsensusForDigest", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingEpoch", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingEpochHash", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pendingMessageCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "previousEpochHash", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pruneInboundEnvelope", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "pubkeyAddressCache", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "reserveManagerAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rosterInitialized", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAttestationHandler", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAuthority", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setEnvelopeRetentionConfig", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setEpochDurationSec", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOPPContract", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setReserveManagerAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; + + events: { + "AttestationBlackholed(bytes,uint16,uint64)": EventFragment; + "AttestationDelivered(address,bytes,uint16,uint64)": EventFragment; + "AttestationHandlerSet(uint16,address,address)": EventFragment; + "AuthorityUpdated(address)": EventFragment; + "EnvelopeRetentionCatchUpPruned(uint32)": EventFragment; + "EnvelopeRetentionConfigUpdated(uint32,uint32)": EventFragment; + "EpochComplete(uint32)": EventFragment; + "EpochConsensus(uint32,bytes32,uint32)": EventFragment; + "EpochDelivery(uint32,address,bytes32)": EventFragment; + "EpochReceived(uint32,bytes32,uint256)": EventFragment; + "Initialized(uint64)": EventFragment; + "ReserveManagerAddressSet(address,address)": EventFragment; + "Upgraded(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AttestationBlackholed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AttestationDelivered"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AttestationHandlerSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "EnvelopeRetentionCatchUpPruned" + ): EventFragment; + getEvent( + nameOrSignatureOrTopic: "EnvelopeRetentionConfigUpdated" + ): EventFragment; + getEvent(nameOrSignatureOrTopic: "EpochComplete"): EventFragment; + getEvent(nameOrSignatureOrTopic: "EpochConsensus"): EventFragment; + getEvent(nameOrSignatureOrTopic: "EpochDelivery"): EventFragment; + getEvent(nameOrSignatureOrTopic: "EpochReceived"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ReserveManagerAddressSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; +} + +export interface AttestationBlackholedEventObject { + messageID: string; + attestationType: number; + sequenceNumber: BigNumber; +} +export type AttestationBlackholedEvent = TypedEvent< + [string, number, BigNumber], + AttestationBlackholedEventObject +>; + +export type AttestationBlackholedEventFilter = + TypedEventFilter; + +export interface AttestationDeliveredEventObject { + handler: string; + messageID: string; + attestationType: number; + sequenceNumber: BigNumber; +} +export type AttestationDeliveredEvent = TypedEvent< + [string, string, number, BigNumber], + AttestationDeliveredEventObject +>; + +export type AttestationDeliveredEventFilter = + TypedEventFilter; + +export interface AttestationHandlerSetEventObject { + attestationType: number; + handler: string; + oldHandler: string; +} +export type AttestationHandlerSetEvent = TypedEvent< + [number, string, string], + AttestationHandlerSetEventObject +>; + +export type AttestationHandlerSetEventFilter = + TypedEventFilter; + +export interface AuthorityUpdatedEventObject { + authority: string; +} +export type AuthorityUpdatedEvent = TypedEvent< + [string], + AuthorityUpdatedEventObject +>; + +export type AuthorityUpdatedEventFilter = + TypedEventFilter; + +export interface EnvelopeRetentionCatchUpPrunedEventObject { + epochIndex: number; +} +export type EnvelopeRetentionCatchUpPrunedEvent = TypedEvent< + [number], + EnvelopeRetentionCatchUpPrunedEventObject +>; + +export type EnvelopeRetentionCatchUpPrunedEventFilter = + TypedEventFilter; + +export interface EnvelopeRetentionConfigUpdatedEventObject { + previousRetentionEpochs: number; + retentionEpochs: number; +} +export type EnvelopeRetentionConfigUpdatedEvent = TypedEvent< + [number, number], + EnvelopeRetentionConfigUpdatedEventObject +>; + +export type EnvelopeRetentionConfigUpdatedEventFilter = + TypedEventFilter; + +export interface EpochCompleteEventObject { + epochIndex: number; +} +export type EpochCompleteEvent = TypedEvent<[number], EpochCompleteEventObject>; + +export type EpochCompleteEventFilter = TypedEventFilter; + +export interface EpochConsensusEventObject { + epochIndex: number; + epochHash: string; + deliveryCount: number; +} +export type EpochConsensusEvent = TypedEvent< + [number, string, number], + EpochConsensusEventObject +>; + +export type EpochConsensusEventFilter = TypedEventFilter; + +export interface EpochDeliveryEventObject { + epochIndex: number; + operator_: string; + epochHash: string; +} +export type EpochDeliveryEvent = TypedEvent< + [number, string, string], + EpochDeliveryEventObject +>; + +export type EpochDeliveryEventFilter = TypedEventFilter; + +export interface EpochReceivedEventObject { + epochIndex: number; + epochHash: string; + messageCount: BigNumber; +} +export type EpochReceivedEvent = TypedEvent< + [number, string, BigNumber], + EpochReceivedEventObject +>; + +export type EpochReceivedEventFilter = TypedEventFilter; + +export interface InitializedEventObject { + version: BigNumber; +} +export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; + +export type InitializedEventFilter = TypedEventFilter; + +export interface ReserveManagerAddressSetEventObject { + newReserveManager: string; + oldReserveManager: string; +} +export type ReserveManagerAddressSetEvent = TypedEvent< + [string, string], + ReserveManagerAddressSetEventObject +>; + +export type ReserveManagerAddressSetEventFilter = + TypedEventFilter; + +export interface UpgradedEventObject { + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface OPPInbound extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OPPInboundInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>; + + MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise<[BigNumber]>; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; + + activeGroupIndex(overrides?: CallOverrides): Promise<[number]>; + + attestationHandlers( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + authority(overrides?: CallOverrides): Promise<[string]>; + + batchOpGroups( + arg0: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + consensusReached(overrides?: CallOverrides): Promise<[boolean]>; + + currentEpochStartedAt(overrides?: CallOverrides): Promise<[BigNumber]>; + + epochDeliveries( + arg0: BigNumberish, + arg1: string, + overrides?: CallOverrides + ): Promise<[string]>; + + epochDeliveryCount( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[number]>; + + epochDigestCount( + arg0: BigNumberish, + arg1: BytesLike, + overrides?: CallOverrides + ): Promise<[number]>; + + epochDurationSec(overrides?: CallOverrides): Promise<[number]>; + + epochIn( + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise<[OPPEnvelopeRetention.EnvelopeRecordStructOutput]>; + + inboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + } + >; + + inboundRetentionConfig( + overrides?: CallOverrides + ): Promise<[number] & { retentionEpochs: number }>; + + initialize( + oppManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isActiveOperator( + operator_: string, + overrides?: CallOverrides + ): Promise<[boolean]>; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; + + lastMessageID(overrides?: CallOverrides): Promise<[string]>; + + nextEpochIndex(overrides?: CallOverrides): Promise<[number]>; + + operatorEthAddress( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[string]>; + + oppContract(overrides?: CallOverrides): Promise<[string]>; + + pendingConsensus( + overrides?: CallOverrides + ): Promise< + [number, number, number, BigNumber, number] & { + nextEpoch: number; + deliveries: number; + groupSize: number; + currentEpochStartedAtTs: BigNumber; + epochDurationSec_: number; + } + >; + + pendingConsensusForDigest( + digest: BytesLike, + overrides?: CallOverrides + ): Promise< + [number, number, number, BigNumber, number] & { + nextEpoch: number; + agreeing: number; + groupSize: number; + currentEpochStartedAtTs: BigNumber; + epochDurationSec_: number; + } + >; + + pendingEpoch( + overrides?: CallOverrides + ): Promise< + [string, EndpointsStructOutput, BigNumber, number, number, string] & { + envelopeHash: string; + endpoints: EndpointsStructOutput; + epochTimestamp: BigNumber; + epochIndex: number; + epochEnvelopeIndex: number; + previousEnvelopeHash: string; + } + >; + + pendingEpochHash(overrides?: CallOverrides): Promise<[string]>; + + pendingMessageCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + previousEpochHash(overrides?: CallOverrides): Promise<[string]>; + + proxiableUUID(overrides?: CallOverrides): Promise<[string]>; + + pruneInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + pubkeyAddressCache( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise<[string]>; + + reserveManagerAddress(overrides?: CallOverrides): Promise<[string]>; + + rosterInitialized(overrides?: CallOverrides): Promise<[boolean]>; + + setAttestationHandler( + attestationType: BigNumberish, + handler: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEpochDurationSec( + durationSec: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPContract( + opp: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + newReserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; + + MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + activeGroupIndex(overrides?: CallOverrides): Promise; + + attestationHandlers( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + batchOpGroups( + arg0: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + consensusReached(overrides?: CallOverrides): Promise; + + currentEpochStartedAt(overrides?: CallOverrides): Promise; + + epochDeliveries( + arg0: BigNumberish, + arg1: string, + overrides?: CallOverrides + ): Promise; + + epochDeliveryCount( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + epochDigestCount( + arg0: BigNumberish, + arg1: BytesLike, + overrides?: CallOverrides + ): Promise; + + epochDurationSec(overrides?: CallOverrides): Promise; + + epochIn( + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + } + >; + + inboundRetentionConfig(overrides?: CallOverrides): Promise; + + initialize( + oppManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isActiveOperator( + operator_: string, + overrides?: CallOverrides + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + nextEpochIndex(overrides?: CallOverrides): Promise; + + operatorEthAddress( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + oppContract(overrides?: CallOverrides): Promise; + + pendingConsensus( + overrides?: CallOverrides + ): Promise< + [number, number, number, BigNumber, number] & { + nextEpoch: number; + deliveries: number; + groupSize: number; + currentEpochStartedAtTs: BigNumber; + epochDurationSec_: number; + } + >; + + pendingConsensusForDigest( + digest: BytesLike, + overrides?: CallOverrides + ): Promise< + [number, number, number, BigNumber, number] & { + nextEpoch: number; + agreeing: number; + groupSize: number; + currentEpochStartedAtTs: BigNumber; + epochDurationSec_: number; + } + >; + + pendingEpoch( + overrides?: CallOverrides + ): Promise< + [string, EndpointsStructOutput, BigNumber, number, number, string] & { + envelopeHash: string; + endpoints: EndpointsStructOutput; + epochTimestamp: BigNumber; + epochIndex: number; + epochEnvelopeIndex: number; + previousEnvelopeHash: string; + } + >; + + pendingEpochHash(overrides?: CallOverrides): Promise; + + pendingMessageCount(overrides?: CallOverrides): Promise; + + previousEpochHash(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + pubkeyAddressCache( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + reserveManagerAddress(overrides?: CallOverrides): Promise; + + rosterInitialized(overrides?: CallOverrides): Promise; + + setAttestationHandler( + attestationType: BigNumberish, + handler: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEpochDurationSec( + durationSec: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPContract( + opp: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + newReserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + callStatic: { + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; + + MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + activeGroupIndex(overrides?: CallOverrides): Promise; + + attestationHandlers( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + batchOpGroups( + arg0: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + consensusReached(overrides?: CallOverrides): Promise; + + currentEpochStartedAt(overrides?: CallOverrides): Promise; + + epochDeliveries( + arg0: BigNumberish, + arg1: string, + overrides?: CallOverrides + ): Promise; + + epochDeliveryCount( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + epochDigestCount( + arg0: BigNumberish, + arg1: BytesLike, + overrides?: CallOverrides + ): Promise; + + epochDurationSec(overrides?: CallOverrides): Promise; + + epochIn(data: BytesLike, overrides?: CallOverrides): Promise; + + getInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise< + [number, BigNumber, string] & { + epochIndex: number; + emittedAt: BigNumber; + checksum: string; + } + >; + + inboundRetentionConfig(overrides?: CallOverrides): Promise; + + initialize(oppManager: string, overrides?: CallOverrides): Promise; + + isActiveOperator( + operator_: string, + overrides?: CallOverrides + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + nextEpochIndex(overrides?: CallOverrides): Promise; + + operatorEthAddress( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + oppContract(overrides?: CallOverrides): Promise; + + pendingConsensus( + overrides?: CallOverrides + ): Promise< + [number, number, number, BigNumber, number] & { + nextEpoch: number; + deliveries: number; + groupSize: number; + currentEpochStartedAtTs: BigNumber; + epochDurationSec_: number; + } + >; + + pendingConsensusForDigest( + digest: BytesLike, + overrides?: CallOverrides + ): Promise< + [number, number, number, BigNumber, number] & { + nextEpoch: number; + agreeing: number; + groupSize: number; + currentEpochStartedAtTs: BigNumber; + epochDurationSec_: number; + } + >; + + pendingEpoch( + overrides?: CallOverrides + ): Promise< + [string, EndpointsStructOutput, BigNumber, number, number, string] & { + envelopeHash: string; + endpoints: EndpointsStructOutput; + epochTimestamp: BigNumber; + epochIndex: number; + epochEnvelopeIndex: number; + previousEnvelopeHash: string; + } + >; + + pendingEpochHash(overrides?: CallOverrides): Promise; + + pendingMessageCount(overrides?: CallOverrides): Promise; + + previousEpochHash(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + pubkeyAddressCache( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + reserveManagerAddress(overrides?: CallOverrides): Promise; + + rosterInitialized(overrides?: CallOverrides): Promise; + + setAttestationHandler( + attestationType: BigNumberish, + handler: string, + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: CallOverrides + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setEpochDurationSec( + durationSec: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOPPContract(opp: string, overrides?: CallOverrides): Promise; + + setReserveManagerAddress( + newReserveManager: string, + overrides?: CallOverrides + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AttestationBlackholed(bytes,uint16,uint64)"( + messageID?: null, + attestationType?: null, + sequenceNumber?: null + ): AttestationBlackholedEventFilter; + AttestationBlackholed( + messageID?: null, + attestationType?: null, + sequenceNumber?: null + ): AttestationBlackholedEventFilter; + + "AttestationDelivered(address,bytes,uint16,uint64)"( + handler?: string | null, + messageID?: null, + attestationType?: null, + sequenceNumber?: null + ): AttestationDeliveredEventFilter; + AttestationDelivered( + handler?: string | null, + messageID?: null, + attestationType?: null, + sequenceNumber?: null + ): AttestationDeliveredEventFilter; + + "AttestationHandlerSet(uint16,address,address)"( + attestationType?: BigNumberish | null, + handler?: null, + oldHandler?: null + ): AttestationHandlerSetEventFilter; + AttestationHandlerSet( + attestationType?: BigNumberish | null, + handler?: null, + oldHandler?: null + ): AttestationHandlerSetEventFilter; + + "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; + AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; + + "EnvelopeRetentionCatchUpPruned(uint32)"( + epochIndex?: BigNumberish | null + ): EnvelopeRetentionCatchUpPrunedEventFilter; + EnvelopeRetentionCatchUpPruned( + epochIndex?: BigNumberish | null + ): EnvelopeRetentionCatchUpPrunedEventFilter; + + "EnvelopeRetentionConfigUpdated(uint32,uint32)"( + previousRetentionEpochs?: null, + retentionEpochs?: null + ): EnvelopeRetentionConfigUpdatedEventFilter; + EnvelopeRetentionConfigUpdated( + previousRetentionEpochs?: null, + retentionEpochs?: null + ): EnvelopeRetentionConfigUpdatedEventFilter; + + "EpochComplete(uint32)"(epochIndex?: null): EpochCompleteEventFilter; + EpochComplete(epochIndex?: null): EpochCompleteEventFilter; + + "EpochConsensus(uint32,bytes32,uint32)"( + epochIndex?: BigNumberish | null, + epochHash?: null, + deliveryCount?: null + ): EpochConsensusEventFilter; + EpochConsensus( + epochIndex?: BigNumberish | null, + epochHash?: null, + deliveryCount?: null + ): EpochConsensusEventFilter; + + "EpochDelivery(uint32,address,bytes32)"( + epochIndex?: BigNumberish | null, + operator_?: string | null, + epochHash?: null + ): EpochDeliveryEventFilter; + EpochDelivery( + epochIndex?: BigNumberish | null, + operator_?: string | null, + epochHash?: null + ): EpochDeliveryEventFilter; + + "EpochReceived(uint32,bytes32,uint256)"( + epochIndex?: null, + epochHash?: null, + messageCount?: null + ): EpochReceivedEventFilter; + EpochReceived( + epochIndex?: null, + epochHash?: null, + messageCount?: null + ): EpochReceivedEventFilter; + + "Initialized(uint64)"(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; + + "ReserveManagerAddressSet(address,address)"( + newReserveManager?: null, + oldReserveManager?: null + ): ReserveManagerAddressSetEventFilter; + ReserveManagerAddressSet( + newReserveManager?: null, + oldReserveManager?: null + ): ReserveManagerAddressSetEventFilter; + + "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; + Upgraded(implementation?: string | null): UpgradedEventFilter; + }; + + estimateGas: { + MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; + + MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + activeGroupIndex(overrides?: CallOverrides): Promise; + + attestationHandlers( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + batchOpGroups( + arg0: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + consensusReached(overrides?: CallOverrides): Promise; + + currentEpochStartedAt(overrides?: CallOverrides): Promise; + + epochDeliveries( + arg0: BigNumberish, + arg1: string, + overrides?: CallOverrides + ): Promise; + + epochDeliveryCount( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + epochDigestCount( + arg0: BigNumberish, + arg1: BytesLike, + overrides?: CallOverrides + ): Promise; + + epochDurationSec(overrides?: CallOverrides): Promise; + + epochIn( + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inboundRetentionConfig(overrides?: CallOverrides): Promise; + + initialize( + oppManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isActiveOperator( + operator_: string, + overrides?: CallOverrides + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + nextEpochIndex(overrides?: CallOverrides): Promise; + + operatorEthAddress( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + oppContract(overrides?: CallOverrides): Promise; + + pendingConsensus(overrides?: CallOverrides): Promise; + + pendingConsensusForDigest( + digest: BytesLike, + overrides?: CallOverrides + ): Promise; + + pendingEpoch(overrides?: CallOverrides): Promise; + + pendingEpochHash(overrides?: CallOverrides): Promise; + + pendingMessageCount(overrides?: CallOverrides): Promise; + + previousEpochHash(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + pubkeyAddressCache( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + reserveManagerAddress(overrides?: CallOverrides): Promise; + + rosterInitialized(overrides?: CallOverrides): Promise; + + setAttestationHandler( + attestationType: BigNumberish, + handler: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEpochDurationSec( + durationSec: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPContract( + opp: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + newReserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + MAX_ENVELOPE_BYTES( + overrides?: CallOverrides + ): Promise; + + MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION( + overrides?: CallOverrides + ): Promise; + + activeGroupIndex(overrides?: CallOverrides): Promise; + + attestationHandlers( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + batchOpGroups( + arg0: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + consensusReached(overrides?: CallOverrides): Promise; + + currentEpochStartedAt( + overrides?: CallOverrides + ): Promise; + + epochDeliveries( + arg0: BigNumberish, + arg1: string, + overrides?: CallOverrides + ): Promise; + + epochDeliveryCount( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + epochDigestCount( + arg0: BigNumberish, + arg1: BytesLike, + overrides?: CallOverrides + ): Promise; + + epochDurationSec(overrides?: CallOverrides): Promise; + + epochIn( + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + getInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inboundEnvelopes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + inboundRetentionConfig( + overrides?: CallOverrides + ): Promise; + + initialize( + oppManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isActiveOperator( + operator_: string, + overrides?: CallOverrides + ): Promise; + + isConsumingScheduledOp( + overrides?: CallOverrides + ): Promise; + + lastMessageID(overrides?: CallOverrides): Promise; + + nextEpochIndex(overrides?: CallOverrides): Promise; + + operatorEthAddress( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + oppContract(overrides?: CallOverrides): Promise; + + pendingConsensus(overrides?: CallOverrides): Promise; + + pendingConsensusForDigest( + digest: BytesLike, + overrides?: CallOverrides + ): Promise; + + pendingEpoch(overrides?: CallOverrides): Promise; + + pendingEpochHash(overrides?: CallOverrides): Promise; + + pendingMessageCount( + overrides?: CallOverrides + ): Promise; + + previousEpochHash(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + pruneInboundEnvelope( + epochIndex_: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + pubkeyAddressCache( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + reserveManagerAddress( + overrides?: CallOverrides + ): Promise; + + rosterInitialized(overrides?: CallOverrides): Promise; + + setAttestationHandler( + attestationType: BigNumberish, + handler: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setEnvelopeRetentionConfig( + retentionEpochs: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setEpochDurationSec( + durationSec: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPContract( + opp: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + newReserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts new file mode 100644 index 0000000..73b8e5e --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts @@ -0,0 +1,1433 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common.js"; + +export type AttestationEntryStruct = { + type_: BigNumberish; + dataSize: BigNumberish; + data: BytesLike; +}; + +export type AttestationEntryStructOutput = [number, number, string] & { + type_: number; + dataSize: number; + data: string; +}; + +export interface OperatorRegistryInterface extends utils.Interface { + functions: { + "DEPOSIT_REVERT_ATTESTATION()": FunctionFragment; + "DEPOSIT_REVERT_GAS_MULTIPLIER()": FunctionFragment; + "OPERATOR_ACTION_ATTESTATION()": FunctionFragment; + "OPPAttestationIn(uint16,bytes)": FunctionFragment; + "UNDERWRITE_INTENT_COMMIT_ATTESTATION()": FunctionFragment; + "UPGRADE_INTERFACE_VERSION()": FunctionFragment; + "__OPPEndpointManaged_init(address)": FunctionFragment; + "authority()": FunctionFragment; + "commit(bytes)": FunctionFragment; + "deposit(uint8,bytes,uint64,uint256)": FunctionFragment; + "depositNonNative(uint64,uint64,uint64,uint8,bytes,uint256)": FunctionFragment; + "depositedByCode(address,uint64)": FunctionFragment; + "getSummaryAttestations()": FunctionFragment; + "initialize(address)": FunctionFragment; + "isConsumingScheduledOp()": FunctionFragment; + "liqToken()": FunctionFragment; + "liqTokenCode()": FunctionFragment; + "nativeTokenCode()": FunctionFragment; + "operators(address)": FunctionFragment; + "oppAddress()": FunctionFragment; + "oppInboundAddress()": FunctionFragment; + "outpostChainCode()": FunctionFragment; + "outpostId()": FunctionFragment; + "proxiableUUID()": FunctionFragment; + "reserveManagerAddress()": FunctionFragment; + "setAuthority(address)": FunctionFragment; + "setLiqToken(address)": FunctionFragment; + "setLiqTokenCode(uint64)": FunctionFragment; + "setNativeTokenCode(uint64)": FunctionFragment; + "setOPPAddresses(address,address)": FunctionFragment; + "setOutpostChainCode(uint64)": FunctionFragment; + "setOutpostId(uint64)": FunctionFragment; + "setReserveManagerAddress(address)": FunctionFragment; + "slash(address,uint64,uint64,string)": FunctionFragment; + "upgradeToAndCall(address,bytes)": FunctionFragment; + "withdraw(bytes,uint64,uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "DEPOSIT_REVERT_ATTESTATION" + | "DEPOSIT_REVERT_GAS_MULTIPLIER" + | "OPERATOR_ACTION_ATTESTATION" + | "OPPAttestationIn" + | "UNDERWRITE_INTENT_COMMIT_ATTESTATION" + | "UPGRADE_INTERFACE_VERSION" + | "__OPPEndpointManaged_init" + | "authority" + | "commit" + | "deposit" + | "depositNonNative" + | "depositedByCode" + | "getSummaryAttestations" + | "initialize" + | "isConsumingScheduledOp" + | "liqToken" + | "liqTokenCode" + | "nativeTokenCode" + | "operators" + | "oppAddress" + | "oppInboundAddress" + | "outpostChainCode" + | "outpostId" + | "proxiableUUID" + | "reserveManagerAddress" + | "setAuthority" + | "setLiqToken" + | "setLiqTokenCode" + | "setNativeTokenCode" + | "setOPPAddresses" + | "setOutpostChainCode" + | "setOutpostId" + | "setReserveManagerAddress" + | "slash" + | "upgradeToAndCall" + | "withdraw" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "DEPOSIT_REVERT_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "DEPOSIT_REVERT_GAS_MULTIPLIER", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "OPERATOR_ACTION_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "OPPAttestationIn", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "UNDERWRITE_INTENT_COMMIT_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "UPGRADE_INTERFACE_VERSION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "__OPPEndpointManaged_init", + values: [string] + ): string; + encodeFunctionData(functionFragment: "authority", values?: undefined): string; + encodeFunctionData(functionFragment: "commit", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "deposit", + values: [BigNumberish, BytesLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "depositNonNative", + values: [ + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "depositedByCode", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getSummaryAttestations", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; + encodeFunctionData( + functionFragment: "isConsumingScheduledOp", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "liqToken", values?: undefined): string; + encodeFunctionData( + functionFragment: "liqTokenCode", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nativeTokenCode", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "operators", values: [string]): string; + encodeFunctionData( + functionFragment: "oppAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "oppInboundAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "outpostChainCode", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "outpostId", values?: undefined): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "reserveManagerAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setAuthority", + values: [string] + ): string; + encodeFunctionData(functionFragment: "setLiqToken", values: [string]): string; + encodeFunctionData( + functionFragment: "setLiqTokenCode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setNativeTokenCode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOPPAddresses", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "setOutpostChainCode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setOutpostId", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setReserveManagerAddress", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "slash", + values: [string, BigNumberish, BigNumberish, string] + ): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "withdraw", + values: [BytesLike, BigNumberish, BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "DEPOSIT_REVERT_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "DEPOSIT_REVERT_GAS_MULTIPLIER", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "OPERATOR_ACTION_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "OPPAttestationIn", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "UNDERWRITE_INTENT_COMMIT_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "UPGRADE_INTERFACE_VERSION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "__OPPEndpointManaged_init", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "commit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "depositNonNative", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "depositedByCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSummaryAttestations", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isConsumingScheduledOp", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "liqToken", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "liqTokenCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nativeTokenCode", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "operators", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oppAddress", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "oppInboundAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "outpostChainCode", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "outpostId", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "reserveManagerAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAuthority", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiqToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setLiqTokenCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setNativeTokenCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOPPAddresses", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOutpostChainCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOutpostId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setReserveManagerAddress", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "slash", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; + + events: { + "AuthorityUpdated(address)": EventFragment; + "DepositReverted(address,uint64,uint256,uint256,bytes,string)": EventFragment; + "Initialized(uint64)": EventFragment; + "LiqTokenCodeSet(uint64)": EventFragment; + "NativeTokenCodeSet(uint64)": EventFragment; + "OperatorDeposited(address,uint8,uint64,uint256)": EventFragment; + "OperatorSlashed(address,uint64,uint256,uint64,address,string)": EventFragment; + "OutpostChainCodeSet(uint64)": EventFragment; + "UnderwriteCommitRelayed(address,bytes)": EventFragment; + "Upgraded(address)": EventFragment; + "WithdrawRemitted(address,uint64,uint256,uint64)": EventFragment; + "WithdrawRequested(address,uint64,uint256,uint64)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "DepositReverted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "LiqTokenCodeSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "NativeTokenCodeSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OperatorDeposited"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OperatorSlashed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OutpostChainCodeSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "UnderwriteCommitRelayed"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "WithdrawRemitted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "WithdrawRequested"): EventFragment; +} + +export interface AuthorityUpdatedEventObject { + authority: string; +} +export type AuthorityUpdatedEvent = TypedEvent< + [string], + AuthorityUpdatedEventObject +>; + +export type AuthorityUpdatedEventFilter = + TypedEventFilter; + +export interface DepositRevertedEventObject { + depositor: string; + tokenCode: BigNumber; + refundedToDepositor: BigNumber; + penaltyToReserve: BigNumber; + originalMessageId: string; + reason: string; +} +export type DepositRevertedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, string, string], + DepositRevertedEventObject +>; + +export type DepositRevertedEventFilter = TypedEventFilter; + +export interface InitializedEventObject { + version: BigNumber; +} +export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; + +export type InitializedEventFilter = TypedEventFilter; + +export interface LiqTokenCodeSetEventObject { + tokenCode: BigNumber; +} +export type LiqTokenCodeSetEvent = TypedEvent< + [BigNumber], + LiqTokenCodeSetEventObject +>; + +export type LiqTokenCodeSetEventFilter = TypedEventFilter; + +export interface NativeTokenCodeSetEventObject { + tokenCode: BigNumber; +} +export type NativeTokenCodeSetEvent = TypedEvent< + [BigNumber], + NativeTokenCodeSetEventObject +>; + +export type NativeTokenCodeSetEventFilter = + TypedEventFilter; + +export interface OperatorDepositedEventObject { + operator: string; + operatorType: number; + tokenCode: BigNumber; + amount: BigNumber; +} +export type OperatorDepositedEvent = TypedEvent< + [string, number, BigNumber, BigNumber], + OperatorDepositedEventObject +>; + +export type OperatorDepositedEventFilter = + TypedEventFilter; + +export interface OperatorSlashedEventObject { + operator: string; + tokenCode: BigNumber; + amount: BigNumber; + reserveCode: BigNumber; + reserveTarget: string; + reason: string; +} +export type OperatorSlashedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, string, string], + OperatorSlashedEventObject +>; + +export type OperatorSlashedEventFilter = TypedEventFilter; + +export interface OutpostChainCodeSetEventObject { + chainCode: BigNumber; +} +export type OutpostChainCodeSetEvent = TypedEvent< + [BigNumber], + OutpostChainCodeSetEventObject +>; + +export type OutpostChainCodeSetEventFilter = + TypedEventFilter; + +export interface UnderwriteCommitRelayedEventObject { + underwriter: string; + uicBytes: string; +} +export type UnderwriteCommitRelayedEvent = TypedEvent< + [string, string], + UnderwriteCommitRelayedEventObject +>; + +export type UnderwriteCommitRelayedEventFilter = + TypedEventFilter; + +export interface UpgradedEventObject { + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface WithdrawRemittedEventObject { + operator: string; + tokenCode: BigNumber; + amount: BigNumber; + requestId: BigNumber; +} +export type WithdrawRemittedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber], + WithdrawRemittedEventObject +>; + +export type WithdrawRemittedEventFilter = + TypedEventFilter; + +export interface WithdrawRequestedEventObject { + operator: string; + tokenCode: BigNumber; + amount: BigNumber; + requestId: BigNumber; +} +export type WithdrawRequestedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber], + WithdrawRequestedEventObject +>; + +export type WithdrawRequestedEventFilter = + TypedEventFilter; + +export interface OperatorRegistry extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OperatorRegistryInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; + + DEPOSIT_REVERT_GAS_MULTIPLIER( + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + UNDERWRITE_INTENT_COMMIT_ATTESTATION( + overrides?: CallOverrides + ): Promise<[number]>; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise<[string]>; + + commit( + uicBytes: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + deposit( + operatorType: BigNumberish, + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + depositNonNative( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + operatorType: BigNumberish, + compressedPubkey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + depositedByCode( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; + + liqToken(overrides?: CallOverrides): Promise<[string]>; + + liqTokenCode(overrides?: CallOverrides): Promise<[BigNumber]>; + + nativeTokenCode(overrides?: CallOverrides): Promise<[BigNumber]>; + + operators( + arg0: string, + overrides?: CallOverrides + ): Promise<[number, number] & { operatorType: number; status: number }>; + + oppAddress(overrides?: CallOverrides): Promise<[string]>; + + oppInboundAddress(overrides?: CallOverrides): Promise<[string]>; + + outpostChainCode(overrides?: CallOverrides): Promise<[BigNumber]>; + + outpostId(overrides?: CallOverrides): Promise<[BigNumber]>; + + proxiableUUID(overrides?: CallOverrides): Promise<[string]>; + + reserveManagerAddress(overrides?: CallOverrides): Promise<[string]>; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqToken( + _liqToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNativeTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostId( + _outpostId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + _reserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + slash( + operator: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise; + + DEPOSIT_REVERT_GAS_MULTIPLIER(overrides?: CallOverrides): Promise; + + OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + UNDERWRITE_INTENT_COMMIT_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + commit( + uicBytes: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + deposit( + operatorType: BigNumberish, + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + depositNonNative( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + operatorType: BigNumberish, + compressedPubkey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + depositedByCode( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + liqToken(overrides?: CallOverrides): Promise; + + liqTokenCode(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + operators( + arg0: string, + overrides?: CallOverrides + ): Promise<[number, number] & { operatorType: number; status: number }>; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + outpostId(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + reserveManagerAddress(overrides?: CallOverrides): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqToken( + _liqToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNativeTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostId( + _outpostId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + _reserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + slash( + operator: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise; + + DEPOSIT_REVERT_GAS_MULTIPLIER( + overrides?: CallOverrides + ): Promise; + + OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + UNDERWRITE_INTENT_COMMIT_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + commit(uicBytes: BytesLike, overrides?: CallOverrides): Promise; + + deposit( + operatorType: BigNumberish, + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + depositNonNative( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + operatorType: BigNumberish, + compressedPubkey: BytesLike, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + depositedByCode( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: CallOverrides + ): Promise; + + initialize(_authority: string, overrides?: CallOverrides): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + liqToken(overrides?: CallOverrides): Promise; + + liqTokenCode(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + operators( + arg0: string, + overrides?: CallOverrides + ): Promise<[number, number] & { operatorType: number; status: number }>; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + outpostId(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + reserveManagerAddress(overrides?: CallOverrides): Promise; + + setAuthority( + newAuthority: string, + overrides?: CallOverrides + ): Promise; + + setLiqToken(_liqToken: string, overrides?: CallOverrides): Promise; + + setLiqTokenCode( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setNativeTokenCode( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: CallOverrides + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setOutpostId( + _outpostId: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setReserveManagerAddress( + _reserveManager: string, + overrides?: CallOverrides + ): Promise; + + slash( + operator: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + reason: string, + overrides?: CallOverrides + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + withdraw( + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; + AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; + + "DepositReverted(address,uint64,uint256,uint256,bytes,string)"( + depositor?: string | null, + tokenCode?: null, + refundedToDepositor?: null, + penaltyToReserve?: null, + originalMessageId?: null, + reason?: null + ): DepositRevertedEventFilter; + DepositReverted( + depositor?: string | null, + tokenCode?: null, + refundedToDepositor?: null, + penaltyToReserve?: null, + originalMessageId?: null, + reason?: null + ): DepositRevertedEventFilter; + + "Initialized(uint64)"(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; + + "LiqTokenCodeSet(uint64)"(tokenCode?: null): LiqTokenCodeSetEventFilter; + LiqTokenCodeSet(tokenCode?: null): LiqTokenCodeSetEventFilter; + + "NativeTokenCodeSet(uint64)"( + tokenCode?: null + ): NativeTokenCodeSetEventFilter; + NativeTokenCodeSet(tokenCode?: null): NativeTokenCodeSetEventFilter; + + "OperatorDeposited(address,uint8,uint64,uint256)"( + operator?: string | null, + operatorType?: null, + tokenCode?: null, + amount?: null + ): OperatorDepositedEventFilter; + OperatorDeposited( + operator?: string | null, + operatorType?: null, + tokenCode?: null, + amount?: null + ): OperatorDepositedEventFilter; + + "OperatorSlashed(address,uint64,uint256,uint64,address,string)"( + operator?: string | null, + tokenCode?: null, + amount?: null, + reserveCode?: null, + reserveTarget?: null, + reason?: null + ): OperatorSlashedEventFilter; + OperatorSlashed( + operator?: string | null, + tokenCode?: null, + amount?: null, + reserveCode?: null, + reserveTarget?: null, + reason?: null + ): OperatorSlashedEventFilter; + + "OutpostChainCodeSet(uint64)"( + chainCode?: null + ): OutpostChainCodeSetEventFilter; + OutpostChainCodeSet(chainCode?: null): OutpostChainCodeSetEventFilter; + + "UnderwriteCommitRelayed(address,bytes)"( + underwriter?: string | null, + uicBytes?: null + ): UnderwriteCommitRelayedEventFilter; + UnderwriteCommitRelayed( + underwriter?: string | null, + uicBytes?: null + ): UnderwriteCommitRelayedEventFilter; + + "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; + Upgraded(implementation?: string | null): UpgradedEventFilter; + + "WithdrawRemitted(address,uint64,uint256,uint64)"( + operator?: string | null, + tokenCode?: null, + amount?: null, + requestId?: null + ): WithdrawRemittedEventFilter; + WithdrawRemitted( + operator?: string | null, + tokenCode?: null, + amount?: null, + requestId?: null + ): WithdrawRemittedEventFilter; + + "WithdrawRequested(address,uint64,uint256,uint64)"( + operator?: string | null, + tokenCode?: null, + amount?: null, + requestId?: null + ): WithdrawRequestedEventFilter; + WithdrawRequested( + operator?: string | null, + tokenCode?: null, + amount?: null, + requestId?: null + ): WithdrawRequestedEventFilter; + }; + + estimateGas: { + DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise; + + DEPOSIT_REVERT_GAS_MULTIPLIER( + overrides?: CallOverrides + ): Promise; + + OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + UNDERWRITE_INTENT_COMMIT_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + commit( + uicBytes: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + deposit( + operatorType: BigNumberish, + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + depositNonNative( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + operatorType: BigNumberish, + compressedPubkey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + depositedByCode( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + liqToken(overrides?: CallOverrides): Promise; + + liqTokenCode(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + operators(arg0: string, overrides?: CallOverrides): Promise; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + outpostId(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + reserveManagerAddress(overrides?: CallOverrides): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqToken( + _liqToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNativeTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostId( + _outpostId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + _reserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + slash( + operator: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + DEPOSIT_REVERT_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + DEPOSIT_REVERT_GAS_MULTIPLIER( + overrides?: CallOverrides + ): Promise; + + OPERATOR_ACTION_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + UNDERWRITE_INTENT_COMMIT_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + UPGRADE_INTERFACE_VERSION( + overrides?: CallOverrides + ): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + commit( + uicBytes: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + deposit( + operatorType: BigNumberish, + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + depositNonNative( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + operatorType: BigNumberish, + compressedPubkey: BytesLike, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + depositedByCode( + arg0: string, + arg1: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp( + overrides?: CallOverrides + ): Promise; + + liqToken(overrides?: CallOverrides): Promise; + + liqTokenCode(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + operators( + arg0: string, + overrides?: CallOverrides + ): Promise; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + outpostId(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + reserveManagerAddress( + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqToken( + _liqToken: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setLiqTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setNativeTokenCode( + tokenCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostId( + _outpostId: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setReserveManagerAddress( + _reserveManager: string, + overrides?: Overrides & { from?: string } + ): Promise; + + slash( + operator: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + compressedPubkey: BytesLike, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts new file mode 100644 index 0000000..c8448d7 --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts @@ -0,0 +1,2323 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common.js"; + +export type AttestationEntryStruct = { + type_: BigNumberish; + dataSize: BigNumberish; + data: BytesLike; +}; + +export type AttestationEntryStructOutput = [number, number, string] & { + type_: number; + dataSize: number; + data: string; +}; + +export declare namespace ReserveManager { + export type ReserveRecordStruct = { + tokenCode: BigNumberish; + reserveCode: BigNumberish; + externalTokenAmount: BigNumberish; + requestedWireAmount: BigNumberish; + connectorWeightBps: BigNumberish; + status: BigNumberish; + creator: string; + exists: boolean; + }; + + export type ReserveRecordStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + number, + number, + string, + boolean + ] & { + tokenCode: BigNumber; + reserveCode: BigNumber; + externalTokenAmount: BigNumber; + requestedWireAmount: BigNumber; + connectorWeightBps: number; + status: number; + creator: string; + exists: boolean; + }; + + export type TrackedCodeEntryStruct = { + tokenCode: BigNumberish; + reserveCode: BigNumberish; + tokenAddr: string; + precision: BigNumberish; + }; + + export type TrackedCodeEntryStructOutput = [ + BigNumber, + BigNumber, + string, + number + ] & { + tokenCode: BigNumber; + reserveCode: BigNumber; + tokenAddr: string; + precision: number; + }; +} + +export declare namespace ReserveManagerLib { + export type ReserveCreateArgsStruct = { + tokenCode: BigNumberish; + reserveCode: BigNumberish; + externalTokenAmount: BigNumberish; + requestedWireAmount: BigNumberish; + connectorWeightBps: BigNumberish; + name: string; + description: string; + isPrivate: boolean; + creatorPubKey: BytesLike; + }; + + export type ReserveCreateArgsStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + number, + string, + string, + boolean, + string + ] & { + tokenCode: BigNumber; + reserveCode: BigNumber; + externalTokenAmount: BigNumber; + requestedWireAmount: BigNumber; + connectorWeightBps: number; + name: string; + description: string; + isPrivate: boolean; + creatorPubKey: string; + }; + + export type PermitSigStruct = { + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + }; + + export type PermitSigStructOutput = [BigNumber, number, string, string] & { + deadline: BigNumber; + v: number; + r: string; + s: string; + }; + + export type SwapArgsStruct = { + sourceTokenCode: BigNumberish; + sourceReserveCode: BigNumberish; + sourceAmount: BigNumberish; + targetChainCode: BigNumberish; + targetTokenCode: BigNumberish; + targetReserveCode: BigNumberish; + targetRecipient: BytesLike; + targetAmount: BigNumberish; + targetToleranceBps: BigNumberish; + }; + + export type SwapArgsStructOutput = [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + number + ] & { + sourceTokenCode: BigNumber; + sourceReserveCode: BigNumber; + sourceAmount: BigNumber; + targetChainCode: BigNumber; + targetTokenCode: BigNumber; + targetReserveCode: BigNumber; + targetRecipient: string; + targetAmount: BigNumber; + targetToleranceBps: number; + }; +} + +export interface ReserveManagerInterface extends utils.Interface { + functions: { + "BALANCE_SHEET_ATTESTATION()": FunctionFragment; + "OPPAttestationIn(uint16,bytes)": FunctionFragment; + "RESERVE_CREATE_ATTESTATION()": FunctionFragment; + "RESERVE_CREATE_CANCEL_ATTESTATION()": FunctionFragment; + "SWAP_REQUEST_ATTESTATION()": FunctionFragment; + "UPGRADE_INTERFACE_VERSION()": FunctionFragment; + "__OPPEndpointManaged_init(address)": FunctionFragment; + "_payRemit(address,uint64,uint256)": FunctionFragment; + "authority()": FunctionFragment; + "balanceOf(uint64)": FunctionFragment; + "cancel_create_reserve(uint64,uint64)": FunctionFragment; + "create_reserve(uint64,uint64,uint256,uint64,uint32,string,string,bool,bytes)": FunctionFragment; + "emitBalanceSheet()": FunctionFragment; + "getReserve(uint64,uint64)": FunctionFragment; + "getSummaryAttestations()": FunctionFragment; + "initialize(address)": FunctionFragment; + "isConsumingScheduledOp()": FunctionFragment; + "nativeTokenCode()": FunctionFragment; + "onReserveCreateCancelled(uint64,uint64,uint64)": FunctionFragment; + "onReserveReady(uint64,uint64,uint64)": FunctionFragment; + "onSwapRevert(address,uint64,uint64,uint64,bytes32,string)": FunctionFragment; + "oppAddress()": FunctionFragment; + "oppInboundAddress()": FunctionFragment; + "outpostChainCode()": FunctionFragment; + "pause()": FunctionFragment; + "paused()": FunctionFragment; + "proxiableUUID()": FunctionFragment; + "requestReserveCreateErc20WithApproval((uint64,uint64,uint256,uint64,uint32,string,string,bool,bytes))": FunctionFragment; + "requestReserveCreateErc20WithPermit((uint64,uint64,uint256,uint64,uint32,string,string,bool,bytes),(uint256,uint8,bytes32,bytes32))": FunctionFragment; + "requestSwap(uint64,uint64,uint64,uint64,uint64,bytes,uint64,uint32)": FunctionFragment; + "requestSwapErc20WithApproval((uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32))": FunctionFragment; + "requestSwapErc20WithPermit((uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32),(uint256,uint8,bytes32,bytes32))": FunctionFragment; + "reserves(bytes32)": FunctionFragment; + "setAuthority(address)": FunctionFragment; + "setOPPAddresses(address,address)": FunctionFragment; + "setOutpostChainCode(uint64)": FunctionFragment; + "setTrackedCodes((uint64,uint64,address,uint8)[])": FunctionFragment; + "swapDepositCounter()": FunctionFragment; + "tokenAddressesByCode(uint64)": FunctionFragment; + "tokenPrecisionByCode(uint64)": FunctionFragment; + "trackedCodesCount()": FunctionFragment; + "trackedReserveCodes(uint256)": FunctionFragment; + "trackedTokenCodes(uint256)": FunctionFragment; + "unpause()": FunctionFragment; + "upgradeToAndCall(address,bytes)": FunctionFragment; + "withdraw(uint64,uint64,uint256,address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "BALANCE_SHEET_ATTESTATION" + | "OPPAttestationIn" + | "RESERVE_CREATE_ATTESTATION" + | "RESERVE_CREATE_CANCEL_ATTESTATION" + | "SWAP_REQUEST_ATTESTATION" + | "UPGRADE_INTERFACE_VERSION" + | "__OPPEndpointManaged_init" + | "_payRemit" + | "authority" + | "balanceOf" + | "cancel_create_reserve" + | "create_reserve" + | "emitBalanceSheet" + | "getReserve" + | "getSummaryAttestations" + | "initialize" + | "isConsumingScheduledOp" + | "nativeTokenCode" + | "onReserveCreateCancelled" + | "onReserveReady" + | "onSwapRevert" + | "oppAddress" + | "oppInboundAddress" + | "outpostChainCode" + | "pause" + | "paused" + | "proxiableUUID" + | "requestReserveCreateErc20WithApproval" + | "requestReserveCreateErc20WithPermit" + | "requestSwap" + | "requestSwapErc20WithApproval" + | "requestSwapErc20WithPermit" + | "reserves" + | "setAuthority" + | "setOPPAddresses" + | "setOutpostChainCode" + | "setTrackedCodes" + | "swapDepositCounter" + | "tokenAddressesByCode" + | "tokenPrecisionByCode" + | "trackedCodesCount" + | "trackedReserveCodes" + | "trackedTokenCodes" + | "unpause" + | "upgradeToAndCall" + | "withdraw" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "BALANCE_SHEET_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "OPPAttestationIn", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "RESERVE_CREATE_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "RESERVE_CREATE_CANCEL_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "SWAP_REQUEST_ATTESTATION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "UPGRADE_INTERFACE_VERSION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "__OPPEndpointManaged_init", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "_payRemit", + values: [string, BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "authority", values?: undefined): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "cancel_create_reserve", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "create_reserve", + values: [ + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + string, + string, + boolean, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "emitBalanceSheet", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getReserve", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getSummaryAttestations", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; + encodeFunctionData( + functionFragment: "isConsumingScheduledOp", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nativeTokenCode", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "onReserveCreateCancelled", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onReserveReady", + values: [BigNumberish, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onSwapRevert", + values: [ + string, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + string + ] + ): string; + encodeFunctionData( + functionFragment: "oppAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "oppInboundAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "outpostChainCode", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "pause", values?: undefined): string; + encodeFunctionData(functionFragment: "paused", values?: undefined): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "requestReserveCreateErc20WithApproval", + values: [ReserveManagerLib.ReserveCreateArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "requestReserveCreateErc20WithPermit", + values: [ + ReserveManagerLib.ReserveCreateArgsStruct, + ReserveManagerLib.PermitSigStruct + ] + ): string; + encodeFunctionData( + functionFragment: "requestSwap", + values: [ + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BigNumberish, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "requestSwapErc20WithApproval", + values: [ReserveManagerLib.SwapArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "requestSwapErc20WithPermit", + values: [ + ReserveManagerLib.SwapArgsStruct, + ReserveManagerLib.PermitSigStruct + ] + ): string; + encodeFunctionData(functionFragment: "reserves", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "setAuthority", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "setOPPAddresses", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "setOutpostChainCode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setTrackedCodes", + values: [ReserveManager.TrackedCodeEntryStruct[]] + ): string; + encodeFunctionData( + functionFragment: "swapDepositCounter", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "tokenAddressesByCode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "tokenPrecisionByCode", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "trackedCodesCount", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "trackedReserveCodes", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "trackedTokenCodes", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "unpause", values?: undefined): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "withdraw", + values: [BigNumberish, BigNumberish, BigNumberish, string] + ): string; + + decodeFunctionResult( + functionFragment: "BALANCE_SHEET_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "OPPAttestationIn", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "RESERVE_CREATE_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "RESERVE_CREATE_CANCEL_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "SWAP_REQUEST_ATTESTATION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "UPGRADE_INTERFACE_VERSION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "__OPPEndpointManaged_init", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "_payRemit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "cancel_create_reserve", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "create_reserve", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "emitBalanceSheet", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getReserve", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getSummaryAttestations", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isConsumingScheduledOp", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nativeTokenCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onReserveCreateCancelled", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onReserveReady", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onSwapRevert", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "oppAddress", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "oppInboundAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "outpostChainCode", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "pause", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requestReserveCreateErc20WithApproval", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requestReserveCreateErc20WithPermit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requestSwap", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requestSwapErc20WithApproval", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "requestSwapErc20WithPermit", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "reserves", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setAuthority", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOPPAddresses", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setOutpostChainCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setTrackedCodes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "swapDepositCounter", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenAddressesByCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "tokenPrecisionByCode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "trackedCodesCount", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "trackedReserveCodes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "trackedTokenCodes", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "unpause", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; + + events: { + "AuthorityUpdated(address)": EventFragment; + "BalanceSheetEmitted()": EventFragment; + "Deposited(uint64,uint64,address,uint256)": EventFragment; + "Initialized(uint64)": EventFragment; + "OutpostChainCodeSet(uint64)": EventFragment; + "Paused(address)": EventFragment; + "ReserveActivated(uint64,uint64)": EventFragment; + "ReserveCancelRequested(uint64,uint64,address)": EventFragment; + "ReserveCancelled(uint64,uint64,address,uint256)": EventFragment; + "ReserveCreateRequested(uint64,uint64,address,uint256,uint64,uint32)": EventFragment; + "SwapDeposit(uint64,bytes32)": EventFragment; + "SwapRemitPaid(address,uint64,uint64,uint256,bytes32)": EventFragment; + "SwapRemitUnpayable(uint64,uint64,uint64,bytes32,string)": EventFragment; + "SwapRequested(address,uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32)": EventFragment; + "SwapRevertError(address,uint64,uint64,uint256,bytes32,bytes)": EventFragment; + "SwapReverted(address,uint64,uint64,uint256,bytes32,string)": EventFragment; + "TokenAddressSet(uint64,address)": EventFragment; + "TrackedCodesUpdated()": EventFragment; + "Unpaused(address)": EventFragment; + "Upgraded(address)": EventFragment; + "Withdrawn(uint64,uint64,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "BalanceSheetEmitted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Deposited"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OutpostChainCodeSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ReserveActivated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ReserveCancelRequested"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ReserveCancelled"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ReserveCreateRequested"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapDeposit"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapRemitPaid"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapRemitUnpayable"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapRequested"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapRevertError"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SwapReverted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TokenAddressSet"): EventFragment; + getEvent(nameOrSignatureOrTopic: "TrackedCodesUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Withdrawn"): EventFragment; +} + +export interface AuthorityUpdatedEventObject { + authority: string; +} +export type AuthorityUpdatedEvent = TypedEvent< + [string], + AuthorityUpdatedEventObject +>; + +export type AuthorityUpdatedEventFilter = + TypedEventFilter; + +export interface BalanceSheetEmittedEventObject {} +export type BalanceSheetEmittedEvent = TypedEvent< + [], + BalanceSheetEmittedEventObject +>; + +export type BalanceSheetEmittedEventFilter = + TypedEventFilter; + +export interface DepositedEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; + from: string; + amount: BigNumber; +} +export type DepositedEvent = TypedEvent< + [BigNumber, BigNumber, string, BigNumber], + DepositedEventObject +>; + +export type DepositedEventFilter = TypedEventFilter; + +export interface InitializedEventObject { + version: BigNumber; +} +export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; + +export type InitializedEventFilter = TypedEventFilter; + +export interface OutpostChainCodeSetEventObject { + chainCode: BigNumber; +} +export type OutpostChainCodeSetEvent = TypedEvent< + [BigNumber], + OutpostChainCodeSetEventObject +>; + +export type OutpostChainCodeSetEventFilter = + TypedEventFilter; + +export interface PausedEventObject { + account: string; +} +export type PausedEvent = TypedEvent<[string], PausedEventObject>; + +export type PausedEventFilter = TypedEventFilter; + +export interface ReserveActivatedEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; +} +export type ReserveActivatedEvent = TypedEvent< + [BigNumber, BigNumber], + ReserveActivatedEventObject +>; + +export type ReserveActivatedEventFilter = + TypedEventFilter; + +export interface ReserveCancelRequestedEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; + creator: string; +} +export type ReserveCancelRequestedEvent = TypedEvent< + [BigNumber, BigNumber, string], + ReserveCancelRequestedEventObject +>; + +export type ReserveCancelRequestedEventFilter = + TypedEventFilter; + +export interface ReserveCancelledEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; + creator: string; + refundedAmount: BigNumber; +} +export type ReserveCancelledEvent = TypedEvent< + [BigNumber, BigNumber, string, BigNumber], + ReserveCancelledEventObject +>; + +export type ReserveCancelledEventFilter = + TypedEventFilter; + +export interface ReserveCreateRequestedEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; + creator: string; + externalTokenAmount: BigNumber; + requestedWireAmount: BigNumber; + connectorWeightBps: number; +} +export type ReserveCreateRequestedEvent = TypedEvent< + [BigNumber, BigNumber, string, BigNumber, BigNumber, number], + ReserveCreateRequestedEventObject +>; + +export type ReserveCreateRequestedEventFilter = + TypedEventFilter; + +export interface SwapDepositEventObject { + id: BigNumber; + hash: string; +} +export type SwapDepositEvent = TypedEvent< + [BigNumber, string], + SwapDepositEventObject +>; + +export type SwapDepositEventFilter = TypedEventFilter; + +export interface SwapRemitPaidEventObject { + recipient: string; + tokenCode: BigNumber; + reserveCode: BigNumber; + amount: BigNumber; + originalMessageId: string; +} +export type SwapRemitPaidEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, string], + SwapRemitPaidEventObject +>; + +export type SwapRemitPaidEventFilter = TypedEventFilter; + +export interface SwapRemitUnpayableEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; + depotAmount: BigNumber; + originalId: string; + reason: string; +} +export type SwapRemitUnpayableEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, string, string], + SwapRemitUnpayableEventObject +>; + +export type SwapRemitUnpayableEventFilter = + TypedEventFilter; + +export interface SwapRequestedEventObject { + user: string; + sourceTokenCode: BigNumber; + sourceReserveCode: BigNumber; + sourceAmount: BigNumber; + targetChainCode: BigNumber; + targetTokenCode: BigNumber; + targetReserveCode: BigNumber; + targetRecipient: string; + targetAmount: BigNumber; + targetToleranceBps: number; +} +export type SwapRequestedEvent = TypedEvent< + [ + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + string, + BigNumber, + number + ], + SwapRequestedEventObject +>; + +export type SwapRequestedEventFilter = TypedEventFilter; + +export interface SwapRevertErrorEventObject { + depositor: string; + tokenCode: BigNumber; + reserveCode: BigNumber; + amount: BigNumber; + originalSwapMessageId: string; + errData: string; +} +export type SwapRevertErrorEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, string, string], + SwapRevertErrorEventObject +>; + +export type SwapRevertErrorEventFilter = TypedEventFilter; + +export interface SwapRevertedEventObject { + depositor: string; + tokenCode: BigNumber; + reserveCode: BigNumber; + amount: BigNumber; + originalSwapMessageId: string; + reason: string; +} +export type SwapRevertedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, string, string], + SwapRevertedEventObject +>; + +export type SwapRevertedEventFilter = TypedEventFilter; + +export interface TokenAddressSetEventObject { + tokenCode: BigNumber; + addr: string; +} +export type TokenAddressSetEvent = TypedEvent< + [BigNumber, string], + TokenAddressSetEventObject +>; + +export type TokenAddressSetEventFilter = TypedEventFilter; + +export interface TrackedCodesUpdatedEventObject {} +export type TrackedCodesUpdatedEvent = TypedEvent< + [], + TrackedCodesUpdatedEventObject +>; + +export type TrackedCodesUpdatedEventFilter = + TypedEventFilter; + +export interface UnpausedEventObject { + account: string; +} +export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject>; + +export type UnpausedEventFilter = TypedEventFilter; + +export interface UpgradedEventObject { + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface WithdrawnEventObject { + tokenCode: BigNumber; + reserveCode: BigNumber; + to: string; + amount: BigNumber; +} +export type WithdrawnEvent = TypedEvent< + [BigNumber, BigNumber, string, BigNumber], + WithdrawnEventObject +>; + +export type WithdrawnEventFilter = TypedEventFilter; + +export interface ReserveManager extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ReserveManagerInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; + + RESERVE_CREATE_CANCEL_ATTESTATION( + overrides?: CallOverrides + ): Promise<[number]>; + + SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + _payRemit( + to: string, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise<[string]>; + + balanceOf( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + cancel_create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + externalTokenAmount: BigNumberish, + requestedWireAmount: BigNumberish, + connectorWeightBps: BigNumberish, + name: string, + description: string, + isPrivate: boolean, + creatorPubKey: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + emitBalanceSheet( + overrides?: Overrides & { from?: string } + ): Promise; + + getReserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise<[ReserveManager.ReserveRecordStructOutput]>; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; + + nativeTokenCode(overrides?: CallOverrides): Promise<[BigNumber]>; + + onReserveCreateCancelled( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onReserveReady( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onSwapRevert( + depositor: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + depotAmount: BigNumberish, + originalSwapMessageId: BytesLike, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + oppAddress(overrides?: CallOverrides): Promise<[string]>; + + oppInboundAddress(overrides?: CallOverrides): Promise<[string]>; + + outpostChainCode(overrides?: CallOverrides): Promise<[BigNumber]>; + + pause( + overrides?: Overrides & { from?: string } + ): Promise; + + paused(overrides?: CallOverrides): Promise<[boolean]>; + + proxiableUUID(overrides?: CallOverrides): Promise<[string]>; + + requestReserveCreateErc20WithApproval( + args: ReserveManagerLib.ReserveCreateArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestReserveCreateErc20WithPermit( + args: ReserveManagerLib.ReserveCreateArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwap( + sourceTokenCode: BigNumberish, + sourceReserveCode: BigNumberish, + targetChainCode: BigNumberish, + targetTokenCode: BigNumberish, + targetReserveCode: BigNumberish, + targetRecipient: BytesLike, + targetAmount: BigNumberish, + targetToleranceBps: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + requestSwapErc20WithApproval( + args: ReserveManagerLib.SwapArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwapErc20WithPermit( + args: ReserveManagerLib.SwapArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + reserves( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + number, + number, + string, + boolean + ] & { + tokenCode: BigNumber; + reserveCode: BigNumber; + externalTokenAmount: BigNumber; + requestedWireAmount: BigNumber; + connectorWeightBps: number; + status: number; + creator: string; + exists: boolean; + } + >; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTrackedCodes( + entries: ReserveManager.TrackedCodeEntryStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + swapDepositCounter(overrides?: CallOverrides): Promise<[BigNumber]>; + + tokenAddressesByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[string]>; + + tokenPrecisionByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[number]>; + + trackedCodesCount(overrides?: CallOverrides): Promise<[BigNumber]>; + + trackedReserveCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + trackedTokenCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + unpause( + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + amount: BigNumberish, + to: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise; + + RESERVE_CREATE_CANCEL_ATTESTATION(overrides?: CallOverrides): Promise; + + SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + _payRemit( + to: string, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + balanceOf( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + cancel_create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + externalTokenAmount: BigNumberish, + requestedWireAmount: BigNumberish, + connectorWeightBps: BigNumberish, + name: string, + description: string, + isPrivate: boolean, + creatorPubKey: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + emitBalanceSheet( + overrides?: Overrides & { from?: string } + ): Promise; + + getReserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + onReserveCreateCancelled( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onReserveReady( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onSwapRevert( + depositor: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + depotAmount: BigNumberish, + originalSwapMessageId: BytesLike, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + pause( + overrides?: Overrides & { from?: string } + ): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + requestReserveCreateErc20WithApproval( + args: ReserveManagerLib.ReserveCreateArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestReserveCreateErc20WithPermit( + args: ReserveManagerLib.ReserveCreateArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwap( + sourceTokenCode: BigNumberish, + sourceReserveCode: BigNumberish, + targetChainCode: BigNumberish, + targetTokenCode: BigNumberish, + targetReserveCode: BigNumberish, + targetRecipient: BytesLike, + targetAmount: BigNumberish, + targetToleranceBps: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + requestSwapErc20WithApproval( + args: ReserveManagerLib.SwapArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwapErc20WithPermit( + args: ReserveManagerLib.SwapArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + reserves( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + number, + number, + string, + boolean + ] & { + tokenCode: BigNumber; + reserveCode: BigNumber; + externalTokenAmount: BigNumber; + requestedWireAmount: BigNumber; + connectorWeightBps: number; + status: number; + creator: string; + exists: boolean; + } + >; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTrackedCodes( + entries: ReserveManager.TrackedCodeEntryStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + swapDepositCounter(overrides?: CallOverrides): Promise; + + tokenAddressesByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenPrecisionByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedCodesCount(overrides?: CallOverrides): Promise; + + trackedReserveCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedTokenCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + unpause( + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + amount: BigNumberish, + to: string, + overrides?: Overrides & { from?: string } + ): Promise; + + callStatic: { + BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise; + + RESERVE_CREATE_CANCEL_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: CallOverrides + ): Promise; + + _payRemit( + to: string, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + balanceOf( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + cancel_create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + externalTokenAmount: BigNumberish, + requestedWireAmount: BigNumberish, + connectorWeightBps: BigNumberish, + name: string, + description: string, + isPrivate: boolean, + creatorPubKey: BytesLike, + overrides?: CallOverrides + ): Promise; + + emitBalanceSheet(overrides?: CallOverrides): Promise; + + getReserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: CallOverrides + ): Promise; + + initialize(_authority: string, overrides?: CallOverrides): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + onReserveCreateCancelled( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + onReserveReady( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + onSwapRevert( + depositor: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + depotAmount: BigNumberish, + originalSwapMessageId: BytesLike, + reason: string, + overrides?: CallOverrides + ): Promise; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + pause(overrides?: CallOverrides): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + requestReserveCreateErc20WithApproval( + args: ReserveManagerLib.ReserveCreateArgsStruct, + overrides?: CallOverrides + ): Promise; + + requestReserveCreateErc20WithPermit( + args: ReserveManagerLib.ReserveCreateArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: CallOverrides + ): Promise; + + requestSwap( + sourceTokenCode: BigNumberish, + sourceReserveCode: BigNumberish, + targetChainCode: BigNumberish, + targetTokenCode: BigNumberish, + targetReserveCode: BigNumberish, + targetRecipient: BytesLike, + targetAmount: BigNumberish, + targetToleranceBps: BigNumberish, + overrides?: CallOverrides + ): Promise; + + requestSwapErc20WithApproval( + args: ReserveManagerLib.SwapArgsStruct, + overrides?: CallOverrides + ): Promise; + + requestSwapErc20WithPermit( + args: ReserveManagerLib.SwapArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: CallOverrides + ): Promise; + + reserves( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise< + [ + BigNumber, + BigNumber, + BigNumber, + BigNumber, + number, + number, + string, + boolean + ] & { + tokenCode: BigNumber; + reserveCode: BigNumber; + externalTokenAmount: BigNumber; + requestedWireAmount: BigNumber; + connectorWeightBps: number; + status: number; + creator: string; + exists: boolean; + } + >; + + setAuthority( + newAuthority: string, + overrides?: CallOverrides + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: CallOverrides + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + setTrackedCodes( + entries: ReserveManager.TrackedCodeEntryStruct[], + overrides?: CallOverrides + ): Promise; + + swapDepositCounter(overrides?: CallOverrides): Promise; + + tokenAddressesByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenPrecisionByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedCodesCount(overrides?: CallOverrides): Promise; + + trackedReserveCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedTokenCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + unpause(overrides?: CallOverrides): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + + withdraw( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + amount: BigNumberish, + to: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; + AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; + + "BalanceSheetEmitted()"(): BalanceSheetEmittedEventFilter; + BalanceSheetEmitted(): BalanceSheetEmittedEventFilter; + + "Deposited(uint64,uint64,address,uint256)"( + tokenCode?: null, + reserveCode?: null, + from?: string | null, + amount?: null + ): DepositedEventFilter; + Deposited( + tokenCode?: null, + reserveCode?: null, + from?: string | null, + amount?: null + ): DepositedEventFilter; + + "Initialized(uint64)"(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; + + "OutpostChainCodeSet(uint64)"( + chainCode?: null + ): OutpostChainCodeSetEventFilter; + OutpostChainCodeSet(chainCode?: null): OutpostChainCodeSetEventFilter; + + "Paused(address)"(account?: null): PausedEventFilter; + Paused(account?: null): PausedEventFilter; + + "ReserveActivated(uint64,uint64)"( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null + ): ReserveActivatedEventFilter; + ReserveActivated( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null + ): ReserveActivatedEventFilter; + + "ReserveCancelRequested(uint64,uint64,address)"( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null, + creator?: string | null + ): ReserveCancelRequestedEventFilter; + ReserveCancelRequested( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null, + creator?: string | null + ): ReserveCancelRequestedEventFilter; + + "ReserveCancelled(uint64,uint64,address,uint256)"( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null, + creator?: string | null, + refundedAmount?: null + ): ReserveCancelledEventFilter; + ReserveCancelled( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null, + creator?: string | null, + refundedAmount?: null + ): ReserveCancelledEventFilter; + + "ReserveCreateRequested(uint64,uint64,address,uint256,uint64,uint32)"( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null, + creator?: string | null, + externalTokenAmount?: null, + requestedWireAmount?: null, + connectorWeightBps?: null + ): ReserveCreateRequestedEventFilter; + ReserveCreateRequested( + tokenCode?: BigNumberish | null, + reserveCode?: BigNumberish | null, + creator?: string | null, + externalTokenAmount?: null, + requestedWireAmount?: null, + connectorWeightBps?: null + ): ReserveCreateRequestedEventFilter; + + "SwapDeposit(uint64,bytes32)"( + id?: BigNumberish | null, + hash?: null + ): SwapDepositEventFilter; + SwapDeposit(id?: BigNumberish | null, hash?: null): SwapDepositEventFilter; + + "SwapRemitPaid(address,uint64,uint64,uint256,bytes32)"( + recipient?: string | null, + tokenCode?: null, + reserveCode?: null, + amount?: null, + originalMessageId?: null + ): SwapRemitPaidEventFilter; + SwapRemitPaid( + recipient?: string | null, + tokenCode?: null, + reserveCode?: null, + amount?: null, + originalMessageId?: null + ): SwapRemitPaidEventFilter; + + "SwapRemitUnpayable(uint64,uint64,uint64,bytes32,string)"( + tokenCode?: null, + reserveCode?: null, + depotAmount?: null, + originalId?: null, + reason?: null + ): SwapRemitUnpayableEventFilter; + SwapRemitUnpayable( + tokenCode?: null, + reserveCode?: null, + depotAmount?: null, + originalId?: null, + reason?: null + ): SwapRemitUnpayableEventFilter; + + "SwapRequested(address,uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32)"( + user?: string | null, + sourceTokenCode?: null, + sourceReserveCode?: null, + sourceAmount?: null, + targetChainCode?: null, + targetTokenCode?: null, + targetReserveCode?: null, + targetRecipient?: null, + targetAmount?: null, + targetToleranceBps?: null + ): SwapRequestedEventFilter; + SwapRequested( + user?: string | null, + sourceTokenCode?: null, + sourceReserveCode?: null, + sourceAmount?: null, + targetChainCode?: null, + targetTokenCode?: null, + targetReserveCode?: null, + targetRecipient?: null, + targetAmount?: null, + targetToleranceBps?: null + ): SwapRequestedEventFilter; + + "SwapRevertError(address,uint64,uint64,uint256,bytes32,bytes)"( + depositor?: string | null, + tokenCode?: null, + reserveCode?: null, + amount?: null, + originalSwapMessageId?: null, + errData?: null + ): SwapRevertErrorEventFilter; + SwapRevertError( + depositor?: string | null, + tokenCode?: null, + reserveCode?: null, + amount?: null, + originalSwapMessageId?: null, + errData?: null + ): SwapRevertErrorEventFilter; + + "SwapReverted(address,uint64,uint64,uint256,bytes32,string)"( + depositor?: string | null, + tokenCode?: null, + reserveCode?: null, + amount?: null, + originalSwapMessageId?: null, + reason?: null + ): SwapRevertedEventFilter; + SwapReverted( + depositor?: string | null, + tokenCode?: null, + reserveCode?: null, + amount?: null, + originalSwapMessageId?: null, + reason?: null + ): SwapRevertedEventFilter; + + "TokenAddressSet(uint64,address)"( + tokenCode?: null, + addr?: null + ): TokenAddressSetEventFilter; + TokenAddressSet(tokenCode?: null, addr?: null): TokenAddressSetEventFilter; + + "TrackedCodesUpdated()"(): TrackedCodesUpdatedEventFilter; + TrackedCodesUpdated(): TrackedCodesUpdatedEventFilter; + + "Unpaused(address)"(account?: null): UnpausedEventFilter; + Unpaused(account?: null): UnpausedEventFilter; + + "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; + Upgraded(implementation?: string | null): UpgradedEventFilter; + + "Withdrawn(uint64,uint64,address,uint256)"( + tokenCode?: null, + reserveCode?: null, + to?: string | null, + amount?: null + ): WithdrawnEventFilter; + Withdrawn( + tokenCode?: null, + reserveCode?: null, + to?: string | null, + amount?: null + ): WithdrawnEventFilter; + }; + + estimateGas: { + BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise; + + RESERVE_CREATE_CANCEL_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + _payRemit( + to: string, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + balanceOf( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + cancel_create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + externalTokenAmount: BigNumberish, + requestedWireAmount: BigNumberish, + connectorWeightBps: BigNumberish, + name: string, + description: string, + isPrivate: boolean, + creatorPubKey: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + emitBalanceSheet( + overrides?: Overrides & { from?: string } + ): Promise; + + getReserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp(overrides?: CallOverrides): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + onReserveCreateCancelled( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onReserveReady( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onSwapRevert( + depositor: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + depotAmount: BigNumberish, + originalSwapMessageId: BytesLike, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + pause(overrides?: Overrides & { from?: string }): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + requestReserveCreateErc20WithApproval( + args: ReserveManagerLib.ReserveCreateArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestReserveCreateErc20WithPermit( + args: ReserveManagerLib.ReserveCreateArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwap( + sourceTokenCode: BigNumberish, + sourceReserveCode: BigNumberish, + targetChainCode: BigNumberish, + targetTokenCode: BigNumberish, + targetReserveCode: BigNumberish, + targetRecipient: BytesLike, + targetAmount: BigNumberish, + targetToleranceBps: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + requestSwapErc20WithApproval( + args: ReserveManagerLib.SwapArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwapErc20WithPermit( + args: ReserveManagerLib.SwapArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + reserves(arg0: BytesLike, overrides?: CallOverrides): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTrackedCodes( + entries: ReserveManager.TrackedCodeEntryStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + swapDepositCounter(overrides?: CallOverrides): Promise; + + tokenAddressesByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenPrecisionByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedCodesCount(overrides?: CallOverrides): Promise; + + trackedReserveCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedTokenCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + unpause(overrides?: Overrides & { from?: string }): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + amount: BigNumberish, + to: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + BALANCE_SHEET_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + OPPAttestationIn( + attestationType: BigNumberish, + data: BytesLike, + overrides?: Overrides & { from?: string } + ): Promise; + + RESERVE_CREATE_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + RESERVE_CREATE_CANCEL_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + SWAP_REQUEST_ATTESTATION( + overrides?: CallOverrides + ): Promise; + + UPGRADE_INTERFACE_VERSION( + overrides?: CallOverrides + ): Promise; + + __OPPEndpointManaged_init( + owner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + _payRemit( + to: string, + tokenCode: BigNumberish, + amount: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + authority(overrides?: CallOverrides): Promise; + + balanceOf( + tokenCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + cancel_create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + create_reserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + externalTokenAmount: BigNumberish, + requestedWireAmount: BigNumberish, + connectorWeightBps: BigNumberish, + name: string, + description: string, + isPrivate: boolean, + creatorPubKey: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + emitBalanceSheet( + overrides?: Overrides & { from?: string } + ): Promise; + + getReserve( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: CallOverrides + ): Promise; + + getSummaryAttestations( + overrides?: Overrides & { from?: string } + ): Promise; + + initialize( + _authority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + isConsumingScheduledOp( + overrides?: CallOverrides + ): Promise; + + nativeTokenCode(overrides?: CallOverrides): Promise; + + onReserveCreateCancelled( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onReserveReady( + chainCode: BigNumberish, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + onSwapRevert( + depositor: string, + tokenCode: BigNumberish, + reserveCode: BigNumberish, + depotAmount: BigNumberish, + originalSwapMessageId: BytesLike, + reason: string, + overrides?: Overrides & { from?: string } + ): Promise; + + oppAddress(overrides?: CallOverrides): Promise; + + oppInboundAddress(overrides?: CallOverrides): Promise; + + outpostChainCode(overrides?: CallOverrides): Promise; + + pause( + overrides?: Overrides & { from?: string } + ): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + requestReserveCreateErc20WithApproval( + args: ReserveManagerLib.ReserveCreateArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestReserveCreateErc20WithPermit( + args: ReserveManagerLib.ReserveCreateArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwap( + sourceTokenCode: BigNumberish, + sourceReserveCode: BigNumberish, + targetChainCode: BigNumberish, + targetTokenCode: BigNumberish, + targetReserveCode: BigNumberish, + targetRecipient: BytesLike, + targetAmount: BigNumberish, + targetToleranceBps: BigNumberish, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + requestSwapErc20WithApproval( + args: ReserveManagerLib.SwapArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + requestSwapErc20WithPermit( + args: ReserveManagerLib.SwapArgsStruct, + permitSig: ReserveManagerLib.PermitSigStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + reserves( + arg0: BytesLike, + overrides?: CallOverrides + ): Promise; + + setAuthority( + newAuthority: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOPPAddresses( + _oppAddress: string, + _oppInboundAddress: string, + overrides?: Overrides & { from?: string } + ): Promise; + + setOutpostChainCode( + chainCode: BigNumberish, + overrides?: Overrides & { from?: string } + ): Promise; + + setTrackedCodes( + entries: ReserveManager.TrackedCodeEntryStruct[], + overrides?: Overrides & { from?: string } + ): Promise; + + swapDepositCounter( + overrides?: CallOverrides + ): Promise; + + tokenAddressesByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + tokenPrecisionByCode( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedCodesCount(overrides?: CallOverrides): Promise; + + trackedReserveCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + trackedTokenCodes( + arg0: BigNumberish, + overrides?: CallOverrides + ): Promise; + + unpause( + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + withdraw( + tokenCode: BigNumberish, + reserveCode: BigNumberish, + amount: BigNumberish, + to: string, + overrides?: Overrides & { from?: string } + ): Promise; + }; +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/common.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/common.ts new file mode 100644 index 0000000..2fc40c7 --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/common.ts @@ -0,0 +1,44 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { Listener } from "@ethersproject/providers"; +import type { Event, EventFilter } from "ethers"; + +export interface TypedEvent< + TArgsArray extends Array = any, + TArgsObject = any +> extends Event { + args: TArgsArray & TArgsObject; +} + +export interface TypedEventFilter<_TEvent extends TypedEvent> + extends EventFilter {} + +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; +} + +type __TypechainArgsArray = T extends TypedEvent ? U : never; + +export interface OnEvent { + ( + eventFilter: TypedEventFilter, + listener: TypedListener + ): TRes; + (eventName: string, listener: Listener): TRes; +} + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts new file mode 100644 index 0000000..695cf95 --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts @@ -0,0 +1,1431 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { OPPInbound, OPPInboundInterface } from "../OPPInbound.js"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AccessManagedInvalidAuthority", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "uint32", + name: "delay", + type: "uint32", + }, + ], + name: "AccessManagedRequiredDelay", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "AccessManagedUnauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + ], + name: "AddressEmptyCode", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ERC1967InvalidImplementation", + type: "error", + }, + { + inputs: [], + name: "ERC1967NonPayable", + type: "error", + }, + { + inputs: [], + name: "FailedCall", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [], + name: "InvalidInitialization", + type: "error", + }, + { + inputs: [], + name: "NotInitializing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "actualBytes", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxBytes", + type: "uint256", + }, + ], + name: "OPP_EnvelopeOverCap", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_EpochHashMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeRecordMissing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint32", + name: "evictBoundary", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeStillInRetention", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + { + internalType: "uint256", + name: "provided", + type: "uint256", + }, + ], + name: "OPP_InsufficientSignatureWeight", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "address", + name: "expected", + type: "address", + }, + ], + name: "OPP_InvalidOPPAddress", + type: "error", + }, + { + inputs: [], + name: "OPP_InvalidRetentionConfig", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "expected", + type: "bytes", + }, + { + internalType: "bytes", + name: "actual", + type: "bytes", + }, + ], + name: "OPP_MessageIDMismatch", + type: "error", + }, + { + inputs: [], + name: "OPP_NoAttestationsSent", + type: "error", + }, + { + inputs: [], + name: "OPP_NoPendingAttestations", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "previousEnvelopeHash", + type: "bytes", + }, + ], + name: "OPP_NonCanonicalPreviousEpochHash", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "expected", + type: "uint32", + }, + { + internalType: "uint32", + name: "actual", + type: "uint32", + }, + ], + name: "OPP_NonSequentialEpoch", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_NotActiveOperator", + type: "error", + }, + { + inputs: [], + name: "OPP_NotSending", + type: "error", + }, + { + inputs: [], + name: "OPP_OPPAddressNotSet", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_OperatorAlreadyDelivered", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_PayloadChecksumMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "stack", + type: "uint256", + }, + ], + name: "OPP_SendStackError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnauthorizedAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnhandledAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "expectedChainId", + type: "uint256", + }, + { + internalType: "ChainKind", + name: "actualKind", + type: "uint8", + }, + { + internalType: "uint32", + name: "actualId", + type: "uint32", + }, + ], + name: "OPP_WrongDestinationChain", + type: "error", + }, + { + inputs: [], + name: "OPP_ZeroTag", + type: "error", + }, + { + inputs: [], + name: "UUPSUnauthorizedCallContext", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "slot", + type: "bytes32", + }, + ], + name: "UUPSUnsupportedProxiableUUID", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes", + name: "messageID", + type: "bytes", + }, + { + indexed: false, + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + indexed: false, + internalType: "uint64", + name: "sequenceNumber", + type: "uint64", + }, + ], + name: "AttestationBlackholed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "handler", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "messageID", + type: "bytes", + }, + { + indexed: false, + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + indexed: false, + internalType: "uint64", + name: "sequenceNumber", + type: "uint64", + }, + ], + name: "AttestationDelivered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + indexed: false, + internalType: "address", + name: "handler", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "oldHandler", + type: "address", + }, + ], + name: "AttestationHandlerSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AuthorityUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "EnvelopeRetentionCatchUpPruned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "previousRetentionEpochs", + type: "uint32", + }, + { + indexed: false, + internalType: "uint32", + name: "retentionEpochs", + type: "uint32", + }, + ], + name: "EnvelopeRetentionConfigUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "EpochComplete", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + indexed: false, + internalType: "bytes32", + name: "epochHash", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint32", + name: "deliveryCount", + type: "uint32", + }, + ], + name: "EpochConsensus", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + indexed: true, + internalType: "address", + name: "operator_", + type: "address", + }, + { + indexed: false, + internalType: "bytes32", + name: "epochHash", + type: "bytes32", + }, + ], + name: "EpochDelivery", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + indexed: false, + internalType: "bytes32", + name: "epochHash", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "messageCount", + type: "uint256", + }, + ], + name: "EpochReceived", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "version", + type: "uint64", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newReserveManager", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "oldReserveManager", + type: "address", + }, + ], + name: "ReserveManagerAddressSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + inputs: [], + name: "MAX_ENVELOPE_BYTES", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_SIG_WEIGHT", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "activeGroupIndex", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + name: "attestationHandlers", + outputs: [ + { + internalType: "contract IOPPReceiver", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "authority", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "batchOpGroups", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "consensusReached", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "currentEpochStartedAt", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "epochDeliveries", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + name: "epochDeliveryCount", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "epochDigestCount", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "epochDurationSec", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "epochIn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex_", + type: "uint32", + }, + ], + name: "getInboundEnvelope", + outputs: [ + { + components: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint64", + name: "emittedAt", + type: "uint64", + }, + { + internalType: "bytes32", + name: "checksum", + type: "bytes32", + }, + ], + internalType: "struct OPPEnvelopeRetention.EnvelopeRecord", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + name: "inboundEnvelopes", + outputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint64", + name: "emittedAt", + type: "uint64", + }, + { + internalType: "bytes32", + name: "checksum", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inboundRetentionConfig", + outputs: [ + { + internalType: "uint32", + name: "retentionEpochs", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "oppManager", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator_", + type: "address", + }, + ], + name: "isActiveOperator", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "isConsumingScheduledOp", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastMessageID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "nextEpochIndex", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "operatorEthAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oppContract", + outputs: [ + { + internalType: "contract IOPP", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingConsensus", + outputs: [ + { + internalType: "uint32", + name: "nextEpoch", + type: "uint32", + }, + { + internalType: "uint32", + name: "deliveries", + type: "uint32", + }, + { + internalType: "uint32", + name: "groupSize", + type: "uint32", + }, + { + internalType: "uint64", + name: "currentEpochStartedAtTs", + type: "uint64", + }, + { + internalType: "uint32", + name: "epochDurationSec_", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "pendingConsensusForDigest", + outputs: [ + { + internalType: "uint32", + name: "nextEpoch", + type: "uint32", + }, + { + internalType: "uint32", + name: "agreeing", + type: "uint32", + }, + { + internalType: "uint32", + name: "groupSize", + type: "uint32", + }, + { + internalType: "uint64", + name: "currentEpochStartedAtTs", + type: "uint64", + }, + { + internalType: "uint32", + name: "epochDurationSec_", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingEpoch", + outputs: [ + { + internalType: "bytes", + name: "envelopeHash", + type: "bytes", + }, + { + components: [ + { + components: [ + { + internalType: "ChainKind", + name: "kind", + type: "uint8", + }, + { + internalType: "uint32", + name: "id", + type: "uint32", + }, + ], + internalType: "struct ChainId", + name: "start", + type: "tuple", + }, + { + components: [ + { + internalType: "ChainKind", + name: "kind", + type: "uint8", + }, + { + internalType: "uint32", + name: "id", + type: "uint32", + }, + ], + internalType: "struct ChainId", + name: "end", + type: "tuple", + }, + ], + internalType: "struct Endpoints", + name: "endpoints", + type: "tuple", + }, + { + internalType: "uint64", + name: "epochTimestamp", + type: "uint64", + }, + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint32", + name: "epochEnvelopeIndex", + type: "uint32", + }, + { + internalType: "bytes", + name: "previousEnvelopeHash", + type: "bytes", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingEpochHash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingMessageCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "previousEpochHash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex_", + type: "uint32", + }, + ], + name: "pruneInboundEnvelope", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "pubkeyAddressCache", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "reserveManagerAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "rosterInitialized", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + internalType: "address", + name: "handler", + type: "address", + }, + ], + name: "setAttestationHandler", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newAuthority", + type: "address", + }, + ], + name: "setAuthority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "retentionEpochs", + type: "uint32", + }, + ], + name: "setEnvelopeRetentionConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "durationSec", + type: "uint32", + }, + ], + name: "setEpochDurationSec", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "opp", + type: "address", + }, + ], + name: "setOPPContract", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newReserveManager", + type: "address", + }, + ], + name: "setReserveManagerAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, +] as const; + +export class OPPInbound__factory { + static readonly abi = _abi; + static createInterface(): OPPInboundInterface { + return new utils.Interface(_abi) as OPPInboundInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): OPPInbound { + return new Contract(address, _abi, signerOrProvider) as OPPInbound; + } +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts new file mode 100644 index 0000000..94b8d8f --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts @@ -0,0 +1,1095 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { OPP, OPPInterface } from "../OPP.js"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AccessManagedInvalidAuthority", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "uint32", + name: "delay", + type: "uint32", + }, + ], + name: "AccessManagedRequiredDelay", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "AccessManagedUnauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + ], + name: "AddressEmptyCode", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ERC1967InvalidImplementation", + type: "error", + }, + { + inputs: [], + name: "ERC1967NonPayable", + type: "error", + }, + { + inputs: [], + name: "FailedCall", + type: "error", + }, + { + inputs: [], + name: "InvalidInitialization", + type: "error", + }, + { + inputs: [], + name: "NotInitializing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "actualBytes", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxBytes", + type: "uint256", + }, + ], + name: "OPP_EnvelopeOverCap", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_EpochHashMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeRecordMissing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint32", + name: "evictBoundary", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeStillInRetention", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + { + internalType: "uint256", + name: "provided", + type: "uint256", + }, + ], + name: "OPP_InsufficientSignatureWeight", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "address", + name: "expected", + type: "address", + }, + ], + name: "OPP_InvalidOPPAddress", + type: "error", + }, + { + inputs: [], + name: "OPP_InvalidRetentionConfig", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "expected", + type: "bytes", + }, + { + internalType: "bytes", + name: "actual", + type: "bytes", + }, + ], + name: "OPP_MessageIDMismatch", + type: "error", + }, + { + inputs: [], + name: "OPP_NoAttestationsSent", + type: "error", + }, + { + inputs: [], + name: "OPP_NoPendingAttestations", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "previousEnvelopeHash", + type: "bytes", + }, + ], + name: "OPP_NonCanonicalPreviousEpochHash", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "expected", + type: "uint32", + }, + { + internalType: "uint32", + name: "actual", + type: "uint32", + }, + ], + name: "OPP_NonSequentialEpoch", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_NotActiveOperator", + type: "error", + }, + { + inputs: [], + name: "OPP_NotSending", + type: "error", + }, + { + inputs: [], + name: "OPP_OPPAddressNotSet", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_OperatorAlreadyDelivered", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_PayloadChecksumMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "stack", + type: "uint256", + }, + ], + name: "OPP_SendStackError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnauthorizedAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnhandledAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "expectedChainId", + type: "uint256", + }, + { + internalType: "ChainKind", + name: "actualKind", + type: "uint8", + }, + { + internalType: "uint32", + name: "actualId", + type: "uint32", + }, + ], + name: "OPP_WrongDestinationChain", + type: "error", + }, + { + inputs: [], + name: "OPP_ZeroTag", + type: "error", + }, + { + inputs: [], + name: "UUPSUnauthorizedCallContext", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "slot", + type: "bytes32", + }, + ], + name: "UUPSUnsupportedProxiableUUID", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AuthorityUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "EnvelopeRetentionCatchUpPruned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "previousRetentionEpochs", + type: "uint32", + }, + { + indexed: false, + internalType: "uint32", + name: "retentionEpochs", + type: "uint32", + }, + ], + name: "EnvelopeRetentionConfigUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "version", + type: "uint64", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "OPPEnvelope", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + inputs: [], + name: "MAX_ENVELOPE_BYTES", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "addAttestation", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "allAuthorizedSenders", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "authority", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "authorizedSenders", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "wireEpochIndex", + type: "uint32", + }, + ], + name: "emitOutboundEnvelope", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tag", + type: "uint256", + }, + ], + name: "enterSendMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tag", + type: "uint256", + }, + ], + name: "exitSendMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getLatestOutboundEnvelope", + outputs: [ + { + internalType: "uint32", + name: "epoch_", + type: "uint32", + }, + { + internalType: "bytes", + name: "data_", + type: "bytes", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex_", + type: "uint32", + }, + ], + name: "getOutboundEnvelope", + outputs: [ + { + components: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint64", + name: "emittedAt", + type: "uint64", + }, + { + internalType: "bytes32", + name: "checksum", + type: "bytes32", + }, + ], + internalType: "struct OPPEnvelopeRetention.EnvelopeRecord", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inSendMode", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_authority", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isConsumingScheduledOp", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastMessageID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "lastMessageTimestamp", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "latestOutboundEnvelope", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "latestOutboundEpoch", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + name: "outboundEnvelopes", + outputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint64", + name: "emittedAt", + type: "uint64", + }, + { + internalType: "bytes32", + name: "checksum", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "outboundRetentionConfig", + outputs: [ + { + internalType: "uint32", + name: "retentionEpochs", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pendingAttestationCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex_", + type: "uint32", + }, + ], + name: "pruneOutboundEnvelope", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "queuedMessageCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "sendModeTag", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + components: [ + { + internalType: "ChainKind", + name: "kind", + type: "uint8", + }, + { + internalType: "uint32", + name: "id", + type: "uint32", + }, + ], + internalType: "struct ChainId", + name: "start", + type: "tuple", + }, + { + components: [ + { + internalType: "ChainKind", + name: "kind", + type: "uint8", + }, + { + internalType: "uint32", + name: "id", + type: "uint32", + }, + ], + internalType: "struct ChainId", + name: "end", + type: "tuple", + }, + ], + internalType: "struct Endpoints", + name: "endpoints", + type: "tuple", + }, + { + internalType: "bytes", + name: "messageId", + type: "bytes", + }, + { + internalType: "bytes", + name: "previousMessageId", + type: "bytes", + }, + { + internalType: "uint32", + name: "payloadSize", + type: "uint32", + }, + { + internalType: "bytes", + name: "payloadChecksum", + type: "bytes", + }, + { + internalType: "uint64", + name: "timestamp", + type: "uint64", + }, + { + internalType: "bytes", + name: "headerChecksum", + type: "bytes", + }, + ], + internalType: "struct MessageHeader", + name: "header", + type: "tuple", + }, + { + components: [ + { + internalType: "uint32", + name: "version", + type: "uint32", + }, + { + components: [ + { + internalType: "AttestationType", + name: "type_", + type: "uint16", + }, + { + internalType: "uint32", + name: "dataSize", + type: "uint32", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct AttestationEntry[]", + name: "attestations", + type: "tuple[]", + }, + ], + internalType: "struct MessagePayload", + name: "payload", + type: "tuple", + }, + ], + name: "serializeMessage", + outputs: [ + { + components: [ + { + components: [ + { + components: [ + { + internalType: "ChainKind", + name: "kind", + type: "uint8", + }, + { + internalType: "uint32", + name: "id", + type: "uint32", + }, + ], + internalType: "struct ChainId", + name: "start", + type: "tuple", + }, + { + components: [ + { + internalType: "ChainKind", + name: "kind", + type: "uint8", + }, + { + internalType: "uint32", + name: "id", + type: "uint32", + }, + ], + internalType: "struct ChainId", + name: "end", + type: "tuple", + }, + ], + internalType: "struct Endpoints", + name: "endpoints", + type: "tuple", + }, + { + internalType: "bytes", + name: "messageId", + type: "bytes", + }, + { + internalType: "bytes", + name: "previousMessageId", + type: "bytes", + }, + { + internalType: "uint32", + name: "payloadSize", + type: "uint32", + }, + { + internalType: "bytes", + name: "payloadChecksum", + type: "bytes", + }, + { + internalType: "uint64", + name: "timestamp", + type: "uint64", + }, + { + internalType: "bytes", + name: "headerChecksum", + type: "bytes", + }, + ], + internalType: "struct MessageHeader", + name: "", + type: "tuple", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newAuthority", + type: "address", + }, + ], + name: "setAuthority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "retentionEpochs", + type: "uint32", + }, + ], + name: "setEnvelopeRetentionConfig", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, +] as const; + +export class OPP__factory { + static readonly abi = _abi; + static createInterface(): OPPInterface { + return new utils.Interface(_abi) as OPPInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): OPP { + return new Contract(address, _abi, signerOrProvider) as OPP; + } +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts new file mode 100644 index 0000000..818b13e --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts @@ -0,0 +1,1677 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + OperatorRegistry, + OperatorRegistryInterface, +} from "../OperatorRegistry.js"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AccessManagedInvalidAuthority", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "uint32", + name: "delay", + type: "uint32", + }, + ], + name: "AccessManagedRequiredDelay", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "AccessManagedUnauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + ], + name: "AddressEmptyCode", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ERC1967InvalidImplementation", + type: "error", + }, + { + inputs: [], + name: "ERC1967NonPayable", + type: "error", + }, + { + inputs: [], + name: "FailedCall", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [], + name: "InvalidInitialization", + type: "error", + }, + { + inputs: [], + name: "NotInitializing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "actualBytes", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxBytes", + type: "uint256", + }, + ], + name: "OPP_EnvelopeOverCap", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_EpochHashMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeRecordMissing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint32", + name: "evictBoundary", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeStillInRetention", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + { + internalType: "uint256", + name: "provided", + type: "uint256", + }, + ], + name: "OPP_InsufficientSignatureWeight", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "address", + name: "expected", + type: "address", + }, + ], + name: "OPP_InvalidOPPAddress", + type: "error", + }, + { + inputs: [], + name: "OPP_InvalidRetentionConfig", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "expected", + type: "bytes", + }, + { + internalType: "bytes", + name: "actual", + type: "bytes", + }, + ], + name: "OPP_MessageIDMismatch", + type: "error", + }, + { + inputs: [], + name: "OPP_NoAttestationsSent", + type: "error", + }, + { + inputs: [], + name: "OPP_NoPendingAttestations", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "previousEnvelopeHash", + type: "bytes", + }, + ], + name: "OPP_NonCanonicalPreviousEpochHash", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "expected", + type: "uint32", + }, + { + internalType: "uint32", + name: "actual", + type: "uint32", + }, + ], + name: "OPP_NonSequentialEpoch", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_NotActiveOperator", + type: "error", + }, + { + inputs: [], + name: "OPP_NotSending", + type: "error", + }, + { + inputs: [], + name: "OPP_OPPAddressNotSet", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_OperatorAlreadyDelivered", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_PayloadChecksumMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "stack", + type: "uint256", + }, + ], + name: "OPP_SendStackError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnauthorizedAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnhandledAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "expectedChainId", + type: "uint256", + }, + { + internalType: "ChainKind", + name: "actualKind", + type: "uint8", + }, + { + internalType: "uint32", + name: "actualId", + type: "uint32", + }, + ], + name: "OPP_WrongDestinationChain", + type: "error", + }, + { + inputs: [], + name: "OPP_ZeroTag", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "SafeERC20FailedOperation", + type: "error", + }, + { + inputs: [], + name: "UUPSUnauthorizedCallContext", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "slot", + type: "bytes32", + }, + ], + name: "UUPSUnsupportedProxiableUUID", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "address", + name: "provided", + type: "address", + }, + ], + name: "WIRE_BadContractAddress", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "bps", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxBps", + type: "uint256", + }, + ], + name: "WIRE_BasisPointsTooHigh", + type: "error", + }, + { + inputs: [], + name: "WIRE_Erc20DepositValueNonZero", + type: "error", + }, + { + inputs: [], + name: "WIRE_Erc20TransferFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "WIRE_EthSendFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_FeeOnTransferUnsupported", + type: "error", + }, + { + inputs: [], + name: "WIRE_GoLiveInProgress", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + { + internalType: "uint256", + name: "available", + type: "uint256", + }, + ], + name: "WIRE_InsufficientEthBalance", + type: "error", + }, + { + inputs: [], + name: "WIRE_InvalidPrice", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "WIRE_LiqEthTransferFailed", + type: "error", + }, + { + inputs: [], + name: "WIRE_MultipleNativeTrackedCodes", + type: "error", + }, + { + inputs: [], + name: "WIRE_NativeDepositValueMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "actor", + type: "address", + }, + { + internalType: "OperatorType", + name: "operatorType", + type: "uint8", + }, + ], + name: "WIRE_NoBonds", + type: "error", + }, + { + inputs: [], + name: "WIRE_NoPricesRecorded", + type: "error", + }, + { + inputs: [], + name: "WIRE_NoYield", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "receiptId", + type: "uint256", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_NotReceiptOwner", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_OnlyOPPInboundLib", + type: "error", + }, + { + inputs: [], + name: "WIRE_OppInboundCallerUnauthorized", + type: "error", + }, + { + inputs: [], + name: "WIRE_OutpostChainCodeUnset", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "innerRevert", + type: "bytes", + }, + ], + name: "WIRE_PermitFailed", + type: "error", + }, + { + inputs: [], + name: "WIRE_PrecisionOverflow", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_PrecisionUnsetForRefund", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "minPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPrice", + type: "uint256", + }, + ], + name: "WIRE_PriceOutOfBounds", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "receiptId", + type: "uint256", + }, + ], + name: "WIRE_ReceiptNotWithdrawable", + type: "error", + }, + { + inputs: [], + name: "WIRE_RefundingInProgress", + type: "error", + }, + { + inputs: [], + name: "WIRE_RefundingOnly", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveAlreadyExists", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveBadParam", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveCancelNotCreator", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveNotCancellable", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapEmptyRecipient", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapSourceNotNative", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapSourceReserveUnavailable", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_SwapSourceTokenNotRegistered", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapUnknownSlugName", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapZeroSourceAmount", + type: "error", + }, + { + inputs: [], + name: "WIRE_TokenAddressUnset", + type: "error", + }, + { + inputs: [ + { + internalType: "uint8", + name: "provided", + type: "uint8", + }, + ], + name: "WIRE_TokenPrecisionOutOfRange", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_TokenPrecisionUnset", + type: "error", + }, + { + inputs: [], + name: "WIRE_TrackedCodeZero", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "WIRE_UnexpectedError", + type: "error", + }, + { + inputs: [], + name: "WIRE_ZeroAmount", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AuthorityUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "depositor", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "refundedToDepositor", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "penaltyToReserve", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "originalMessageId", + type: "bytes", + }, + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "DepositReverted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "version", + type: "uint64", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "LiqTokenCodeSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "NativeTokenCodeSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "OperatorType", + name: "operatorType", + type: "uint8", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "OperatorDeposited", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "address", + name: "reserveTarget", + type: "address", + }, + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "OperatorSlashed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + ], + name: "OutpostChainCodeSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "underwriter", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "uicBytes", + type: "bytes", + }, + ], + name: "UnderwriteCommitRelayed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint64", + name: "requestId", + type: "uint64", + }, + ], + name: "WithdrawRemitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint64", + name: "requestId", + type: "uint64", + }, + ], + name: "WithdrawRequested", + type: "event", + }, + { + inputs: [], + name: "DEPOSIT_REVERT_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "DEPOSIT_REVERT_GAS_MULTIPLIER", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "OPERATOR_ACTION_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "OPPAttestationIn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "UNDERWRITE_INTENT_COMMIT_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "__OPPEndpointManaged_init", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "authority", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "uicBytes", + type: "bytes", + }, + ], + name: "commit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "OperatorType", + name: "operatorType", + type: "uint8", + }, + { + internalType: "bytes", + name: "compressedPubkey", + type: "bytes", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "deposit", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "OperatorType", + name: "operatorType", + type: "uint8", + }, + { + internalType: "bytes", + name: "compressedPubkey", + type: "bytes", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "depositNonNative", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + name: "depositedByCode", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getSummaryAttestations", + outputs: [ + { + components: [ + { + internalType: "AttestationType", + name: "type_", + type: "uint16", + }, + { + internalType: "uint32", + name: "dataSize", + type: "uint32", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct AttestationEntry[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_authority", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isConsumingScheduledOp", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "liqToken", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "liqTokenCode", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "nativeTokenCode", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "operators", + outputs: [ + { + internalType: "OperatorType", + name: "operatorType", + type: "uint8", + }, + { + internalType: "OperatorStatus", + name: "status", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oppAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oppInboundAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "outpostChainCode", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "outpostId", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "reserveManagerAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newAuthority", + type: "address", + }, + ], + name: "setAuthority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_liqToken", + type: "address", + }, + ], + name: "setLiqToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "setLiqTokenCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "setNativeTokenCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_oppAddress", + type: "address", + }, + { + internalType: "address", + name: "_oppInboundAddress", + type: "address", + }, + ], + name: "setOPPAddresses", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + ], + name: "setOutpostChainCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "_outpostId", + type: "uint64", + }, + ], + name: "setOutpostId", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_reserveManager", + type: "address", + }, + ], + name: "setReserveManagerAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "slash", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "compressedPubkey", + type: "bytes", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; + +export class OperatorRegistry__factory { + static readonly abi = _abi; + static createInterface(): OperatorRegistryInterface { + return new utils.Interface(_abi) as OperatorRegistryInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): OperatorRegistry { + return new Contract(address, _abi, signerOrProvider) as OperatorRegistry; + } +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts new file mode 100644 index 0000000..8df24f7 --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts @@ -0,0 +1,2476 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + ReserveManager, + ReserveManagerInterface, +} from "../ReserveManager.js"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AccessManagedInvalidAuthority", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "uint32", + name: "delay", + type: "uint32", + }, + ], + name: "AccessManagedRequiredDelay", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "AccessManagedUnauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + ], + name: "AddressEmptyCode", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ERC1967InvalidImplementation", + type: "error", + }, + { + inputs: [], + name: "ERC1967NonPayable", + type: "error", + }, + { + inputs: [], + name: "EnforcedPause", + type: "error", + }, + { + inputs: [], + name: "ExpectedPause", + type: "error", + }, + { + inputs: [], + name: "FailedCall", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "raw", + type: "uint64", + }, + ], + name: "InvalidEnumValue", + type: "error", + }, + { + inputs: [], + name: "InvalidInitialization", + type: "error", + }, + { + inputs: [], + name: "NotInitializing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "actualBytes", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxBytes", + type: "uint256", + }, + ], + name: "OPP_EnvelopeOverCap", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_EpochHashMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeRecordMissing", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "uint32", + name: "evictBoundary", + type: "uint32", + }, + ], + name: "OPP_InboundEnvelopeStillInRetention", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + { + internalType: "uint256", + name: "provided", + type: "uint256", + }, + ], + name: "OPP_InsufficientSignatureWeight", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + { + internalType: "address", + name: "expected", + type: "address", + }, + ], + name: "OPP_InvalidOPPAddress", + type: "error", + }, + { + inputs: [], + name: "OPP_InvalidRetentionConfig", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "expected", + type: "bytes", + }, + { + internalType: "bytes", + name: "actual", + type: "bytes", + }, + ], + name: "OPP_MessageIDMismatch", + type: "error", + }, + { + inputs: [], + name: "OPP_NoAttestationsSent", + type: "error", + }, + { + inputs: [], + name: "OPP_NoPendingAttestations", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "previousEnvelopeHash", + type: "bytes", + }, + ], + name: "OPP_NonCanonicalPreviousEpochHash", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "expected", + type: "uint32", + }, + { + internalType: "uint32", + name: "actual", + type: "uint32", + }, + ], + name: "OPP_NonSequentialEpoch", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_NotActiveOperator", + type: "error", + }, + { + inputs: [], + name: "OPP_NotSending", + type: "error", + }, + { + inputs: [], + name: "OPP_OPPAddressNotSet", + type: "error", + }, + { + inputs: [ + { + internalType: "uint32", + name: "epochIndex", + type: "uint32", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "OPP_OperatorAlreadyDelivered", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "expected", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "actual", + type: "bytes32", + }, + ], + name: "OPP_PayloadChecksumMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "stack", + type: "uint256", + }, + ], + name: "OPP_SendStackError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnauthorizedAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + ], + name: "OPP_UnhandledAttestationType", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "expectedChainId", + type: "uint256", + }, + { + internalType: "ChainKind", + name: "actualKind", + type: "uint8", + }, + { + internalType: "uint32", + name: "actualId", + type: "uint32", + }, + ], + name: "OPP_WrongDestinationChain", + type: "error", + }, + { + inputs: [], + name: "OPP_ZeroTag", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "SafeERC20FailedOperation", + type: "error", + }, + { + inputs: [], + name: "UUPSUnauthorizedCallContext", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "slot", + type: "bytes32", + }, + ], + name: "UUPSUnsupportedProxiableUUID", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "address", + name: "provided", + type: "address", + }, + ], + name: "WIRE_BadContractAddress", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "bps", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxBps", + type: "uint256", + }, + ], + name: "WIRE_BasisPointsTooHigh", + type: "error", + }, + { + inputs: [], + name: "WIRE_Erc20DepositValueNonZero", + type: "error", + }, + { + inputs: [], + name: "WIRE_Erc20TransferFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "WIRE_EthSendFailed", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_FeeOnTransferUnsupported", + type: "error", + }, + { + inputs: [], + name: "WIRE_GoLiveInProgress", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "required", + type: "uint256", + }, + { + internalType: "uint256", + name: "available", + type: "uint256", + }, + ], + name: "WIRE_InsufficientEthBalance", + type: "error", + }, + { + inputs: [], + name: "WIRE_InvalidPrice", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "WIRE_LiqEthTransferFailed", + type: "error", + }, + { + inputs: [], + name: "WIRE_MultipleNativeTrackedCodes", + type: "error", + }, + { + inputs: [], + name: "WIRE_NativeDepositValueMismatch", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "actor", + type: "address", + }, + { + internalType: "OperatorType", + name: "operatorType", + type: "uint8", + }, + ], + name: "WIRE_NoBonds", + type: "error", + }, + { + inputs: [], + name: "WIRE_NoPricesRecorded", + type: "error", + }, + { + inputs: [], + name: "WIRE_NoYield", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "receiptId", + type: "uint256", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_NotReceiptOwner", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_OnlyOPPInboundLib", + type: "error", + }, + { + inputs: [], + name: "WIRE_OppInboundCallerUnauthorized", + type: "error", + }, + { + inputs: [], + name: "WIRE_OutpostChainCodeUnset", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes", + name: "innerRevert", + type: "bytes", + }, + ], + name: "WIRE_PermitFailed", + type: "error", + }, + { + inputs: [], + name: "WIRE_PrecisionOverflow", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_PrecisionUnsetForRefund", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "uint256", + name: "minPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPrice", + type: "uint256", + }, + ], + name: "WIRE_PriceOutOfBounds", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "receiptId", + type: "uint256", + }, + ], + name: "WIRE_ReceiptNotWithdrawable", + type: "error", + }, + { + inputs: [], + name: "WIRE_RefundingInProgress", + type: "error", + }, + { + inputs: [], + name: "WIRE_RefundingOnly", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveAlreadyExists", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveBadParam", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveCancelNotCreator", + type: "error", + }, + { + inputs: [], + name: "WIRE_ReserveNotCancellable", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapEmptyRecipient", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapSourceNotNative", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapSourceReserveUnavailable", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_SwapSourceTokenNotRegistered", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapUnknownSlugName", + type: "error", + }, + { + inputs: [], + name: "WIRE_SwapZeroSourceAmount", + type: "error", + }, + { + inputs: [], + name: "WIRE_TokenAddressUnset", + type: "error", + }, + { + inputs: [ + { + internalType: "uint8", + name: "provided", + type: "uint8", + }, + ], + name: "WIRE_TokenPrecisionOutOfRange", + type: "error", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "WIRE_TokenPrecisionUnset", + type: "error", + }, + { + inputs: [], + name: "WIRE_TrackedCodeZero", + type: "error", + }, + { + inputs: [ + { + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "WIRE_UnexpectedError", + type: "error", + }, + { + inputs: [], + name: "WIRE_ZeroAmount", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "AuthorityUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "BalanceSheetEmitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Deposited", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "version", + type: "uint64", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + ], + name: "OutpostChainCodeSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Paused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: true, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + ], + name: "ReserveActivated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: true, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: true, + internalType: "address", + name: "creator", + type: "address", + }, + ], + name: "ReserveCancelRequested", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: true, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: true, + internalType: "address", + name: "creator", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "refundedAmount", + type: "uint256", + }, + ], + name: "ReserveCancelled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: true, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: true, + internalType: "address", + name: "creator", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "externalTokenAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint64", + name: "requestedWireAmount", + type: "uint64", + }, + { + indexed: false, + internalType: "uint32", + name: "connectorWeightBps", + type: "uint32", + }, + ], + name: "ReserveCreateRequested", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint64", + name: "id", + type: "uint64", + }, + { + indexed: false, + internalType: "bytes32", + name: "hash", + type: "bytes32", + }, + ], + name: "SwapDeposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "originalMessageId", + type: "bytes32", + }, + ], + name: "SwapRemitPaid", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "depotAmount", + type: "uint64", + }, + { + indexed: false, + internalType: "bytes32", + name: "originalId", + type: "bytes32", + }, + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "SwapRemitUnpayable", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "sourceTokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "sourceReserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint64", + name: "targetChainCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "targetTokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "targetReserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "bytes", + name: "targetRecipient", + type: "bytes", + }, + { + indexed: false, + internalType: "uint64", + name: "targetAmount", + type: "uint64", + }, + { + indexed: false, + internalType: "uint32", + name: "targetToleranceBps", + type: "uint32", + }, + ], + name: "SwapRequested", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "depositor", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "originalSwapMessageId", + type: "bytes32", + }, + { + indexed: false, + internalType: "bytes", + name: "errData", + type: "bytes", + }, + ], + name: "SwapRevertError", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "depositor", + type: "address", + }, + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes32", + name: "originalSwapMessageId", + type: "bytes32", + }, + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "SwapReverted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "TokenAddressSet", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "TrackedCodesUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Unpaused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + indexed: false, + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "Withdrawn", + type: "event", + }, + { + inputs: [], + name: "BALANCE_SHEET_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "AttestationType", + name: "attestationType", + type: "uint16", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "OPPAttestationIn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "RESERVE_CREATE_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "RESERVE_CREATE_CANCEL_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "SWAP_REQUEST_ATTESTATION", + outputs: [ + { + internalType: "AttestationType", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "__OPPEndpointManaged_init", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "_payRemit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "authority", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + ], + name: "cancel_create_reserve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "externalTokenAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "requestedWireAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "connectorWeightBps", + type: "uint32", + }, + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + { + internalType: "bool", + name: "isPrivate", + type: "bool", + }, + { + internalType: "bytes", + name: "creatorPubKey", + type: "bytes", + }, + ], + name: "create_reserve", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "emitBalanceSheet", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + ], + name: "getReserve", + outputs: [ + { + components: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "externalTokenAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "requestedWireAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "connectorWeightBps", + type: "uint32", + }, + { + internalType: "enum ReserveManager.LocalReserveStatus", + name: "status", + type: "uint8", + }, + { + internalType: "address", + name: "creator", + type: "address", + }, + { + internalType: "bool", + name: "exists", + type: "bool", + }, + ], + internalType: "struct ReserveManager.ReserveRecord", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getSummaryAttestations", + outputs: [ + { + components: [ + { + internalType: "AttestationType", + name: "type_", + type: "uint16", + }, + { + internalType: "uint32", + name: "dataSize", + type: "uint32", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct AttestationEntry[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_authority", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "isConsumingScheduledOp", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "nativeTokenCode", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + ], + name: "onReserveCreateCancelled", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + ], + name: "onReserveReady", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "depositor", + type: "address", + }, + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "depotAmount", + type: "uint64", + }, + { + internalType: "bytes32", + name: "originalSwapMessageId", + type: "bytes32", + }, + { + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "onSwapRevert", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "oppAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oppInboundAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "outpostChainCode", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "paused", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "externalTokenAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "requestedWireAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "connectorWeightBps", + type: "uint32", + }, + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + { + internalType: "bool", + name: "isPrivate", + type: "bool", + }, + { + internalType: "bytes", + name: "creatorPubKey", + type: "bytes", + }, + ], + internalType: "struct ReserveManagerLib.ReserveCreateArgs", + name: "args", + type: "tuple", + }, + ], + name: "requestReserveCreateErc20WithApproval", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "externalTokenAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "requestedWireAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "connectorWeightBps", + type: "uint32", + }, + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + { + internalType: "bool", + name: "isPrivate", + type: "bool", + }, + { + internalType: "bytes", + name: "creatorPubKey", + type: "bytes", + }, + ], + internalType: "struct ReserveManagerLib.ReserveCreateArgs", + name: "args", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + internalType: "struct ReserveManagerLib.PermitSig", + name: "permitSig", + type: "tuple", + }, + ], + name: "requestReserveCreateErc20WithPermit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "sourceTokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "sourceReserveCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetChainCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetTokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetReserveCode", + type: "uint64", + }, + { + internalType: "bytes", + name: "targetRecipient", + type: "bytes", + }, + { + internalType: "uint64", + name: "targetAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "targetToleranceBps", + type: "uint32", + }, + ], + name: "requestSwap", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint64", + name: "sourceTokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "sourceReserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "targetChainCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetTokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetReserveCode", + type: "uint64", + }, + { + internalType: "bytes", + name: "targetRecipient", + type: "bytes", + }, + { + internalType: "uint64", + name: "targetAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "targetToleranceBps", + type: "uint32", + }, + ], + internalType: "struct ReserveManagerLib.SwapArgs", + name: "args", + type: "tuple", + }, + ], + name: "requestSwapErc20WithApproval", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint64", + name: "sourceTokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "sourceReserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "targetChainCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetTokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "targetReserveCode", + type: "uint64", + }, + { + internalType: "bytes", + name: "targetRecipient", + type: "bytes", + }, + { + internalType: "uint64", + name: "targetAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "targetToleranceBps", + type: "uint32", + }, + ], + internalType: "struct ReserveManagerLib.SwapArgs", + name: "args", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + internalType: "struct ReserveManagerLib.PermitSig", + name: "permitSig", + type: "tuple", + }, + ], + name: "requestSwapErc20WithPermit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "reserves", + outputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "externalTokenAmount", + type: "uint256", + }, + { + internalType: "uint64", + name: "requestedWireAmount", + type: "uint64", + }, + { + internalType: "uint32", + name: "connectorWeightBps", + type: "uint32", + }, + { + internalType: "enum ReserveManager.LocalReserveStatus", + name: "status", + type: "uint8", + }, + { + internalType: "address", + name: "creator", + type: "address", + }, + { + internalType: "bool", + name: "exists", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newAuthority", + type: "address", + }, + ], + name: "setAuthority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_oppAddress", + type: "address", + }, + { + internalType: "address", + name: "_oppInboundAddress", + type: "address", + }, + ], + name: "setOPPAddresses", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "chainCode", + type: "uint64", + }, + ], + name: "setOutpostChainCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "address", + name: "tokenAddr", + type: "address", + }, + { + internalType: "uint8", + name: "precision", + type: "uint8", + }, + ], + internalType: "struct ReserveManager.TrackedCodeEntry[]", + name: "entries", + type: "tuple[]", + }, + ], + name: "setTrackedCodes", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapDepositCounter", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + name: "tokenAddressesByCode", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + name: "tokenPrecisionByCode", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "trackedCodesCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "trackedReserveCodes", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "trackedTokenCodes", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "unpause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint64", + name: "tokenCode", + type: "uint64", + }, + { + internalType: "uint64", + name: "reserveCode", + type: "uint64", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; + +export class ReserveManager__factory { + static readonly abi = _abi; + static createInterface(): ReserveManagerInterface { + return new utils.Interface(_abi) as ReserveManagerInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ReserveManager { + return new Contract(address, _abi, signerOrProvider) as ReserveManager; + } +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts new file mode 100644 index 0000000..158632f --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts @@ -0,0 +1,7 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { OPP__factory } from "./OPP__factory.js"; +export { OPPInbound__factory } from "./OPPInbound__factory.js"; +export { OperatorRegistry__factory } from "./OperatorRegistry__factory.js"; +export { ReserveManager__factory } from "./ReserveManager__factory.js"; diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/index.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/index.ts new file mode 100644 index 0000000..ea0a0af --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/index.ts @@ -0,0 +1,12 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { OPP } from "./OPP.js"; +export type { OPPInbound } from "./OPPInbound.js"; +export type { OperatorRegistry } from "./OperatorRegistry.js"; +export type { ReserveManager } from "./ReserveManager.js"; +export * as factories from "./factories/index.js"; +export { OperatorRegistry__factory } from "./factories/OperatorRegistry__factory.js"; +export { OPP__factory } from "./factories/OPP__factory.js"; +export { OPPInbound__factory } from "./factories/OPPInbound__factory.js"; +export { ReserveManager__factory } from "./factories/ReserveManager__factory.js"; diff --git a/packages/sdk-outpost/src/contracts/ethereum/index.ts b/packages/sdk-outpost/src/contracts/ethereum/index.ts new file mode 100644 index 0000000..0f12c57 --- /dev/null +++ b/packages/sdk-outpost/src/contracts/ethereum/index.ts @@ -0,0 +1 @@ +export * from "./generated/index.js" diff --git a/packages/sdk-outpost/src/contracts/index.ts b/packages/sdk-outpost/src/contracts/index.ts new file mode 100644 index 0000000..cca66fc --- /dev/null +++ b/packages/sdk-outpost/src/contracts/index.ts @@ -0,0 +1 @@ +export * from "./ethereum/index.js" diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index d5a6b60..a9a619f 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -1,3 +1,4 @@ +import { PublicKey } from "@solana/web3.js" import { utils as ethersUtils } from "ethers" import { z } from "zod" @@ -17,7 +18,19 @@ const SourceRevisionSchema = z.string().regex(/^[0-9a-f]{8,40}$/), .transform(value => ChainId.from(value)), EthereumAddressSchema = z .string() - .refine(ethersUtils.isAddress, "Invalid Ethereum address") + .refine(ethersUtils.isAddress, "Invalid Ethereum address"), + SolanaAddressSchema = z.string().transform((value, context) => { + try { + return new PublicKey(value).toBase58() + } catch (error: unknown) { + const message = error instanceof Error ? error.message : String(error) + context.addIssue({ + code: "custom", + message: `Invalid Solana address: ${message}` + }) + return z.NEVER + } + }) /** Source repository identity embedded in an artifact bundle. */ export const ArtifactSourceSchema = z.object({ @@ -31,7 +44,9 @@ export const ArtifactBundleSchema = z.object({ sourceArchiveSha256: Sha256Schema, platformRelease: z.object({ tag: z.string().regex(/^v\d+\.\d+\.\d+$/), - url: z.url() + url: z.url(), + manifest: ArtifactSourceSchema, + libraries: ArtifactSourceSchema }), sources: z.object({ wireTools: ArtifactSourceSchema, @@ -49,7 +64,7 @@ export const EthereumContractDeploymentSchema = z.object({ /** Runtime metadata for one deployed Solana program. */ export const SolanaProgramDeploymentSchema = z.object({ - address: z.string().min(32).max(44), + address: SolanaAddressSchema, artifactSha256: Sha256Schema }) diff --git a/packages/sdk-outpost/src/deployments/Sim2.ts b/packages/sdk-outpost/src/deployments/Sim2.ts new file mode 100644 index 0000000..8b710a9 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/Sim2.ts @@ -0,0 +1,86 @@ +import { parseOutpostDeployment } from "./Schema.js" +import { + EthereumContractName, + OutpostDeploymentId, + SolanaProgramName +} from "./Types.js" + +const Sim2DeploymentDocument = { + schemaVersion: 1, + id: OutpostDeploymentId.sim2, + artifactBundle: { + generatedAt: "2026-07-31T15:47:46Z", + sourceArchiveSha256: + "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", + platformRelease: { + tag: "v1.0.0", + url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + manifest: { + repository: "Wire-Network/wire-platform-manifest", + revision: "78ed083740e62a03d9ea873ff0a9a44db23ca195" + }, + libraries: { + repository: "Wire-Network/wire-libraries-ts", + revision: "3cfda4a238e4e8d98bda836e857e6679b85f44fa" + } + }, + sources: { + wireTools: { + repository: "Wire-Network/wire-tools-ts", + revision: "ac4ea7a2783f81d03f13a62ead2fa173cf12094f" + }, + wireSysio: { + repository: "Wire-Network/wire-sysio", + revision: "235501b0ad4612ee842c428182f84cd66ef803fc" + }, + wireEthereum: { + repository: "Wire-Network/wire-ethereum", + revision: "c1ea82b2b3cffacecec35e5c186e82e381f6be67" + }, + wireSolana: { + repository: "Wire-Network/wire-solana", + revision: "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" + } + } + }, + wire: { + chainId: "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023" + }, + ethereum: { + chainId: 31_337, + contracts: { + [EthereumContractName.OPP]: { + address: "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + artifactSha256: + "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" + }, + [EthereumContractName.OPPInbound]: { + address: "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + artifactSha256: + "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" + }, + [EthereumContractName.OperatorRegistry]: { + address: "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + artifactSha256: + "d9ce20dce4d4f5b039bdd52df69037c8c289f9a419b420efdac6c02cafbd5607" + }, + [EthereumContractName.ReserveManager]: { + address: "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + artifactSha256: + "1df4221be4fc24617d3368877e5962214ae55330362bb644028e56518d12b17f" + } + } + }, + solana: { + programs: { + [SolanaProgramName.liqsolCore]: { + address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + artifactSha256: + "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" + } + } + } +} + +/** Validated sim2 deployment and artifact provenance. */ +export const Sim2Deployment = parseOutpostDeployment(Sim2DeploymentDocument) diff --git a/packages/sdk-outpost/src/deployments/index.ts b/packages/sdk-outpost/src/deployments/index.ts index 29919be..055ca49 100644 --- a/packages/sdk-outpost/src/deployments/index.ts +++ b/packages/sdk-outpost/src/deployments/index.ts @@ -1,2 +1,3 @@ export * from "./Schema.js" +export * from "./Sim2.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts index 58d373a..2e62e4a 100644 --- a/packages/sdk-outpost/src/index.ts +++ b/packages/sdk-outpost/src/index.ts @@ -1 +1,3 @@ +export * from "./contracts/index.js" export * from "./deployments/index.js" +export * from "./programs/index.js" diff --git a/packages/sdk-outpost/src/programs/index.ts b/packages/sdk-outpost/src/programs/index.ts new file mode 100644 index 0000000..813411c --- /dev/null +++ b/packages/sdk-outpost/src/programs/index.ts @@ -0,0 +1 @@ +export * from "./solana/index.js" diff --git a/packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts b/packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts new file mode 100644 index 0000000..55b81cc --- /dev/null +++ b/packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts @@ -0,0 +1,8509 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ +import type { Idl } from "@coral-xyz/anchor" + +const liqsolCoreIdlValue = { + address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + metadata: { + name: "liqsolCore", + version: "0.1.0", + spec: "0.1.0", + description: "Created with Anchor" + }, + instructions: [ + { + name: "addAttestation", + discriminator: [206, 82, 129, 170, 54, 159, 161, 156], + accounts: [ + { + name: "authority", + signer: true + }, + { + name: "config" + }, + { + name: "outboundMessageBuffer", + writable: true + } + ], + args: [ + { + name: "attestationType", + type: "i32" + }, + { + name: "data", + type: "bytes" + } + ] + }, + { + name: "addTopPerformersBatch", + docs: [ + "Process batch of ranks for addition (top performers from leaderboard)" + ], + discriminator: [152, 7, 241, 69, 197, 73, 32, 12], + accounts: [ + { + name: "allocationState", + writable: true + }, + { + name: "activeList", + writable: true + }, + { + name: "graveyardList", + writable: true + }, + { + name: "leaderboardState" + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for threshold parameters"] + }, + { + name: "authority", + signer: true + } + ], + args: [] + }, + { + name: "adminForceUnbondRole", + discriminator: [80, 107, 27, 49, 126, 25, 31, 238], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState" + }, + { + name: "user", + docs: ["The user whose role bond is being force-unbonded"] + }, + { + name: "outpostAccount", + writable: true + } + ], + args: [ + { + name: "role", + type: { + defined: { + name: "role" + } + } + } + ] + }, + { + name: "aggregateStakeMetrics", + docs: [ + "V2: Aggregate stake metrics across all validators using PDA architecture" + ], + discriminator: [13, 245, 47, 202, 170, 73, 98, 207], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "stakeMetrics", + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "activeList" + } + ], + args: [] + }, + { + name: "bondRole", + discriminator: [143, 136, 20, 230, 136, 103, 107, 167], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "globalState" + }, + { + name: "outpostAccount", + writable: true + } + ], + args: [ + { + name: "role", + type: { + defined: { + name: "role" + } + } + } + ] + }, + { + name: "calculateUnstakeAllocations", + docs: [ + "Calculate unstake allocations across validators (batched, up to 10 per call)", + "Distributes the FROZEN processing amount proportionally based on active stake", + "Call this after accumulating requests via accumulate_unstake_request" + ], + discriminator: [156, 232, 48, 116, 107, 60, 136, 140], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeAllocationState", + docs: [ + "Stake allocation state - to track unstake allocation batching" + ], + writable: true + }, + { + name: "stakeMetrics", + docs: [ + "Stake metrics - to validate total unstake amount is available" + ] + }, + { + name: "activeList", + docs: [ + "Active validator list - to verify validators are in active list" + ] + }, + { + name: "maintenanceLedger", + docs: ["Maintenance ledger - to track last unstake allocation epoch"], + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + } + ], + args: [] + }, + { + name: "calculateValidatorAllocations", + discriminator: [48, 217, 8, 168, 228, 221, 140, 112], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeAllocationState", + docs: ["Stake allocation state - to track rebalancing progress"], + writable: true + }, + { + name: "stakeMetrics", + docs: ["Stake metrics - to get current total active stake"] + }, + { + name: "activeList", + docs: [ + "Active validator list - to verify validators are in active list" + ] + }, + { + name: "reservePool", + docs: ["Reserve pool - to read current balance"], + writable: true + }, + { + name: "maintenanceLedger", + docs: ["Maintenance ledger - to track last rebalance epoch"], + writable: true + }, + { + name: "clock" + }, + { + name: "global", + docs: [ + "Global withdraw operator state - to read total_encumbered_funds" + ] + }, + { + name: "globalConfig", + docs: ["Global config for rebalancing thresholds"] + } + ], + args: [] + }, + { + name: "cancelCreateReserve", + discriminator: [218, 158, 127, 156, 61, 162, 19, 255], + accounts: [ + { + name: "creator", + writable: true, + signer: true + }, + { + name: "config" + }, + { + name: "reserve" + }, + { + name: "outboundMessageBuffer", + writable: true + } + ], + args: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "reserveCode", + type: "u64" + } + ] + }, + { + name: "claimRewards", + discriminator: [4, 144, 132, 71, 116, 23, 151, 80], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "userAta", + writable: true + }, + { + name: "userRecord", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "liqsolMint" + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + docs: ["The bucket's associated token account holding liqSOL"], + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "claimWithdraw", + docs: [ + "Pay user (stub) and close/burn the receipt via CPI to nft_factory." + ], + discriminator: [232, 89, 154, 117, 16, 204, 182, 224], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "global", + docs: ["Global operator state"], + writable: true + }, + { + name: "mintAuthority" + }, + { + name: "receiptData", + writable: true + }, + { + name: "mintAccount", + writable: true + }, + { + name: "ownerAta", + writable: true + }, + { + name: "reservePool", + writable: true + }, + { + name: "vault" + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "globalConfig", + docs: ["Global config for claim_withdrawals_enabled check"] + }, + { + name: "tokenProgram" + }, + { + name: "stakeProgram" + }, + { + name: "systemProgram" + }, + { + name: "associatedTokenProgram" + } + ], + args: [] + }, + { + name: "cleanupEnvelopeChunks", + discriminator: [224, 118, 156, 99, 9, 136, 14, 207], + accounts: [ + { + name: "reaper", + signer: true + }, + { + name: "config" + }, + { + name: "latestOutboundEnvelope" + }, + { + name: "chunkBuffer", + writable: true + }, + { + name: "uploader", + writable: true + } + ], + args: [ + { + name: "epochIndex", + type: "u32" + } + ] + }, + { + name: "cleanupGraveyardBatch", + docs: [ + "Cleanup graveyard validators batch: remove validators that have been NotDelegated for > 10 epochs", + "This function should be called after aggregate_stake_metrics.", + "Validators meeting the cleanup criteria will have their PDAs closed and rent returned to admin." + ], + discriminator: [241, 120, 180, 4, 160, 109, 206, 71], + accounts: [ + { + name: "graveyardList", + writable: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "globalConfig" + }, + { + name: "clock" + }, + { + name: "cranky", + writable: true, + signer: true + } + ], + args: [] + }, + { + name: "commitUnderwrite", + discriminator: [88, 172, 141, 118, 9, 74, 188, 117], + accounts: [ + { + name: "underwriter", + writable: true, + signer: true + }, + { + name: "operatorRegistry" + }, + { + name: "outboundMessageBuffer", + writable: true + } + ], + args: [ + { + name: "uicBytes", + type: "bytes" + } + ] + }, + { + name: "completeUnbondRole", + discriminator: [204, 50, 36, 17, 192, 156, 246, 64], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState" + }, + { + name: "user", + docs: ["The user whose unbond is being completed"] + }, + { + name: "outpostAccount", + writable: true + } + ], + args: [ + { + name: "role", + type: { + defined: { + name: "role" + } + } + } + ] + }, + { + name: "completeWithdraw", + discriminator: [172, 129, 141, 17, 95, 253, 251, 98], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "user", + writable: true + }, + { + name: "outpostAccount", + writable: true + }, + { + name: "liqsolMint", + writable: true + }, + { + name: "poolAuthority" + }, + { + name: "pretokenPurchaseHistory", + writable: true + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "senderUserRecord", + writable: true + }, + { + name: "receiverUserRecord", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "liqsolPoolAta", + writable: true + }, + { + name: "userAta", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "userKey", + type: "pubkey" + }, + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "concludeMergeActivating", + docs: [ + "Conclude merge activating - marks merge complete if all validators processed or 0 validators" + ], + discriminator: [207, 32, 222, 98, 243, 188, 38, 67], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "processingState", + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "activeList" + }, + { + name: "graveyardList" + }, + { + name: "clock" + } + ], + args: [] + }, + { + name: "concludeMergeDeactivating", + docs: [ + "Conclude merge deactivating - marks merge complete if all validators processed or 0 validators" + ], + discriminator: [66, 206, 43, 71, 122, 97, 33, 24], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "processingState", + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "withdrawGlobal", + writable: true + }, + { + name: "activeList" + }, + { + name: "graveyardList" + }, + { + name: "clock" + } + ], + args: [] + }, + { + name: "concludeSyncStakes", + docs: [ + "Conclude sync stakes - marks sync complete if all validators processed or 0 validators" + ], + discriminator: [77, 127, 231, 78, 151, 23, 237, 207], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "processingState", + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "activeList" + }, + { + name: "graveyardList" + }, + { + name: "clock" + } + ], + args: [] + }, + { + name: "createReserve", + discriminator: [26, 161, 211, 19, 90, 218, 112, 235], + accounts: [ + { + name: "creator", + writable: true, + signer: true + }, + { + name: "config" + }, + { + name: "reserve", + writable: true + }, + { + name: "reserveVault", + writable: true + }, + { + name: "mint" + }, + { + name: "creatorAta", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "reserveCode", + type: "u64" + }, + { + name: "externalTokenAmount", + type: "u64" + }, + { + name: "requestedWireAmount", + type: "u64" + }, + { + name: "connectorWeightBps", + type: "u32" + }, + { + name: "name", + type: "string" + }, + { + name: "description", + type: "string" + }, + { + name: "isPrivate", + type: "bool" + } + ] + }, + { + name: "createReserveNative", + discriminator: [124, 173, 189, 251, 64, 230, 215, 6], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "authority", + signer: true + }, + { + name: "config" + }, + { + name: "reserve", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "reserveCode", + type: "u64" + }, + { + name: "externalTokenAmount", + type: "u64" + }, + { + name: "requestedWireAmount", + type: "u64" + }, + { + name: "connectorWeightBps", + type: "u32" + }, + { + name: "name", + type: "string" + }, + { + name: "description", + type: "string" + } + ] + }, + { + name: "createReserveSplAuthority", + discriminator: [168, 158, 192, 109, 179, 81, 156, 173], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "authority", + signer: true + }, + { + name: "config" + }, + { + name: "reserve", + writable: true + }, + { + name: "reserveVault", + writable: true + }, + { + name: "mint" + }, + { + name: "authorityAta", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "reserveCode", + type: "u64" + }, + { + name: "externalTokenAmount", + type: "u64" + }, + { + name: "requestedWireAmount", + type: "u64" + }, + { + name: "connectorWeightBps", + type: "u32" + }, + { + name: "name", + type: "string" + }, + { + name: "description", + type: "string" + } + ] + }, + { + name: "deposit", + discriminator: [242, 35, 198, 137, 82, 225, 242, 182], + accounts: [ + { + name: "depositor", + writable: true, + signer: true + }, + { + name: "config" + }, + { + name: "operatorRegistry", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "vault", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "operatorType", + type: "u32" + }, + { + name: "tokenCode", + type: "u64" + }, + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "depositNonNative", + discriminator: [75, 182, 44, 132, 167, 101, 31, 138], + accounts: [ + { + name: "depositor", + writable: true, + signer: true + }, + { + name: "config" + }, + { + name: "operatorRegistry", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "mint" + }, + { + name: "depositorAta", + writable: true + }, + { + name: "collateralVault", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [ + { + name: "chainCode", + type: "u64" + }, + { + name: "tokenCode", + type: "u64" + }, + { + name: "reserveCode", + type: "u64" + }, + { + name: "operatorType", + type: "u32" + }, + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "depositToReserve", + discriminator: [8, 79, 123, 129, 146, 140, 178, 128], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "depositor", + writable: true, + signer: true + }, + { + name: "reservePool", + writable: true + }, + { + name: "vault" + }, + { + name: "ephemeralStake", + writable: true + }, + { + name: "controllerState" + }, + { + name: "stakeProgram" + }, + { + name: "systemProgram" + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "rent" + } + ], + args: [ + { + name: "amount", + type: "u64" + }, + { + name: "seed", + type: "u32" + } + ] + }, + { + name: "desynd", + discriminator: [12, 71, 102, 46, 8, 179, 29, 190], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "liqsolMint", + writable: true + }, + { + name: "globalState", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "userAta", + writable: true + }, + { + name: "poolAuthority" + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "senderUserRecord", + writable: true + }, + { + name: "receiverUserRecord", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "liqsolPoolAta", + writable: true + }, + { + name: "outpostAccount", + docs: ["User's outpost account"], + writable: true + }, + { + name: "pretokenPurchaseHistory", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "associatedTokenProgram" + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "discardEnvelopeChunks", + discriminator: [180, 10, 216, 16, 101, 165, 10, 70], + accounts: [ + { + name: "uploader", + docs: [ + "The operator that uploaded (and rent-paid) the buffer. Authorization is", + "structural: the buffer PDA's third seed is this signer's key, so the", + "account constraint can only ever resolve the signer's OWN buffer —", + "no other operator's in-flight upload is reachable from here." + ], + writable: true, + signer: true + }, + { + name: "chunkBuffer", + writable: true + } + ], + args: [ + { + name: "epochIndex", + type: "u32" + } + ] + }, + { + name: "emitOutboundEnvelope", + discriminator: [142, 109, 163, 152, 3, 80, 224, 157], + accounts: [ + { + name: "authority", + docs: [ + "The outpost authority. The standalone emit is a recovery escape hatch", + "only — an open signer here could advance the outbound chain tip to a", + "digest the depot never accepted, so it is gated exactly like the other", + "admin instructions. Even the authority is bound by the guards in", + "`emit_outbound_inner`: the emitted epoch must be exactly the next", + "outbound slot AND already accepted by the inbound cursor, so a", + "recovery emit can only fill an accepted-but-unemitted gap and can", + "never preempt a pending epoch's consensus-triggered emit." + ], + writable: true, + signer: true + }, + { + name: "config", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "outboundEnvelopes", + writable: true + }, + { + name: "latestOutboundEnvelope", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "wireEpochIndex", + type: "u32" + } + ] + }, + { + name: "epochIn", + discriminator: [85, 70, 55, 132, 50, 198, 135, 115], + accounts: [ + { + name: "operator", + writable: true, + signer: true + }, + { + name: "config", + writable: true + }, + { + name: "operatorRegistry", + writable: true + }, + { + name: "epochDeliveries", + writable: true + }, + { + name: "chunkBuffer", + writable: true + }, + { + name: "inboundEnvelopes", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "outboundEnvelopes", + writable: true + }, + { + name: "latestOutboundEnvelope", + writable: true + }, + { + name: "vault", + writable: true + }, + { + name: "reserveAggregate", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "epochIndex", + type: "u32" + }, + { + name: "chunkIndex", + type: "u16" + }, + { + name: "totalChunks", + type: "u16" + }, + { + name: "totalBytes", + type: "u32" + }, + { + name: "chunkData", + type: "bytes" + } + ] + }, + { + name: "finalizeOutpostAccount", + discriminator: [181, 14, 39, 201, 210, 148, 241, 187], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "poolAuthority" + }, + { + name: "outpostAccount", + writable: true + }, + { + name: "pretokenPurchaseHistory" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "getMinMaxResolvedEpochDeactivations", + docs: [ + "Get minimum max_resolved_epoch_deactivations from MaintenanceLedger", + "This is designed to be called via CPI from other programs" + ], + discriminator: [171, 169, 39, 207, 181, 67, 86, 73], + accounts: [ + { + name: "epochState" + } + ], + args: [], + returns: "u16" + }, + { + name: "hasRole", + discriminator: [218, 136, 44, 87, 142, 247, 141, 195], + accounts: [ + { + name: "user", + docs: ["User whose role status is being checked."] + }, + { + name: "outpostAccount" + }, + { + name: "globalState" + } + ], + args: [ + { + name: "role", + type: { + defined: { + name: "role" + } + } + } + ], + returns: "bool" + }, + { + name: "initBucket", + docs: ["Done///"], + discriminator: [237, 69, 61, 218, 18, 60, 21, 236], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "liqsolMint" + }, + { + name: "systemProgram" + }, + { + name: "tokenProgram" + }, + { + name: "associatedTokenProgram" + } + ], + args: [] + }, + { + name: "initReserve", + discriminator: [138, 245, 71, 225, 153, 4, 3, 43], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "authority", + signer: true + }, + { + name: "config" + }, + { + name: "reserveAggregate", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initTrancheState", + discriminator: [87, 134, 47, 11, 241, 14, 118, 201], + accounts: [ + { + name: "authority", + writable: true, + signer: true + }, + { + name: "trancheState", + writable: true + }, + { + name: "chainlinkFeed" + }, + { + name: "chainlinkProgram" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initWireConfig", + discriminator: [109, 159, 158, 174, 192, 150, 14, 34], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalState", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initialize", + discriminator: [175, 175, 109, 31, 13, 152, 155, 237], + accounts: [ + { + name: "authority", + writable: true, + signer: true + }, + { + name: "liqsolMint" + }, + { + name: "distributionState", + writable: true + }, + { + name: "bucketAuthority" + }, + { + name: "poolAuthority" + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [] + }, + { + name: "initializeActiveList", + docs: ["Initialize the active validator list (zero-copy)"], + discriminator: [222, 123, 57, 119, 223, 4, 150, 36], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "activeList", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeEpochState", + docs: ["Done///"], + discriminator: [139, 122, 53, 254, 85, 205, 138, 245], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "epochState", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeGlobalConfig", + discriminator: [113, 216, 122, 131, 225, 209, 22, 55], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "payer", + writable: true, + signer: true + }, + { + name: "program" + }, + { + name: "programData" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeGraveyardList", + docs: ["Initialize the graveyard validator list (zero-copy)"], + discriminator: [178, 8, 179, 111, 75, 19, 130, 176], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "graveyardList", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeOutpost", + discriminator: [9, 54, 169, 104, 32, 218, 81, 11], + accounts: [ + { + name: "authority", + writable: true, + signer: true + }, + { + name: "config", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "operatorRegistry", + writable: true + }, + { + name: "inboundEnvelopes", + writable: true + }, + { + name: "outboundEnvelopes", + writable: true + }, + { + name: "latestOutboundEnvelope", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "chainCode", + type: "u64" + } + ] + }, + { + name: "initializePayRateHistory", + docs: ["Done///"], + discriminator: [157, 190, 74, 135, 91, 232, 250, 122], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "payRateHistory", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializePayoutState", + docs: ["Done///"], + discriminator: [105, 120, 7, 121, 238, 221, 62, 160], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "payoutState", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializePretokenPurchaseHistory", + docs: ["Admin-only: initialize PretokenPurchaseHistory PDA for a pool"], + discriminator: [140, 166, 196, 128, 189, 240, 159, 1], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalConfig" + }, + { + name: "pretokenPurchaseHistory", + writable: true + }, + { + name: "poolAuthority" + }, + { + name: "globalState", + writable: true + }, + { + name: "poolPretokenRecord", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeProcessingState", + docs: ["Done///"], + discriminator: [228, 202, 164, 194, 29, 134, 125, 242], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "processingState", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeReservePool", + docs: ["Done///"], + discriminator: [4, 7, 171, 131, 156, 172, 150, 220], + accounts: [ + { + name: "reservePool", + writable: true + }, + { + name: "vault" + }, + { + name: "payer", + writable: true, + signer: true + }, + { + name: "controllerState", + writable: true + }, + { + name: "stakeProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [] + }, + { + name: "initializeStakeAllocationState", + discriminator: [159, 99, 175, 136, 251, 241, 88, 82], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeAllocationState", + writable: true + }, + { + name: "clock" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeStakeControllerState", + docs: ["Done///"], + discriminator: [220, 247, 13, 165, 202, 250, 102, 197], + accounts: [ + { + name: "controllerState", + writable: true + }, + { + name: "payer", + writable: true, + signer: true + }, + { + name: "authority", + signer: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeStakeMetrics", + docs: ["Done///"], + discriminator: [203, 209, 129, 123, 12, 17, 20, 175], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeMetrics", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeVault", + docs: ["Done///"], + discriminator: [48, 191, 163, 44, 71, 129, 63, 164], + accounts: [ + { + name: "vault", + writable: true + }, + { + name: "payer", + writable: true, + signer: true + }, + { + name: "controllerState", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "initializeWithdrawGlobal", + discriminator: [110, 0, 210, 101, 59, 75, 224, 158], + accounts: [ + { + name: "authority", + writable: true, + signer: true + }, + { + name: "liqsolMint", + docs: ["liqSOL Token-2022 mint"] + }, + { + name: "global", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [] + }, + { + name: "initializeWithdrawMetadata", + discriminator: [0, 170, 135, 3, 35, 58, 213, 75], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "metadata", + writable: true + }, + { + name: "globalConfig" + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "args", + type: { + defined: { + name: "metadataArgs" + } + } + } + ] + }, + { + name: "mergeActivatingStakes", + docs: [ + "V2: Merge activating transient stakes using PDA architecture", + "Returns the number of epochs successfully merged" + ], + discriminator: [181, 183, 76, 92, 57, 11, 212, 189], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "vault", + writable: true + }, + { + name: "treasury", + docs: [ + "(treasury funded it at creation), closing the rent loop within the protocol." + ], + writable: true + }, + { + name: "activeList", + docs: ["Active validators list (zero-copy)"] + }, + { + name: "graveyardList", + docs: [ + "Graveyard validators list (zero-copy) - needed to check validators in cooldown" + ] + }, + { + name: "validatorInfo", + docs: ["Validator info PDA for the validator being processed"], + writable: true + }, + { + name: "validatorTransient", + docs: [ + "Validator transient tracking PDA for the validator being processed" + ], + writable: true + }, + { + name: "stakeProgram" + }, + { + name: "systemProgram" + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "rent" + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + } + ], + args: [ + { + name: "voteAccount", + type: "pubkey" + } + ], + returns: "u16" + }, + { + name: "mergeDeactivatedStakes", + docs: ["V2: Merge fully deactivated stakes back to reserve"], + discriminator: [160, 255, 180, 104, 216, 98, 248, 73], + accounts: [ + { + name: "globalConfig" + }, + { + name: "cranky", + signer: true + }, + { + name: "vault", + writable: true + }, + { + name: "activeList", + docs: ["Active validators list (zero-copy)"] + }, + { + name: "graveyardList", + docs: [ + "Graveyard validators list (zero-copy) - needed to check validators in cooldown" + ] + }, + { + name: "validatorInfo", + docs: ["Validator info PDA for the validator being processed"], + writable: true + }, + { + name: "validatorTransient", + docs: [ + "Validator transient tracking PDA for the validator being processed" + ], + writable: true + }, + { + name: "withdrawGlobal", + writable: true + }, + { + name: "stakeProgram" + }, + { + name: "systemProgram" + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "rent" + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "reservePool", + docs: [ + "(principal stays). The merged-in rent is then withdrawn to treasury." + ], + writable: true + }, + { + name: "treasury", + docs: [ + "back from reserve, closing the rent loop (treasury funded it at creation)." + ], + writable: true + } + ], + args: [ + { + name: "voteAccount", + type: "pubkey" + } + ] + }, + { + name: "migrateBatchOrchestrator", + docs: [ + "One-shot migration: realloc BatchOrchestrator for the four per-op", + "`*_started_epoch: u16` fields + restored `_reserved` buffer.", + "Idempotent, ungated. `payer` covers the rent delta." + ], + discriminator: [130, 240, 40, 175, 53, 209, 232, 11], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "batchOrchestrator", + docs: ["is the only authorization needed; the op is idempotent."], + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "migrateBatchOrchestratorV16", + docs: [ + "One-shot migration: stamp BatchOrchestrator's v1.6.0 epoch pins", + "(unstake_started_epoch + cursors_epoch) to the current epoch so a", + "mid-epoch upgrade doesn't wipe live cursors. Admin-gated, idempotent", + "within an epoch; refuses re-runs after an epoch boundary (a late", + "re-stamp would bless dead cursors as live)." + ], + discriminator: [124, 12, 96, 155, 218, 4, 229, 56], + accounts: [ + { + name: "globalConfig" + }, + { + name: "admin", + writable: true, + signer: true + }, + { + name: "batchOrchestrator", + writable: true + } + ], + args: [] + }, + { + name: "migrateStakeAllocationState", + docs: [ + "One-shot migration: explicitly zero StakeAllocationState.rebalance_started_epoch", + "(repurposed from the deprecated addition_target_rank slot). Admin-gated, idempotent." + ], + discriminator: [40, 175, 21, 85, 88, 249, 223, 73], + accounts: [ + { + name: "globalConfig" + }, + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeAllocationState", + writable: true + } + ], + args: [] + }, + { + name: "migrateStakeMetrics", + docs: [ + "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)" + ], + discriminator: [183, 154, 168, 221, 78, 179, 112, 165], + accounts: [ + { + name: "globalConfig" + }, + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeMetrics", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "migrateUserRecord", + discriminator: [6, 118, 249, 178, 209, 106, 197, 25], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalConfig" + }, + { + name: "userAta" + }, + { + name: "userRecord", + writable: true + }, + { + name: "distributionState" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "migrateValidatorInfoBatch", + docs: [ + "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)", + "Pass validator_info PDAs via remaining_accounts" + ], + discriminator: [250, 77, 53, 116, 38, 22, 12, 100], + accounts: [ + { + name: "globalConfig" + }, + { + name: "admin", + writable: true, + signer: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "processGraveyardValidatorsBatch", + docs: [ + "Process graveyard validators batch: check transient resolution, queue main stake deactivation", + "Validators in graveyard with resolved transients will have their main stake queued for deactivation" + ], + discriminator: [141, 178, 8, 118, 133, 183, 86, 233], + accounts: [ + { + name: "graveyardList", + writable: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + }, + { + name: "clock" + }, + { + name: "authority", + signer: true + } + ], + args: [] + }, + { + name: "processPayCycle", + docs: ["Done///"], + discriminator: [98, 183, 240, 247, 39, 248, 198, 224], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "stakeMetrics", + writable: true + }, + { + name: "payoutState", + writable: true + }, + { + name: "payRateHistory", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "liqsolMint", + writable: true + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "stakeControllerAuthority", + writable: true + }, + { + name: "mintAuthority" + }, + { + name: "liqsolProgram" + }, + { + name: "tokenProgram" + }, + { + name: "instructions" + }, + { + name: "globalConfig", + docs: ["Global config for process_pay_cycle_enabled check"] + } + ], + args: [] + }, + { + name: "processStakeOrders", + docs: [ + "V2: Process stake orders using PDA architecture with pre-calculated allocations", + "Validators must be sent contiguously from the active list starting at validators_processed_this_epoch" + ], + discriminator: [92, 161, 223, 219, 54, 232, 40, 16], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "reservePool", + writable: true + }, + { + name: "treasury", + docs: [ + "(system transfer, treasury signs). Falls back to admin only if treasury is dry." + ], + writable: true + }, + { + name: "vault" + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "activeList", + docs: ["Active validator list - used to get total validator count"] + }, + { + name: "stakeAllocationState", + docs: [ + "Stake allocation state - to verify allocations have been calculated for current epoch" + ], + writable: true + }, + { + name: "stakeProgram" + }, + { + name: "systemProgram" + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "stakeConfig" + }, + { + name: "rent" + }, + { + name: "globalConfig", + docs: ["Global config for process_stake_orders_enabled check"] + } + ], + args: [ + { + name: "callerFundsRent", + type: "bool" + } + ] + }, + { + name: "processTransferHook", + discriminator: [167, 45, 151, 64, 209, 186, 192, 78], + accounts: [ + { + name: "sourceToken" + }, + { + name: "destinationToken" + }, + { + name: "senderUserRecord", + writable: true + }, + { + name: "receiverUserRecord", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "bucketTokenAccount" + } + ], + args: [ + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "processUnstakeOrders", + docs: [ + "V2: Process unstake orders by splitting and deactivating stakes", + "Validators must be sent contiguously: first from active list, then graveyard list" + ], + discriminator: [44, 122, 251, 185, 253, 193, 250, 191], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "vault", + writable: true + }, + { + name: "treasury", + docs: [ + "here (system transfer, treasury signs). Falls back to admin only if dry.", + "Reserve no longer sources rent, so it's not needed by this instruction." + ], + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "activeList", + docs: ["Active validator list - used to get total validator count"] + }, + { + name: "graveyardList", + docs: [ + "Graveyard validator list - allows unstaking from graveyard validators" + ] + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "stakeConfig" + }, + { + name: "rent" + }, + { + name: "systemProgram" + }, + { + name: "stakeProgram" + }, + { + name: "globalConfig", + docs: ["Global config for process_unstake_orders_enabled check"] + } + ], + args: [ + { + name: "callerFundsRent", + type: "bool" + } + ] + }, + { + name: "purchase", + discriminator: [21, 93, 113, 154, 193, 160, 242, 168], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "liqsolMint", + writable: true + }, + { + name: "globalState", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "buyerAta", + writable: true + }, + { + name: "poolAuthority" + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "senderUserRecord", + writable: true + }, + { + name: "receiverUserRecord", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "liqsolPoolAta", + writable: true + }, + { + name: "outpostAccount", + docs: ["User's pretoken deposit record"], + writable: true + }, + { + name: "trancheState", + writable: true + }, + { + name: "userPretokenRecord", + writable: true + }, + { + name: "chainlinkFeed" + }, + { + name: "chainlinkProgram" + }, + { + name: "tokenProgram" + }, + { + name: "associatedTokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "pretokenPurchaseHistory", + writable: true + } + ], + args: [ + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "purchaseFromYield", + discriminator: [232, 143, 47, 77, 246, 113, 31, 202], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "globalState", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "liqsolMint" + }, + { + name: "poolAuthority", + docs: ["Pool authority PDA"] + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "liqsolPoolAta", + docs: [ + "Pool's liqSOL ATA - deterministically derived from pool_authority + liqsol_mint" + ], + writable: true + }, + { + name: "liqsolPoolUserRecord", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "tokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "trancheState", + writable: true + }, + { + name: "poolPretokenRecord", + writable: true + }, + { + name: "chainlinkFeed" + }, + { + name: "chainlinkProgram" + }, + { + name: "pretokenPurchaseHistory", + writable: true + } + ], + args: [] + }, + { + name: "recordPrice", + discriminator: [210, 113, 46, 101, 107, 218, 83, 51], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "trancheState" + }, + { + name: "priceHistory", + writable: true + }, + { + name: "chainlinkProgram" + }, + { + name: "chainlinkFeed" + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "refreshStakeMetricsPostLateEpoch", + docs: [ + "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)", + "Requires Distribution + UnstakeOrder as prerequisites", + "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch" + ], + discriminator: [11, 226, 87, 114, 47, 159, 99, 157], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "stakeMetrics", + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "activeList" + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + } + ], + args: [] + }, + { + name: "refreshStakeMetricsPostSync", + docs: [ + "V2: Refresh stake metrics after removal selection + PDA setup", + "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites", + "Tracks completion in last_post_sync_stake_metrics_refresh_epoch" + ], + discriminator: [177, 250, 32, 155, 196, 199, 199, 249], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "stakeMetrics", + writable: true + }, + { + name: "epochState", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "activeList" + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + } + ], + args: [] + }, + { + name: "refund", + discriminator: [2, 96, 183, 251, 63, 208, 46, 46], + accounts: [ + { + name: "associatedTokenProgram" + }, + { + name: "user", + writable: true, + signer: true + }, + { + name: "globalState", + writable: true + }, + { + name: "outpostAccount", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "poolAuthority" + }, + { + name: "liqsolPoolAta", + writable: true + }, + { + name: "refundLiqsolAta", + writable: true + }, + { + name: "liqsolPoolUserRecord", + writable: true + }, + { + name: "userRecord", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "liqsolMint" + }, + { + name: "tokenProgram" + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "pretokenPurchaseHistory", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "registerSystemPda", + discriminator: [110, 93, 36, 156, 179, 69, 54, 210], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalConfig" + }, + { + name: "pdaOwner", + docs: [ + "The PDA whose user record we're creating — must be system-owned (no program data)." + ] + }, + { + name: "pdaAta" + }, + { + name: "userRecord", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + docs: [ + "The bucket's associated token account holding liqSOL (for index sync)" + ], + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "registerUser", + discriminator: [2, 241, 150, 223, 99, 214, 116, 97], + accounts: [ + { + name: "payer", + writable: true, + signer: true + }, + { + name: "userAta" + }, + { + name: "userRecord", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + docs: [ + "The bucket's associated token account holding liqSOL (for index sync)" + ], + writable: true + }, + { + name: "systemProgram" + } + ], + args: [] + }, + { + name: "removeLowPerformersBatch", + docs: ["Process batch of validators for removal (below exit threshold)"], + discriminator: [91, 142, 166, 98, 245, 245, 159, 44], + accounts: [ + { + name: "activeList", + writable: true + }, + { + name: "graveyardList", + writable: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "allocationState" + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + }, + { + name: "authority", + signer: true + } + ], + args: [] + }, + { + name: "requestSwap", + discriminator: [170, 167, 97, 14, 88, 175, 39, 108], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "config" + }, + { + name: "reserve", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "sourceTokenCode", + type: "u64" + }, + { + name: "sourceReserveCode", + type: "u64" + }, + { + name: "sourceAmount", + type: "u64" + }, + { + name: "targetChainCode", + type: "u64" + }, + { + name: "targetTokenCode", + type: "u64" + }, + { + name: "targetReserveCode", + type: "u64" + }, + { + name: "targetRecipient", + type: "bytes" + }, + { + name: "targetAmount", + type: "u64" + }, + { + name: "targetToleranceBps", + type: "u32" + } + ] + }, + { + name: "requestSwapSpl", + discriminator: [119, 83, 153, 185, 164, 202, 45, 38], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "config" + }, + { + name: "reserve", + writable: true + }, + { + name: "reserveVault", + writable: true + }, + { + name: "mint" + }, + { + name: "userAta", + writable: true + }, + { + name: "outboundMessageBuffer", + writable: true + }, + { + name: "tokenProgram" + } + ], + args: [ + { + name: "sourceTokenCode", + type: "u64" + }, + { + name: "sourceReserveCode", + type: "u64" + }, + { + name: "sourceAmount", + type: "u64" + }, + { + name: "targetChainCode", + type: "u64" + }, + { + name: "targetTokenCode", + type: "u64" + }, + { + name: "targetReserveCode", + type: "u64" + }, + { + name: "targetRecipient", + type: "bytes" + }, + { + name: "targetAmount", + type: "u64" + }, + { + name: "targetToleranceBps", + type: "u32" + } + ] + }, + { + name: "requestUnbondRole", + discriminator: [223, 225, 84, 83, 115, 183, 80, 33], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "globalState" + }, + { + name: "outpostAccount", + writable: true + } + ], + args: [ + { + name: "role", + type: { + defined: { + name: "role" + } + } + } + ] + }, + { + name: "requestWithdraw", + discriminator: [137, 95, 187, 96, 250, 138, 31, 182], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "owner", + docs: ["Recipient of the NFT receipt (can be user)"], + writable: true + }, + { + name: "global", + docs: ["Global operator state"], + writable: true + }, + { + name: "liqsolMint", + docs: [ + "liqSOL mint reference (must match Global.liqsol_mint so we can read decimals)" + ], + writable: true + }, + { + name: "userAta", + writable: true + }, + { + name: "userRecord", + writable: true + }, + { + name: "distributionState", + docs: ["Distribution state for index tracking"], + writable: true + }, + { + name: "bucketTokenAccount", + docs: [ + "The bucket's token account holding liqSOL (for sync_index balance)" + ], + writable: true + }, + { + name: "reservePool", + docs: [ + "Reserve pool - to check available balance for instant withdrawals" + ], + writable: true + }, + { + name: "stakeAllocationState", + docs: ["Stake allocation state - for accumulate_unstake_request"], + writable: true + }, + { + name: "stakeMetrics", + docs: ["Stake metrics - for accumulate_unstake_request"] + }, + { + name: "maintenanceLedger", + docs: ["Maintenance ledger - for accumulate_unstake_request"] + }, + { + name: "globalConfig", + docs: ["Global config for min_unstake_request setting"] + }, + { + name: "clock" + }, + { + name: "mintAuthority" + }, + { + name: "receiptData", + writable: true + }, + { + name: "metadata", + writable: true + }, + { + name: "nftMint", + docs: [ + "Uses global.next_receipt_id for deterministic, collision-free address generation" + ], + writable: true + }, + { + name: "nftAta", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "tokenInterface" + }, + { + name: "associatedTokenProgram" + }, + { + name: "systemProgram" + }, + { + name: "rent" + } + ], + args: [ + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "setAdmin", + discriminator: [251, 163, 0, 52, 91, 194, 187, 92], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "admin", + signer: true + }, + { + name: "newAuthority" + } + ], + args: [] + }, + { + name: "setCranky", + discriminator: [232, 48, 178, 74, 194, 60, 143, 164], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "admin", + signer: true + }, + { + name: "newAuthority" + } + ], + args: [] + }, + { + name: "setPaused", + discriminator: [91, 60, 125, 192, 176, 225, 166, 218], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState", + writable: true + } + ], + args: [ + { + name: "paused", + type: "bool" + } + ] + }, + { + name: "setRetentionConfig", + discriminator: [224, 115, 230, 164, 16, 100, 30, 234], + accounts: [ + { + name: "authority", + signer: true + }, + { + name: "config", + writable: true + } + ], + args: [ + { + name: "retentionEpochs", + type: "u32" + } + ] + }, + { + name: "setRolePrincipal", + discriminator: [33, 199, 203, 50, 60, 167, 90, 92], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState", + writable: true + } + ], + args: [ + { + name: "role", + type: { + defined: { + name: "role" + } + } + }, + { + name: "principal", + type: "u64" + } + ] + }, + { + name: "setRoleWarmupDuration", + discriminator: [229, 188, 179, 162, 56, 173, 228, 68], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState", + writable: true + } + ], + args: [ + { + name: "durationSeconds", + type: "i64" + } + ] + }, + { + name: "setTokenAddress", + discriminator: [231, 130, 7, 149, 155, 155, 110, 53], + accounts: [ + { + name: "authority", + signer: true + }, + { + name: "config", + writable: true + } + ], + args: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "mint", + type: "pubkey" + } + ] + }, + { + name: "setTokenPrecision", + discriminator: [202, 218, 56, 157, 228, 15, 175, 107], + accounts: [ + { + name: "authority", + signer: true + }, + { + name: "config", + writable: true + } + ], + args: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "decimals", + type: "u8" + } + ] + }, + { + name: "setWireState", + discriminator: [62, 194, 254, 126, 251, 69, 35, 228], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState", + writable: true + } + ], + args: [ + { + name: "wireState", + type: { + defined: { + name: "wireState" + } + } + } + ] + }, + { + name: "setupValidatorPdasBatch", + discriminator: [115, 37, 9, 246, 144, 224, 178, 79], + accounts: [ + { + name: "authority", + writable: true, + signer: true + }, + { + name: "activeList", + writable: true + }, + { + name: "processingState", + writable: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "allocationState", + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + }, + { + name: "systemProgram", + docs: ["Needed for manual PDA creation"] + } + ], + args: [] + }, + { + name: "slashBond", + discriminator: [143, 246, 51, 243, 88, 198, 217, 48], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "globalConfig" + }, + { + name: "globalState", + writable: true + }, + { + name: "user", + docs: ["The user being slashed"] + }, + { + name: "outpostAccount", + writable: true + } + ], + args: [] + }, + { + name: "solToLiqsol", + discriminator: [250, 110, 1, 100, 71, 3, 235, 113], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "depositAuthority", + writable: true + }, + { + name: "systemProgram" + }, + { + name: "tokenProgram" + }, + { + name: "associatedTokenProgram" + }, + { + name: "liqsolProgram" + }, + { + name: "payRateHistory" + }, + { + name: "stakeProgram" + }, + { + name: "liqsolMint", + writable: true + }, + { + name: "userAta", + writable: true + }, + { + name: "liqsolMintAuthority" + }, + { + name: "reservePool", + writable: true + }, + { + name: "vault" + }, + { + name: "ephemeralStake", + writable: true + }, + { + name: "controllerState", + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for deposit settings"] + }, + { + name: "payoutState", + writable: true + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + docs: ["The bucket's associated token account"], + writable: true + }, + { + name: "userRecord", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "instructionsSysvar" + }, + { + name: "clock" + }, + { + name: "stakeHistory" + }, + { + name: "rent" + } + ], + args: [ + { + name: "amount", + type: "u64" + }, + { + name: "seed", + type: "u32" + } + ] + }, + { + name: "syncActiveScores", + discriminator: [38, 188, 30, 93, 139, 1, 140, 168], + accounts: [ + { + name: "activeList", + writable: true + }, + { + name: "leaderboardState" + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for late epoch slot gate"] + }, + { + name: "authority", + signer: true + } + ], + args: [] + }, + { + name: "syncLeaderboardScoresBatch", + docs: ["region: Validator Leaderboard Syncing"], + discriminator: [52, 11, 210, 173, 90, 5, 48, 50], + accounts: [ + { + name: "leaderboardState" + }, + { + name: "processingState", + writable: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "authority", + signer: true + } + ], + args: [] + }, + { + name: "syncMainStakeAccounts", + docs: [ + "V2: Sync main stake accounts using PDA architecture (batched)", + "Processes validators in batches via remaining_accounts (batch size is enforced client-side)", + "Note: Only syncs primary delegated stakes, not transient stakes" + ], + discriminator: [159, 17, 201, 39, 89, 62, 65, 135], + accounts: [ + { + name: "admin", + signer: true + }, + { + name: "processingState", + docs: ["Processing state for tracking batch progress"], + writable: true + }, + { + name: "epochState", + docs: ["Epoch state to mark completion"], + writable: true + }, + { + name: "activeList", + docs: [ + "Active validator list - to check validator counts and membership" + ] + }, + { + name: "graveyardList", + docs: [ + "Graveyard validator list - graveyard validators also need syncing for merge operations" + ] + }, + { + name: "stakeHistory" + }, + { + name: "vault", + writable: true + }, + { + name: "reservePool", + writable: true + }, + { + name: "stakeProgram" + }, + { + name: "clock" + } + ], + args: [] + }, + { + name: "syncValidatorSelectionThresholds", + docs: [ + "Calculate and store entry/exit thresholds from validator leaderboard" + ], + discriminator: [102, 171, 32, 136, 205, 105, 208, 225], + accounts: [ + { + name: "leaderboardState" + }, + { + name: "allocationState", + writable: true + }, + { + name: "maintenanceLedger", + writable: true + }, + { + name: "globalConfig", + docs: ["Global config for min_vpp_entry and min_vpp_exit"] + }, + { + name: "authority", + signer: true + } + ], + args: [] + }, + { + name: "synd", + discriminator: [153, 175, 231, 40, 44, 65, 175, 172], + accounts: [ + { + name: "user", + writable: true, + signer: true + }, + { + name: "liqsolMint", + writable: true + }, + { + name: "globalState", + writable: true + }, + { + name: "distributionState", + writable: true + }, + { + name: "userAta", + writable: true + }, + { + name: "poolAuthority" + }, + { + name: "bucketAuthority" + }, + { + name: "bucketTokenAccount", + writable: true + }, + { + name: "bucketUserRecord", + writable: true + }, + { + name: "senderUserRecord", + writable: true + }, + { + name: "receiverUserRecord", + writable: true + }, + { + name: "extraAccountMetaList" + }, + { + name: "liqsolCoreProgram" + }, + { + name: "transferHookProgram" + }, + { + name: "liqsolPoolAta", + writable: true + }, + { + name: "outpostAccount", + docs: ["User's pretoken deposit record"], + writable: true + }, + { + name: "pretokenPurchaseHistory", + writable: true + }, + { + name: "tokenProgram" + }, + { + name: "associatedTokenProgram" + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "amount", + type: "u64" + } + ] + }, + { + name: "updateConfigBool", + discriminator: [79, 36, 65, 239, 188, 35, 13, 160], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "admin", + signer: true + } + ], + args: [ + { + name: "key", + type: { + defined: { + name: "configKeyBool" + } + } + }, + { + name: "value", + type: "bool" + } + ] + }, + { + name: "updateConfigU16", + discriminator: [149, 9, 244, 25, 46, 136, 59, 173], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "admin", + signer: true + } + ], + args: [ + { + name: "key", + type: { + defined: { + name: "configKeyU16" + } + } + }, + { + name: "value", + type: "u16" + } + ] + }, + { + name: "updateConfigU64", + discriminator: [120, 43, 124, 106, 97, 80, 208, 123], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "admin", + signer: true + } + ], + args: [ + { + name: "key", + type: { + defined: { + name: "configKeyU64" + } + } + }, + { + name: "value", + type: "u64" + } + ] + }, + { + name: "updateConfigU8", + discriminator: [17, 160, 31, 134, 222, 250, 229, 253], + accounts: [ + { + name: "globalConfig", + writable: true + }, + { + name: "admin", + signer: true + } + ], + args: [ + { + name: "key", + type: { + defined: { + name: "configKeyU8" + } + } + }, + { + name: "value", + type: "u8" + } + ] + }, + { + name: "updateGrowthParameters", + discriminator: [172, 187, 237, 233, 250, 160, 115, 239], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalConfig" + }, + { + name: "trancheState", + writable: true + }, + { + name: "priceHistory", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "supplyGrowthBps", + type: "u16" + }, + { + name: "priceGrowthCents", + type: "u16" + } + ] + }, + { + name: "updatePriceBounds", + discriminator: [241, 116, 141, 65, 61, 95, 232, 28], + accounts: [ + { + name: "admin", + writable: true, + signer: true + }, + { + name: "globalConfig" + }, + { + name: "trancheState", + writable: true + }, + { + name: "priceHistory", + writable: true + }, + { + name: "systemProgram" + } + ], + args: [ + { + name: "minPriceUsd", + type: "u64" + }, + { + name: "maxPriceUsd", + type: "u64" + }, + { + name: "maxStalenessSeconds", + type: "i64" + } + ] + } + ], + accounts: [ + { + name: "batchOrchestrator", + discriminator: [70, 163, 206, 225, 7, 189, 73, 94] + }, + { + name: "distributionState", + discriminator: [7, 25, 94, 15, 208, 170, 4, 103] + }, + { + name: "envelopeChunks", + discriminator: [51, 126, 62, 161, 85, 175, 66, 63] + }, + { + name: "envelopeLog", + discriminator: [73, 107, 128, 29, 76, 210, 155, 113] + }, + { + name: "epochDeliveries", + discriminator: [134, 83, 77, 28, 26, 189, 174, 190] + }, + { + name: "global", + discriminator: [167, 232, 232, 177, 200, 108, 114, 127] + }, + { + name: "globalConfig", + discriminator: [149, 8, 156, 202, 160, 252, 176, 217] + }, + { + name: "globalState", + discriminator: [163, 46, 74, 168, 216, 123, 133, 98] + }, + { + name: "latestOutboundEnvelope", + discriminator: [74, 80, 163, 159, 178, 236, 249, 15] + }, + { + name: "leaderboardState", + discriminator: [211, 181, 29, 120, 189, 4, 106, 111] + }, + { + name: "liqReceiptData", + discriminator: [75, 119, 90, 79, 25, 200, 9, 46] + }, + { + name: "maintenanceLedger", + discriminator: [140, 250, 92, 173, 147, 65, 26, 39] + }, + { + name: "operatorRegistry", + discriminator: [194, 188, 172, 240, 220, 209, 36, 100] + }, + { + name: "outboundMessageBuffer", + discriminator: [133, 145, 100, 61, 28, 106, 209, 197] + }, + { + name: "outpostAccount", + discriminator: [87, 205, 242, 192, 212, 51, 26, 93] + }, + { + name: "outpostConfig", + discriminator: [211, 233, 11, 174, 26, 119, 188, 182] + }, + { + name: "payRateHistory", + discriminator: [139, 8, 65, 111, 71, 41, 187, 218] + }, + { + name: "payoutState", + discriminator: [106, 54, 13, 167, 203, 44, 168, 150] + }, + { + name: "pretokenPurchaseHistory", + discriminator: [33, 71, 113, 206, 33, 180, 236, 131] + }, + { + name: "priceHistory", + discriminator: [38, 241, 40, 19, 42, 228, 93, 152] + }, + { + name: "reserve", + discriminator: [43, 242, 204, 202, 26, 247, 59, 127] + }, + { + name: "reserveAggregate", + discriminator: [46, 66, 28, 2, 223, 209, 19, 45] + }, + { + name: "stakeAllocationState", + discriminator: [23, 238, 120, 198, 156, 165, 151, 119] + }, + { + name: "stakeControllerState", + discriminator: [218, 168, 114, 136, 80, 186, 29, 218] + }, + { + name: "stakeMetrics", + discriminator: [91, 84, 217, 97, 98, 38, 18, 143] + }, + { + name: "tokenMetadata", + discriminator: [237, 215, 132, 182, 24, 127, 175, 173] + }, + { + name: "trancheState", + discriminator: [212, 231, 254, 24, 238, 63, 92, 105] + }, + { + name: "userPretokenRecord", + discriminator: [117, 99, 159, 251, 98, 253, 6, 238] + }, + { + name: "userRecord", + discriminator: [210, 252, 132, 218, 191, 85, 173, 167] + }, + { + name: "validatorInfoAccount", + discriminator: [195, 243, 81, 187, 172, 232, 57, 59] + }, + { + name: "validatorList", + discriminator: [131, 181, 125, 127, 46, 36, 40, 167] + }, + { + name: "validatorTransientAccount", + discriminator: [97, 207, 155, 142, 86, 170, 118, 161] + } + ], + events: [ + { + name: "epochResolved", + discriminator: [62, 81, 212, 223, 209, 104, 51, 65] + }, + { + name: "graveyardDeactivationQueuedEvent", + discriminator: [131, 241, 122, 229, 108, 21, 67, 37] + }, + { + name: "graveyardValidatorCleanedEvent", + discriminator: [3, 252, 58, 228, 135, 135, 104, 34] + }, + { + name: "pretokenPurchased", + discriminator: [39, 1, 143, 191, 8, 14, 80, 41] + }, + { + name: "stakesMerged", + discriminator: [3, 16, 51, 153, 152, 186, 19, 97] + }, + { + name: "validatorAddedEvent", + discriminator: [71, 123, 103, 213, 174, 178, 82, 130] + }, + { + name: "validatorRemovedEvent", + discriminator: [49, 23, 179, 208, 124, 3, 231, 59] + }, + { + name: "validatorSwappedEvent", + discriminator: [33, 50, 10, 35, 69, 113, 96, 180] + }, + { + name: "validatorsSyncedEvent", + discriminator: [119, 121, 49, 120, 230, 132, 109, 214] + }, + { + name: "withdrawClaimed", + discriminator: [77, 130, 89, 38, 239, 172, 174, 85] + }, + { + name: "withdrawRequested", + discriminator: [114, 16, 240, 206, 93, 128, 151, 39] + } + ], + errors: [ + { + code: 6000, + name: "envelopeDecodeFailed", + msg: "Envelope protobuf decode failed" + }, + { + code: 6001, + name: "attestationDecodeFailed", + msg: "Attestation protobuf decode failed" + }, + { + code: 6002, + name: "nonSequentialEpoch", + msg: "Non-sequential epoch index" + }, + { + code: 6003, + name: "epochHashMismatch", + msg: "Previous envelope hash mismatch" + }, + { + code: 6004, + name: "operatorAlreadyDelivered", + msg: "Operator already delivered this epoch" + }, + { + code: 6005, + name: "notActiveOperator", + msg: "Caller is not an active batch operator" + }, + { + code: 6006, + name: "emptyOperatorGroups", + msg: "Operator group list cannot be empty while roster is initialized" + }, + { + code: 6007, + name: "outboundMessageBufferOverflow", + msg: "Outbound message buffer capacity exceeded" + }, + { + code: 6008, + name: "unauthorized", + msg: "Unauthorized caller for attestation" + }, + { + code: 6009, + name: "operatorRegistryFull", + msg: "Operator registry is full; cannot add another operator" + }, + { + code: 6010, + name: "operatorGroupListFull", + msg: "Operator group count exceeds configured maximum" + }, + { + code: 6011, + name: "operatorGroupFull", + msg: "Operator group member count exceeds configured maximum" + }, + { + code: 6012, + name: "invalidSolanaAddressLength", + msg: "Solana address in Operators entry is not 32 bytes" + }, + { + code: 6013, + name: "epochDeliveryListFull", + msg: "Epoch delivery count exceeds configured maximum" + }, + { + code: 6014, + name: "unsupportedAttestationType", + msg: "Attestation type not supported by this outpost" + }, + { + code: 6015, + name: "zeroAmount", + msg: "Amount must be greater than zero" + }, + { + code: 6016, + name: "invalidOperatorType", + msg: "Invalid OperatorType for Solana outpost" + }, + { + code: 6017, + name: "invalidTokenKind", + msg: "Invalid TokenKind for deposit" + }, + { + code: 6018, + name: "invalidWireNameLength", + msg: "WIRE account name exceeds 13 characters" + }, + { + code: 6019, + name: "envelopeTooLarge", + msg: "Envelope data exceeds MAX_ENVELOPE_BYTES" + }, + { + code: 6020, + name: "invalidRetentionConfig", + msg: "Retention config invalid: full_retention_seconds < data_retention_epochs * epoch_duration_seconds" + }, + { + code: 6021, + name: "invalidEpochDuration", + msg: "Epoch duration must be non-zero" + }, + { + code: 6022, + name: "envelopeKindMismatch", + msg: "Envelope kind does not match account type" + }, + { + code: 6023, + name: "envelopeStillInRetention", + msg: "Envelope pruning attempted on record still inside retention window" + }, + { + code: 6024, + name: "invalidChunkCount", + msg: "Chunk count must be in 1..=MAX_CHUNKS" + }, + { + code: 6025, + name: "chunkIndexOutOfRange", + msg: "Chunk index out of range for declared total_chunks" + }, + { + code: 6026, + name: "chunkTooLarge", + msg: "Chunk payload exceeds MAX_CHUNK_BYTES" + }, + { + code: 6027, + name: "chunkSizeMismatch", + msg: "Chunk size does not match the declared envelope shape" + }, + { + code: 6028, + name: "chunkOutOfOrder", + msg: "Chunk arrived out of order; chunks must be submitted sequentially" + }, + { + code: 6029, + name: "chunkBufferEpochMismatch", + msg: "Chunk buffer header locked to a different epoch" + }, + { + code: 6030, + name: "chunkBufferShapeMismatch", + msg: "Chunk buffer header locked to a different total_chunks/total_bytes" + }, + { + code: 6031, + name: "chunkBufferOperatorMismatch", + msg: "Chunk buffer was opened by a different operator" + }, + { + code: 6032, + name: "chunkCleanupNotYetEligible", + msg: "Chunk cleanup is not eligible until the epoch has advanced" + }, + { + code: 6033, + name: "oversizedQueuedMessage", + msg: "A single queued outbound message exceeds MAX_ENVELOPE_BYTES; cannot pack into an envelope" + }, + { + code: 6034, + name: "collateralLedgerOverflow", + msg: "Collateral ledger has reached MAX_COLLATERAL_ENTRIES capacity" + }, + { + code: 6035, + name: "callerNotRegistered", + msg: "Caller is not present in the operator registry" + }, + { + code: 6036, + name: "wrongOperatorType", + msg: "Caller's operator role does not match the action's required role" + }, + { + code: 6037, + name: "operatorNotActive", + msg: "Caller's operator status is not ACTIVE" + }, + { + code: 6038, + name: "reserveNotFound", + msg: "Reserve PDA not found for the supplied (token_code, reserve_code)" + }, + { + code: 6039, + name: "reserveWrongStatus", + msg: "Reserve is not in the status required by the action" + }, + { + code: 6040, + name: "reserveNotCreator", + msg: "Caller does not match the reserve's creator" + }, + { + code: 6041, + name: "tokenCodeNotConfigured", + msg: "Token code is not configured in outpost_config.token_addresses_by_code" + }, + { + code: 6042, + name: "badConnectorWeight", + msg: "Connector weight must be in 1..=10_000 basis points" + }, + { + code: 6043, + name: "reserveNameTooLong", + msg: "Reserve name exceeds RESERVE_NAME_MAX_BYTES" + }, + { + code: 6044, + name: "reserveDescriptionTooLong", + msg: "Reserve description exceeds RESERVE_DESCRIPTION_MAX_BYTES" + }, + { + code: 6045, + name: "tokenAddressesFull", + msg: "Token addresses table is full; cannot register another entry" + }, + { + code: 6046, + name: "zeroReserveAmount", + msg: "Reserve external_token_amount must be greater than zero" + }, + { + code: 6047, + name: "swapUnknownSlugName", + msg: "requestSwap: slug_name parameter is UNKNOWN (zero)" + }, + { + code: 6048, + name: "swapEmptyRecipient", + msg: "requestSwap: target_recipient is empty" + }, + { + code: 6049, + name: "swapZeroSourceAmount", + msg: "requestSwap: source_amount must be > 0" + }, + { + code: 6050, + name: "swapSourceNotNative", + msg: "requestSwap: source token must be native (this pass)" + }, + { + code: 6051, + name: "swapSourceReserveUnavailable", + msg: "requestSwap: source reserve unavailable" + }, + { + code: 6052, + name: "arithmeticOverflow", + msg: "arithmetic overflow during reserve accounting" + }, + { + code: 6053, + name: "swapSourceIsNative", + msg: "requestSwapSpl: source token must be SPL, not native" + }, + { + code: 6054, + name: "swapSplMintMismatch", + msg: "SPL mint does not match outpost_config binding for this token_code" + }, + { + code: 6055, + name: "precisionUnconfigured", + msg: "token precision not configured — call set_token_precision first" + }, + { + code: 6056, + name: "recipientAtaCreationFailed", + msg: "handle_swap_remit: recipient ATA creation failed on-chain" + }, + { + code: 6057, + name: "terminalChunkNotEmpty", + msg: "epoch_in: the terminal finalize call must carry no chunk data" + }, + { + code: 6058, + name: "terminalChunkBeforeDataComplete", + msg: "epoch_in: terminal finalize before every data chunk was uploaded" + }, + { + code: 6059, + name: "envelopeEpochMismatch", + msg: "Decoded envelope epoch does not match the epoch_in instruction epoch" + }, + { + code: 6060, + name: "nonCanonicalPreviousEnvelopeHash", + msg: "previous_envelope_hash is not in canonical form" + }, + { + code: 6061, + name: "reserveCreatorAtaNotCanonical", + msg: "createReserve: creator ATA is not the canonical account for this mint" + }, + { + code: 6062, + name: "emitBeforeEpochAccepted", + msg: "Outbound emit for an epoch the inbound cursor has not accepted" + }, + { + code: 6063, + name: "envelopeWrongDestination", + msg: "envelope destination is not an SVM chain" + }, + { + code: 7000, + name: "destinationAccountDoesNotExist", + msg: "Destination stake account does not exist" + }, + { + code: 7001, + name: "sourceAccountDoesNotExist", + msg: "Source stake account does not exist" + }, + { + code: 7002, + name: "invalidDestinationOwner", + msg: "Destination account not owned by stake program" + }, + { + code: 7003, + name: "invalidSourceOwner", + msg: "Source account not owned by stake program" + }, + { + code: 7004, + name: "clockBorrowFailed", + msg: "Failed to borrow clock data" + }, + { + code: 7005, + name: "clockDeserializeFailed", + msg: "Failed to deserialize clock" + }, + { + code: 7006, + name: "destinationAnalysisFailed", + msg: "Failed to analyze destination stake account" + }, + { + code: 7007, + name: "sourceAnalysisFailed", + msg: "Failed to analyze source stake account" + }, + { + code: 7008, + name: "destinationStillActivating", + msg: "Destination stake is still activating" + }, + { + code: 7009, + name: "destinationDeactivating", + msg: "Destination stake is deactivating" + }, + { + code: 7010, + name: "sourceStillActivating", + msg: "Source stake is still activating" + }, + { + code: 7011, + name: "sourceDeactivating", + msg: "Source stake is deactivating" + }, + { + code: 7012, + name: "destinationBorrowFailed", + msg: "Failed to borrow destination account data" + }, + { + code: 7013, + name: "destinationParseFailed", + msg: "Failed to parse destination stake state" + }, + { + code: 7014, + name: "sourceBorrowFailed", + msg: "Failed to borrow source account data" + }, + { + code: 7015, + name: "sourceParseFailed", + msg: "Failed to parse source stake state" + }, + { + code: 7016, + name: "differentValidators", + msg: "Stakes are delegated to different validators" + }, + { + code: 7017, + name: "differentStakers", + msg: "Stakes have different staker authorities" + }, + { + code: 7018, + name: "differentWithdrawers", + msg: "Stakes have different withdrawer authorities" + }, + { + code: 7019, + name: "authoritiesNotFound", + msg: "Could not extract authorities from accounts" + }, + { + code: 7020, + name: "mergeInstructionFailed", + msg: "Merge instruction failed" + }, + { + code: 7021, + name: "epochRewardsActive", + msg: "Epoch rewards distribution is active - stake operations blocked" + }, + { + code: 7022, + name: "differentCreditsObserved", + msg: "Stakes have different credits_observed - cannot merge until both earn same rewards" + }, + { + code: 7100, + name: "accountBorrowFailed", + msg: "Util Acc borrow Failed" + }, + { + code: 7200, + name: "invalidAuthority", + msg: "Only the configured admin may perform this action" + }, + { + code: 7201, + name: "invalidAccountOwner", + msg: "OutpostAccount does not belong to the signer" + }, + { + code: 7202, + name: "roleNotEnabled", + msg: "Role is not enabled (principal is 0)" + }, + { + code: 7203, + name: "alreadyBondedForRole", + msg: "Already bonded for this role" + }, + { + code: 7204, + name: "notBondedForRole", + msg: "Not bonded for this role" + }, + { + code: 7205, + name: "insufficientStakedLiqsol", + msg: "Insufficient staked liqSOL for bonding" + }, + { + code: 7206, + name: "bondStillInWarmup", + msg: "Bond still in warmup period" + }, + { + code: 7207, + name: "alreadyUnbonding", + msg: "Unbond already requested for this role" + }, + { + code: 7208, + name: "notUnbonding", + msg: "Unbond not requested for this role" + }, + { + code: 7209, + name: "notBonded", + msg: "User has no active bonds" + }, + { + code: 7210, + name: "missingRole", + msg: "Actor does not have required role" + }, + { + code: 7211, + name: "overflow", + msg: "Arithmetic overflow" + }, + { + code: 7212, + name: "underflow", + msg: "Arithmetic underflow" + }, + { + code: 7213, + name: "invalidWarmupDuration", + msg: "Invalid warmup duration" + }, + { + code: 7300, + name: "depositTooSmall", + msg: "Deposit amount is below minimum required" + }, + { + code: 7301, + name: "notInitialized", + msg: "Deposit Router not initialized" + }, + { + code: 7302, + name: "invalidAuthority", + msg: "Invalid authority" + }, + { + code: 7303, + name: "insufficientFunds", + msg: "Insufficient funds" + }, + { + code: 7304, + name: "overflow", + msg: "Arithmetic overflow" + }, + { + code: 7305, + name: "calculationFailure", + msg: "Calculation failure" + }, + { + code: 7306, + name: "nothingToMint", + msg: "Cannot mint zero tokens" + }, + { + code: 7307, + name: "invalidAccount", + msg: "Invalid account provided" + }, + { + code: 7308, + name: "insufficientFundsForStake", + msg: "Insufficient funds remaining after reserving fees to proceed with staking" + }, + { + code: 7309, + name: "unauthorizedProgram", + msg: "Unauthorized program attempting to call this instruction" + }, + { + code: 7310, + name: "depositsDisabled", + msg: "Deposits are currently disabled" + }, + { + code: 7400, + name: "noRewardsToClaim", + msg: "No rewards to claim" + }, + { + code: 7401, + name: "insufficientBalance", + msg: "Insufficient balance" + }, + { + code: 7402, + name: "insufficientFunds", + msg: "Insufficient funds" + }, + { + code: 7403, + name: "unauthorized", + msg: "Unauthorized - caller is not the distribution authority" + }, + { + code: 7404, + name: "invalidMint", + msg: "Invalid mint" + }, + { + code: 7405, + name: "invalidOwner", + msg: "Invalid owner" + }, + { + code: 7406, + name: "invalidBucketAccount", + msg: "Invalid bucket token account" + }, + { + code: 7407, + name: "invalidUserRecord", + msg: "Invalid user record" + }, + { + code: 7408, + name: "invalidWithdrawal", + msg: "Invalid withdrawal - balance increased instead of decreased" + }, + { + code: 7409, + name: "invalidWithdrawalAmount", + msg: "Invalid withdrawal - request must be greater than 0" + }, + { + code: 7410, + name: "invalidProgramId", + msg: "Invalid program ID" + }, + { + code: 7411, + name: "instructionIntrospectionFailed", + msg: "Instruction introspection failed" + }, + { + code: 7412, + name: "transferNotInProgress", + msg: "Transfer hook not active for this token account" + }, + { + code: 7413, + name: "shareZeroTransfer", + msg: "Amount too small resulting in zero share transfer" + }, + { + code: 7414, + name: "receiptFulfilled", + msg: "Receipt already fulfilled" + }, + { + code: 7415, + name: "insufficientBucketBalance", + msg: "Insufficient bucket balance to fulfill claim" + }, + { + code: 7416, + name: "claimCalculationError", + msg: "Claim calculation error" + }, + { + code: 7417, + name: "overflow", + msg: "Arithmetic overflow" + }, + { + code: 7418, + name: "underflow", + msg: "Arithmetic underflow" + }, + { + code: 7419, + name: "balanceBelowTracked", + msg: "Balance below tracked amount — possible token burn detected" + }, + { + code: 7420, + name: "legacyUserRecordMigrationRequired", + msg: "Legacy user record must be migrated via register_user or migrate_user_record before claiming or transfers" + }, + { + code: 7421, + name: "amountExceedsEntitled", + msg: "Requested amount exceeds share-backed entitlement — cap at max_withdrawable or use full-ATA withdraw" + }, + { + code: 7500, + name: "unauthorized", + msg: "Unauthorized: The authority does not match the controller state's authority." + }, + { + code: 7501, + name: "noUpgradeAuthority", + msg: "Program has no upgrade authority (immutable)." + }, + { + code: 7502, + name: "percentOutOfRange", + msg: "Percent config value must be in 0..=100" + }, + { + code: 7503, + name: "percentInversion", + msg: "Percent config would invert hysteresis: entry must be <= exit" + }, + { + code: 7504, + name: "unstakeDeltaBelowSplitMinimum", + msg: "min_rebalance_unstake_delta must be >= MIN_STAKE_DELEGATION (1 SOL)" + }, + { + code: 7600, + name: "insufficientFunds", + msg: "Insufficient funds" + }, + { + code: 7601, + name: "invalidValidator", + msg: "Invalid validator" + }, + { + code: 7602, + name: "noSuitableValidator", + msg: "No suitable validator found" + }, + { + code: 7603, + name: "ticketNotFound", + msg: "Unstake ticket not found" + }, + { + code: 7604, + name: "ticketNotClaimable", + msg: "Ticket not claimable yet" + }, + { + code: 7605, + name: "unauthorized", + msg: "Unauthorized" + }, + { + code: 7606, + name: "arithmeticOverflow", + msg: "Arithmetic overflow" + }, + { + code: 7607, + name: "accountAlreadyExists", + msg: "Account already exists" + }, + { + code: 7608, + name: "invalidStakeAccount", + msg: "Invalid stake account" + }, + { + code: 7609, + name: "invalidThreshold", + msg: "Invalid threshold value" + }, + { + code: 7610, + name: "invalidAccountData", + msg: "Invalid account data" + }, + { + code: 7611, + name: "invalidVoteAccount", + msg: "Invalid vote account" + }, + { + code: 7612, + name: "stakesNotYetActive", + msg: "Stakes not yet active" + }, + { + code: 7613, + name: "epochDistributionAlreadyDone", + msg: "Invalid epoch" + }, + { + code: 7614, + name: "epochAlreadyResolved", + msg: "Epoch already resolved" + }, + { + code: 7615, + name: "mergeFailed", + msg: "Merge failed" + }, + { + code: 7616, + name: "reservePoolNotInitialized", + msg: "Reserve pool not initialized" + }, + { + code: 7617, + name: "invalidEphemeralAccount", + msg: "Invalid ephemeral account" + }, + { + code: 7618, + name: "invalidStakeAccount0", + msg: "Invalid stake account 0" + }, + { + code: 7619, + name: "epochNotReadyForResolution", + msg: "Epoch Table Not Ready To be resolved" + }, + { + code: 7620, + name: "insufficientSlotsElapsed", + msg: "Function called too soon in epoch, should be called close to epoch boundary" + }, + { + code: 7621, + name: "epochRewardsActive", + msg: "Epoch rewards distribution is active - stake operations blocked" + }, + { + code: 7622, + name: "validatorSyncRequired", + msg: "Validator sync required - please call sync_validator_stakes first" + }, + { + code: 7623, + name: "tooSmallDeposit", + msg: "Deposit amount too small" + }, + { + code: 7624, + name: "allocationsNotCalculated", + msg: "Allocations not calculated for current epoch - please run rebalance_validators first" + }, + { + code: 7625, + name: "invalidAccountCount", + msg: "Invalid account count - expected different number of accounts" + }, + { + code: 7626, + name: "invalidValidatorInfo", + msg: "Invalid ValidatorInfo account" + }, + { + code: 7627, + name: "unstakeAllocationsNotCalculated", + msg: "Unstake allocations must be calculated before validator allocations - please run calculate_unstake_allocations first" + }, + { + code: 7628, + name: "invalidReservePoolAccount", + msg: "Invalid reserve pool account" + }, + { + code: 7629, + name: "preReqsUnmet", + msg: "Some Pre Req Not Met, Look at Solana Logs for details" + }, + { + code: 7630, + name: "systemBusy", + msg: "System busy: stake metrics are stale from a recent unstake — please retry shortly" + }, + { + code: 7631, + name: "updateInProgress", + msg: "Update in progress: stake metrics are being refreshed for this epoch — please retry shortly" + }, + { + code: 7632, + name: "maintenanceMergeRequired", + msg: "Maintenance Merge Transients Failed - please run merge_activating_stakes first" + }, + { + code: 7633, + name: "unstakeTooSMall", + msg: "Unstake Request Too Small" + }, + { + code: 7634, + name: "operationInProgress", + msg: "Operation already in progress" + }, + { + code: 7635, + name: "noOperationInProgress", + msg: "No operation currently in progress" + }, + { + code: 7636, + name: "invalidSequence", + msg: "Invalid sequence - expected different index or rank" + }, + { + code: 7637, + name: "validatorNotFound", + msg: "Validator not found in leaderboard" + }, + { + code: 7638, + name: "invalidRank", + msg: "Invalid rank - exceeds validator count" + }, + { + code: 7639, + name: "noValidatorsInLeaderboard", + msg: "No validators in leaderboard" + }, + { + code: 7640, + name: "noValidatorsFound", + msg: "No validators found in active list" + }, + { + code: 7641, + name: "graveyardFull", + msg: "Graveyard list is full" + }, + { + code: 7642, + name: "validatorHasActiveStake", + msg: "Validator still has active stake - cannot cleanup until stake is repatriated" + }, + { + code: 7643, + name: "validatorHasPendingDeactivations", + msg: "Validator has pending deactivations - cannot cleanup until all deactivations complete" + }, + { + code: 7644, + name: "validatorNotUndelegated", + msg: "Validator is not in NotDelegated state - stake must be fully deactivated before cleanup" + }, + { + code: 7645, + name: "batchSizeTooLarge", + msg: "Batch size exceeds maximum allowed" + }, + { + code: 7646, + name: "stakingDisabled", + msg: "Staking is currently disabled" + }, + { + code: 7647, + name: "withdrawalsDisabled", + msg: "Withdrawals are currently disabled" + }, + { + code: 7648, + name: "emergencyModeActive", + msg: "Emergency mode is active" + }, + { + code: 7649, + name: "processStakeOrdersDisabled", + msg: "Process stake orders is currently disabled" + }, + { + code: 7650, + name: "processUnstakeOrdersDisabled", + msg: "Process unstake orders is currently disabled" + }, + { + code: 7651, + name: "processPayCycleDisabled", + msg: "Process pay cycle is currently disabled" + }, + { + code: 7652, + name: "validatorRecordNotUpdated", + msg: "Validator record not updated for current epoch" + }, + { + code: 7653, + name: "lateEpochSlotGateNotMet", + msg: "Late epoch operation called too early - minimum slots not yet elapsed" + }, + { + code: 7654, + name: "indexOutOfBounds", + msg: "Index out of bounds" + }, + { + code: 7655, + name: "accountAlreadyMigrated", + msg: "Account already at target size, migration not needed" + }, + { + code: 7656, + name: "treasuryRentUnfunded", + msg: "Treasury can't cover stake-account rent and caller opted out of fronting it" + }, + { + code: 7700, + name: "invalidChainlinkProgram", + msg: "Invalid Chainlink program account" + }, + { + code: 7701, + name: "invalidChainlinkFeed", + msg: "Invalid Chainlink feed account" + }, + { + code: 7702, + name: "arithmeticOverflow", + msg: "Arithmetic overflow in calculation" + }, + { + code: 7703, + name: "invalidCalculation", + msg: "Invalid calculation result" + }, + { + code: 7704, + name: "decimalPrecisionMismatch", + msg: "Decimal precision mismatch" + }, + { + code: 7705, + name: "missingNextTranche", + msg: "Next tranche account required but not provided" + }, + { + code: 7706, + name: "insufficientNextTrancheSupply", + msg: "Insufficient pretokens in next tranche" + }, + { + code: 7707, + name: "trancheExhausted", + msg: "Current tranche exhausted" + }, + { + code: 7708, + name: "invalidPretokenPrice", + msg: "Invalid pretoken price" + }, + { + code: 7709, + name: "chainlinkPriceFetchFailed", + msg: "Failed to fetch SOL price from Chainlink" + }, + { + code: 7710, + name: "stalePrice", + msg: "Chainlink price data is stale" + }, + { + code: 7711, + name: "priceOutOfBounds", + msg: "Price out of valid bounds" + }, + { + code: 7712, + name: "invalidGrowthBps", + msg: "Invalid growth BPS value (must be <= 10000)" + }, + { + code: 7713, + name: "unauthorized", + msg: "Unauthorized: caller is not admin" + }, + { + code: 7714, + name: "emptyPriceHistory", + msg: "Price history is empty" + }, + { + code: 7715, + name: "insufficientFunds", + msg: "Insufficient funds for pretoken purchase" + }, + { + code: 7716, + name: "exceededTrancheLimit", + msg: "Exceeded tranche limit, split purchase into multiple transactions" + }, + { + code: 7717, + name: "zeroPretokensPurchased", + msg: "Deposit too small to purchase any pretokens at current tranche price" + }, + { + code: 7718, + name: "invalidRoundData", + msg: "Invalid round data from Chainlink feed" + }, + { + code: 7719, + name: "invalidStaleness", + msg: "max_staleness_seconds must be > 0 - any non-positive value would brick price reads" + }, + { + code: 7800, + name: "unauthorized", + msg: "Unauthorized access" + }, + { + code: 7801, + name: "maxValidatorsReached", + msg: "Maximum validators reached" + }, + { + code: 7802, + name: "validatorAlreadyExists", + msg: "Validator already exists" + }, + { + code: 7803, + name: "validatorNotFound", + msg: "Validator not found" + }, + { + code: 7804, + name: "invalidStakeUpdateType", + msg: "Invalid stake update type" + }, + { + code: 7805, + name: "invalidVoteAccount", + msg: "Invalid vote account provided" + }, + { + code: 7806, + name: "invalidInputLength", + msg: "Invalid input length - all vectors must have same length" + }, + { + code: 7807, + name: "invalidStakeAccount", + msg: "Invalid Stake Account" + }, + { + code: 7808, + name: "arithmeticOverflow", + msg: "Arithmetic overflow" + }, + { + code: 7809, + name: "insufficientTransientStake", + msg: "Insufficient transient stake" + }, + { + code: 7810, + name: "transientTrackingFull", + msg: "Transient tracking is full (100 entries max)" + }, + { + code: 7811, + name: "validatorStillInCooldown", + msg: "Validator is still in cooldown period" + }, + { + code: 7812, + name: "invalidVppScore", + msg: "VPP score must be between 0 and 100" + }, + { + code: 7900, + name: "unauthorized", + msg: "Unauthorized admin attempting to call this instruction" + }, + { + code: 7901, + name: "invalidAmount", + msg: "Invalid amount" + }, + { + code: 7902, + name: "dDayNotSet", + msg: "D-Day is not set" + }, + { + code: 7903, + name: "dDayActive", + msg: "D-Day is active - stakes not allowed" + }, + { + code: 7904, + name: "invalidLiqsolMint", + msg: "Invalid liqSOL mint address" + }, + { + code: 7905, + name: "insufficientFunds", + msg: "Insufficient funds in user account" + }, + { + code: 7906, + name: "insufficientStake", + msg: "Insufficient staked amount for withdrawal" + }, + { + code: 7907, + name: "insufficientShares", + msg: "Insufficient shares for withdrawal" + }, + { + code: 7908, + name: "overflow", + msg: "Arithmetic overflow" + }, + { + code: 7909, + name: "underflow", + msg: "Arithmetic underflow" + }, + { + code: 7910, + name: "emptyLiqsolPool", + msg: "No liqSOL deposits registered in the pool" + }, + { + code: 7911, + name: "noLiqsolPosition", + msg: "No liqSOL position recorded for this user" + }, + { + code: 7912, + name: "noStakeDeposit", + msg: "No stake deposit found (only pretoken purchases exist)" + }, + { + code: 7913, + name: "rawSolBucketUnimplemented", + msg: "Raw SOL bucket handling is not implemented yet" + }, + { + code: 7914, + name: "noAccumulatedYield", + msg: "No accumulated yield available to consume" + }, + { + code: 7915, + name: "refundsNotActive", + msg: "Refunds are not active" + }, + { + code: 7916, + name: "noRefundablePosition", + msg: "No refundable position found for this user" + }, + { + code: 7917, + name: "systemPaused", + msg: "System is currently paused" + }, + { + code: 7918, + name: "refundsActive", + msg: "Refunds are active - operation not allowed" + }, + { + code: 7919, + name: "receiptLocked", + msg: "OutpostAccount is locked by an active bond" + }, + { + code: 7920, + name: "invalidWireState", + msg: "Invalid wire state for this operation" + }, + { + code: 8000, + name: "invalidUserRecord", + msg: "Invalid user record" + }, + { + code: 8001, + name: "insufficientBalance", + msg: "Insufficient balance" + }, + { + code: 8002, + name: "overflow", + msg: "Arithmetic overflow" + }, + { + code: 8003, + name: "arithmeticUnderflow", + msg: "Arithmetic underflow" + }, + { + code: 8004, + name: "alreadyFulfilled", + msg: "Receipt already fulfilled" + }, + { + code: 8005, + name: "notYetServiceable", + msg: "Receipt not yet serviceable" + }, + { + code: 8006, + name: "badFrontierOrder", + msg: "Frontier receipts out of order or unexpected id" + }, + { + code: 8007, + name: "missingNftToken", + msg: "User does not hold the NFT receipt token" + }, + { + code: 8008, + name: "withdrawalsDisabled", + msg: "Withdrawals are currently disabled" + }, + { + code: 8009, + name: "claimWithdrawalsDisabled", + msg: "Claim withdrawals are currently disabled" + } + ], + types: [ + { + name: "attestationData", + type: { + kind: "struct", + fields: [ + { + name: "attestationType", + type: "i32" + }, + { + name: "data", + type: "bytes" + } + ] + } + }, + { + name: "batchOrchestrator", + docs: [ + "Holds resume positions for batched ops - cursors only, no value.", + "", + "Rule of thumb for what lives here vs StakeAllocationState: this account is", + "for WIPEABLE positions. Completion truth is in MaintenanceLedger, so a stale", + 'cursor\'s staleness response is just "zero it" (sweep_stale_cursors does that', + "blanket at every epoch boundary). Anything that carries money/accounting and", + "needs abort/recover on staleness belongs on StakeAllocationState next to its", + "cycle, not here. The aggregation temps are the one grandfathered exception -", + "they carry value, so they sit outside the sweep behind their own mode-tag +", + "started_epoch guard.", + "", + "On liveness: ops here have no in_progress bools - a nonzero cursor/mode-tag", + "IS the liveness signal (see graveyard_locked, WIN-60). That inference works", + "because zero is out-of-band by construction for these fields: cursor at 0 =", + "no progress = idle, same state. Don't copy this pattern to fields where zero", + "is a real value (epochs, amounts) - those need an explicit bool." + ], + type: { + kind: "struct", + fields: [ + { + name: "validatorsProcessedThisEpoch", + type: "u8" + }, + { + name: "validatorsMergeProcessedThisEpoch", + type: "u16" + }, + { + name: "validatorsDeactivatingMergeProcessed", + type: "u16" + }, + { + name: "validatorsSyncProcessedThisEpoch", + type: "u16" + }, + { + name: "validatorsUnstakeProcessedThisEpoch", + type: "u16" + }, + { + name: "validatorsAggregateProcessedThisEpoch", + type: "u16" + }, + { + name: "tempTotalActiveStake", + type: "u64" + }, + { + name: "tempTotalTransientStake", + type: "u64" + }, + { + name: "tempTotalReward", + type: "u64" + }, + { + name: "tempTotalUnstakeableStake", + type: "u64" + }, + { + name: "bump", + type: "u8" + }, + { + name: "infraNextIndex", + docs: ["Next active_list index to process for PDA setup"], + type: "u16" + }, + { + name: "infosNextIndex", + docs: ["Next active_list index to process for infos sync"], + type: "u16" + }, + { + name: "leaderboardScoresNextIndex", + docs: ["Next leaderboard registry index to process for score sync"], + type: "u16" + }, + { + name: "removalNextIndex", + docs: ["Next index in active list to check for removal"], + type: "u16" + }, + { + name: "additionNextRank", + docs: ["Next rank in leaderboard to check for addition"], + type: "u16" + }, + { + name: "additionTargetRank", + docs: ["Target (inclusive) leaderboard rank to process up to"], + type: "u16" + }, + { + name: "graveyardNextIndex", + docs: ["Next index in graveyard list to process"], + type: "u16" + }, + { + name: "graveyardCleanupNextIndex", + docs: ["Next index in graveyard list to check for cleanup"], + type: "u16" + }, + { + name: "aggregateModeTag", + docs: [ + "Tracks which aggregation mode currently owns the shared temp fields.", + "0 = idle,", + "1 = Normal,", + "2 = PostSync,", + "3 = PostLateEpoch.", + "Prevents cross-mode state contamination when modes share the same vars." + ], + type: "u8" + }, + { + name: "aggregationStartedEpoch", + docs: [ + "The epoch when the current aggregation batch started.", + "Prevents stale partial accumulators from being committed if an epoch boundary is crossed mid-aggregation." + ], + type: "u64" + }, + { + name: "mevClaimsNextIndex", + docs: ["Next active_list index to process for MEV tip claims"], + type: "u16" + }, + { + name: "tempTotalMevReward", + docs: ["Temporary accumulator for MEV rewards across batches"], + type: "u64" + }, + { + name: "tempTotalOutstandingAmountToUnstake", + docs: [ + "Temporary accumulator for sum of validators' amount_to_unstake across batches" + ], + type: "u64" + }, + { + name: "validatorsSyncStartedEpoch", + docs: ["Owns validators_sync_processed_this_epoch."], + type: "u16" + }, + { + name: "leaderboardScoresStartedEpoch", + docs: ["Owns leaderboard_scores_next_index."], + type: "u16" + }, + { + name: "graveyardCleanupStartedEpoch", + docs: ["Owns graveyard_cleanup_next_index."], + type: "u16" + }, + { + name: "additionStartedEpoch", + docs: ["Owns addition_next_rank + addition_target_rank."], + type: "u16" + }, + { + name: "unstakeStartedEpoch", + docs: [ + "Owns validators_unstake_processed_this_epoch. A nonzero cursor from a", + "dead epoch is not a real lock — this pin lets consumers tell stale", + "leftovers apart from a live in-epoch traversal." + ], + type: "u16" + }, + { + name: "cursorsEpoch", + docs: [ + "Every cursor on this account is a per-epoch resume position — at an", + "epoch boundary any nonzero one is stale garbage. The first batch op to", + "touch this account in a new epoch wipes them all in one swing via", + "sweep_stale_cursors, so no op ever resumes against a list that", + "selection reshuffled since. Backstop for the per-op pins above." + ], + type: "u16" + }, + { + name: "reserved", + type: { + array: ["u8", 60] + } + } + ] + } + }, + { + name: "collateralEntry", + type: { + kind: "struct", + fields: [ + { + name: "depositor", + type: "pubkey" + }, + { + name: "tokenCode", + type: "u64" + }, + { + name: "amount", + type: "u64" + } + ] + } + }, + { + name: "configKeyBool", + docs: [ + "Keys for bool config values (feature flags) - stored as bits in a u16", + "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,", + "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved" + ], + type: { + kind: "enum", + variants: [ + { + name: "depositsEnabled" + }, + { + name: "withdrawalsEnabled" + }, + { + name: "claimWithdrawalsEnabled" + }, + { + name: "processStakeOrdersEnabled" + }, + { + name: "processUnstakeOrdersEnabled" + }, + { + name: "processPayCycleEnabled" + }, + { + name: "rebalancingEnabled" + } + ] + } + }, + { + name: "configKeyU16", + docs: ["Keys for u16 config values (small counts, thresholds, ranks)"], + type: { + kind: "enum", + variants: [ + { + name: "cooldownEpochs" + }, + { + name: "depositFeeEpochsMultiplier" + }, + { + name: "minVppEntry" + }, + { + name: "minVppExit" + }, + { + name: "tinyNetworkThreshold" + }, + { + name: "smallNetworkThreshold" + }, + { + name: "mediumNetworkThreshold" + }, + { + name: "largeNetworkEntryRank" + }, + { + name: "largeNetworkExitRank" + } + ] + } + }, + { + name: "configKeyU64", + docs: ["Keys for u64 config values (large amounts, rates)"], + type: { + kind: "enum", + variants: [ + { + name: "minUserDeposit" + }, + { + name: "minUnstakeRequest" + }, + { + name: "minRebalanceStakeDelta" + }, + { + name: "minRebalanceUnstakeDelta" + }, + { + name: "transientThreshold" + }, + { + name: "minLateEpochSlotGate" + } + ] + } + }, + { + name: "configKeyU8", + docs: ["Keys for u8 config values (percentages 0-100)"], + type: { + kind: "enum", + variants: [ + { + name: "smallNetworkEntryPercent" + }, + { + name: "smallNetworkExitPercent" + }, + { + name: "mediumNetworkEntryPercent" + }, + { + name: "mediumNetworkExitPercent" + } + ] + } + }, + { + name: "distributionState", + type: { + kind: "struct", + fields: [ + { + name: "liqsolMint", + type: "pubkey" + }, + { + name: "currentIndex", + type: "u64" + }, + { + name: "totalShares", + docs: ["Sum of all user shares across the system"], + type: "u64" + }, + { + name: "lastBucketBalance", + docs: [ + "Last observed bucket balance used for incremental index updates" + ], + type: "u64" + }, + { + name: "bump", + type: "u8" + }, + { + name: "bucketBump", + docs: [ + "Cached bucket authority bump to avoid repeated find_program_address calls" + ], + type: "u8" + }, + { + name: "poolBump", + docs: [ + "Cached pool authority bump to avoid repeated find_program_address calls" + ], + type: "u8" + }, + { + name: "bucketAuthority", + docs: [ + "Cached bucket authority pubkey for transfer-hook optimization" + ], + type: "pubkey" + }, + { + name: "poolAuthority", + docs: [ + "Cached pool authority pubkey for transfer-hook optimization" + ], + type: "pubkey" + } + ] + } + }, + { + name: "envelopeChunks", + type: { + kind: "struct", + fields: [ + { + name: "bump", + type: "u8" + }, + { + name: "epochIndex", + type: "u32" + }, + { + name: "operator", + type: "pubkey" + }, + { + name: "totalChunks", + type: "u16" + }, + { + name: "totalBytes", + type: "u32" + }, + { + name: "receivedChunks", + type: "u16" + }, + { + name: "data", + type: "bytes" + } + ] + } + }, + { + name: "envelopeLog", + type: { + kind: "struct", + fields: [ + { + name: "envelopes", + type: { + vec: { + defined: { + name: "envelopeRecord" + } + } + } + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "envelopeRecord", + type: { + kind: "struct", + fields: [ + { + name: "epochIndex", + type: "u32" + }, + { + name: "emittedAt", + type: "u64" + }, + { + name: "checksum", + type: { + array: ["u8", 32] + } + } + ] + } + }, + { + name: "epochDeliveries", + type: { + kind: "struct", + fields: [ + { + name: "epochIndex", + type: "u32" + }, + { + name: "deliveries", + type: { + vec: { + defined: { + name: "operatorDelivery" + } + } + } + }, + { + name: "consensusReached", + type: "bool" + }, + { + name: "consensusHash", + type: { + array: ["u8", 32] + } + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "epochResolved", + type: { + kind: "struct", + fields: [ + { + name: "validator", + type: "pubkey" + }, + { + name: "epoch", + type: "u64" + }, + { + name: "totalStakeAmount", + type: "u64" + }, + { + name: "maxIndex", + type: "u32" + } + ] + } + }, + { + name: "failedSwapRemit", + type: { + kind: "struct", + fields: [ + { + name: "originalSwapRemitId", + type: { + array: ["u8", 32] + } + }, + { + name: "recipientAddress", + type: { + array: ["u8", 32] + } + }, + { + name: "tokenCode", + type: "u64" + }, + { + name: "amount", + type: "u64" + }, + { + name: "timestamp", + type: "i64" + }, + { + name: "reasonLen", + type: "u8" + }, + { + name: "reason", + type: { + array: ["u8", 32] + } + } + ] + } + }, + { + name: "global", + docs: [ + "Global operator state. Epoch-based model: receipts are serviceable", + "when `epoch <= serviceable_epoch` as reported by an external runtime." + ], + type: { + kind: "struct", + fields: [ + { + name: "bump", + type: "u8" + }, + { + name: "authority", + docs: [ + "DEPRECATED: Originally intended as authority for serviceable_epoch updates,", + "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.", + "Retained to preserve account layout." + ], + type: "pubkey" + }, + { + name: "liqsolMint", + docs: ["Token-2022 liqSOL mint burned on withdraw."], + type: "pubkey" + }, + { + name: "serviceableEpoch", + docs: ["Highest epoch that is currently claimable."], + type: "u64" + }, + { + name: "totalEncumberedFunds", + docs: [ + "Total SOL encumbered for pending withdrawal requests.", + "This amount is reserved from the reserve pool and will be paid out when receipts are claimed." + ], + type: "u64" + }, + { + name: "nextReceiptId", + docs: ["Monotonic counter for generating unique receipt IDs"], + type: "u64" + } + ] + } + }, + { + name: "globalConfig", + docs: ["Zero-copy global config PDA"], + serialization: "bytemuckunsafe", + repr: { + kind: "c" + }, + type: { + kind: "struct", + fields: [ + { + name: "bump", + type: "u8" + }, + { + name: "padding", + type: { + array: ["u8", 7] + } + }, + { + name: "admin", + type: "pubkey" + }, + { + name: "cranky", + type: "pubkey" + }, + { + name: "reservedPubkey", + type: { + array: ["pubkey", 1] + } + }, + { + name: "minUserDeposit", + docs: ["Minimum SOL amount a user can deposit"], + type: "u64" + }, + { + name: "minUnstakeRequest", + docs: ["Minimum SOL amount for an unstake/withdrawal request"], + type: "u64" + }, + { + name: "minRebalanceStakeDelta", + docs: ["Minimum stake delta to trigger a stake rebalance order"], + type: "u64" + }, + { + name: "minRebalanceUnstakeDelta", + docs: [ + "Minimum unstake delta to trigger an unstake rebalance order" + ], + type: "u64" + }, + { + name: "transientThreshold", + docs: [ + "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.", + "Rebalance now counts all transient stake on both sides of the delta equation,", + "so the per-validator threshold gate was removed." + ], + type: "u64" + }, + { + name: "minLateEpochSlotGate", + docs: [ + "Minimum slots that must have elapsed in the epoch before late epoch operations can execute" + ], + type: "u64" + }, + { + name: "reservedU64", + type: { + array: ["u64", 2] + } + }, + { + name: "cooldownEpochs", + docs: [ + "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change" + ], + type: "u16" + }, + { + name: "depositFeeMultiplier", + docs: [ + 'Multiplier for deposit fee calculation, this would be average "pay rate x number of epochs we expect the stake to warm up"' + ], + type: "u16" + }, + { + name: "minVppEntry", + docs: [ + "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small" + ], + type: "u16" + }, + { + name: "minVppExit", + docs: [ + "VPP score threshold below which a validator is removed from active set, again a fall back" + ], + type: "u16" + }, + { + name: "tinyNetworkThreshold", + docs: [ + 'Max validators for "tiny" network band (uses fixed VPP thresholds) as above' + ], + type: "u16" + }, + { + name: "smallNetworkThreshold", + docs: [ + 'Max validators for "small" network band (uses percentile-based selection)' + ], + type: "u16" + }, + { + name: "mediumNetworkThreshold", + docs: [ + 'Max validators for "medium" network band (uses percentile-based selection)' + ], + type: "u16" + }, + { + name: "largeNetworkEntryRank", + docs: [ + "Fixed rank threshold to enter active set in large networks (0-indexed)" + ], + type: "u16" + }, + { + name: "largeNetworkExitRank", + docs: [ + "Fixed rank threshold to exit active set in large networks (0-indexed)" + ], + type: "u16" + }, + { + name: "reservedU16", + type: { + array: ["u16", 3] + } + }, + { + name: "smallNetworkEntryPercent", + docs: [ + "Percentile rank required to enter active set in small networks" + ], + type: "u8" + }, + { + name: "smallNetworkExitPercent", + docs: [ + "Percentile rank below which validators exit in small networks" + ], + type: "u8" + }, + { + name: "mediumNetworkEntryPercent", + docs: [ + "Percentile rank required to enter active set in medium networks" + ], + type: "u8" + }, + { + name: "mediumNetworkExitPercent", + docs: [ + "Percentile rank below which validators exit in medium networks" + ], + type: "u8" + }, + { + name: "reservedU8", + type: { + array: ["u8", 2] + } + }, + { + name: "featureFlags", + docs: [ + "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,", + "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,", + "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved" + ], + type: "u16" + }, + { + name: "reservedFlags", + type: { + array: ["u16", 1] + } + }, + { + name: "reservedTrailing", + type: { + array: ["u8", 32] + } + } + ] + } + }, + { + name: "globalState", + type: { + kind: "struct", + fields: [ + { + name: "deployedAt", + docs: [ + "Legacy refund timer fields retained to preserve account layout.", + "Refund activation is controlled exclusively through `wire_state`." + ], + type: "i64" + }, + { + name: "refundDelaySeconds", + type: "i64" + }, + { + name: "paused", + docs: [ + "Global pause flag - when true, all operations except refunds are disabled" + ], + type: "bool" + }, + { + name: "totalStakedLiqsol", + docs: [ + "Aggregate liqSOL staked through pretokens (maps to distribution tracked balance)" + ], + type: "u64" + }, + { + name: "totalPurchasedLiqsol", + docs: [ + "Aggregate liqSOL pretoken purchases (part of distribution tracked balance)" + ], + type: "u64" + }, + { + name: "totalShares", + docs: [ + "Total shares issued to all users (for share/index yield isolation)" + ], + type: "u64" + }, + { + name: "protocolShares", + docs: [ + "Total shares issued to protocol (for share/index yield isolation)" + ], + type: "u64" + }, + { + name: "currentIndex", + docs: [ + "Current share-to-token exchange rate (scaled by INDEX_SCALE = 1e12)", + "Starts at INDEX_SCALE (1.0) and grows as yield accrues" + ], + type: "u64" + }, + { + name: "expectedPoolBalance", + docs: [ + "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).", + "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield." + ], + type: "u64" + }, + { + name: "yieldAccumulatedLiqsol", + docs: [ + "Accumulated liqSOL yield available for protocol pretoken purchases" + ], + type: "u64" + }, + { + name: "rolePrincipals", + docs: [ + "Required principal (liqSOL) per role [YieldOp, BatchOp, Underwriter, PoolOp]" + ], + type: { + array: ["u64", 4] + } + }, + { + name: "roleWarmupDuration", + docs: [ + "Warmup duration in seconds (applies when ANY new role is bonded)" + ], + type: "i64" + }, + { + name: "wireState", + type: { + defined: { + name: "wireState" + } + } + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "graveyardDeactivationQueuedEvent", + docs: [ + "Event emitted when a graveyard validator's main stake deactivation is queued" + ], + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + type: "pubkey" + }, + { + name: "amountToUnstake", + type: "u64" + } + ] + } + }, + { + name: "graveyardValidatorCleanedEvent", + docs: ["Event emitted when a graveyard validator is cleaned up"], + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + type: "pubkey" + }, + { + name: "epochsSinceStateChange", + type: "u16" + } + ] + } + }, + { + name: "latestOutboundEnvelope", + type: { + kind: "struct", + fields: [ + { + name: "epochIndex", + type: "u32" + }, + { + name: "checksum", + type: { + array: ["u8", 32] + } + }, + { + name: "data", + type: "bytes" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "leaderboardState", + docs: [ + "Central leaderboard state using parallel arrays for efficient ranking and CPI access", + "Stores VPP scores and sorted rankings for up to 1024 validators", + "Uses zero-copy for efficient access from other programs via CPI" + ], + serialization: "bytemuck", + repr: { + kind: "c" + }, + type: { + kind: "struct", + fields: [ + { + name: "scores", + docs: [ + "VPP scores indexed by registry_index (0-100 range)", + "registry_index is assigned on first validator registration and never changes" + ], + type: { + array: ["u8", 1024] + } + }, + { + name: "sortedIndices", + docs: [ + "Validator indices sorted by VPP score descending", + "sorted_indices[0] = registry_index of highest VPP validator", + "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc." + ], + type: { + array: ["u16", 1024] + } + }, + { + name: "voteAccounts", + docs: [ + "Vote account pubkeys indexed by registry_index", + "Allows CPI callers to get vote accounts for top N validators" + ], + type: { + array: [ + { + defined: { + name: "pubkeyBytes" + } + }, + 1024 + ] + } + }, + { + name: "numValidators", + docs: ["Number of active validators currently in the leaderboard"], + type: "u16" + }, + { + name: "bump", + docs: ["PDA bump seed"], + type: "u8" + }, + { + name: "align", + docs: ["Alignment byte (keeps u16 fields below properly aligned)"], + type: "u8" + }, + { + name: "crankNextIndex", + docs: [ + "Next validator index to process during crank_update_scores" + ], + type: "u16" + }, + { + name: "lastCrankEpoch", + docs: [ + "Last epoch when crank_update_scores completed all validators" + ], + type: "u16" + }, + { + name: "crankStartedEpoch", + docs: [ + "Epoch when start_crank was called (signals an active crank cycle)" + ], + type: "u16" + } + ] + } + }, + { + name: "liqReceiptData", + type: { + kind: "struct", + fields: [ + { + name: "receiptId", + type: "u64" + }, + { + name: "liqports", + type: "u64" + }, + { + name: "epoch", + type: "u64" + }, + { + name: "fulfilled", + type: "bool" + } + ] + } + }, + { + name: "maintenanceLedger", + type: { + kind: "struct", + fields: [ + { + name: "lastSyncEpoch", + type: "u16" + }, + { + name: "lastValidatorScoreSyncEpoch", + type: "u16" + }, + { + name: "lastLeaderboardScoresSyncEpoch", + type: "u16" + }, + { + name: "lastActiveInfosSyncedEpoch", + docs: [ + "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout." + ], + type: "u16" + }, + { + name: "lastUpdatedStakeMetricsEpoch", + type: "u64" + }, + { + name: "lastDistributionEpoch", + type: { + option: "u64" + } + }, + { + name: "lastDistributionSlot", + docs: [ + "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout." + ], + type: { + option: "u64" + } + }, + { + name: "lastMergeDeactivatingTransientsEpoch", + type: "u64" + }, + { + name: "lastRebalanceAllocationEpoch", + type: "u64" + }, + { + name: "lastMergeActivatingTransientsEpoch", + type: "u64" + }, + { + name: "lastUnstakeEpoch", + type: { + option: "u64" + } + }, + { + name: "lastUnstakeAllocationEpoch", + type: "u64" + }, + { + name: "minMaxResolvedEpochDeactivations", + type: "u16" + }, + { + name: "lastThresholdSyncEpoch", + type: "u16" + }, + { + name: "lastValidatorRemovalSelectionEpoch", + type: "u16" + }, + { + name: "lastValidatorAdditionSelectionEpoch", + type: "u16" + }, + { + name: "lastValidatorPdaSetupEpoch", + type: "u16" + }, + { + name: "lastGraveyardProcessingEpoch", + type: "u16" + }, + { + name: "lastPostSyncStakeMetricsRefreshEpoch", + type: "u16" + }, + { + name: "lastGraveyardCleanupEpoch", + type: "u16" + }, + { + name: "lastPostLateEpochStakeMetricsRefreshEpoch", + type: "u16" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "metadataArgs", + type: { + kind: "struct", + fields: [ + { + name: "name", + type: "string" + }, + { + name: "symbol", + type: "string" + }, + { + name: "uri", + type: "string" + } + ] + } + }, + { + name: "operatorDelivery", + type: { + kind: "struct", + fields: [ + { + name: "operator", + type: "pubkey" + }, + { + name: "envelopeHash", + type: { + array: ["u8", 32] + } + } + ] + } + }, + { + name: "operatorGroup", + type: { + kind: "struct", + fields: [ + { + name: "members", + type: { + vec: "pubkey" + } + } + ] + } + }, + { + name: "operatorMapping", + type: { + kind: "struct", + fields: [ + { + name: "wireName", + type: "u64" + }, + { + name: "solAddress", + type: "pubkey" + }, + { + name: "role", + type: "u32" + }, + { + name: "status", + type: "u32" + }, + { + name: "slashedAt", + type: "i64" + }, + { + name: "terminatedAt", + type: "i64" + } + ] + } + }, + { + name: "operatorRegistry", + type: { + kind: "struct", + fields: [ + { + name: "activeGroupIndex", + type: "u32" + }, + { + name: "groups", + type: { + vec: { + defined: { + name: "operatorGroup" + } + } + } + }, + { + name: "operators", + type: { + vec: { + defined: { + name: "operatorMapping" + } + } + } + }, + { + name: "collateralByCode", + type: { + vec: { + defined: { + name: "collateralEntry" + } + } + } + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "outboundMessageBuffer", + type: { + kind: "struct", + fields: [ + { + name: "attestationCount", + type: "u16" + }, + { + name: "usedDataBytes", + type: "u32" + }, + { + name: "entries", + type: { + vec: { + defined: { + name: "attestationData" + } + } + } + }, + { + name: "nextSwapId", + type: "u64" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "outpostAccount", + type: { + kind: "struct", + fields: [ + { + name: "user", + type: "pubkey" + }, + { + name: "stakedLiqsol", + docs: [ + "STAKE deposits (withdrawable pre-D-Day)", + "Principal amount staked (for display/tracking)" + ], + type: "u64" + }, + { + name: "stakedShares", + docs: [ + "Shares from staking (actual accounting for yield isolation)" + ], + type: "u64" + }, + { + name: "purchasedLiqsol", + docs: [ + "WARRANT_PURCHASE deposits with liqSOL (permanent)", + "Principal amount spent on pretokens (for display/tracking)" + ], + type: "u64" + }, + { + name: "purchasedShares", + docs: [ + "Shares from liqSOL pretoken purchases (actual accounting for yield isolation)" + ], + type: "u64" + }, + { + name: "bondedPrincipals", + docs: ["LiqSOL locked by bonds per role"], + type: { + array: ["u64", 4] + } + }, + { + name: "bondedRoles", + docs: [ + "Bitmap of bonded roles (bits 0-3 for YieldOp, BatchOp, Underwriter, PoolOp)" + ], + type: "u8" + }, + { + name: "unbondRequested", + docs: ["Bitmap of roles with pending unbond requests (bits 0-3)"], + type: "u8" + }, + { + name: "warmupEndsAt", + docs: [ + "Warmup end timestamp - has_role returns false until this time" + ], + type: "i64" + }, + { + name: "bump", + type: "u8" + }, + { + name: "accumulatedPretokenYield", + type: { + option: "u64" + } + }, + { + name: "lastEpochSyndLiqsol", + type: { + option: "u64" + } + }, + { + name: "lastSyndEpoch", + type: { + option: "u64" + } + } + ] + } + }, + { + name: "outpostConfig", + type: { + kind: "struct", + fields: [ + { + name: "authority", + type: "pubkey" + }, + { + name: "chainCode", + type: "u64" + }, + { + name: "nextEpochIndex", + type: "u32" + }, + { + name: "previousEpochHash", + type: { + array: ["u8", 32] + } + }, + { + name: "previousOutboundEpochHash", + docs: [ + "Chain tip for the OUTBOUND (outpost → depot) stream: the canonical", + "epoch digest (`keccak256(encoded envelope)`, `envelope_hash` empty) of", + "this outpost's own previous emit. Stamped into each outbound", + "envelope's `previous_envelope_hash` and advanced after every emit —", + "SEC-114 per-stream chaining; the depot's inbound verification drops a", + "cross-stream link (the inbound tip `previous_epoch_hash`) as a chain", + "break. All-zero = genesis (no emit on this stream yet)." + ], + type: { + array: ["u8", 32] + } + }, + { + name: "epochDurationSec", + type: "u32" + }, + { + name: "currentEpochStartedAt", + type: "i64" + }, + { + name: "registryInitialized", + type: "bool" + }, + { + name: "lastMessageId", + type: { + array: ["u8", 32] + } + }, + { + name: "lastMessageTimestamp", + type: "u64" + }, + { + name: "envelopeRetentionEpochs", + type: "u32" + }, + { + name: "tokenAddressesByCode", + type: { + vec: { + defined: { + name: "tokenAddressEntry" + } + } + } + }, + { + name: "precisionByTokenCode", + type: { + vec: { + defined: { + name: "tokenPrecisionEntry" + } + } + } + }, + { + name: "configVersion", + type: "u8" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "payRateEntry", + type: { + kind: "struct", + fields: [ + { + name: "timestamp", + type: "i64" + }, + { + name: "scaledRate", + type: "u64" + } + ] + } + }, + { + name: "payRateHistory", + type: { + kind: "struct", + fields: [ + { + name: "currentIndex", + type: "u16" + }, + { + name: "totalEntriesAdded", + type: "u64" + }, + { + name: "entries", + type: { + vec: { + defined: { + name: "payRateEntry" + } + } + } + }, + { + name: "maxEntries", + type: "u16" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "payoutState", + type: { + kind: "struct", + fields: [ + { + name: "totalYieldPaidOutEpoch", + type: "u64" + }, + { + name: "feesRemainingToDistribute", + type: "u64" + }, + { + name: "totalFeesDeposited", + type: "u64" + }, + { + name: "totalCumulativePayoutAlltime", + type: "u128" + }, + { + name: "totalCumulativePayoutEpoch", + type: "u64" + }, + { + name: "timestamp", + type: "i64" + }, + { + name: "epoch", + type: "u16" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "pretokenPurchaseHistory", + serialization: "bytemuck", + repr: { + kind: "c" + }, + type: { + kind: "struct", + fields: [ + { + name: "startingEpoch", + type: "u64" + }, + { + name: "latestEpoch", + type: "u64" + }, + { + name: "purchasedPerEpoch", + type: { + array: ["u64", 100] + } + }, + { + name: "syndPerEpoch", + type: { + array: ["u64", 100] + } + }, + { + name: "bump", + type: "u8" + }, + { + name: "padding", + type: { + array: ["u8", 7] + } + } + ] + } + }, + { + name: "pretokenPurchased", + type: { + kind: "struct", + fields: [ + { + name: "user", + type: "pubkey" + }, + { + name: "trancheNumber", + type: "u64" + }, + { + name: "pretokensPurchased", + type: "u64" + } + ] + } + }, + { + name: "priceHistory", + docs: [ + "Price history for windowed moving average calculations", + "All prices stored in 8-decimal precision" + ], + type: { + kind: "struct", + fields: [ + { + name: "windowSize", + docs: ["Number of prices to keep in the moving average window"], + type: "u8" + }, + { + name: "prices", + docs: ["Circular buffer of recent prices (fixed size, 8-dec each)"], + type: { + array: ["u64", 10] + } + }, + { + name: "count", + docs: ["Number of valid entries in the prices array (0-10)"], + type: "u8" + }, + { + name: "nextIndex", + type: "u8" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "pubkeyBytes", + docs: [ + "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.", + "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`." + ], + serialization: "bytemuck", + repr: { + kind: "transparent" + }, + type: { + kind: "struct", + fields: [ + { + name: "bytes", + type: { + array: ["u8", 32] + } + } + ] + } + }, + { + name: "reserve", + type: { + kind: "struct", + fields: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "reserveCode", + type: "u64" + }, + { + name: "externalTokenAmount", + type: "u64" + }, + { + name: "requestedWireAmount", + type: "u64" + }, + { + name: "connectorWeightBps", + type: "u32" + }, + { + name: "status", + type: { + defined: { + name: "reserveStatus" + } + } + }, + { + name: "creator", + type: "pubkey" + }, + { + name: "custodyMint", + docs: [ + "Mint/native mode pinned at reserve creation. `NATIVE_TOKEN_MARKER`", + "means the reserve custodies lamports; any other pubkey is the SPL mint", + "held by the `reserve_vault`. Terminal handlers (SwapRemit, SwapRevert,", + "ReserveCreateCancelled) read this instead of the mutable", + "`OutpostConfig.token_addresses_by_code`, so an admin re-point of a", + "token_code between creation and dispatch cannot change how an", + "already-created reserve settles." + ], + type: "pubkey" + }, + { + name: "custodyDecimals", + docs: [ + "Chain-side decimals pinned at reserve creation. Native reserves use", + "`DEPOT_PRECISION_DECIMALS`; SPL reserves use the source mint's", + "`decimals` at creation time." + ], + type: "u8" + }, + { + name: "nameLen", + type: "u8" + }, + { + name: "nameBytes", + type: { + array: ["u8", 64] + } + }, + { + name: "descriptionLen", + type: "u16" + }, + { + name: "descriptionBytes", + type: { + array: ["u8", 256] + } + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "reserveAggregate", + type: { + kind: "struct", + fields: [ + { + name: "failedRemits", + type: { + array: [ + { + defined: { + name: "failedSwapRemit" + } + }, + 8 + ] + } + }, + { + name: "failedRemitsHead", + type: "u8" + }, + { + name: "failedRemitsTotal", + type: "u64" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "reserveStatus", + docs: [ + "Local Borsh enum (NOT the proto enum): tags Pending=0, Active=1, Cancelled=2." + ], + type: { + kind: "enum", + variants: [ + { + name: "pending" + }, + { + name: "active" + }, + { + name: "cancelled" + } + ] + } + }, + { + name: "role", + repr: { + kind: "rust" + }, + type: { + kind: "enum", + variants: [ + { + name: "yieldOperator" + }, + { + name: "batchOperator" + }, + { + name: "underwriter" + }, + { + name: "poolOperator" + } + ] + } + }, + { + name: "stakeAllocationState", + docs: [ + "Stake allocation state tracking for validator stake distribution and unstake orders", + "Tracks both staking allocations (VPP-based) and unstake order batching", + "", + "Rule of thumb for what lives here vs BatchOrchestrator: this account holds", + "CONSERVED-VALUE cycles (frozen amounts, distributed totals, snapshots) - you", + "can never blanket-zero these, a stale cycle gets aborted/recovered instead", + "(see start_unstake_allocation's remainder recovery and abort_rebalance).", + "That's also why the *_started_epoch pins live here and not on BO: the pin is", + "part of its cycle record and must be stamped/cleared atomically with it by", + "the cycle's own start/abort methods, so pin and cycle can't desync. Pure", + "resume cursors with no value attached belong on BatchOrchestrator, where the", + "epoch sweep can wipe them for free.", + "", + "The in_progress bools here are deliberately explicit, NOT inferred like BO", + "does with its cursors. Inference needs a signal whose zero is out-of-band,", + "and every candidate here has a meaningful zero: epoch 0 is real (localnet),", + "an unstake-only rebalance legitimately distributes 0, and the processed", + "counter being nonzero-while-open is an accident of call sites, not a", + "guarantee. Plus these cycles have a state BO ops don't: open-but-stale with", + "recoverable frozen value - stale here means recover, not wipe, so it must", + "stay distinguishable from idle." + ], + type: { + kind: "struct", + fields: [ + { + name: "totalActiveVpp", + docs: [ + "Sum of all VPP scores (0-100 each) for Trusted validators in the active list.", + "Max with 200 validators at 100 each = 20,000, fits in u32.", + "", + "Authoritatively recomputed by `conclude_addition_selection` from the active", + "list's `vpp` fields at the end of every addition-selection cycle, so any", + "intra-cycle drift from removals/score updates is wiped before allocation", + "uses this as a denominator. Do not maintain incrementally." + ], + type: "u32" + }, + { + name: "bump", + docs: ["Bump seed for PDA"], + type: "u8" + }, + { + name: "initialReserveBalance", + docs: [ + "Initial reserve balance when distribution cycle started (for batched distribution)" + ], + type: "u64" + }, + { + name: "pendingUnstakeAmountThisEpoch", + docs: [ + "Accumulates unstake requests during the epoch (before allocation starts)", + "Resets to 0 when allocation cycle begins" + ], + type: "u64" + }, + { + name: "unstakeAllocationInProgress", + docs: [ + "Whether unstake allocation is currently in progress (batched processing)" + ], + type: "bool" + }, + { + name: "validatorsProcessedThisUnstakeAllocation", + docs: [ + "Number of validators processed in the current unstake allocation batch" + ], + type: "u16" + }, + { + name: "processingUnstakeAmountThisAllocation", + docs: [ + "FROZEN amount being allocated across all batches this cycle", + "Set at start of allocation, prevents race conditions with new requests" + ], + type: "u64" + }, + { + name: "amountDistributedThisUnstakeAllocation", + docs: [ + "Tracks cumulative amount distributed across all batches in current unstake allocation cycle" + ], + type: "u64" + }, + { + name: "rebalanceInProgress", + docs: [ + "Whether rebalancing is currently in progress (batched processing)" + ], + type: "bool" + }, + { + name: "validatorsProcessedThisRebalance", + docs: [ + "Number of validators processed in the current rebalance cycle" + ], + type: "u16" + }, + { + name: "totalAmountToDistributeThisRebalance", + docs: [ + "Total amount to distribute for this rebalance cycle (after subtracting encumbered funds and buffer)", + "Saved at the start to ensure consistency across all batches" + ], + type: "u64" + }, + { + name: "cumulativeStakeRequestedThisRebalance", + docs: [ + "Tracks cumulative stake requested (sum of positive deltas) across all batches in current rebalance cycle" + ], + type: "u64" + }, + { + name: "rebalanceStakeScaleFactor", + docs: [ + "Scale factor to apply during process_stake_orders (uses PAY_RATE_SCALE_FACTOR precision)", + "Set to PAY_RATE_SCALE_FACTOR (1.0) if no scaling needed, or lower if cumulative > available" + ], + type: "u64" + }, + { + name: "isSmallDistributionMode", + docs: [ + "Whether we're in small distribution mode (not enough for VPP-based distribution)", + "In this mode, we distribute evenly to first N validators instead of using VPP ratios" + ], + type: "bool" + }, + { + name: "validatorsToFundThisRebalance", + docs: [ + "Number of validators to fund in small distribution mode", + "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)" + ], + type: "u16" + }, + { + name: "amountPerValidatorThisRebalance", + docs: [ + "Amount each validator gets in small distribution mode", + "Calculated as total_to_distribute / validators_to_fund" + ], + type: "u64" + }, + { + name: "selectionEntryThresholdVpp", + docs: [ + "Entry threshold VPP from leaderboard (validators must meet this to be added, 0-100)" + ], + type: "u8" + }, + { + name: "selectionExitThresholdVpp", + docs: [ + "Exit threshold VPP from leaderboard (validators below this are removed, 0-100)" + ], + type: "u8" + }, + { + name: "additionInProgress", + docs: ["DEPRECATED — see BatchOrchestrator. Always false."], + type: "bool" + }, + { + name: "unstakeAllocationStartedEpoch", + docs: [ + "Epoch in which the current unstake allocation cycle was started.", + "Used to detect stale cycles that span epoch boundaries — if the epoch", + "has advanced, the cycle is reset and restarted to avoid resuming", + "against a mutated validator active list.", + "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)" + ], + type: "u16" + }, + { + name: "rebalanceStartedEpoch", + docs: [ + "Epoch in which the current rebalance cycle was started. Same job as", + "unstake_allocation_started_epoch above — a cycle whose epoch no longer", + "matches is stale (active list may have been reshuffled by selection)", + "and gets aborted + restarted instead of resumed.", + "(Repurposed from the deprecated addition_target_rank field — always 0 on mainnet.)" + ], + type: "u16" + }, + { + name: "validatorsAddedThisSelection", + docs: ["DEPRECATED — see BatchOrchestrator. Always 0."], + type: "u16" + }, + { + name: "removalInProgress", + docs: ["DEPRECATED — see BatchOrchestrator. Always false."], + type: "bool" + }, + { + name: "removalNextIndex", + docs: [ + "DEPRECATED — see BatchOrchestrator.removal_next_index. Always 0." + ], + type: "u16" + }, + { + name: "removalActiveListSnapshot", + docs: ["DEPRECATED — see BatchOrchestrator. Always 0."], + type: "u16" + }, + { + name: "validatorsRemovedThisSelection", + docs: ["DEPRECATED — see BatchOrchestrator. Always 0."], + type: "u16" + } + ] + } + }, + { + name: "stakeControllerState", + type: { + kind: "struct", + fields: [ + { + name: "authority", + type: "pubkey" + }, + { + name: "vaultInitialized", + type: "bool" + }, + { + name: "reservePoolInitialized", + type: "bool" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "stakeMetrics", + type: { + kind: "struct", + fields: [ + { + name: "currentActiveStake", + type: "u64" + }, + { + name: "transientActiveStake", + type: "u64" + }, + { + name: "actualSystemYieldReceived", + type: "u64" + }, + { + name: "solSystemPayRate", + type: "u64" + }, + { + name: "unstakeableStake", + type: "u64" + }, + { + name: "bump", + type: "u8" + }, + { + name: "mevReward", + docs: [ + "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)" + ], + type: "u64" + }, + { + name: "totalOutstandingAmountToUnstake", + docs: [ + "WNS-16: total amount_to_unstake across all validators at last metrics refresh.", + "Represents allocated-but-not-yet-deactivated unstake obligations.", + "Subtracted from unstakeable_stake in admission control to prevent double-promising." + ], + type: "u64" + }, + { + name: "reserved", + docs: ["Reserved space for future use"], + type: { + array: ["u8", 24] + } + } + ] + } + }, + { + name: "stakesMerged", + type: { + kind: "struct", + fields: [ + { + name: "validator", + type: "pubkey" + }, + { + name: "epoch", + type: "u64" + }, + { + name: "count", + type: "u32" + }, + { + name: "amount", + type: "u64" + } + ] + } + }, + { + name: "tokenAddressEntry", + type: { + kind: "struct", + fields: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "mint", + type: "pubkey" + } + ] + } + }, + { + name: "tokenMetadata", + type: { + kind: "struct", + fields: [ + { + name: "name", + type: "string" + }, + { + name: "symbol", + type: "string" + }, + { + name: "uri", + type: "string" + } + ] + } + }, + { + name: "tokenPrecisionEntry", + type: { + kind: "struct", + fields: [ + { + name: "tokenCode", + type: "u64" + }, + { + name: "decimals", + type: "u8" + } + ] + } + }, + { + name: "trancheState", + docs: [ + "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)", + "Example: $193.32 is stored as 19332000000" + ], + type: { + kind: "struct", + fields: [ + { + name: "currentTrancheNumber", + type: "u64" + }, + { + name: "currentTrancheSupply", + type: "u64" + }, + { + name: "currentTranchePriceUsd", + type: "u64" + }, + { + name: "totalPretokensSold", + type: "u64" + }, + { + name: "initialTrancheSupply", + type: "u64" + }, + { + name: "supplyGrowthBps", + docs: ["Supply growth in basis points (e.g., 100 = 1%, max 10000)"], + type: "u16" + }, + { + name: "priceGrowthCents", + docs: ["Price growth in cents per tranche (0.01 USD units)"], + type: "u16" + }, + { + name: "minPriceUsd", + docs: ["Minimum valid SOL/USD price for validation (8-dec)"], + type: "u64" + }, + { + name: "maxPriceUsd", + docs: ["Maximum valid SOL/USD price for validation (8-dec)"], + type: "u64" + }, + { + name: "maxStalenessSeconds", + docs: ["Maximum staleness in seconds for Chainlink data"], + type: "i64" + }, + { + name: "chainlinkProgram", + docs: ["Chainlink program address"], + type: "pubkey" + }, + { + name: "chainlinkFeed", + docs: ["Chainlink price feed PDA"], + type: "pubkey" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "userPretokenRecord", + type: { + kind: "struct", + fields: [ + { + name: "user", + type: "pubkey" + }, + { + name: "totalSolDeposited", + type: "u64" + }, + { + name: "totalPretokensPurchased", + type: "u64" + }, + { + name: "lastTrancheNumber", + type: "u64" + }, + { + name: "lastTranchePriceUsd", + type: "u64" + }, + { + name: "bump", + type: "u8" + } + ] + } + }, + { + name: "userRecord", + type: { + kind: "struct", + fields: [ + { + name: "shares", + docs: [ + "User's share of the distribution pool", + "entitled_balance = shares * current_index / INDEX_SCALE" + ], + type: "u64" + }, + { + name: "bump", + type: "u8" + }, + { + name: "trackedBalance", + docs: ["Last reconciled liqSOL token balance for this user ATA"], + type: "u64" + } + ] + } + }, + { + name: "validatorAddedEvent", + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + type: "pubkey" + }, + { + name: "vpp", + type: "u8" + } + ] + } + }, + { + name: "validatorInfoAccount", + docs: [ + "Per-validator information account", + 'Seed: ["validator_info", vote_account]' + ], + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + docs: ["Vote account this info belongs to"], + type: "pubkey" + }, + { + name: "vpp", + docs: ["Validator Performance Points (0-100 score)"], + type: "u8" + }, + { + name: "bump", + docs: ["Bump seed for PDA"], + type: "u8" + }, + { + name: "currentActiveStake", + docs: ["Fully active stake earning rewards"], + type: "u64" + }, + { + name: "epochReward", + docs: [ + "Rewards earned in the last epoch", + "This is update in the function: sync_validator_stakes_v2 and is a simple subtraction of current - previous active stake. This does cater for deactivations etc. so", + "no worries" + ], + type: "u64" + }, + { + name: "transientActiveStake", + docs: ["Stake warming up (activating), not fully active yet"], + type: "u64" + }, + { + name: "transientDeactivatingStake", + docs: [ + "Stake cooling down (deactivating), no longer earning rewards" + ], + type: "u64" + }, + { + name: "lastChainSyncEpoch", + docs: [ + "When was this entry last updated from the chain?", + "This is update in the function: sync_validator_stakes_v2" + ], + type: "u16" + }, + { + name: "lastScoreSyncEpoch", + docs: [ + "When was this VPP score last updated from our Validator Leaderboard program?" + ], + type: "u16" + }, + { + name: "lastStateChangeEpoch", + docs: [ + "When was the validator state last changed? (helps determine cooldowns)" + ], + type: "u16" + }, + { + name: "amountToStake", + docs: ["The amount of stake to stake"], + type: "u64" + }, + { + name: "amountToUnstake", + docs: ["The amount of stake to unstake"], + type: "u64" + }, + { + name: "validatorRepute", + docs: ["State of the validator"], + type: { + defined: { + name: "validatorReputation" + } + } + }, + { + name: "validatorState", + type: { + defined: { + name: "validatorState" + } + } + }, + { + name: "stateTransitionTriggerStakeAmount", + type: "u64" + }, + { + name: "mevEarned", + docs: ["MEV reward swept for this validator in the current epoch"], + type: "u64" + }, + { + name: "rebalanceUnstakePending", + docs: [ + "The share of amount_to_unstake that came from rebalance this epoch.", + "amount_to_unstake mixes two things with different rules: user-withdrawal", + "shares are DEBT (back receipts, never resettable) while the rebalance", + "share is INTENT (recomputed from target-vs-effective every cycle,", + "replaceable). This field makes the intent part separable so a new", + "rebalance cycle can drop a dead cycle's contribution instead of adding", + "on top of it, without ever touching user debt.", + "(Carved from _reserved - those bytes are structurally zero: introduced", + "via realloc(len, true) in migrate_validator_info_batch and zeroed by", + 'initialize() on fresh PDAs, never written since. Zero = "all existing', + "amount_to_unstake is debt\", which is exactly today's safe behavior.)" + ], + type: "u64" + }, + { + name: "rebalanceUnstakeEpoch", + docs: [ + "Epoch the rebalance component was stamped. A mismatch with the current", + "epoch means the component is a dead cycle's intent - subtract and re-add." + ], + type: "u16" + }, + { + name: "reserved", + docs: ["Reserved space for future use"], + type: { + array: ["u8", 14] + } + } + ] + } + }, + { + name: "validatorList", + docs: [ + "Zero-copy validator list account", + "Stores a fixed-capacity array of validator vote account pubkeys" + ], + serialization: "bytemuckunsafe", + repr: { + kind: "c" + }, + type: { + kind: "struct", + fields: [ + { + name: "count", + docs: ["Current number of validators in the list"], + type: "u32" + }, + { + name: "capacity", + docs: ["Maximum capacity of the list"], + type: "u32" + }, + { + name: "bump", + docs: ["PDA bump seed"], + type: "u8" + }, + { + name: "padding", + docs: ["Padding for alignment"], + type: { + array: ["u8", 7] + } + }, + { + name: "validators", + docs: [ + "Fixed array of validator vote account pubkeys", + "Using Option to allow for empty slots (None = empty)" + ], + type: { + array: [ + { + defined: { + name: "validatorListEntry" + } + }, + 200 + ] + } + } + ] + } + }, + { + name: "validatorListEntry", + serialization: "bytemuckunsafe", + repr: { + kind: "c" + }, + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + docs: ["Vote account pubkey (all zeros = empty slot)"], + type: "pubkey" + }, + { + name: "registryIndex", + docs: [ + "Immutable index into the validator leaderboard arrays (u16::MAX = unknown)" + ], + type: "u16" + }, + { + name: "pdasInitialized", + docs: [ + "Whether per-validator PDAs (info/transient) are initialized" + ], + type: "bool" + }, + { + name: "vpp", + docs: [ + "Cached VPP score (0-100) refreshed at the start of a maintenance run" + ], + type: "u8" + }, + { + name: "pad", + docs: [ + "Padding to keep 8-byte alignment (32 + 2 + 1 + 1 + 4 = 40 bytes)" + ], + type: { + array: ["u8", 4] + } + } + ] + } + }, + { + name: "validatorRemovedEvent", + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + type: "pubkey" + }, + { + name: "vpp", + type: "u8" + } + ] + } + }, + { + name: "validatorReputation", + type: { + kind: "enum", + variants: [ + { + name: "trusted" + }, + { + name: "blacklisted" + }, + { + name: "underPerforming" + } + ] + } + }, + { + name: "validatorState", + type: { + kind: "enum", + variants: [ + { + name: "warming" + }, + { + name: "notDelegated" + }, + { + name: "cooling" + }, + { + name: "warm" + }, + { + name: "readyToCool" + } + ] + } + }, + { + name: "validatorSwappedEvent", + type: { + kind: "struct", + fields: [ + { + name: "removedVote", + type: "pubkey" + }, + { + name: "removedVpp", + type: "u8" + }, + { + name: "addedVote", + type: "pubkey" + }, + { + name: "addedVpp", + type: "u8" + } + ] + } + }, + { + name: "validatorTransientAccount", + docs: [ + "Per-validator transient stake tracking account", + 'Seed: ["validator_transient", vote_account]', + "", + "This account tracks the resolution status of transient stake accounts", + "(both activating and deactivating) for a specific validator." + ], + type: { + kind: "struct", + fields: [ + { + name: "voteAccount", + docs: ["Vote account this transient tracking belongs to"], + type: "pubkey" + }, + { + name: "bump", + docs: ["Bump seed for PDA"], + type: "u8" + }, + { + name: "padding", + docs: ["Padding for alignment"], + type: { + array: ["u8", 7] + } + }, + { + name: "maxResolvedEpochDeactivations", + docs: [ + "The epoch number for which we have resolved the deactivating stakes", + "(resolved = deactivated and merged into the stake pool reserve)" + ], + type: "u16" + }, + { + name: "maxResolvedActivatingStake", + docs: [ + "The epoch number for which we have resolved the activating stakes", + "(resolved = fully activated and merged into the main stake account)" + ], + type: "u16" + }, + { + name: "lastUpdatedEpochActivations", + docs: [ + "When did we last check if there are pending activated transient stakes that need to be merged in" + ], + type: "u16" + }, + { + name: "lastUpdatedEpochDeactivations", + docs: [ + "When did we last check if there were pending deactivated stakes that need to be merged into the reserve pool" + ], + type: "u16" + } + ] + } + }, + { + name: "validatorsSyncedEvent", + type: { + kind: "struct", + fields: [ + { + name: "updatedCount", + type: "u32" + }, + { + name: "notFoundCount", + type: "u32" + }, + { + name: "epoch", + type: "u64" + } + ] + } + }, + { + name: "wireState", + type: { + kind: "enum", + variants: [ + { + name: "preLaunch" + }, + { + name: "postLaunch" + }, + { + name: "refund" + } + ] + } + }, + { + name: "withdrawClaimed", + type: { + kind: "struct", + fields: [ + { + name: "epoch", + type: "u64" + }, + { + name: "amount", + type: "u64" + }, + { + name: "user", + type: "pubkey" + } + ] + } + }, + { + name: "withdrawRequested", + type: { + kind: "struct", + fields: [ + { + name: "epoch", + type: "u64" + }, + { + name: "amount", + type: "u64" + }, + { + name: "user", + type: "pubkey" + }, + { + name: "receiptId", + type: "u64" + } + ] + } + } + ] +} as const + +/** Strict Anchor IDL type generated from the checked-in liqsol_core artifact. */ +export type LiqsolCore = Idl & typeof liqsolCoreIdlValue + +/** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ +export const liqsolCoreIdl = liqsolCoreIdlValue as LiqsolCore diff --git a/packages/sdk-outpost/src/programs/solana/generated/index.ts b/packages/sdk-outpost/src/programs/solana/generated/index.ts new file mode 100644 index 0000000..678debf --- /dev/null +++ b/packages/sdk-outpost/src/programs/solana/generated/index.ts @@ -0,0 +1 @@ +export * from "./LiqsolCore.js" diff --git a/packages/sdk-outpost/src/programs/solana/index.ts b/packages/sdk-outpost/src/programs/solana/index.ts new file mode 100644 index 0000000..0f12c57 --- /dev/null +++ b/packages/sdk-outpost/src/programs/solana/index.ts @@ -0,0 +1 @@ +export * from "./generated/index.js" diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts new file mode 100644 index 0000000..36ab082 --- /dev/null +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -0,0 +1,48 @@ +import Crypto from "node:crypto" +import Fs from "node:fs" +import Path from "node:path" + +import { + EthereumContractName, + OPP__factory, + Sim2Deployment, + SolanaProgramName, + liqsolCoreIdl +} from "@wireio/sdk-outpost" + +const PackagePath = Path.resolve(__dirname, "../.."), + EthereumAssetPath = Path.join(PackagePath, "src/assets/ethereum/sim2"), + SolanaAssetPath = Path.join(PackagePath, "src/assets/solana/sim2") + +function sha256(file: string): string { + return Crypto.createHash("sha256").update(Fs.readFileSync(file)).digest("hex") +} + +describe("sim2 assets", () => { + it("matches every recorded Ethereum ABI digest", () => { + Object.values(EthereumContractName).forEach(contractName => { + const deployment = Sim2Deployment.ethereum.contracts[contractName] + + expect(sha256(Path.join(EthereumAssetPath, `${contractName}.json`))).toBe( + deployment.artifactSha256 + ) + }) + }) + + it("matches the recorded Solana IDL and program identity", () => { + const deployment = + Sim2Deployment.solana.programs[SolanaProgramName.liqsolCore] + + expect(sha256(Path.join(SolanaAssetPath, "liqsol_core.json"))).toBe( + deployment.artifactSha256 + ) + expect(liqsolCoreIdl.address).toBe(deployment.address) + }) + + it("generates callable Ethereum factories from the runtime ABI", () => { + expect(OPP__factory.abi.length).toBeGreaterThan(0) + expect( + OPP__factory.createInterface().getFunction("addAttestation") + ).toBeDefined() + }) +}) diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index effe529..40d9763 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -23,7 +23,15 @@ function createDeploymentFixture() { sourceArchiveSha256: Hash, platformRelease: { tag: "v1.0.0", - url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0" + url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + manifest: { + repository: "Wire-Network/wire-platform-manifest", + revision: Revision + }, + libraries: { + repository: "Wire-Network/wire-libraries-ts", + revision: Revision + } }, sources: { wireTools: { @@ -84,4 +92,13 @@ describe("OutpostDeploymentSchema", () => { "Invalid Ethereum address" ) }) + + it("rejects an invalid Solana program address", () => { + const fixture = createDeploymentFixture() + fixture.solana.programs.liqsolCore.address = "not-a-program-address" + + expect(() => parseOutpostDeployment(fixture)).toThrow( + "Invalid Solana address" + ) + }) }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ba3413..f7f7a77 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -197,6 +197,12 @@ importers: '@coral-xyz/anchor': specifier: ^0.32.1 version: 0.32.1(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + '@ethersproject/abi': + specifier: ^5.8.0 + version: 5.8.0 + '@ethersproject/providers': + specifier: ^5.8.0 + version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) '@solana/web3.js': specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) @@ -213,6 +219,9 @@ importers: '@typechain/ethers-v5': specifier: ^11.1.2 version: 11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2) + prettier: + specifier: 3.8.1 + version: 3.8.1 typechain: specifier: ^8.3.2 version: 8.3.2(typescript@6.0.2) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8a8d855..6b24193 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -10,7 +10,9 @@ overrides: debug: 4.3.4 lodash: 4.18.1 prettier: 3.8.1 + "typechain>prettier": 2.8.8 tracer: 1.3.0 + uuid: "11" webpack: 5.104.1 webpack-cli: 6.0.1 webpack-dev-server: 6.0.0 From ba75407569316bbdb0694fa41d0208e75554546c Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 31 Jul 2026 14:52:36 -0400 Subject: [PATCH 03/48] feat(sdk-outpost): verify deployments through typed chain clients --- CLAUDE.md | 4 +- packages/sdk-outpost/README.md | 84 +++++++++++++- packages/sdk-outpost/package.json | 2 + .../sdk-outpost/src/clients/OutpostClient.ts | 25 +++++ packages/sdk-outpost/src/clients/Types.ts | 41 +++++++ .../clients/ethereum/EthereumOutpostClient.ts | 106 ++++++++++++++++++ .../sdk-outpost/src/clients/ethereum/Types.ts | 30 +++++ .../sdk-outpost/src/clients/ethereum/index.ts | 2 + packages/sdk-outpost/src/clients/index.ts | 4 + .../src/clients/solana/SolanaOutpostClient.ts | 65 +++++++++++ .../sdk-outpost/src/clients/solana/Types.ts | 19 ++++ .../sdk-outpost/src/clients/solana/index.ts | 2 + .../sdk-outpost/src/deployments/Registry.ts | 22 ++++ .../sdk-outpost/src/deployments/Schema.ts | 1 + packages/sdk-outpost/src/deployments/Sim2.ts | 1 + packages/sdk-outpost/src/deployments/index.ts | 1 + packages/sdk-outpost/src/index.ts | 1 + .../tests/clients/OutpostClient.test.ts | 61 ++++++++++ .../ethereum/EthereumOutpostClient.test.ts | 65 +++++++++++ .../solana/SolanaOutpostClient.test.ts | 66 +++++++++++ .../tests/deployments/Registry.test.ts | 21 ++++ .../tests/deployments/Schema.test.ts | 1 + pnpm-lock.yaml | 6 + 23 files changed, 625 insertions(+), 5 deletions(-) create mode 100644 packages/sdk-outpost/src/clients/OutpostClient.ts create mode 100644 packages/sdk-outpost/src/clients/Types.ts create mode 100644 packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts create mode 100644 packages/sdk-outpost/src/clients/ethereum/Types.ts create mode 100644 packages/sdk-outpost/src/clients/ethereum/index.ts create mode 100644 packages/sdk-outpost/src/clients/index.ts create mode 100644 packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts create mode 100644 packages/sdk-outpost/src/clients/solana/Types.ts create mode 100644 packages/sdk-outpost/src/clients/solana/index.ts create mode 100644 packages/sdk-outpost/src/deployments/Registry.ts create mode 100644 packages/sdk-outpost/tests/clients/OutpostClient.test.ts create mode 100644 packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts create mode 100644 packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts create mode 100644 packages/sdk-outpost/tests/deployments/Registry.test.ts diff --git a/CLAUDE.md b/CLAUDE.md index d6e0060..697fdc0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -221,8 +221,10 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns external-chain ABI/IDL assets, their deployment provenance, and strictly typed Ethereum/Solana clients. It extends `sdk-core`; it must not duplicate Wire-chain contract types or import generated OPP model packages. -- `sdk-outpost` deployment documents are untrusted JSON boundaries validated with Zod. ABI/IDL-derived contract and program types remain generator-owned and must never be re-declared as Zod schemas. +- `sdk-outpost` deployment payloads are untrusted data boundaries validated with Zod. ABI/IDL-derived contract and program types remain generator-owned and must never be re-declared as Zod schemas. - Add a deployment bundle only with its source revisions, archive/artifact digests, and verified on-chain identities. A checked-in artifact does not by itself prove a contract or program is deployed. +- `sdk-outpost` clients accept caller-owned Ethers/Anchor providers, verify chain identity and deployed bytecode/program executability during asynchronous creation, and expose one typed `OutpostClient` facade. Do not hard-code RPC transport into deployment records. +- Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 2e1320a..1cb518e 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -10,10 +10,83 @@ applications. ## Status -This is a preview package. Its first deployment bundle is sourced from the -sim2 artifacts generated on July 31, 2026 and records the compatible Wire -platform release and every source revision. A deployment is exposed only when -the supplied artifacts and live chain state prove it exists. +This is a preview package. Its first deployment bundle is sourced from the sim2 +artifacts generated on July 31, 2026 and records the compatible Wire platform +release and every source revision. A deployment is exposed only when the +supplied artifacts and live chain state prove it exists. + +| Family | sim2 assets | +| -------- | --------------------------------------------------------- | +| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager` | +| Solana | `liqsol_core` | + +The package does not infer support from an ABI, IDL, RPC URL, or configured +address alone. Client creation verifies the external chain identity and every +configured contract or program before returning. Higher-level stake, swap, +settlement, and retry workflows stay gated until the platform capabilities that +back those flows are proven operational. + +## Usage + +Resolve a deployment from the selected parent Wire chain, then provide the +current external-chain provider. RPC selection remains caller-owned so a Hub +network change can rebuild clients from its live network-group configuration. + +```ts +import { providers } from "ethers" + +import { + EthereumContractName, + OutpostChainFamily, + OutpostClient, + assertOutpostDeployment +} from "@wireio/sdk-outpost" + +const deployment = assertOutpostDeployment(wireChainId) +const ethereum = await OutpostClient.create({ + family: OutpostChainFamily.ethereum, + options: { + deployment, + connection: new providers.JsonRpcProvider(ethereumRpcUrl) + } +}) +const reserves = ethereum.contract(EthereumContractName.ReserveManager) +``` + +Solana uses the same facade and returns the precise Anchor program type: + +```ts +import { + OutpostChainFamily, + OutpostClient, + SolanaProgramName +} from "@wireio/sdk-outpost" + +const solana = await OutpostClient.create({ + family: OutpostChainFamily.solana, + options: { deployment, provider: anchorProvider } +}) +const liqsol = solana.program(SolanaProgramName.liqsolCore) +``` + +Zod validates versioned deployment data at the handwritten data boundary. +Contract and program call types come directly from generator-owned ABI and IDL +outputs; the package does not wrap or re-declare them. + +## Hub integration sequence + +1. Install the published preview beside `@wireio/sdk-core`. +2. Resolve the deployment from the selected Wire `ChainId`. +3. Build Ethers and Anchor providers from the Hub's current network-group RPCs. +4. Recreate both clients when that network-group observable changes; feed + verification failures into the existing top-level capability gate. +5. Replace local external-chain ABI/IDL connections with these typed clients, + while retaining Hub product state and transaction orchestration services. +6. Enable stake or swap actions only when both SDK verification and the + platform's flow-specific capability checks pass. + +This keeps network transport dynamic, deployment identity versioned, and feature +availability honest without moving application concerns into the SDK. ## Development @@ -28,3 +101,6 @@ Generated contract and program types must be regenerated from checked-in artifacts. Do not hand-edit generated files or re-declare their shapes. Generated outputs live under each chain's `generated/` directory and are excluded from handwritten-code lint rules. + +The TypeChain generator is isolated on its compatible Prettier 2 dependency; the +repository and Solana generator remain on the pinned Prettier 3 toolchain. diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 52b2255..dbe601e 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -47,6 +47,8 @@ "@solana/web3.js": "^1.98.4", "@wireio/sdk-core": "workspace:*", "ethers": "^5.8.0", + "lodash": "^4.18.1", + "ts-pattern": "^5.9.0", "zod": "^4.4.3" }, "devDependencies": { diff --git a/packages/sdk-outpost/src/clients/OutpostClient.ts b/packages/sdk-outpost/src/clients/OutpostClient.ts new file mode 100644 index 0000000..4282d3d --- /dev/null +++ b/packages/sdk-outpost/src/clients/OutpostClient.ts @@ -0,0 +1,25 @@ +import { match } from "ts-pattern" + +import { OutpostChainFamily } from "../deployments/index.js" +import { EthereumOutpostClient } from "./ethereum/index.js" +import { SolanaOutpostClient } from "./solana/index.js" +import { OutpostClientFor, OutpostClientInput } from "./Types.js" + +/** Cross-chain facade for creating a verified, family-specific outpost client. */ +export namespace OutpostClient { + /** Create the precise client type selected by the request discriminator. */ + export async function create( + input: T + ): Promise> { + const client = await match(input as OutpostClientInput) + .with({ family: OutpostChainFamily.ethereum }, ({ options }) => + EthereumOutpostClient.create(options) + ) + .with({ family: OutpostChainFamily.solana }, ({ options }) => + SolanaOutpostClient.create(options) + ) + .exhaustive() + + return client as OutpostClientFor + } +} diff --git a/packages/sdk-outpost/src/clients/Types.ts b/packages/sdk-outpost/src/clients/Types.ts new file mode 100644 index 0000000..6dbd60e --- /dev/null +++ b/packages/sdk-outpost/src/clients/Types.ts @@ -0,0 +1,41 @@ +import type { + EthereumOutpostClient, + EthereumOutpostClientOptions +} from "./ethereum/index.js" +import type { + SolanaOutpostClient, + SolanaOutpostClientOptions +} from "./solana/index.js" +import { OutpostChainFamily } from "../deployments/index.js" + +/** Request for an Ethereum outpost client. */ +export interface EthereumOutpostClientInput { + /** External-chain family discriminator. */ + family: OutpostChainFamily.ethereum + /** Ethereum-specific client options. */ + options: EthereumOutpostClientOptions +} + +/** Request for a Solana outpost client. */ +export interface SolanaOutpostClientInput { + /** External-chain family discriminator. */ + family: OutpostChainFamily.solana + /** Solana-specific client options. */ + options: SolanaOutpostClientOptions +} + +/** Typed request accepted by the cross-chain client facade. */ +export type OutpostClientInput = + | EthereumOutpostClientInput + | SolanaOutpostClientInput + +/** Concrete client types keyed by external-chain family. */ +export interface OutpostClientMap { + /** Ethereum client type. */ + [OutpostChainFamily.ethereum]: EthereumOutpostClient + /** Solana client type. */ + [OutpostChainFamily.solana]: SolanaOutpostClient +} + +/** Client returned for a selected external-chain family. */ +export type OutpostClientFor = OutpostClientMap[T] diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts new file mode 100644 index 0000000..686a04d --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -0,0 +1,106 @@ +import { providers, Signer } from "ethers" +import { identity } from "lodash" +import { match } from "ts-pattern" + +import { + OPPInbound__factory, + OPP__factory, + OperatorRegistry__factory, + ReserveManager__factory +} from "../../contracts/ethereum/index.js" +import { EthereumContractName } from "../../deployments/index.js" +import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" + +function resolveProvider( + connection: providers.Provider | Signer +): providers.Provider { + return match(connection) + .when(Signer.isSigner, signer => { + if (signer.provider == null) { + throw new Error("Ethereum signer must be connected to a provider") + } + return signer.provider + }) + .otherwise(identity) +} + +/** Strictly typed access to one verified Ethereum outpost deployment. */ +export class EthereumOutpostClient { + private static readonly EmptyCode = "0x" + + /** Create a client after verifying chain identity and deployed bytecode. */ + static async create( + options: EthereumOutpostClientOptions + ): Promise { + const { connection, deployment } = options, + provider = resolveProvider(connection), + network = await provider.getNetwork() + + if (network.chainId !== deployment.ethereum.chainId) { + throw new Error( + `Ethereum chain mismatch: expected ${deployment.ethereum.chainId}, received ${network.chainId}` + ) + } + + await Promise.all( + Object.values(EthereumContractName).map(async contractName => { + const { address } = deployment.ethereum.contracts[contractName], + code = await provider.getCode(address) + + if (code === EthereumOutpostClient.EmptyCode) { + throw new Error( + `Ethereum contract ${contractName} is not deployed at ${address}` + ) + } + }) + ) + return new EthereumOutpostClient(options, provider) + } + + private constructor( + private readonly options: EthereumOutpostClientOptions, + /** Provider verified against the configured Ethereum chain. */ + readonly provider: providers.Provider + ) {} + + /** Deployment used to verify and connect this client. */ + get deployment(): EthereumOutpostClientOptions["deployment"] { + return this.options.deployment + } + + /** Connect a generated contract client by its typed deployment name. */ + contract(name: T): EthereumContractMap[T] { + const { connection, deployment } = this.options, + contract = match(name as EthereumContractName) + .with(EthereumContractName.OPP, () => + OPP__factory.connect( + deployment.ethereum.contracts[EthereumContractName.OPP].address, + connection + ) + ) + .with(EthereumContractName.OPPInbound, () => + OPPInbound__factory.connect( + deployment.ethereum.contracts[EthereumContractName.OPPInbound] + .address, + connection + ) + ) + .with(EthereumContractName.OperatorRegistry, () => + OperatorRegistry__factory.connect( + deployment.ethereum.contracts[EthereumContractName.OperatorRegistry] + .address, + connection + ) + ) + .with(EthereumContractName.ReserveManager, () => + ReserveManager__factory.connect( + deployment.ethereum.contracts[EthereumContractName.ReserveManager] + .address, + connection + ) + ) + .exhaustive() + + return contract as EthereumContractMap[T] + } +} diff --git a/packages/sdk-outpost/src/clients/ethereum/Types.ts b/packages/sdk-outpost/src/clients/ethereum/Types.ts new file mode 100644 index 0000000..9a08bbe --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/Types.ts @@ -0,0 +1,30 @@ +import type { providers, Signer } from "ethers" + +import type { + OPP, + OPPInbound, + OperatorRegistry, + ReserveManager +} from "../../contracts/ethereum/index.js" +import type { OutpostDeployment } from "../../deployments/index.js" +import { EthereumContractName } from "../../deployments/index.js" + +/** Inputs required to connect an Ethereum outpost client. */ +export interface EthereumOutpostClientOptions { + /** Validated deployment selected from the parent Wire chain. */ + deployment: OutpostDeployment + /** Ethers provider or connected signer for the target Ethereum chain. */ + connection: providers.Provider | Signer +} + +/** Generated contract clients keyed by their deployment identity. */ +export interface EthereumContractMap { + /** Outbound OPP endpoint. */ + [EthereumContractName.OPP]: OPP + /** Inbound OPP endpoint. */ + [EthereumContractName.OPPInbound]: OPPInbound + /** Operator collateral registry. */ + [EthereumContractName.OperatorRegistry]: OperatorRegistry + /** Reserve custody manager. */ + [EthereumContractName.ReserveManager]: ReserveManager +} diff --git a/packages/sdk-outpost/src/clients/ethereum/index.ts b/packages/sdk-outpost/src/clients/ethereum/index.ts new file mode 100644 index 0000000..300bba5 --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/index.ts @@ -0,0 +1,2 @@ +export * from "./EthereumOutpostClient.js" +export * from "./Types.js" diff --git a/packages/sdk-outpost/src/clients/index.ts b/packages/sdk-outpost/src/clients/index.ts new file mode 100644 index 0000000..70c41f7 --- /dev/null +++ b/packages/sdk-outpost/src/clients/index.ts @@ -0,0 +1,4 @@ +export * from "./ethereum/index.js" +export * from "./OutpostClient.js" +export * from "./solana/index.js" +export * from "./Types.js" diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts new file mode 100644 index 0000000..631fcf4 --- /dev/null +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -0,0 +1,65 @@ +import { Program } from "@coral-xyz/anchor" +import { PublicKey } from "@solana/web3.js" +import { match } from "ts-pattern" + +import { SolanaProgramName } from "../../deployments/index.js" +import { LiqsolCore, liqsolCoreIdl } from "../../programs/solana/index.js" +import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" + +/** Strictly typed access to one verified Solana outpost deployment. */ +export class SolanaOutpostClient { + /** Create a client after verifying cluster identity and executable programs. */ + static async create( + options: SolanaOutpostClientOptions + ): Promise { + const { deployment, provider } = options, + genesisHash = await provider.connection.getGenesisHash() + + if (genesisHash !== deployment.solana.genesisHash) { + throw new Error( + `Solana genesis mismatch: expected ${deployment.solana.genesisHash}, received ${genesisHash}` + ) + } + + await Promise.all( + Object.values(SolanaProgramName).map(async programName => { + const { address } = deployment.solana.programs[programName], + account = await provider.connection.getAccountInfo( + new PublicKey(address) + ) + + if (account == null || !account.executable) { + throw new Error( + `Solana program ${programName} is not executable at ${address}` + ) + } + }) + ) + return new SolanaOutpostClient(options) + } + + private readonly liqsolCore: Program + + private constructor(private readonly options: SolanaOutpostClientOptions) { + this.liqsolCore = new Program(liqsolCoreIdl, options.provider) + } + + /** Provider verified against the configured Solana cluster. */ + get provider(): SolanaOutpostClientOptions["provider"] { + return this.options.provider + } + + /** Deployment used to verify and connect this client. */ + get deployment(): SolanaOutpostClientOptions["deployment"] { + return this.options.deployment + } + + /** Return a generated Anchor program client by typed deployment name. */ + program(name: T): SolanaProgramMap[T] { + const program = match(name as SolanaProgramName) + .with(SolanaProgramName.liqsolCore, () => this.liqsolCore) + .exhaustive() + + return program as SolanaProgramMap[T] + } +} diff --git a/packages/sdk-outpost/src/clients/solana/Types.ts b/packages/sdk-outpost/src/clients/solana/Types.ts new file mode 100644 index 0000000..23d737c --- /dev/null +++ b/packages/sdk-outpost/src/clients/solana/Types.ts @@ -0,0 +1,19 @@ +import type { AnchorProvider, Program } from "@coral-xyz/anchor" + +import type { OutpostDeployment } from "../../deployments/index.js" +import { SolanaProgramName } from "../../deployments/index.js" +import type { LiqsolCore } from "../../programs/solana/index.js" + +/** Inputs required to connect a Solana outpost client. */ +export interface SolanaOutpostClientOptions { + /** Validated deployment selected from the parent Wire chain. */ + deployment: OutpostDeployment + /** Anchor provider for the target Solana cluster. */ + provider: AnchorProvider +} + +/** Generated program clients keyed by their deployment identity. */ +export interface SolanaProgramMap { + /** liqSOL core program deployed for this network group. */ + [SolanaProgramName.liqsolCore]: Program +} diff --git a/packages/sdk-outpost/src/clients/solana/index.ts b/packages/sdk-outpost/src/clients/solana/index.ts new file mode 100644 index 0000000..36da129 --- /dev/null +++ b/packages/sdk-outpost/src/clients/solana/index.ts @@ -0,0 +1,2 @@ +export * from "./SolanaOutpostClient.js" +export * from "./Types.js" diff --git a/packages/sdk-outpost/src/deployments/Registry.ts b/packages/sdk-outpost/src/deployments/Registry.ts new file mode 100644 index 0000000..997a438 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/Registry.ts @@ -0,0 +1,22 @@ +import { ChainId, ChainIdType } from "@wireio/sdk-core" + +import { Sim2Deployment } from "./Sim2.js" +import { OutpostDeployment } from "./Schema.js" + +/** Deployment bundles available to SDK consumers. */ +export const OutpostDeployments: readonly OutpostDeployment[] = [Sim2Deployment] + +/** Resolve a deployment by its parent Wire chain identity or throw. */ +export function assertOutpostDeployment( + wireChainId: ChainIdType +): OutpostDeployment { + const chainId = ChainId.from(wireChainId), + deployment = OutpostDeployments.find(candidate => + candidate.wire.chainId.equals(chainId) + ) + + if (deployment == null) { + throw new Error(`No outpost deployment for Wire chain ${chainId.hexString}`) + } + return deployment +} diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index a9a619f..7a4c960 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -86,6 +86,7 @@ export const OutpostDeploymentSchema = z.object({ }) }), solana: z.object({ + genesisHash: SolanaAddressSchema, programs: z.object({ [SolanaProgramName.liqsolCore]: SolanaProgramDeploymentSchema }) diff --git a/packages/sdk-outpost/src/deployments/Sim2.ts b/packages/sdk-outpost/src/deployments/Sim2.ts index 8b710a9..8d46824 100644 --- a/packages/sdk-outpost/src/deployments/Sim2.ts +++ b/packages/sdk-outpost/src/deployments/Sim2.ts @@ -72,6 +72,7 @@ const Sim2DeploymentDocument = { } }, solana: { + genesisHash: "3rVuMvjfU8SGyyfYWsmkhJNHSsrbxaGLLzdwnYZvWadc", programs: { [SolanaProgramName.liqsolCore]: { address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", diff --git a/packages/sdk-outpost/src/deployments/index.ts b/packages/sdk-outpost/src/deployments/index.ts index 055ca49..e1a0f95 100644 --- a/packages/sdk-outpost/src/deployments/index.ts +++ b/packages/sdk-outpost/src/deployments/index.ts @@ -1,3 +1,4 @@ +export * from "./Registry.js" export * from "./Schema.js" export * from "./Sim2.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts index 2e62e4a..c238b58 100644 --- a/packages/sdk-outpost/src/index.ts +++ b/packages/sdk-outpost/src/index.ts @@ -1,3 +1,4 @@ +export * from "./clients/index.js" export * from "./contracts/index.js" export * from "./deployments/index.js" export * from "./programs/index.js" diff --git a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts new file mode 100644 index 0000000..16426f9 --- /dev/null +++ b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts @@ -0,0 +1,61 @@ +import { AnchorProvider, Wallet } from "@coral-xyz/anchor" +import { Connection, Keypair, SystemProgram } from "@solana/web3.js" +import { providers } from "ethers" + +import { + EthereumOutpostClient, + OutpostChainFamily, + OutpostClient, + Sim2Deployment, + SolanaOutpostClient +} from "@wireio/sdk-outpost" + +function createSolanaProvider(): AnchorProvider { + const connection = new Connection("http://127.0.0.1:8899"), + provider = new AnchorProvider(connection, new Wallet(Keypair.generate())) + + jest + .spyOn(connection, "getGenesisHash") + .mockResolvedValue(Sim2Deployment.solana.genesisHash) + jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ + data: Buffer.alloc(0), + executable: true, + lamports: 1, + owner: SystemProgram.programId, + rentEpoch: 0 + }) + return provider +} + +describe("OutpostClient", () => { + it("preserves the precise Ethereum client type", async () => { + const provider = new providers.JsonRpcProvider() + jest.spyOn(provider, "getNetwork").mockResolvedValue({ + chainId: Sim2Deployment.ethereum.chainId, + name: "sim2" + }) + jest.spyOn(provider, "getCode").mockResolvedValue("0x01") + + const client = await OutpostClient.create({ + family: OutpostChainFamily.ethereum, + options: { + deployment: Sim2Deployment, + connection: provider + } + }) + + expect(client).toBeInstanceOf(EthereumOutpostClient) + }) + + it("preserves the precise Solana client type", async () => { + const client = await OutpostClient.create({ + family: OutpostChainFamily.solana, + options: { + deployment: Sim2Deployment, + provider: createSolanaProvider() + } + }) + + expect(client).toBeInstanceOf(SolanaOutpostClient) + }) +}) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts new file mode 100644 index 0000000..2e5c609 --- /dev/null +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -0,0 +1,65 @@ +import { providers } from "ethers" + +import { + EthereumContractName, + EthereumOutpostClient, + Sim2Deployment +} from "@wireio/sdk-outpost" + +const DeployedCode = "0x01" + +function createProvider(): providers.JsonRpcProvider { + const provider = new providers.JsonRpcProvider() + jest.spyOn(provider, "getNetwork").mockResolvedValue({ + chainId: Sim2Deployment.ethereum.chainId, + name: "sim2" + }) + jest.spyOn(provider, "getCode").mockResolvedValue(DeployedCode) + return provider +} + +describe("EthereumOutpostClient", () => { + it("verifies the deployment and returns a generated contract type", async () => { + const provider = createProvider(), + client = await EthereumOutpostClient.create({ + deployment: Sim2Deployment, + connection: provider + }), + reserveManager = client.contract(EthereumContractName.ReserveManager) + + expect(reserveManager.address).toBe( + Sim2Deployment.ethereum.contracts[EthereumContractName.ReserveManager] + .address + ) + expect(provider.getCode).toHaveBeenCalledTimes( + Object.values(EthereumContractName).length + ) + }) + + it("rejects the wrong Ethereum chain", async () => { + const provider = createProvider() + jest.spyOn(provider, "getNetwork").mockResolvedValue({ + chainId: 1, + name: "mainnet" + }) + + await expect( + EthereumOutpostClient.create({ + deployment: Sim2Deployment, + connection: provider + }) + ).rejects.toThrow("Ethereum chain mismatch") + }) + + it("rejects a configured contract without bytecode", async () => { + const provider = createProvider() + jest.spyOn(provider, "getCode").mockResolvedValue("0x") + + await expect( + EthereumOutpostClient.create({ + deployment: Sim2Deployment, + connection: provider + }) + ).rejects.toThrow("is not deployed") + }) +}) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts new file mode 100644 index 0000000..1e60fd8 --- /dev/null +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -0,0 +1,66 @@ +import { AnchorProvider, Wallet } from "@coral-xyz/anchor" +import { Connection, Keypair, SystemProgram } from "@solana/web3.js" + +import { + Sim2Deployment, + SolanaOutpostClient, + SolanaProgramName +} from "@wireio/sdk-outpost" + +function createProvider(): AnchorProvider { + const connection = new Connection("http://127.0.0.1:8899"), + provider = new AnchorProvider(connection, new Wallet(Keypair.generate())) + + jest + .spyOn(connection, "getGenesisHash") + .mockResolvedValue(Sim2Deployment.solana.genesisHash) + jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ + data: Buffer.alloc(0), + executable: true, + lamports: 1, + owner: SystemProgram.programId, + rentEpoch: 0 + }) + return provider +} + +describe("SolanaOutpostClient", () => { + it("verifies the deployment and returns a generated program type", async () => { + const provider = createProvider(), + client = await SolanaOutpostClient.create({ + deployment: Sim2Deployment, + provider + }), + program = client.program(SolanaProgramName.liqsolCore) + + expect(program.programId.toBase58()).toBe( + Sim2Deployment.solana.programs[SolanaProgramName.liqsolCore].address + ) + }) + + it("rejects the wrong Solana cluster", async () => { + const provider = createProvider() + jest + .spyOn(provider.connection, "getGenesisHash") + .mockResolvedValue("9".repeat(32)) + + await expect( + SolanaOutpostClient.create({ + deployment: Sim2Deployment, + provider + }) + ).rejects.toThrow("Solana genesis mismatch") + }) + + it("rejects a configured program that is not executable", async () => { + const provider = createProvider() + jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue(null) + + await expect( + SolanaOutpostClient.create({ + deployment: Sim2Deployment, + provider + }) + ).rejects.toThrow("is not executable") + }) +}) diff --git a/packages/sdk-outpost/tests/deployments/Registry.test.ts b/packages/sdk-outpost/tests/deployments/Registry.test.ts new file mode 100644 index 0000000..787ee0f --- /dev/null +++ b/packages/sdk-outpost/tests/deployments/Registry.test.ts @@ -0,0 +1,21 @@ +import { + OutpostDeploymentId, + Sim2Deployment, + assertOutpostDeployment +} from "@wireio/sdk-outpost" + +describe("assertOutpostDeployment", () => { + it("resolves the deployment from the parent Wire chain", () => { + expect(assertOutpostDeployment(Sim2Deployment.wire.chainId).id).toBe( + OutpostDeploymentId.sim2 + ) + }) + + it("rejects an unsupported Wire chain", () => { + const unsupportedChainId = "f".repeat(64) + + expect(() => assertOutpostDeployment(unsupportedChainId)).toThrow( + unsupportedChainId + ) + }) +}) diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index 40d9763..223a855 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -63,6 +63,7 @@ function createDeploymentFixture() { } }, solana: { + genesisHash: SolanaAddress, programs: { liqsolCore: { address: SolanaAddress, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f7f7a77..554f49a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -212,6 +212,12 @@ importers: ethers: specifier: ^5.8.0 version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + lodash: + specifier: 4.18.1 + version: 4.18.1 + ts-pattern: + specifier: ^5.9.0 + version: 5.9.0 zod: specifier: ^4.4.3 version: 4.4.3 From 6b43c8f26705585a4681b307fb1476ab26f366af Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 31 Jul 2026 14:57:47 -0400 Subject: [PATCH 04/48] chore(sdk-outpost): constrain published package contents --- packages/sdk-outpost/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index dbe601e..a0addc3 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -12,7 +12,8 @@ "access": "public" }, "files": [ - "lib", + "lib/cjs", + "lib/esm", "README.md" ], "types": "lib/esm/index.d.ts", From 3d980355f7431967112e4b30882d0c09a5b38941 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 15:17:24 -0400 Subject: [PATCH 05/48] feat(sdk-outpost): version sim2 deployments and automate artifact refresh --- packages/sdk-outpost/package.json | 8 +- .../sdk-outpost/scripts/deployment-utils.mjs | 81 + .../scripts/generate-deployment-catalog.mjs | 44 + .../scripts/generate-ethereum-types.mjs | 31 + .../scripts/generate-solana-types.mjs | 17 +- .../sdk-outpost/scripts/import-deployment.mjs | 262 + .../scripts/verify-deployments.mjs | 93 + .../OPP.json | 0 .../OPPInbound.json | 0 .../OperatorRegistry.json | 0 .../ReserveManager.json | 0 .../sim2-2026-08-03-ca8d3a9d/OPP.json | 1081 ++ .../sim2-2026-08-03-ca8d3a9d/OPPInbound.json | 1414 +++ .../OperatorRegistry.json | 1764 +++ .../ReserveManager.json | 2563 ++++ .../liqsol_core.json | 0 .../sim2-2026-08-03-ca8d3a9d/liqsol_core.json | 10161 ++++++++++++++++ .../factories/OperatorRegistry__factory.ts | 107 + .../factories/ReserveManager__factory.ts | 107 + .../sdk-outpost/src/deployments/Registry.ts | 22 +- .../sdk-outpost/src/deployments/Schema.ts | 11 +- packages/sdk-outpost/src/deployments/Sim2.ts | 87 - packages/sdk-outpost/src/deployments/Types.ts | 5 - .../sdk-outpost/src/deployments/current.json | 3 + .../data/sim2-2026-07-31-365c4416.json | 74 + .../data/sim2-2026-08-03-ca8d3a9d.json | 74 + .../src/deployments/generated/Catalog.ts | 177 + packages/sdk-outpost/src/deployments/index.ts | 1 - 28 files changed, 18077 insertions(+), 110 deletions(-) create mode 100644 packages/sdk-outpost/scripts/deployment-utils.mjs create mode 100644 packages/sdk-outpost/scripts/generate-deployment-catalog.mjs create mode 100644 packages/sdk-outpost/scripts/generate-ethereum-types.mjs create mode 100644 packages/sdk-outpost/scripts/import-deployment.mjs create mode 100644 packages/sdk-outpost/scripts/verify-deployments.mjs rename packages/sdk-outpost/src/assets/ethereum/{sim2 => sim2-2026-07-31-365c4416}/OPP.json (100%) rename packages/sdk-outpost/src/assets/ethereum/{sim2 => sim2-2026-07-31-365c4416}/OPPInbound.json (100%) rename packages/sdk-outpost/src/assets/ethereum/{sim2 => sim2-2026-07-31-365c4416}/OperatorRegistry.json (100%) rename packages/sdk-outpost/src/assets/ethereum/{sim2 => sim2-2026-07-31-365c4416}/ReserveManager.json (100%) create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPP.json create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPPInbound.json create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OperatorRegistry.json create mode 100644 packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/ReserveManager.json rename packages/sdk-outpost/src/assets/solana/{sim2 => sim2-2026-07-31-365c4416}/liqsol_core.json (100%) create mode 100644 packages/sdk-outpost/src/assets/solana/sim2-2026-08-03-ca8d3a9d/liqsol_core.json delete mode 100644 packages/sdk-outpost/src/deployments/Sim2.ts create mode 100644 packages/sdk-outpost/src/deployments/current.json create mode 100644 packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json create mode 100644 packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json create mode 100644 packages/sdk-outpost/src/deployments/generated/Catalog.ts diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index a0addc3..86a123b 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -38,8 +38,12 @@ "compile:watch": "tsc -b tsconfig.json -w", "test": "jest", "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", - "generate:ethereum": "typechain --target ethers-v5 --node16-modules --out-dir src/contracts/ethereum/generated 'src/assets/ethereum/**/*.json'", - "generate:solana": "node scripts/generate-solana-types.mjs" + "import:deployment": "node scripts/import-deployment.mjs", + "generate:deployments": "node scripts/generate-deployment-catalog.mjs", + "generate:ethereum": "node scripts/generate-ethereum-types.mjs", + "generate:solana": "node scripts/generate-solana-types.mjs", + "generate": "pnpm run generate:deployments && pnpm run generate:ethereum && pnpm run generate:solana", + "verify:deployments": "node scripts/verify-deployments.mjs" }, "dependencies": { "@coral-xyz/anchor": "^0.32.1", diff --git a/packages/sdk-outpost/scripts/deployment-utils.mjs b/packages/sdk-outpost/scripts/deployment-utils.mjs new file mode 100644 index 0000000..ca4c62c --- /dev/null +++ b/packages/sdk-outpost/scripts/deployment-utils.mjs @@ -0,0 +1,81 @@ +import Crypto from "node:crypto" +import Fs from "node:fs/promises" +import Path from "node:path" +import { fileURLToPath } from "node:url" + +import { format } from "prettier" + +export const PackagePath = Path.resolve( + Path.dirname(fileURLToPath(import.meta.url)), + ".." + ), + DeploymentDataPath = Path.join(PackagePath, "src/deployments/data"), + CurrentDeploymentFile = Path.join( + PackagePath, + "src/deployments/current.json" + ), + GeneratedCatalogFile = Path.join( + PackagePath, + "src/deployments/generated/Catalog.ts" + ) + +export async function pathExists(path) { + try { + await Fs.access(path) + return true + } catch { + return false + } +} + +export async function sha256(path) { + const contents = await Fs.readFile(path) + return Crypto.createHash("sha256").update(contents).digest("hex") +} + +export async function readJson(path) { + return JSON.parse(await Fs.readFile(path, "utf8")) +} + +export async function writeJson(path, value) { + await Fs.mkdir(Path.dirname(path), { recursive: true }) + await Fs.writeFile(path, `${JSON.stringify(value, null, 2)}\n`) +} + +export async function readDeploymentDocuments() { + const entries = await Fs.readdir(DeploymentDataPath, { withFileTypes: true }) + const documents = await Promise.all( + entries + .filter(entry => entry.isFile() && entry.name.endsWith(".json")) + .map(entry => readJson(Path.join(DeploymentDataPath, entry.name))) + ) + + return documents.sort((left, right) => + left.artifactBundle.generatedAt.localeCompare( + right.artifactBundle.generatedAt + ) + ) +} + +export async function readCurrentDeploymentId() { + const current = await readJson(CurrentDeploymentFile) + if (typeof current.id !== "string" || current.id.length === 0) { + throw new Error("Current deployment id is missing") + } + return current.id +} + +export async function writeTypescript(path, source) { + const formatted = await format(source, { + parser: "typescript", + semi: false, + singleQuote: false, + trailingComma: "none" + }) + await Fs.mkdir(Path.dirname(path), { recursive: true }) + await Fs.writeFile(path, formatted) +} + +export function deploymentAssetPath(family, deploymentId) { + return Path.join(PackagePath, "src/assets", family, deploymentId) +} diff --git a/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs b/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs new file mode 100644 index 0000000..4045c06 --- /dev/null +++ b/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs @@ -0,0 +1,44 @@ +import { + GeneratedCatalogFile, + readCurrentDeploymentId, + readDeploymentDocuments, + writeTypescript +} from "./deployment-utils.mjs" + +const documents = await readDeploymentDocuments(), + currentId = await readCurrentDeploymentId(), + ids = new Set(), + wireChainIds = new Set() + +for (const document of documents) { + if (ids.has(document.id)) { + throw new Error(`Duplicate outpost deployment id ${document.id}`) + } + if (wireChainIds.has(document.wire.chainId)) { + throw new Error( + `Duplicate outpost deployment Wire chain ${document.wire.chainId}` + ) + } + ids.add(document.id) + wireChainIds.add(document.wire.chainId) +} + +if (!ids.has(currentId)) { + throw new Error( + `Current outpost deployment ${currentId} is not in the catalog` + ) +} + +await writeTypescript( + GeneratedCatalogFile, + ` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + + /** Untrusted deployment documents validated by Registry at module load. */ + export const OutpostDeploymentDocuments: readonly unknown[] = ${JSON.stringify(documents, null, 2)} + + /** Deployment whose ABI and IDL surfaces own the generated client types. */ + export const CurrentOutpostDeploymentId = ${JSON.stringify(currentId)} + ` +) diff --git a/packages/sdk-outpost/scripts/generate-ethereum-types.mjs b/packages/sdk-outpost/scripts/generate-ethereum-types.mjs new file mode 100644 index 0000000..5560a46 --- /dev/null +++ b/packages/sdk-outpost/scripts/generate-ethereum-types.mjs @@ -0,0 +1,31 @@ +import ChildProcess from "node:child_process" +import Fs from "node:fs/promises" +import Path from "node:path" + +import { + PackagePath, + deploymentAssetPath, + readCurrentDeploymentId +} from "./deployment-utils.mjs" + +const deploymentId = await readCurrentDeploymentId(), + assetGlob = Path.join( + deploymentAssetPath("ethereum", deploymentId), + "*.json" + ), + outputPath = Path.join(PackagePath, "src/contracts/ethereum/generated"), + typechain = Path.join(PackagePath, "node_modules/.bin/typechain") + +await Fs.rm(outputPath, { force: true, recursive: true }) +ChildProcess.execFileSync( + typechain, + [ + "--target", + "ethers-v5", + "--node16-modules", + "--out-dir", + outputPath, + assetGlob + ], + { stdio: "inherit" } +) diff --git a/packages/sdk-outpost/scripts/generate-solana-types.mjs b/packages/sdk-outpost/scripts/generate-solana-types.mjs index 1f73cda..b77f61e 100644 --- a/packages/sdk-outpost/scripts/generate-solana-types.mjs +++ b/packages/sdk-outpost/scripts/generate-solana-types.mjs @@ -1,17 +1,22 @@ import Fs from "node:fs/promises" import Path from "node:path" -import { fileURLToPath } from "node:url" import { convertIdlToCamelCase } from "@coral-xyz/anchor/dist/cjs/idl.js" import { format } from "prettier" -const packagePath = Path.resolve( - Path.dirname(fileURLToPath(import.meta.url)), - ".." +import { + PackagePath, + deploymentAssetPath, + readCurrentDeploymentId +} from "./deployment-utils.mjs" + +const deploymentId = await readCurrentDeploymentId(), + idlFile = Path.join( + deploymentAssetPath("solana", deploymentId), + "liqsol_core.json" ), - idlFile = Path.join(packagePath, "src/assets/solana/sim2/liqsol_core.json"), outputFile = Path.join( - packagePath, + PackagePath, "src/programs/solana/generated/LiqsolCore.ts" ), rawIdl = JSON.parse(await Fs.readFile(idlFile, "utf8")), diff --git a/packages/sdk-outpost/scripts/import-deployment.mjs b/packages/sdk-outpost/scripts/import-deployment.mjs new file mode 100644 index 0000000..05823a8 --- /dev/null +++ b/packages/sdk-outpost/scripts/import-deployment.mjs @@ -0,0 +1,262 @@ +import ChildProcess from "node:child_process" +import Fs from "node:fs/promises" +import Os from "node:os" +import Path from "node:path" + +import { + CurrentDeploymentFile, + DeploymentDataPath, + PackagePath, + deploymentAssetPath, + pathExists, + readJson, + sha256, + writeJson +} from "./deployment-utils.mjs" + +const ContractNames = [ + "OPP", + "OPPInbound", + "OperatorRegistry", + "ReserveManager" + ], + IdPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/, + RevisionPattern = /^[0-9a-f]{40}$/, + argumentsByName = parseArguments(process.argv.slice(2)), + archive = requiredPath("archive"), + platformManifestRevision = requiredRevision("platform-manifest-revision"), + librariesRevision = requiredRevision("libraries-revision"), + platformRelease = argumentsByName.get("platform-release") ?? "v1.0.0", + standaloneManifest = argumentsByName.get("manifest"), + replace = argumentsByName.has("replace"), + makeCurrent = argumentsByName.has("current"), + tempPath = await Fs.mkdtemp(Path.join(Os.tmpdir(), "sdk-outpost-import-")) + +try { + ChildProcess.execFileSync("tar", ["-xzf", archive, "-C", tempPath], { + stdio: "ignore" + }) + + const artifactRoot = await locateArtifactRoot(tempPath), + manifestPath = Path.join(artifactRoot, "cluster-manifest.json"), + readmePath = Path.join(artifactRoot, "README.txt"), + manifest = await readJson(manifestPath), + generatedAt = await readGeneratedAt(readmePath), + wireChainId = requiredValue(manifest, "identity.chains.wire.chain_id"), + defaultId = `${requiredValue(manifest, "prefix")}-${generatedAt.slice(0, 10)}-${wireChainId.slice(0, 8)}`, + id = argumentsByName.get("id") ?? defaultId + + if (!IdPattern.test(id)) { + throw new Error(`Invalid deployment id ${id}`) + } + if (standaloneManifest != null) { + const [embeddedHash, standaloneHash] = await Promise.all([ + sha256(manifestPath), + sha256(Path.resolve(standaloneManifest)) + ]) + if (embeddedHash !== standaloneHash) { + throw new Error("Standalone and archived cluster manifests do not match") + } + } + + const deploymentPath = Path.join(DeploymentDataPath, `${id}.json`) + if ((await pathExists(deploymentPath)) && !replace) { + throw new Error( + `Deployment ${id} already exists; use --replace only for an intentional correction` + ) + } + + const ethereumContracts = {}, + ethereumAssetPath = deploymentAssetPath("ethereum", id), + solanaAssetPath = deploymentAssetPath("solana", id) + + await Fs.mkdir(ethereumAssetPath, { recursive: true }) + await Fs.mkdir(solanaAssetPath, { recursive: true }) + + for (const contractName of ContractNames) { + const sourcePath = Path.join( + artifactRoot, + "ethereum/runtime-abis", + `${contractName}.json` + ), + expectedHash = + manifest.identity?.evm_abis?.[`${contractName}.json`]?.sha256, + actualHash = await sha256(sourcePath) + + if (typeof expectedHash !== "string" || actualHash !== expectedHash) { + throw new Error(`${contractName} ABI does not match the cluster manifest`) + } + await Fs.copyFile( + sourcePath, + Path.join(ethereumAssetPath, `${contractName}.json`) + ) + ethereumContracts[contractName] = { + address: requiredValue( + manifest, + `identity.evm_contracts.${contractName}.address` + ), + artifactSha256: actualHash + } + } + + const solanaSourcePath = Path.join( + artifactRoot, + "solana/runtime-idls/liqsol_core.json" + ), + solanaHash = await sha256(solanaSourcePath), + expectedSolanaHash = requiredValue( + manifest, + "identity.svm_programs.liqsol_core.idl_sha256" + ) + + if (solanaHash !== expectedSolanaHash) { + throw new Error("liqsol_core IDL does not match the cluster manifest") + } + await Fs.copyFile( + solanaSourcePath, + Path.join(solanaAssetPath, "liqsol_core.json") + ) + + const document = { + schemaVersion: 1, + id, + artifactBundle: { + generatedAt, + sourceArchiveSha256: await sha256(archive), + clusterManifestSha256: await sha256(manifestPath), + deploymentChecksum: requiredValue(manifest, "deployment_checksum"), + snapshotChecksum: requiredValue(manifest, "snapshot_checksum"), + platformRelease: { + tag: platformRelease, + url: `https://github.com/Wire-Network/wire-platform-build-system/releases/tag/${platformRelease}`, + manifest: { + repository: "Wire-Network/wire-platform-manifest", + revision: platformManifestRevision + }, + libraries: { + repository: "Wire-Network/wire-libraries-ts", + revision: librariesRevision + } + }, + sources: { + wireTools: sourceRevision(manifest, "wire-tools-ts"), + wireSysio: sourceRevision(manifest, "wire-sysio"), + wireEthereum: sourceRevision(manifest, "wire-ethereum"), + wireSolana: sourceRevision(manifest, "wire-solana") + } + }, + wire: { chainId: wireChainId }, + ethereum: { + chainId: Number(requiredValue(manifest, "identity.chains.evm.chain_id")), + contracts: ethereumContracts + }, + solana: { + genesisHash: requiredValue(manifest, "identity.chains.svm.genesis"), + programs: { + liqsolCore: { + address: requiredValue( + manifest, + "identity.svm_programs.liqsol_core.program_id" + ), + artifactSha256: solanaHash + } + } + } + } + + await writeJson(deploymentPath, document) + if (makeCurrent || !(await pathExists(CurrentDeploymentFile))) { + await writeJson(CurrentDeploymentFile, { id }) + } + + for (const script of [ + "generate-deployment-catalog.mjs", + "generate-ethereum-types.mjs", + "generate-solana-types.mjs", + "verify-deployments.mjs" + ]) { + ChildProcess.execFileSync( + process.execPath, + [Path.join(PackagePath, "scripts", script)], + { stdio: "inherit" } + ) + } + + process.stdout.write(`Imported ${id}${makeCurrent ? " as current" : ""}\n`) +} finally { + await Fs.rm(tempPath, { force: true, recursive: true }) +} + +function parseArguments(values) { + const parsed = new Map() + for (let index = 0; index < values.length; index += 1) { + const value = values[index] + if (!value.startsWith("--")) { + throw new Error(`Unexpected argument ${value}`) + } + const name = value.slice(2) + if (["current", "replace"].includes(name)) { + parsed.set(name, "true") + continue + } + const next = values[index + 1] + if (next == null || next.startsWith("--")) { + throw new Error(`Missing value for --${name}`) + } + parsed.set(name, next) + index += 1 + } + return parsed +} + +function requiredPath(name) { + const value = argumentsByName.get(name) + if (value == null) throw new Error(`Missing --${name}`) + return Path.resolve(value) +} + +function requiredRevision(name) { + const value = argumentsByName.get(name) + if (value == null || !RevisionPattern.test(value)) { + throw new Error(`--${name} must be a full Git revision`) + } + return value +} + +async function locateArtifactRoot(root) { + const entries = await Fs.readdir(root, { withFileTypes: true }) + for (const entry of entries) { + if (!entry.isDirectory()) continue + const candidate = Path.join(root, entry.name) + if (await pathExists(Path.join(candidate, "cluster-manifest.json"))) { + return candidate + } + } + throw new Error("Archive does not contain a cluster-manifest.json") +} + +async function readGeneratedAt(readmePath) { + const readme = await Fs.readFile(readmePath, "utf8"), + match = readme.match(/regenerated\s+(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)/) + if (match == null) + throw new Error("Artifact README does not record generated time") + return match[1] +} + +function requiredValue(value, path) { + let current = value + for (const part of path.split(".")) { + current = current?.[part] + } + if (current == null || current === "") { + throw new Error(`Cluster manifest is missing ${path}`) + } + return current +} + +function sourceRevision(manifest, repository) { + return { + repository: `Wire-Network/${repository}`, + revision: requiredValue(manifest, `identity.sources.${repository}`) + } +} diff --git a/packages/sdk-outpost/scripts/verify-deployments.mjs b/packages/sdk-outpost/scripts/verify-deployments.mjs new file mode 100644 index 0000000..2569d54 --- /dev/null +++ b/packages/sdk-outpost/scripts/verify-deployments.mjs @@ -0,0 +1,93 @@ +import Path from "node:path" + +import { + deploymentAssetPath, + readCurrentDeploymentId, + readDeploymentDocuments, + readJson, + sha256 +} from "./deployment-utils.mjs" + +const ContractNames = [ + "OPP", + "OPPInbound", + "OperatorRegistry", + "ReserveManager" + ], + documents = await readDeploymentDocuments(), + currentId = await readCurrentDeploymentId(), + current = documents.find(document => document.id === currentId) + +if (current == null) throw new Error(`Unknown current deployment ${currentId}`) + +for (const deployment of documents) { + for (const contractName of ContractNames) { + const path = Path.join( + deploymentAssetPath("ethereum", deployment.id), + `${contractName}.json` + ), + actualHash = await sha256(path), + expectedHash = deployment.ethereum.contracts[contractName].artifactSha256 + if (actualHash !== expectedHash) { + throw new Error(`${deployment.id} ${contractName} ABI digest mismatch`) + } + } + + const solanaPath = Path.join( + deploymentAssetPath("solana", deployment.id), + "liqsol_core.json" + ), + solanaHash = await sha256(solanaPath) + if (solanaHash !== deployment.solana.programs.liqsolCore.artifactSha256) { + throw new Error(`${deployment.id} liqsol_core IDL digest mismatch`) + } +} + +for (const deployment of documents) { + if (deployment.id === current.id) continue + for (const contractName of ContractNames) { + const previous = await readJson( + Path.join( + deploymentAssetPath("ethereum", deployment.id), + `${contractName}.json` + ) + ), + currentArtifact = await readJson( + Path.join( + deploymentAssetPath("ethereum", current.id), + `${contractName}.json` + ) + ) + assertSurfaceCovered( + `${deployment.id} ${contractName}`, + callableSurface(previous.abi), + callableSurface(currentArtifact.abi) + ) + } +} + +process.stdout.write( + `Verified ${documents.length} outpost deployments; current=${current.id}\n` +) + +function callableSurface(abi) { + return new Set( + abi + .filter(entry => entry.type === "function" || entry.type === "event") + .map( + entry => + `${entry.type}:${entry.name}(${(entry.inputs ?? []).map(input => input.type).join(",")})` + ) + ) +} + +function assertSurfaceCovered(label, previous, currentSurface) { + const missing = [...previous].filter( + signature => !currentSurface.has(signature) + ) + if (missing.length > 0) { + throw new Error( + `${label} is not covered by the current generated types: ${missing.join(", ")}` + ) + } +} diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/OPP.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPP.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2/OPP.json rename to packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPP.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/OPPInbound.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPPInbound.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2/OPPInbound.json rename to packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPPInbound.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/OperatorRegistry.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OperatorRegistry.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2/OperatorRegistry.json rename to packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OperatorRegistry.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2/ReserveManager.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/ReserveManager.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2/ReserveManager.json rename to packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/ReserveManager.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPP.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPP.json new file mode 100644 index 0000000..e82f293 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPP.json @@ -0,0 +1,1081 @@ +{ + "contractName": "OPP", + "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionCatchUpPruned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "previousRetentionEpochs", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OPPEnvelope", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_ENVELOPE_BYTES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "addAttestation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allAuthorizedSenders", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "authorizedSenders", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "wireEpochIndex", + "type": "uint32" + } + ], + "name": "emitOutboundEnvelope", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tag", + "type": "uint256" + } + ], + "name": "enterSendMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tag", + "type": "uint256" + } + ], + "name": "exitSendMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getLatestOutboundEnvelope", + "outputs": [ + { + "internalType": "uint32", + "name": "epoch_", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data_", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "getOutboundEnvelope", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inSendMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastMessageID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastMessageTimestamp", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestOutboundEnvelope", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestOutboundEpoch", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "outboundEnvelopes", + "outputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outboundRetentionConfig", + "outputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAttestationCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "pruneOutboundEnvelope", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "queuedMessageCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sendModeTag", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "start", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "end", + "type": "tuple" + } + ], + "internalType": "struct Endpoints", + "name": "endpoints", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "messageId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousMessageId", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "payloadSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "payloadChecksum", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "headerChecksum", + "type": "bytes" + } + ], + "internalType": "struct MessageHeader", + "name": "header", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "version", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "AttestationType", + "name": "type_", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "dataSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct AttestationEntry[]", + "name": "attestations", + "type": "tuple[]" + } + ], + "internalType": "struct MessagePayload", + "name": "payload", + "type": "tuple" + } + ], + "name": "serializeMessage", + "outputs": [ + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "start", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "end", + "type": "tuple" + } + ], + "internalType": "struct Endpoints", + "name": "endpoints", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "messageId", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousMessageId", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "payloadSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "payloadChecksum", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "headerChecksum", + "type": "bytes" + } + ], + "internalType": "struct MessageHeader", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "setEnvelopeRetentionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPPInbound.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPPInbound.json new file mode 100644 index 0000000..ac08035 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPPInbound.json @@ -0,0 +1,1414 @@ +{ + "contractName": "OPPInbound", + "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "messageID", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + } + ], + "name": "AttestationBlackholed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "handler", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "messageID", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + } + ], + "name": "AttestationDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "address", + "name": "handler", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldHandler", + "type": "address" + } + ], + "name": "AttestationHandlerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionCatchUpPruned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "previousRetentionEpochs", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "EnvelopeRetentionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "EpochComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "epochHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "deliveryCount", + "type": "uint32" + } + ], + "name": "EpochConsensus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator_", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "epochHash", + "type": "bytes32" + } + ], + "name": "EpochDelivery", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "epochHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "messageCount", + "type": "uint256" + } + ], + "name": "EpochReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReserveManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldReserveManager", + "type": "address" + } + ], + "name": "ReserveManagerAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_ENVELOPE_BYTES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_SIG_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "activeGroupIndex", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "name": "attestationHandlers", + "outputs": [ + { + "internalType": "contract IOPPReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "batchOpGroups", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "consensusReached", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentEpochStartedAt", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "epochDeliveries", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "epochDeliveryCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "epochDigestCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "epochDurationSec", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "epochIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "getInboundEnvelope", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "inboundEnvelopes", + "outputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "emittedAt", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "checksum", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inboundRetentionConfig", + "outputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oppManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator_", + "type": "address" + } + ], + "name": "isActiveOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastMessageID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextEpochIndex", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "operatorEthAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppContract", + "outputs": [ + { + "internalType": "contract IOPP", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingConsensus", + "outputs": [ + { + "internalType": "uint32", + "name": "nextEpoch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "deliveries", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "groupSize", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "currentEpochStartedAtTs", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "epochDurationSec_", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "pendingConsensusForDigest", + "outputs": [ + { + "internalType": "uint32", + "name": "nextEpoch", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "agreeing", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "groupSize", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "currentEpochStartedAtTs", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "epochDurationSec_", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingEpoch", + "outputs": [ + { + "internalType": "bytes", + "name": "envelopeHash", + "type": "bytes" + }, + { + "components": [ + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "start", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "ChainKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "internalType": "struct ChainId", + "name": "end", + "type": "tuple" + } + ], + "internalType": "struct Endpoints", + "name": "endpoints", + "type": "tuple" + }, + { + "internalType": "uint64", + "name": "epochTimestamp", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "epochEnvelopeIndex", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingEpochHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingMessageCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "previousEpochHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex_", + "type": "uint32" + } + ], + "name": "pruneInboundEnvelope", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "pubkeyAddressCache", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserveManagerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rosterInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "address", + "name": "handler", + "type": "address" + } + ], + "name": "setAttestationHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "retentionEpochs", + "type": "uint32" + } + ], + "name": "setEnvelopeRetentionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "durationSec", + "type": "uint32" + } + ], + "name": "setEpochDurationSec", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "opp", + "type": "address" + } + ], + "name": "setOPPContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newReserveManager", + "type": "address" + } + ], + "name": "setReserveManagerAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OperatorRegistry.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OperatorRegistry.json new file mode 100644 index 0000000..ce933e6 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OperatorRegistry.json @@ -0,0 +1,1764 @@ +{ + "contractName": "OperatorRegistry", + "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "provided", + "type": "address" + } + ], + "name": "WIRE_BadContractAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "bps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBps", + "type": "uint256" + } + ], + "name": "WIRE_BasisPointsTooHigh", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "derived", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_DepositorKeyMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20DepositValueNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20TransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_EthSendFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_FeeOnTransferUnsupported", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_GoLiveInProgress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + } + ], + "name": "WIRE_InsufficientEthBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "WIRE_InvalidDepositorKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "WIRE_InvalidNodeTier", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_InvalidPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "WIRE_InvalidWireAccountName", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "WireKeyType", + "name": "keyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "keyLength", + "type": "uint256" + } + ], + "name": "WIRE_InvalidWireKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_LiqEthTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_MultipleNativeTrackedCodes", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NativeDepositValueMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + } + ], + "name": "WIRE_NoBonds", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoPricesRecorded", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoYield", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nftAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_NodeTokenNotOwned", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_NotReceiptOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_OnlyOPPInboundLib", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OppInboundCallerUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OutpostChainCodeUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "innerRevert", + "type": "bytes" + } + ], + "name": "WIRE_PermitFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_PrecisionOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_PrecisionUnsetForRefund", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "WIRE_PriceOutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + } + ], + "name": "WIRE_ReceiptNotWithdrawable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingInProgress", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveBadParam", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveCancelNotCreator", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveNotCancellable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapEmptyRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceNotNative", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceReserveUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_SwapSourceTokenNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapUnknownSlugName", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapZeroSourceAmount", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TokenAddressUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "provided", + "type": "uint8" + } + ], + "name": "WIRE_TokenPrecisionOutOfRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_TokenPrecisionUnset", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TrackedCodeZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "WIRE_UnexpectedError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "WIRE_UnexpectedTokenDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_WireNodesContractNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ZeroAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "refundedToDepositor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "penaltyToReserve", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "originalMessageId", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "DepositReverted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "LiqTokenCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "NativeTokenCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "OperatorDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "reserveTarget", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "OperatorSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "OutpostChainCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underwriter", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "uicBytes", + "type": "bytes" + } + ], + "name": "UnderwriteCommitRelayed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "requestId", + "type": "uint64" + } + ], + "name": "WithdrawRemitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "requestId", + "type": "uint64" + } + ], + "name": "WithdrawRequested", + "type": "event" + }, + { + "inputs": [], + "name": "DEPOSIT_REVERT_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEPOSIT_REVERT_GAS_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OPERATOR_ACTION_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OPPAttestationIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERWRITE_INTENT_COMMIT_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "__OPPEndpointManaged_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "uicBytes", + "type": "bytes" + } + ], + "name": "commit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "compressedPubkey", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "compressedPubkey", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositNonNative", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "depositedByCode", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSummaryAttestations", + "outputs": [ + { + "components": [ + { + "internalType": "AttestationType", + "name": "type_", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "dataSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct AttestationEntry[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liqToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liqTokenCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeTokenCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "operators", + "outputs": [ + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + }, + { + "internalType": "OperatorStatus", + "name": "status", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppInboundAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outpostChainCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outpostId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserveManagerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_liqToken", + "type": "address" + } + ], + "name": "setLiqToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "setLiqTokenCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "setNativeTokenCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oppAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_oppInboundAddress", + "type": "address" + } + ], + "name": "setOPPAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "setOutpostChainCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_outpostId", + "type": "uint64" + } + ], + "name": "setOutpostId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_reserveManager", + "type": "address" + } + ], + "name": "setReserveManagerAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "compressedPubkey", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/ReserveManager.json b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/ReserveManager.json new file mode 100644 index 0000000..7925177 --- /dev/null +++ b/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/ReserveManager.json @@ -0,0 +1,2563 @@ +{ + "contractName": "ReserveManager", + "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "raw", + "type": "uint64" + } + ], + "name": "InvalidEnumValue", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualBytes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBytes", + "type": "uint256" + } + ], + "name": "OPP_EnvelopeOverCap", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_EpochHashMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeRecordMissing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "evictBoundary", + "type": "uint32" + } + ], + "name": "OPP_InboundEnvelopeStillInRetention", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + } + ], + "name": "OPP_InsufficientSignatureWeight", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "expected", + "type": "address" + } + ], + "name": "OPP_InvalidOPPAddress", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_InvalidRetentionConfig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "expected", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "actual", + "type": "bytes" + } + ], + "name": "OPP_MessageIDMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoAttestationsSent", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NoPendingAttestations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "previousEnvelopeHash", + "type": "bytes" + } + ], + "name": "OPP_NonCanonicalPreviousEpochHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "expected", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "actual", + "type": "uint32" + } + ], + "name": "OPP_NonSequentialEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_NotActiveOperator", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_NotSending", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_OPPAddressNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "epochIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "OPP_OperatorAlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "OPP_PayloadChecksumMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stack", + "type": "uint256" + } + ], + "name": "OPP_SendStackError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnauthorizedAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + } + ], + "name": "OPP_UnhandledAttestationType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedChainId", + "type": "uint256" + }, + { + "internalType": "ChainKind", + "name": "actualKind", + "type": "uint8" + }, + { + "internalType": "uint32", + "name": "actualId", + "type": "uint32" + } + ], + "name": "OPP_WrongDestinationChain", + "type": "error" + }, + { + "inputs": [], + "name": "OPP_ZeroTag", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "provided", + "type": "address" + } + ], + "name": "WIRE_BadContractAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "bps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBps", + "type": "uint256" + } + ], + "name": "WIRE_BasisPointsTooHigh", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "derived", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_DepositorKeyMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20DepositValueNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_Erc20TransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_EthSendFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_FeeOnTransferUnsupported", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_GoLiveInProgress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "available", + "type": "uint256" + } + ], + "name": "WIRE_InsufficientEthBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "WIRE_InvalidDepositorKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "WIRE_InvalidNodeTier", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_InvalidPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "WIRE_InvalidWireAccountName", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "WireKeyType", + "name": "keyType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "keyLength", + "type": "uint256" + } + ], + "name": "WIRE_InvalidWireKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WIRE_LiqEthTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_MultipleNativeTrackedCodes", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NativeDepositValueMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "internalType": "OperatorType", + "name": "operatorType", + "type": "uint8" + } + ], + "name": "WIRE_NoBonds", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoPricesRecorded", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_NoYield", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nftAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_NodeTokenNotOwned", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_NotReceiptOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "WIRE_OnlyOPPInboundLib", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OppInboundCallerUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_OutpostChainCodeUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "innerRevert", + "type": "bytes" + } + ], + "name": "WIRE_PermitFailed", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_PrecisionOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_PrecisionUnsetForRefund", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "name": "WIRE_PriceOutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "receiptId", + "type": "uint256" + } + ], + "name": "WIRE_ReceiptNotWithdrawable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingInProgress", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_RefundingOnly", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveBadParam", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveCancelNotCreator", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ReserveNotCancellable", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapEmptyRecipient", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceNotNative", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapSourceReserveUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_SwapSourceTokenNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapUnknownSlugName", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_SwapZeroSourceAmount", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TokenAddressUnset", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "provided", + "type": "uint8" + } + ], + "name": "WIRE_TokenPrecisionOutOfRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "WIRE_TokenPrecisionUnset", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_TrackedCodeZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "WIRE_UnexpectedError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "WIRE_UnexpectedTokenDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_WireNodesContractNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "WIRE_ZeroAmount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "BalanceSheetEmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Deposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "OutpostChainCodeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "ReserveActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "creator", + "type": "address" + } + ], + "name": "ReserveCancelRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "refundedAmount", + "type": "uint256" + } + ], + "name": "ReserveCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + } + ], + "name": "ReserveCreateRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "id", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "name": "SwapDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalMessageId", + "type": "bytes32" + } + ], + "name": "SwapRemitPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "depotAmount", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "SwapRemitUnpayable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "name": "SwapRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalSwapMessageId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "errData", + "type": "bytes" + } + ], + "name": "SwapRevertError", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "originalSwapMessageId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "SwapReverted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "TokenAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TrackedCodesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [], + "name": "BALANCE_SHEET_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "AttestationType", + "name": "attestationType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OPPAttestationIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_CREATE_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_CREATE_CANCEL_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SWAP_REQUEST_ATTESTATION", + "outputs": [ + { + "internalType": "AttestationType", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "__OPPEndpointManaged_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_payRemit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "cancel_create_reserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "bool", + "name": "isPrivate", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "creatorPubKey", + "type": "bytes" + } + ], + "name": "create_reserve", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "emitBalanceSheet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "getReserve", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "enum ReserveManager.LocalReserveStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "bool", + "name": "exists", + "type": "bool" + } + ], + "internalType": "struct ReserveManager.ReserveRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSummaryAttestations", + "outputs": [ + { + "components": [ + { + "internalType": "AttestationType", + "name": "type_", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "dataSize", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct AttestationEntry[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isConsumingScheduledOp", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeTokenCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "onReserveCreateCancelled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + } + ], + "name": "onReserveReady", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "depotAmount", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "originalSwapMessageId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "onSwapRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oppAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oppInboundAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outpostChainCode", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "bool", + "name": "isPrivate", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "creatorPubKey", + "type": "bytes" + } + ], + "internalType": "struct ReserveManagerLib.ReserveCreateArgs", + "name": "args", + "type": "tuple" + } + ], + "name": "requestReserveCreateErc20WithApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "internalType": "bool", + "name": "isPrivate", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "creatorPubKey", + "type": "bytes" + } + ], + "internalType": "struct ReserveManagerLib.ReserveCreateArgs", + "name": "args", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct ReserveManagerLib.PermitSig", + "name": "permitSig", + "type": "tuple" + } + ], + "name": "requestReserveCreateErc20WithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "name": "requestSwap", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "internalType": "struct ReserveManagerLib.SwapArgs", + "name": "args", + "type": "tuple" + } + ], + "name": "requestSwapErc20WithApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "sourceTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sourceReserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "targetChainCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetTokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "targetReserveCode", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "targetRecipient", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "targetAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "targetToleranceBps", + "type": "uint32" + } + ], + "internalType": "struct ReserveManagerLib.SwapArgs", + "name": "args", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct ReserveManagerLib.PermitSig", + "name": "permitSig", + "type": "tuple" + } + ], + "name": "requestSwapErc20WithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "reserves", + "outputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "externalTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "requestedWireAmount", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "connectorWeightBps", + "type": "uint32" + }, + { + "internalType": "enum ReserveManager.LocalReserveStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "bool", + "name": "exists", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oppAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_oppInboundAddress", + "type": "address" + } + ], + "name": "setOPPAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "chainCode", + "type": "uint64" + } + ], + "name": "setOutpostChainCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "address", + "name": "tokenAddr", + "type": "address" + }, + { + "internalType": "uint8", + "name": "precision", + "type": "uint8" + } + ], + "internalType": "struct ReserveManager.TrackedCodeEntry[]", + "name": "entries", + "type": "tuple[]" + } + ], + "name": "setTrackedCodes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapDepositCounter", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "tokenAddressesByCode", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "tokenPrecisionByCode", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "trackedCodesCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "trackedReserveCodes", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "trackedTokenCodes", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "tokenCode", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "reserveCode", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/solana/sim2/liqsol_core.json b/packages/sdk-outpost/src/assets/solana/sim2-2026-07-31-365c4416/liqsol_core.json similarity index 100% rename from packages/sdk-outpost/src/assets/solana/sim2/liqsol_core.json rename to packages/sdk-outpost/src/assets/solana/sim2-2026-07-31-365c4416/liqsol_core.json diff --git a/packages/sdk-outpost/src/assets/solana/sim2-2026-08-03-ca8d3a9d/liqsol_core.json b/packages/sdk-outpost/src/assets/solana/sim2-2026-08-03-ca8d3a9d/liqsol_core.json new file mode 100644 index 0000000..0e01656 --- /dev/null +++ b/packages/sdk-outpost/src/assets/solana/sim2-2026-08-03-ca8d3a9d/liqsol_core.json @@ -0,0 +1,10161 @@ +{ + "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + "metadata": { + "name": "liqsol_core", + "version": "0.1.0", + "spec": "0.1.0", + "description": "Created with Anchor" + }, + "instructions": [ + { + "name": "add_attestation", + "discriminator": [ + 206, + 82, + 129, + 170, + 54, + 159, + 161, + 156 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "outbound_message_buffer", + "writable": true + } + ], + "args": [ + { + "name": "attestation_type", + "type": "i32" + }, + { + "name": "data", + "type": "bytes" + } + ] + }, + { + "name": "add_top_performers_batch", + "docs": [ + "Process batch of ranks for addition (top performers from leaderboard)" + ], + "discriminator": [ + 152, + 7, + 241, + 69, + 197, + 73, + 32, + 12 + ], + "accounts": [ + { + "name": "allocation_state", + "writable": true + }, + { + "name": "active_list", + "writable": true + }, + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "leaderboard_state" + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for threshold parameters" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "admin_force_unbond_role", + "discriminator": [ + 80, + 107, + 27, + 49, + 126, + 25, + 31, + 238 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state" + }, + { + "name": "user", + "docs": [ + "The user whose role bond is being force-unbonded" + ] + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "aggregate_stake_metrics", + "docs": [ + "V2: Aggregate stake metrics across all validators using PDA architecture" + ], + "discriminator": [ + 13, + 245, + 47, + 202, + 170, + 73, + 98, + 207 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list" + } + ], + "args": [] + }, + { + "name": "bond_role", + "discriminator": [ + 143, + 136, + 20, + 230, + 136, + 103, + 107, + 167 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state" + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "calculate_unstake_allocations", + "docs": [ + "Calculate unstake allocations across validators (batched, up to 10 per call)", + "Distributes the FROZEN processing amount proportionally based on active stake", + "Call this after accumulating requests via accumulate_unstake_request" + ], + "discriminator": [ + 156, + 232, + 48, + 116, + 107, + 60, + 136, + 140 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - to track unstake allocation batching" + ], + "writable": true + }, + { + "name": "stake_metrics", + "docs": [ + "Stake metrics - to validate total unstake amount is available" + ] + }, + { + "name": "active_list", + "docs": [ + "Active validator list - to verify validators are in active list" + ] + }, + { + "name": "maintenance_ledger", + "docs": [ + "Maintenance ledger - to track last unstake allocation epoch" + ], + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + } + ], + "args": [] + }, + { + "name": "calculate_validator_allocations", + "discriminator": [ + 48, + 217, + 8, + 168, + 228, + 221, + 140, + 112 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - to track rebalancing progress" + ], + "writable": true + }, + { + "name": "stake_metrics", + "docs": [ + "Stake metrics - to get current total active stake" + ] + }, + { + "name": "active_list", + "docs": [ + "Active validator list - to verify validators are in active list" + ] + }, + { + "name": "reserve_pool", + "docs": [ + "Reserve pool - to read current balance" + ], + "writable": true + }, + { + "name": "maintenance_ledger", + "docs": [ + "Maintenance ledger - to track last rebalance epoch" + ], + "writable": true + }, + { + "name": "clock" + }, + { + "name": "global", + "docs": [ + "Global withdraw operator state - to read total_encumbered_funds" + ] + }, + { + "name": "global_config", + "docs": [ + "Global config for rebalancing thresholds" + ] + } + ], + "args": [] + }, + { + "name": "cancel_create_reserve", + "discriminator": [ + 218, + 158, + 127, + 156, + 61, + 162, + 19, + 255 + ], + "accounts": [ + { + "name": "creator", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve" + }, + { + "name": "outbound_message_buffer", + "writable": true + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + } + ] + }, + { + "name": "claim_rewards", + "discriminator": [ + 4, + 144, + 132, + 71, + 116, + 23, + 151, + 80 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_mint" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account holding liqSOL" + ], + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "claim_withdraw", + "docs": [ + "Pay user (stub) and close/burn the receipt via CPI to nft_factory." + ], + "discriminator": [ + 232, + 89, + 154, + 117, + 16, + 204, + 182, + 224 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global", + "docs": [ + "Global operator state" + ], + "writable": true + }, + { + "name": "mint_authority" + }, + { + "name": "receipt_data", + "writable": true + }, + { + "name": "mint_account", + "writable": true + }, + { + "name": "owner_ata", + "writable": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "global_config", + "docs": [ + "Global config for claim_withdrawals_enabled check" + ] + }, + { + "name": "token_program" + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "associated_token_program" + } + ], + "args": [] + }, + { + "name": "cleanup_envelope_chunks", + "discriminator": [ + 224, + 118, + 156, + 99, + 9, + 136, + 14, + 207 + ], + "accounts": [ + { + "name": "reaper", + "signer": true + }, + { + "name": "config" + }, + { + "name": "latest_outbound_envelope" + }, + { + "name": "chunk_buffer", + "writable": true + }, + { + "name": "uploader", + "writable": true + } + ], + "args": [ + { + "name": "epoch_index", + "type": "u32" + } + ] + }, + { + "name": "cleanup_graveyard_batch", + "docs": [ + "Cleanup graveyard validators batch: remove validators that have been NotDelegated for > 10 epochs", + "This function should be called after aggregate_stake_metrics.", + "Validators meeting the cleanup criteria will have their PDAs closed and rent returned to admin." + ], + "discriminator": [ + 241, + 120, + 180, + 4, + 160, + 109, + 206, + 71 + ], + "accounts": [ + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "global_config" + }, + { + "name": "clock" + }, + { + "name": "cranky", + "writable": true, + "signer": true + } + ], + "args": [] + }, + { + "name": "commit_underwrite", + "discriminator": [ + 88, + 172, + 141, + 118, + 9, + 74, + 188, + 117 + ], + "accounts": [ + { + "name": "underwriter", + "writable": true, + "signer": true + }, + { + "name": "operator_registry" + }, + { + "name": "outbound_message_buffer", + "writable": true + } + ], + "args": [ + { + "name": "uic_bytes", + "type": "bytes" + } + ] + }, + { + "name": "complete_unbond_role", + "discriminator": [ + 204, + 50, + 36, + 17, + 192, + 156, + 246, + 64 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state" + }, + { + "name": "user", + "docs": [ + "The user whose unbond is being completed" + ] + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "complete_withdraw", + "discriminator": [ + 172, + 129, + 141, + 17, + 95, + 253, + 251, + 98 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "user", + "writable": true + }, + { + "name": "outpost_account", + "writable": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "user_key", + "type": "pubkey" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "conclude_merge_activating", + "docs": [ + "Conclude merge activating - marks merge complete if all validators processed or 0 validators" + ], + "discriminator": [ + 207, + 32, + 222, + 98, + 243, + 188, + 38, + 67 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "graveyard_list" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "conclude_merge_deactivating", + "docs": [ + "Conclude merge deactivating - marks merge complete if all validators processed or 0 validators" + ], + "discriminator": [ + 66, + 206, + 43, + 71, + 122, + 97, + 33, + 24 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "withdraw_global", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "graveyard_list" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "conclude_sync_stakes", + "docs": [ + "Conclude sync stakes - marks sync complete if all validators processed or 0 validators" + ], + "discriminator": [ + 77, + 127, + 231, + 78, + 151, + 23, + 237, + 207 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "graveyard_list" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "create_reserve", + "discriminator": [ + 26, + 161, + 211, + 19, + 90, + 218, + 112, + 235 + ], + "accounts": [ + { + "name": "creator", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "reserve_vault", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "creator_ata", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "description", + "type": "string" + }, + { + "name": "is_private", + "type": "bool" + } + ] + }, + { + "name": "create_reserve_native", + "discriminator": [ + 124, + 173, + 189, + 251, + 64, + 230, + 215, + 6 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "description", + "type": "string" + } + ] + }, + { + "name": "create_reserve_spl_authority", + "discriminator": [ + 168, + 158, + 192, + 109, + 179, + 81, + 156, + 173 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "reserve_vault", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "authority_ata", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "description", + "type": "string" + } + ] + }, + { + "name": "deposit", + "discriminator": [ + 242, + 35, + 198, + 137, + 82, + 225, + 242, + 182 + ], + "accounts": [ + { + "name": "depositor", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "operator_type", + "type": "u32" + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "deposit_non_native", + "discriminator": [ + 75, + 182, + 44, + 132, + 167, + 101, + 31, + 138 + ], + "accounts": [ + { + "name": "depositor", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "depositor_ata", + "writable": true + }, + { + "name": "collateral_vault", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "chain_code", + "type": "u64" + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "operator_type", + "type": "u32" + }, + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "deposit_to_reserve", + "discriminator": [ + 8, + 79, + 123, + 129, + 146, + 140, + 178, + 128 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "depositor", + "writable": true, + "signer": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "ephemeral_stake", + "writable": true + }, + { + "name": "controller_state" + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "seed", + "type": "u32" + } + ] + }, + { + "name": "desynd", + "discriminator": [ + 12, + 71, + 102, + 46, + 8, + 179, + 29, + 190 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "outpost_account", + "docs": [ + "User's outpost account" + ], + "writable": true + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "discard_envelope_chunks", + "discriminator": [ + 180, + 10, + 216, + 16, + 101, + 165, + 10, + 70 + ], + "accounts": [ + { + "name": "uploader", + "docs": [ + "The operator that uploaded (and rent-paid) the buffer. Authorization is", + "structural: the buffer PDA's third seed is this signer's key, so the", + "account constraint can only ever resolve the signer's OWN buffer —", + "no other operator's in-flight upload is reachable from here." + ], + "writable": true, + "signer": true + }, + { + "name": "chunk_buffer", + "writable": true + } + ], + "args": [ + { + "name": "epoch_index", + "type": "u32" + } + ] + }, + { + "name": "emit_outbound_envelope", + "discriminator": [ + 142, + 109, + 163, + 152, + 3, + 80, + 224, + 157 + ], + "accounts": [ + { + "name": "authority", + "docs": [ + "The outpost authority. The standalone emit is a recovery escape hatch", + "only — an open signer here could advance the outbound chain tip to a", + "digest the depot never accepted, so it is gated exactly like the other", + "admin instructions. Even the authority is bound by the guards in", + "`emit_outbound_inner`: the emitted epoch must be exactly the next", + "outbound slot AND already accepted by the inbound cursor, so a", + "recovery emit can only fill an accepted-but-unemitted gap and can", + "never preempt a pending epoch's consensus-triggered emit." + ], + "writable": true, + "signer": true + }, + { + "name": "config", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "outbound_envelopes", + "writable": true + }, + { + "name": "latest_outbound_envelope", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "wire_epoch_index", + "type": "u32" + } + ] + }, + { + "name": "epoch_in", + "discriminator": [ + 85, + 70, + 55, + 132, + 50, + 198, + 135, + 115 + ], + "accounts": [ + { + "name": "operator", + "writable": true, + "signer": true + }, + { + "name": "config", + "writable": true + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "epoch_deliveries", + "writable": true + }, + { + "name": "chunk_buffer", + "writable": true + }, + { + "name": "inbound_envelopes", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "outbound_envelopes", + "writable": true + }, + { + "name": "latest_outbound_envelope", + "writable": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "reserve_aggregate", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "chunk_index", + "type": "u16" + }, + { + "name": "total_chunks", + "type": "u16" + }, + { + "name": "total_bytes", + "type": "u32" + }, + { + "name": "chunk_data", + "type": "bytes" + } + ] + }, + { + "name": "finalize_outpost_account", + "discriminator": [ + 181, + 14, + 39, + 201, + 210, + 148, + 241, + 187 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "pool_authority" + }, + { + "name": "outpost_account", + "writable": true + }, + { + "name": "pretoken_purchase_history" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "get_min_max_resolved_epoch_deactivations", + "docs": [ + "Get minimum max_resolved_epoch_deactivations from MaintenanceLedger", + "This is designed to be called via CPI from other programs" + ], + "discriminator": [ + 171, + 169, + 39, + 207, + 181, + 67, + 86, + 73 + ], + "accounts": [ + { + "name": "epoch_state" + } + ], + "args": [], + "returns": "u16" + }, + { + "name": "has_role", + "discriminator": [ + 218, + 136, + 44, + 87, + 142, + 247, + 141, + 195 + ], + "accounts": [ + { + "name": "user", + "docs": [ + "User whose role status is being checked." + ] + }, + { + "name": "outpost_account" + }, + { + "name": "global_state" + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ], + "returns": "bool" + }, + { + "name": "init_bucket", + "docs": [ + "Done///" + ], + "discriminator": [ + 237, + 69, + 61, + 218, + 18, + 60, + 21, + 236 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "liqsol_mint" + }, + { + "name": "system_program" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + } + ], + "args": [] + }, + { + "name": "init_reserve", + "discriminator": [ + 138, + 245, + 71, + 225, + 153, + 4, + 3, + 43 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve_aggregate", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "init_tranche_state", + "discriminator": [ + 87, + 134, + 47, + 11, + 241, + 14, + 118, + 201 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "chainlink_feed" + }, + { + "name": "chainlink_program" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "init_wire_config", + "discriminator": [ + 109, + 159, + 158, + 174, + 192, + 150, + 14, + 34 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize", + "discriminator": [ + 175, + 175, + 109, + 31, + 13, + 152, + 155, + 237 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint" + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "pool_authority" + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [] + }, + { + "name": "initialize_active_list", + "docs": [ + "Initialize the active validator list (zero-copy)" + ], + "discriminator": [ + 222, + 123, + 57, + 119, + 223, + 4, + 150, + 36 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "active_list", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_epoch_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 139, + 122, + 53, + 254, + 85, + 205, + 138, + 245 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_global_config", + "discriminator": [ + 113, + 216, + 122, + 131, + 225, + 209, + 22, + 55 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "program" + }, + { + "name": "program_data" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_graveyard_list", + "docs": [ + "Initialize the graveyard validator list (zero-copy)" + ], + "discriminator": [ + 178, + 8, + 179, + 111, + 75, + 19, + 130, + 176 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_outpost", + "discriminator": [ + 9, + 54, + 169, + 104, + 32, + 218, + 81, + 11 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "config", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "operator_registry", + "writable": true + }, + { + "name": "inbound_envelopes", + "writable": true + }, + { + "name": "outbound_envelopes", + "writable": true + }, + { + "name": "latest_outbound_envelope", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "chain_code", + "type": "u64" + } + ] + }, + { + "name": "initialize_pay_rate_history", + "docs": [ + "Done///" + ], + "discriminator": [ + 157, + 190, + 74, + 135, + 91, + 232, + 250, + 122 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "pay_rate_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_payout_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 105, + 120, + 7, + 121, + 238, + 221, + 62, + 160 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "payout_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_pretoken_purchase_history", + "docs": [ + "Admin-only: initialize PretokenPurchaseHistory PDA for a pool" + ], + "discriminator": [ + 140, + 166, + 196, + 128, + 189, + 240, + 159, + 1 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "pool_pretoken_record", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_processing_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 228, + 202, + 164, + 194, + 29, + 134, + 125, + 242 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_reserve_pool", + "docs": [ + "Done///" + ], + "discriminator": [ + 4, + 7, + 171, + 131, + 156, + 172, + 150, + 220 + ], + "accounts": [ + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "controller_state", + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [] + }, + { + "name": "initialize_stake_allocation_state", + "discriminator": [ + 159, + 99, + 175, + 136, + 251, + 241, + 88, + 82 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "writable": true + }, + { + "name": "clock" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_stake_controller_state", + "docs": [ + "Done///" + ], + "discriminator": [ + 220, + 247, + 13, + 165, + 202, + 250, + 102, + 197 + ], + "accounts": [ + { + "name": "controller_state", + "writable": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "authority", + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_stake_metrics", + "docs": [ + "Done///" + ], + "discriminator": [ + 203, + 209, + 129, + 123, + 12, + 17, + 20, + 175 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_vault", + "docs": [ + "Done///" + ], + "discriminator": [ + 48, + 191, + 163, + 44, + 71, + 129, + 63, + 164 + ], + "accounts": [ + { + "name": "vault", + "writable": true + }, + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "controller_state", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "initialize_withdraw_global", + "discriminator": [ + 110, + 0, + 210, + 101, + 59, + 75, + 224, + 158 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "docs": [ + "liqSOL Token-2022 mint" + ] + }, + { + "name": "global", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [] + }, + { + "name": "initialize_withdraw_metadata", + "discriminator": [ + 0, + 170, + 135, + 3, + 35, + 58, + 213, + 75 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "metadata", + "writable": true + }, + { + "name": "global_config" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": { + "name": "MetadataArgs" + } + } + } + ] + }, + { + "name": "merge_activating_stakes", + "docs": [ + "V2: Merge activating transient stakes using PDA architecture", + "Returns the number of epochs successfully merged" + ], + "discriminator": [ + 181, + 183, + 76, + 92, + 57, + 11, + 212, + 189 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "treasury", + "docs": [ + "(treasury funded it at creation), closing the rent loop within the protocol." + ], + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validators list (zero-copy)" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validators list (zero-copy) - needed to check validators in cooldown" + ] + }, + { + "name": "validator_info", + "docs": [ + "Validator info PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "validator_transient", + "docs": [ + "Validator transient tracking PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + } + ], + "args": [ + { + "name": "vote_account", + "type": "pubkey" + } + ], + "returns": "u16" + }, + { + "name": "merge_deactivated_stakes", + "docs": [ + "V2: Merge fully deactivated stakes back to reserve" + ], + "discriminator": [ + 160, + 255, + 180, + 104, + 216, + 98, + 248, + 73 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "cranky", + "signer": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validators list (zero-copy)" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validators list (zero-copy) - needed to check validators in cooldown" + ] + }, + { + "name": "validator_info", + "docs": [ + "Validator info PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "validator_transient", + "docs": [ + "Validator transient tracking PDA for the validator being processed" + ], + "writable": true + }, + { + "name": "withdraw_global", + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "reserve_pool", + "docs": [ + "(principal stays). The merged-in rent is then withdrawn to treasury." + ], + "writable": true + }, + { + "name": "treasury", + "docs": [ + "back from reserve, closing the rent loop (treasury funded it at creation)." + ], + "writable": true + } + ], + "args": [ + { + "name": "vote_account", + "type": "pubkey" + } + ] + }, + { + "name": "migrate_batch_orchestrator", + "docs": [ + "One-shot migration: realloc BatchOrchestrator for the four per-op", + "`*_started_epoch: u16` fields + restored `_reserved` buffer.", + "Idempotent, ungated. `payer` covers the rent delta." + ], + "discriminator": [ + 130, + 240, + 40, + 175, + 53, + 209, + 232, + 11 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "batch_orchestrator", + "docs": [ + "is the only authorization needed; the op is idempotent." + ], + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "migrate_batch_orchestrator_v1_6", + "docs": [ + "One-shot migration: stamp BatchOrchestrator's v1.6.0 epoch pins", + "(unstake_started_epoch + cursors_epoch) to the current epoch so a", + "mid-epoch upgrade doesn't wipe live cursors. Admin-gated, idempotent", + "within an epoch; refuses re-runs after an epoch boundary (a late", + "re-stamp would bless dead cursors as live)." + ], + "discriminator": [ + 124, + 12, + 96, + 155, + 218, + 4, + 229, + 56 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "batch_orchestrator", + "writable": true + } + ], + "args": [] + }, + { + "name": "migrate_stake_allocation_state", + "docs": [ + "One-shot migration: explicitly zero StakeAllocationState.rebalance_started_epoch", + "(repurposed from the deprecated addition_target_rank slot). Admin-gated, idempotent." + ], + "discriminator": [ + 40, + 175, + 21, + 85, + 88, + 249, + 223, + 73 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_allocation_state", + "writable": true + } + ], + "args": [] + }, + { + "name": "migrate_stake_metrics", + "docs": [ + "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)" + ], + "discriminator": [ + 183, + 154, + 168, + 221, + 78, + 179, + 112, + 165 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "migrate_user_record", + "discriminator": [ + 6, + 118, + 249, + 178, + 209, + 106, + 197, + 25 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "user_ata" + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "migrate_validator_info_batch", + "docs": [ + "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)", + "Pass validator_info PDAs via remaining_accounts" + ], + "discriminator": [ + 250, + 77, + 53, + 116, + 38, + 22, + 12, + 100 + ], + "accounts": [ + { + "name": "global_config" + }, + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "process_graveyard_validators_batch", + "docs": [ + "Process graveyard validators batch: check transient resolution, queue main stake deactivation", + "Validators in graveyard with resolved transients will have their main stake queued for deactivation" + ], + "discriminator": [ + 141, + 178, + 8, + 118, + 133, + 183, + 86, + 233 + ], + "accounts": [ + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "clock" + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "process_pay_cycle", + "docs": [ + "Done///" + ], + "discriminator": [ + 98, + 183, + 240, + 247, + 39, + 248, + 198, + 224 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "payout_state", + "writable": true + }, + { + "name": "pay_rate_history", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "stake_controller_authority", + "writable": true + }, + { + "name": "mint_authority" + }, + { + "name": "liqsol_program" + }, + { + "name": "token_program" + }, + { + "name": "instructions" + }, + { + "name": "global_config", + "docs": [ + "Global config for process_pay_cycle_enabled check" + ] + } + ], + "args": [] + }, + { + "name": "process_stake_orders", + "docs": [ + "V2: Process stake orders using PDA architecture with pre-calculated allocations", + "Validators must be sent contiguously from the active list starting at validators_processed_this_epoch" + ], + "discriminator": [ + 92, + 161, + 223, + 219, + 54, + 232, + 40, + 16 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "treasury", + "docs": [ + "(system transfer, treasury signs). Falls back to admin only if treasury is dry." + ], + "writable": true + }, + { + "name": "vault" + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validator list - used to get total validator count" + ] + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - to verify allocations have been calculated for current epoch" + ], + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "system_program" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "stake_config" + }, + { + "name": "rent" + }, + { + "name": "global_config", + "docs": [ + "Global config for process_stake_orders_enabled check" + ] + } + ], + "args": [ + { + "name": "caller_funds_rent", + "type": "bool" + } + ] + }, + { + "name": "process_transfer_hook", + "discriminator": [ + 167, + 45, + 151, + 64, + 209, + 186, + 192, + 78 + ], + "accounts": [ + { + "name": "source_token" + }, + { + "name": "destination_token" + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_token_account" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "process_unstake_orders", + "docs": [ + "V2: Process unstake orders by splitting and deactivating stakes", + "Validators must be sent contiguously: first from active list, then graveyard list" + ], + "discriminator": [ + 44, + 122, + 251, + 185, + 253, + 193, + 250, + 191 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "vault", + "writable": true + }, + { + "name": "treasury", + "docs": [ + "here (system transfer, treasury signs). Falls back to admin only if dry.", + "Reserve no longer sources rent, so it's not needed by this instruction." + ], + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validator list - used to get total validator count" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validator list - allows unstaking from graveyard validators" + ] + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "stake_config" + }, + { + "name": "rent" + }, + { + "name": "system_program" + }, + { + "name": "stake_program" + }, + { + "name": "global_config", + "docs": [ + "Global config for process_unstake_orders_enabled check" + ] + } + ], + "args": [ + { + "name": "caller_funds_rent", + "type": "bool" + } + ] + }, + { + "name": "purchase", + "discriminator": [ + 21, + 93, + 113, + 154, + 193, + 160, + 242, + 168 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "buyer_ata", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "outpost_account", + "docs": [ + "User's pretoken deposit record" + ], + "writable": true + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "user_pretoken_record", + "writable": true + }, + { + "name": "chainlink_feed" + }, + { + "name": "chainlink_program" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + }, + { + "name": "pretoken_purchase_history", + "writable": true + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "purchase_from_yield", + "discriminator": [ + 232, + 143, + 47, + 77, + 246, + 113, + 31, + 202 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "liqsol_mint" + }, + { + "name": "pool_authority", + "docs": [ + "Pool authority PDA" + ] + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "liqsol_pool_ata", + "docs": [ + "Pool's liqSOL ATA - deterministically derived from pool_authority + liqsol_mint" + ], + "writable": true + }, + { + "name": "liqsol_pool_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "token_program" + }, + { + "name": "system_program" + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "pool_pretoken_record", + "writable": true + }, + { + "name": "chainlink_feed" + }, + { + "name": "chainlink_program" + }, + { + "name": "pretoken_purchase_history", + "writable": true + } + ], + "args": [] + }, + { + "name": "record_price", + "discriminator": [ + 210, + 113, + 46, + 101, + 107, + 218, + 83, + 51 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "tranche_state" + }, + { + "name": "price_history", + "writable": true + }, + { + "name": "chainlink_program" + }, + { + "name": "chainlink_feed" + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "refresh_stake_metrics_post_late_epoch", + "docs": [ + "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)", + "Requires Distribution + UnstakeOrder as prerequisites", + "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch" + ], + "discriminator": [ + 11, + 226, + 87, + 114, + 47, + 159, + 99, + 157 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + } + ], + "args": [] + }, + { + "name": "refresh_stake_metrics_post_sync", + "docs": [ + "V2: Refresh stake metrics after removal selection + PDA setup", + "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites", + "Tracks completion in last_post_sync_stake_metrics_refresh_epoch" + ], + "discriminator": [ + 177, + 250, + 32, + 155, + 196, + 199, + 199, + 249 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "stake_metrics", + "writable": true + }, + { + "name": "epoch_state", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "active_list" + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + } + ], + "args": [] + }, + { + "name": "refund", + "discriminator": [ + 2, + 96, + 183, + 251, + 63, + 208, + 46, + 46 + ], + "accounts": [ + { + "name": "associated_token_program" + }, + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "outpost_account", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "refund_liqsol_ata", + "writable": true + }, + { + "name": "liqsol_pool_user_record", + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_mint" + }, + { + "name": "token_program" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "register_system_pda", + "discriminator": [ + 110, + 93, + 36, + 156, + 179, + 69, + 54, + 210 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "pda_owner", + "docs": [ + "The PDA whose user record we're creating — must be system-owned (no program data)." + ] + }, + { + "name": "pda_ata" + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account holding liqSOL (for index sync)" + ], + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "register_user", + "discriminator": [ + 2, + 241, + 150, + 223, + 99, + 214, + 116, + 97 + ], + "accounts": [ + { + "name": "payer", + "writable": true, + "signer": true + }, + { + "name": "user_ata" + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account holding liqSOL (for index sync)" + ], + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [] + }, + { + "name": "remove_low_performers_batch", + "docs": [ + "Process batch of validators for removal (below exit threshold)" + ], + "discriminator": [ + 91, + 142, + 166, + 98, + 245, + 245, + 159, + 44 + ], + "accounts": [ + { + "name": "active_list", + "writable": true + }, + { + "name": "graveyard_list", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "allocation_state" + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "request_swap", + "discriminator": [ + 170, + 167, + 97, + 14, + 88, + 175, + 39, + 108 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "source_token_code", + "type": "u64" + }, + { + "name": "source_reserve_code", + "type": "u64" + }, + { + "name": "source_amount", + "type": "u64" + }, + { + "name": "target_chain_code", + "type": "u64" + }, + { + "name": "target_token_code", + "type": "u64" + }, + { + "name": "target_reserve_code", + "type": "u64" + }, + { + "name": "target_recipient", + "type": "bytes" + }, + { + "name": "target_amount", + "type": "u64" + }, + { + "name": "target_tolerance_bps", + "type": "u32" + } + ] + }, + { + "name": "request_swap_spl", + "discriminator": [ + 119, + 83, + 153, + 185, + 164, + 202, + 45, + 38 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "config" + }, + { + "name": "reserve", + "writable": true + }, + { + "name": "reserve_vault", + "writable": true + }, + { + "name": "mint" + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "outbound_message_buffer", + "writable": true + }, + { + "name": "token_program" + } + ], + "args": [ + { + "name": "source_token_code", + "type": "u64" + }, + { + "name": "source_reserve_code", + "type": "u64" + }, + { + "name": "source_amount", + "type": "u64" + }, + { + "name": "target_chain_code", + "type": "u64" + }, + { + "name": "target_token_code", + "type": "u64" + }, + { + "name": "target_reserve_code", + "type": "u64" + }, + { + "name": "target_recipient", + "type": "bytes" + }, + { + "name": "target_amount", + "type": "u64" + }, + { + "name": "target_tolerance_bps", + "type": "u32" + } + ] + }, + { + "name": "request_unbond_role", + "discriminator": [ + 223, + 225, + 84, + 83, + 115, + 183, + 80, + 33 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "global_state" + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + } + ] + }, + { + "name": "request_withdraw", + "discriminator": [ + 137, + 95, + 187, + 96, + 250, + 138, + 31, + 182 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "owner", + "docs": [ + "Recipient of the NFT receipt (can be user)" + ], + "writable": true + }, + { + "name": "global", + "docs": [ + "Global operator state" + ], + "writable": true + }, + { + "name": "liqsol_mint", + "docs": [ + "liqSOL mint reference (must match Global.liqsol_mint so we can read decimals)" + ], + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "docs": [ + "Distribution state for index tracking" + ], + "writable": true + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's token account holding liqSOL (for sync_index balance)" + ], + "writable": true + }, + { + "name": "reserve_pool", + "docs": [ + "Reserve pool - to check available balance for instant withdrawals" + ], + "writable": true + }, + { + "name": "stake_allocation_state", + "docs": [ + "Stake allocation state - for accumulate_unstake_request" + ], + "writable": true + }, + { + "name": "stake_metrics", + "docs": [ + "Stake metrics - for accumulate_unstake_request" + ] + }, + { + "name": "maintenance_ledger", + "docs": [ + "Maintenance ledger - for accumulate_unstake_request" + ] + }, + { + "name": "global_config", + "docs": [ + "Global config for min_unstake_request setting" + ] + }, + { + "name": "clock" + }, + { + "name": "mint_authority" + }, + { + "name": "receipt_data", + "writable": true + }, + { + "name": "metadata", + "writable": true + }, + { + "name": "nft_mint", + "docs": [ + "Uses global.next_receipt_id for deterministic, collision-free address generation" + ], + "writable": true + }, + { + "name": "nft_ata", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "token_interface" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "set_admin", + "discriminator": [ + 251, + 163, + 0, + 52, + 91, + 194, + 187, + 92 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + }, + { + "name": "new_authority" + } + ], + "args": [] + }, + { + "name": "set_cranky", + "discriminator": [ + 232, + 48, + 178, + 74, + 194, + 60, + 143, + 164 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + }, + { + "name": "new_authority" + } + ], + "args": [] + }, + { + "name": "set_paused", + "discriminator": [ + 91, + 60, + 125, + 192, + 176, + 225, + 166, + 218 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "paused", + "type": "bool" + } + ] + }, + { + "name": "set_retention_config", + "discriminator": [ + 224, + 115, + 230, + 164, + 16, + 100, + 30, + 234 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config", + "writable": true + } + ], + "args": [ + { + "name": "retention_epochs", + "type": "u32" + } + ] + }, + { + "name": "set_role_principal", + "discriminator": [ + 33, + 199, + 203, + 50, + 60, + 167, + 90, + 92 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "role", + "type": { + "defined": { + "name": "Role" + } + } + }, + { + "name": "principal", + "type": "u64" + } + ] + }, + { + "name": "set_role_warmup_duration", + "discriminator": [ + 229, + 188, + 179, + 162, + 56, + 173, + 228, + 68 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "duration_seconds", + "type": "i64" + } + ] + }, + { + "name": "set_token_address", + "discriminator": [ + 231, + 130, + 7, + 149, + 155, + 155, + 110, + 53 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config", + "writable": true + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + } + ] + }, + { + "name": "set_token_precision", + "discriminator": [ + 202, + 218, + 56, + 157, + 228, + 15, + 175, + 107 + ], + "accounts": [ + { + "name": "authority", + "signer": true + }, + { + "name": "config", + "writable": true + } + ], + "args": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "decimals", + "type": "u8" + } + ] + }, + { + "name": "set_wire_state", + "discriminator": [ + 62, + 194, + 254, + 126, + 251, + 69, + 35, + 228 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + } + ], + "args": [ + { + "name": "wire_state", + "type": { + "defined": { + "name": "WireState" + } + } + } + ] + }, + { + "name": "setup_validator_pdas_batch", + "discriminator": [ + 115, + 37, + 9, + 246, + 144, + 224, + 178, + 79 + ], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "active_list", + "writable": true + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "allocation_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "system_program", + "docs": [ + "Needed for manual PDA creation" + ] + } + ], + "args": [] + }, + { + "name": "slash_bond", + "discriminator": [ + 143, + 246, + 51, + 243, + 88, + 198, + 217, + 48 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "user", + "docs": [ + "The user being slashed" + ] + }, + { + "name": "outpost_account", + "writable": true + } + ], + "args": [] + }, + { + "name": "sol_to_liqsol", + "discriminator": [ + 250, + 110, + 1, + 100, + 71, + 3, + 235, + 113 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "deposit_authority", + "writable": true + }, + { + "name": "system_program" + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "liqsol_program" + }, + { + "name": "pay_rate_history" + }, + { + "name": "stake_program" + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "liqsol_mint_authority" + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "vault" + }, + { + "name": "ephemeral_stake", + "writable": true + }, + { + "name": "controller_state", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for deposit settings" + ] + }, + { + "name": "payout_state", + "writable": true + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "docs": [ + "The bucket's associated token account" + ], + "writable": true + }, + { + "name": "user_record", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "instructions_sysvar" + }, + { + "name": "clock" + }, + { + "name": "stake_history" + }, + { + "name": "rent" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + }, + { + "name": "seed", + "type": "u32" + } + ] + }, + { + "name": "sync_active_scores", + "discriminator": [ + 38, + 188, + 30, + 93, + 139, + 1, + 140, + 168 + ], + "accounts": [ + { + "name": "active_list", + "writable": true + }, + { + "name": "leaderboard_state" + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for late epoch slot gate" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "sync_leaderboard_scores_batch", + "docs": [ + "region: Validator Leaderboard Syncing" + ], + "discriminator": [ + 52, + 11, + 210, + 173, + 90, + 5, + 48, + 50 + ], + "accounts": [ + { + "name": "leaderboard_state" + }, + { + "name": "processing_state", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "sync_main_stake_accounts", + "docs": [ + "V2: Sync main stake accounts using PDA architecture (batched)", + "Processes validators in batches via remaining_accounts (batch size is enforced client-side)", + "Note: Only syncs primary delegated stakes, not transient stakes" + ], + "discriminator": [ + 159, + 17, + 201, + 39, + 89, + 62, + 65, + 135 + ], + "accounts": [ + { + "name": "admin", + "signer": true + }, + { + "name": "processing_state", + "docs": [ + "Processing state for tracking batch progress" + ], + "writable": true + }, + { + "name": "epoch_state", + "docs": [ + "Epoch state to mark completion" + ], + "writable": true + }, + { + "name": "active_list", + "docs": [ + "Active validator list - to check validator counts and membership" + ] + }, + { + "name": "graveyard_list", + "docs": [ + "Graveyard validator list - graveyard validators also need syncing for merge operations" + ] + }, + { + "name": "stake_history" + }, + { + "name": "vault", + "writable": true + }, + { + "name": "reserve_pool", + "writable": true + }, + { + "name": "stake_program" + }, + { + "name": "clock" + } + ], + "args": [] + }, + { + "name": "sync_validator_selection_thresholds", + "docs": [ + "Calculate and store entry/exit thresholds from validator leaderboard" + ], + "discriminator": [ + 102, + 171, + 32, + 136, + 205, + 105, + 208, + 225 + ], + "accounts": [ + { + "name": "leaderboard_state" + }, + { + "name": "allocation_state", + "writable": true + }, + { + "name": "maintenance_ledger", + "writable": true + }, + { + "name": "global_config", + "docs": [ + "Global config for min_vpp_entry and min_vpp_exit" + ] + }, + { + "name": "authority", + "signer": true + } + ], + "args": [] + }, + { + "name": "synd", + "discriminator": [ + 153, + 175, + 231, + 40, + 44, + 65, + 175, + 172 + ], + "accounts": [ + { + "name": "user", + "writable": true, + "signer": true + }, + { + "name": "liqsol_mint", + "writable": true + }, + { + "name": "global_state", + "writable": true + }, + { + "name": "distribution_state", + "writable": true + }, + { + "name": "user_ata", + "writable": true + }, + { + "name": "pool_authority" + }, + { + "name": "bucket_authority" + }, + { + "name": "bucket_token_account", + "writable": true + }, + { + "name": "bucket_user_record", + "writable": true + }, + { + "name": "sender_user_record", + "writable": true + }, + { + "name": "receiver_user_record", + "writable": true + }, + { + "name": "extra_account_meta_list" + }, + { + "name": "liqsol_core_program" + }, + { + "name": "transfer_hook_program" + }, + { + "name": "liqsol_pool_ata", + "writable": true + }, + { + "name": "outpost_account", + "docs": [ + "User's pretoken deposit record" + ], + "writable": true + }, + { + "name": "pretoken_purchase_history", + "writable": true + }, + { + "name": "token_program" + }, + { + "name": "associated_token_program" + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "amount", + "type": "u64" + } + ] + }, + { + "name": "update_config_bool", + "discriminator": [ + 79, + 36, + 65, + 239, + 188, + 35, + 13, + 160 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyBool" + } + } + }, + { + "name": "value", + "type": "bool" + } + ] + }, + { + "name": "update_config_u16", + "discriminator": [ + 149, + 9, + 244, + 25, + 46, + 136, + 59, + 173 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyU16" + } + } + }, + { + "name": "value", + "type": "u16" + } + ] + }, + { + "name": "update_config_u64", + "discriminator": [ + 120, + 43, + 124, + 106, + 97, + 80, + 208, + 123 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyU64" + } + } + }, + { + "name": "value", + "type": "u64" + } + ] + }, + { + "name": "update_config_u8", + "discriminator": [ + 17, + 160, + 31, + 134, + 222, + 250, + 229, + 253 + ], + "accounts": [ + { + "name": "global_config", + "writable": true + }, + { + "name": "admin", + "signer": true + } + ], + "args": [ + { + "name": "key", + "type": { + "defined": { + "name": "ConfigKeyU8" + } + } + }, + { + "name": "value", + "type": "u8" + } + ] + }, + { + "name": "update_growth_parameters", + "discriminator": [ + 172, + 187, + 237, + 233, + 250, + 160, + 115, + 239 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "price_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "supply_growth_bps", + "type": "u16" + }, + { + "name": "price_growth_cents", + "type": "u16" + } + ] + }, + { + "name": "update_price_bounds", + "discriminator": [ + 241, + 116, + 141, + 65, + 61, + 95, + 232, + 28 + ], + "accounts": [ + { + "name": "admin", + "writable": true, + "signer": true + }, + { + "name": "global_config" + }, + { + "name": "tranche_state", + "writable": true + }, + { + "name": "price_history", + "writable": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "min_price_usd", + "type": "u64" + }, + { + "name": "max_price_usd", + "type": "u64" + }, + { + "name": "max_staleness_seconds", + "type": "i64" + } + ] + } + ], + "accounts": [ + { + "name": "BatchOrchestrator", + "discriminator": [ + 70, + 163, + 206, + 225, + 7, + 189, + 73, + 94 + ] + }, + { + "name": "DistributionState", + "discriminator": [ + 7, + 25, + 94, + 15, + 208, + 170, + 4, + 103 + ] + }, + { + "name": "EnvelopeChunks", + "discriminator": [ + 51, + 126, + 62, + 161, + 85, + 175, + 66, + 63 + ] + }, + { + "name": "EnvelopeLog", + "discriminator": [ + 73, + 107, + 128, + 29, + 76, + 210, + 155, + 113 + ] + }, + { + "name": "EpochDeliveries", + "discriminator": [ + 134, + 83, + 77, + 28, + 26, + 189, + 174, + 190 + ] + }, + { + "name": "Global", + "discriminator": [ + 167, + 232, + 232, + 177, + 200, + 108, + 114, + 127 + ] + }, + { + "name": "GlobalConfig", + "discriminator": [ + 149, + 8, + 156, + 202, + 160, + 252, + 176, + 217 + ] + }, + { + "name": "GlobalState", + "discriminator": [ + 163, + 46, + 74, + 168, + 216, + 123, + 133, + 98 + ] + }, + { + "name": "LatestOutboundEnvelope", + "discriminator": [ + 74, + 80, + 163, + 159, + 178, + 236, + 249, + 15 + ] + }, + { + "name": "LeaderboardState", + "discriminator": [ + 211, + 181, + 29, + 120, + 189, + 4, + 106, + 111 + ] + }, + { + "name": "LiqReceiptData", + "discriminator": [ + 75, + 119, + 90, + 79, + 25, + 200, + 9, + 46 + ] + }, + { + "name": "MaintenanceLedger", + "discriminator": [ + 140, + 250, + 92, + 173, + 147, + 65, + 26, + 39 + ] + }, + { + "name": "OperatorRegistry", + "discriminator": [ + 194, + 188, + 172, + 240, + 220, + 209, + 36, + 100 + ] + }, + { + "name": "OutboundMessageBuffer", + "discriminator": [ + 133, + 145, + 100, + 61, + 28, + 106, + 209, + 197 + ] + }, + { + "name": "OutpostAccount", + "discriminator": [ + 87, + 205, + 242, + 192, + 212, + 51, + 26, + 93 + ] + }, + { + "name": "OutpostConfig", + "discriminator": [ + 211, + 233, + 11, + 174, + 26, + 119, + 188, + 182 + ] + }, + { + "name": "PayRateHistory", + "discriminator": [ + 139, + 8, + 65, + 111, + 71, + 41, + 187, + 218 + ] + }, + { + "name": "PayoutState", + "discriminator": [ + 106, + 54, + 13, + 167, + 203, + 44, + 168, + 150 + ] + }, + { + "name": "PretokenPurchaseHistory", + "discriminator": [ + 33, + 71, + 113, + 206, + 33, + 180, + 236, + 131 + ] + }, + { + "name": "PriceHistory", + "discriminator": [ + 38, + 241, + 40, + 19, + 42, + 228, + 93, + 152 + ] + }, + { + "name": "Reserve", + "discriminator": [ + 43, + 242, + 204, + 202, + 26, + 247, + 59, + 127 + ] + }, + { + "name": "ReserveAggregate", + "discriminator": [ + 46, + 66, + 28, + 2, + 223, + 209, + 19, + 45 + ] + }, + { + "name": "StakeAllocationState", + "discriminator": [ + 23, + 238, + 120, + 198, + 156, + 165, + 151, + 119 + ] + }, + { + "name": "StakeControllerState", + "discriminator": [ + 218, + 168, + 114, + 136, + 80, + 186, + 29, + 218 + ] + }, + { + "name": "StakeMetrics", + "discriminator": [ + 91, + 84, + 217, + 97, + 98, + 38, + 18, + 143 + ] + }, + { + "name": "TokenMetadata", + "discriminator": [ + 237, + 215, + 132, + 182, + 24, + 127, + 175, + 173 + ] + }, + { + "name": "TrancheState", + "discriminator": [ + 212, + 231, + 254, + 24, + 238, + 63, + 92, + 105 + ] + }, + { + "name": "UserPretokenRecord", + "discriminator": [ + 117, + 99, + 159, + 251, + 98, + 253, + 6, + 238 + ] + }, + { + "name": "UserRecord", + "discriminator": [ + 210, + 252, + 132, + 218, + 191, + 85, + 173, + 167 + ] + }, + { + "name": "ValidatorInfoAccount", + "discriminator": [ + 195, + 243, + 81, + 187, + 172, + 232, + 57, + 59 + ] + }, + { + "name": "ValidatorList", + "discriminator": [ + 131, + 181, + 125, + 127, + 46, + 36, + 40, + 167 + ] + }, + { + "name": "ValidatorTransientAccount", + "discriminator": [ + 97, + 207, + 155, + 142, + 86, + 170, + 118, + 161 + ] + } + ], + "events": [ + { + "name": "EpochResolved", + "discriminator": [ + 62, + 81, + 212, + 223, + 209, + 104, + 51, + 65 + ] + }, + { + "name": "GraveyardDeactivationQueuedEvent", + "discriminator": [ + 131, + 241, + 122, + 229, + 108, + 21, + 67, + 37 + ] + }, + { + "name": "GraveyardValidatorCleanedEvent", + "discriminator": [ + 3, + 252, + 58, + 228, + 135, + 135, + 104, + 34 + ] + }, + { + "name": "PretokenPurchased", + "discriminator": [ + 39, + 1, + 143, + 191, + 8, + 14, + 80, + 41 + ] + }, + { + "name": "StakesMerged", + "discriminator": [ + 3, + 16, + 51, + 153, + 152, + 186, + 19, + 97 + ] + }, + { + "name": "ValidatorAddedEvent", + "discriminator": [ + 71, + 123, + 103, + 213, + 174, + 178, + 82, + 130 + ] + }, + { + "name": "ValidatorRemovedEvent", + "discriminator": [ + 49, + 23, + 179, + 208, + 124, + 3, + 231, + 59 + ] + }, + { + "name": "ValidatorSwappedEvent", + "discriminator": [ + 33, + 50, + 10, + 35, + 69, + 113, + 96, + 180 + ] + }, + { + "name": "ValidatorsSyncedEvent", + "discriminator": [ + 119, + 121, + 49, + 120, + 230, + 132, + 109, + 214 + ] + }, + { + "name": "WithdrawClaimed", + "discriminator": [ + 77, + 130, + 89, + 38, + 239, + 172, + 174, + 85 + ] + }, + { + "name": "WithdrawRequested", + "discriminator": [ + 114, + 16, + 240, + 206, + 93, + 128, + 151, + 39 + ] + } + ], + "errors": [ + { + "code": 6000, + "name": "EnvelopeDecodeFailed", + "msg": "Envelope protobuf decode failed" + }, + { + "code": 6001, + "name": "AttestationDecodeFailed", + "msg": "Attestation protobuf decode failed" + }, + { + "code": 6002, + "name": "NonSequentialEpoch", + "msg": "Non-sequential epoch index" + }, + { + "code": 6003, + "name": "EpochHashMismatch", + "msg": "Previous envelope hash mismatch" + }, + { + "code": 6004, + "name": "OperatorAlreadyDelivered", + "msg": "Operator already delivered this epoch" + }, + { + "code": 6005, + "name": "NotActiveOperator", + "msg": "Caller is not an active batch operator" + }, + { + "code": 6006, + "name": "EmptyOperatorGroups", + "msg": "Operator group list cannot be empty while roster is initialized" + }, + { + "code": 6007, + "name": "OutboundMessageBufferOverflow", + "msg": "Outbound message buffer capacity exceeded" + }, + { + "code": 6008, + "name": "Unauthorized", + "msg": "Unauthorized caller for attestation" + }, + { + "code": 6009, + "name": "OperatorRegistryFull", + "msg": "Operator registry is full; cannot add another operator" + }, + { + "code": 6010, + "name": "OperatorGroupListFull", + "msg": "Operator group count exceeds configured maximum" + }, + { + "code": 6011, + "name": "OperatorGroupFull", + "msg": "Operator group member count exceeds configured maximum" + }, + { + "code": 6012, + "name": "InvalidSolanaAddressLength", + "msg": "Solana address in Operators entry is not 32 bytes" + }, + { + "code": 6013, + "name": "EpochDeliveryListFull", + "msg": "Epoch delivery count exceeds configured maximum" + }, + { + "code": 6014, + "name": "UnsupportedAttestationType", + "msg": "Attestation type not supported by this outpost" + }, + { + "code": 6015, + "name": "ZeroAmount", + "msg": "Amount must be greater than zero" + }, + { + "code": 6016, + "name": "InvalidOperatorType", + "msg": "Invalid OperatorType for Solana outpost" + }, + { + "code": 6017, + "name": "InvalidTokenKind", + "msg": "Invalid TokenKind for deposit" + }, + { + "code": 6018, + "name": "InvalidWireNameLength", + "msg": "WIRE account name exceeds 13 characters" + }, + { + "code": 6019, + "name": "EnvelopeTooLarge", + "msg": "Envelope data exceeds MAX_ENVELOPE_BYTES" + }, + { + "code": 6020, + "name": "InvalidRetentionConfig", + "msg": "Retention config invalid: full_retention_seconds < data_retention_epochs * epoch_duration_seconds" + }, + { + "code": 6021, + "name": "InvalidEpochDuration", + "msg": "Epoch duration must be non-zero" + }, + { + "code": 6022, + "name": "EnvelopeKindMismatch", + "msg": "Envelope kind does not match account type" + }, + { + "code": 6023, + "name": "EnvelopeStillInRetention", + "msg": "Envelope pruning attempted on record still inside retention window" + }, + { + "code": 6024, + "name": "InvalidChunkCount", + "msg": "Chunk count must be in 1..=MAX_CHUNKS" + }, + { + "code": 6025, + "name": "ChunkIndexOutOfRange", + "msg": "Chunk index out of range for declared total_chunks" + }, + { + "code": 6026, + "name": "ChunkTooLarge", + "msg": "Chunk payload exceeds MAX_CHUNK_BYTES" + }, + { + "code": 6027, + "name": "ChunkSizeMismatch", + "msg": "Chunk size does not match the declared envelope shape" + }, + { + "code": 6028, + "name": "ChunkOutOfOrder", + "msg": "Chunk arrived out of order; chunks must be submitted sequentially" + }, + { + "code": 6029, + "name": "ChunkBufferEpochMismatch", + "msg": "Chunk buffer header locked to a different epoch" + }, + { + "code": 6030, + "name": "ChunkBufferShapeMismatch", + "msg": "Chunk buffer header locked to a different total_chunks/total_bytes" + }, + { + "code": 6031, + "name": "ChunkBufferOperatorMismatch", + "msg": "Chunk buffer was opened by a different operator" + }, + { + "code": 6032, + "name": "ChunkCleanupNotYetEligible", + "msg": "Chunk cleanup is not eligible until the epoch has advanced" + }, + { + "code": 6033, + "name": "OversizedQueuedMessage", + "msg": "A single queued outbound message exceeds MAX_ENVELOPE_BYTES; cannot pack into an envelope" + }, + { + "code": 6034, + "name": "CollateralLedgerOverflow", + "msg": "Collateral ledger has reached MAX_COLLATERAL_ENTRIES capacity" + }, + { + "code": 6035, + "name": "CallerNotRegistered", + "msg": "Caller is not present in the operator registry" + }, + { + "code": 6036, + "name": "WrongOperatorType", + "msg": "Caller's operator role does not match the action's required role" + }, + { + "code": 6037, + "name": "OperatorNotActive", + "msg": "Caller's operator status is not ACTIVE" + }, + { + "code": 6038, + "name": "ReserveNotFound", + "msg": "Reserve PDA not found for the supplied (token_code, reserve_code)" + }, + { + "code": 6039, + "name": "ReserveWrongStatus", + "msg": "Reserve is not in the status required by the action" + }, + { + "code": 6040, + "name": "ReserveNotCreator", + "msg": "Caller does not match the reserve's creator" + }, + { + "code": 6041, + "name": "TokenCodeNotConfigured", + "msg": "Token code is not configured in outpost_config.token_addresses_by_code" + }, + { + "code": 6042, + "name": "BadConnectorWeight", + "msg": "Connector weight must be in 1..=10_000 basis points" + }, + { + "code": 6043, + "name": "ReserveNameTooLong", + "msg": "Reserve name exceeds RESERVE_NAME_MAX_BYTES" + }, + { + "code": 6044, + "name": "ReserveDescriptionTooLong", + "msg": "Reserve description exceeds RESERVE_DESCRIPTION_MAX_BYTES" + }, + { + "code": 6045, + "name": "TokenAddressesFull", + "msg": "Token addresses table is full; cannot register another entry" + }, + { + "code": 6046, + "name": "ZeroReserveAmount", + "msg": "Reserve external_token_amount must be greater than zero" + }, + { + "code": 6047, + "name": "SwapUnknownSlugName", + "msg": "requestSwap: slug_name parameter is UNKNOWN (zero)" + }, + { + "code": 6048, + "name": "SwapEmptyRecipient", + "msg": "requestSwap: target_recipient is empty" + }, + { + "code": 6049, + "name": "SwapZeroSourceAmount", + "msg": "requestSwap: source_amount must be > 0" + }, + { + "code": 6050, + "name": "SwapSourceNotNative", + "msg": "requestSwap: source token must be native (this pass)" + }, + { + "code": 6051, + "name": "SwapSourceReserveUnavailable", + "msg": "requestSwap: source reserve unavailable" + }, + { + "code": 6052, + "name": "ArithmeticOverflow", + "msg": "arithmetic overflow during reserve accounting" + }, + { + "code": 6053, + "name": "SwapSourceIsNative", + "msg": "requestSwapSpl: source token must be SPL, not native" + }, + { + "code": 6054, + "name": "SwapSplMintMismatch", + "msg": "SPL mint does not match outpost_config binding for this token_code" + }, + { + "code": 6055, + "name": "PrecisionUnconfigured", + "msg": "token precision not configured — call set_token_precision first" + }, + { + "code": 6056, + "name": "RecipientAtaCreationFailed", + "msg": "handle_swap_remit: recipient ATA creation failed on-chain" + }, + { + "code": 6057, + "name": "TerminalChunkNotEmpty", + "msg": "epoch_in: the terminal finalize call must carry no chunk data" + }, + { + "code": 6058, + "name": "TerminalChunkBeforeDataComplete", + "msg": "epoch_in: terminal finalize before every data chunk was uploaded" + }, + { + "code": 6059, + "name": "EnvelopeEpochMismatch", + "msg": "Decoded envelope epoch does not match the epoch_in instruction epoch" + }, + { + "code": 6060, + "name": "NonCanonicalPreviousEnvelopeHash", + "msg": "previous_envelope_hash is not in canonical form" + }, + { + "code": 6061, + "name": "ReserveCreatorAtaNotCanonical", + "msg": "createReserve: creator ATA is not the canonical account for this mint" + }, + { + "code": 6062, + "name": "EmitBeforeEpochAccepted", + "msg": "Outbound emit for an epoch the inbound cursor has not accepted" + }, + { + "code": 6063, + "name": "EnvelopeWrongDestination", + "msg": "envelope destination is not an SVM chain" + }, + { + "code": 7000, + "name": "DestinationAccountDoesNotExist", + "msg": "Destination stake account does not exist" + }, + { + "code": 7001, + "name": "SourceAccountDoesNotExist", + "msg": "Source stake account does not exist" + }, + { + "code": 7002, + "name": "InvalidDestinationOwner", + "msg": "Destination account not owned by stake program" + }, + { + "code": 7003, + "name": "InvalidSourceOwner", + "msg": "Source account not owned by stake program" + }, + { + "code": 7004, + "name": "ClockBorrowFailed", + "msg": "Failed to borrow clock data" + }, + { + "code": 7005, + "name": "ClockDeserializeFailed", + "msg": "Failed to deserialize clock" + }, + { + "code": 7006, + "name": "DestinationAnalysisFailed", + "msg": "Failed to analyze destination stake account" + }, + { + "code": 7007, + "name": "SourceAnalysisFailed", + "msg": "Failed to analyze source stake account" + }, + { + "code": 7008, + "name": "DestinationStillActivating", + "msg": "Destination stake is still activating" + }, + { + "code": 7009, + "name": "DestinationDeactivating", + "msg": "Destination stake is deactivating" + }, + { + "code": 7010, + "name": "SourceStillActivating", + "msg": "Source stake is still activating" + }, + { + "code": 7011, + "name": "SourceDeactivating", + "msg": "Source stake is deactivating" + }, + { + "code": 7012, + "name": "DestinationBorrowFailed", + "msg": "Failed to borrow destination account data" + }, + { + "code": 7013, + "name": "DestinationParseFailed", + "msg": "Failed to parse destination stake state" + }, + { + "code": 7014, + "name": "SourceBorrowFailed", + "msg": "Failed to borrow source account data" + }, + { + "code": 7015, + "name": "SourceParseFailed", + "msg": "Failed to parse source stake state" + }, + { + "code": 7016, + "name": "DifferentValidators", + "msg": "Stakes are delegated to different validators" + }, + { + "code": 7017, + "name": "DifferentStakers", + "msg": "Stakes have different staker authorities" + }, + { + "code": 7018, + "name": "DifferentWithdrawers", + "msg": "Stakes have different withdrawer authorities" + }, + { + "code": 7019, + "name": "AuthoritiesNotFound", + "msg": "Could not extract authorities from accounts" + }, + { + "code": 7020, + "name": "MergeInstructionFailed", + "msg": "Merge instruction failed" + }, + { + "code": 7021, + "name": "EpochRewardsActive", + "msg": "Epoch rewards distribution is active - stake operations blocked" + }, + { + "code": 7022, + "name": "DifferentCreditsObserved", + "msg": "Stakes have different credits_observed - cannot merge until both earn same rewards" + }, + { + "code": 7100, + "name": "AccountBorrowFailed", + "msg": "Util Acc borrow Failed" + }, + { + "code": 7200, + "name": "InvalidAuthority", + "msg": "Only the configured admin may perform this action" + }, + { + "code": 7201, + "name": "InvalidAccountOwner", + "msg": "OutpostAccount does not belong to the signer" + }, + { + "code": 7202, + "name": "RoleNotEnabled", + "msg": "Role is not enabled (principal is 0)" + }, + { + "code": 7203, + "name": "AlreadyBondedForRole", + "msg": "Already bonded for this role" + }, + { + "code": 7204, + "name": "NotBondedForRole", + "msg": "Not bonded for this role" + }, + { + "code": 7205, + "name": "InsufficientStakedLiqsol", + "msg": "Insufficient staked liqSOL for bonding" + }, + { + "code": 7206, + "name": "BondStillInWarmup", + "msg": "Bond still in warmup period" + }, + { + "code": 7207, + "name": "AlreadyUnbonding", + "msg": "Unbond already requested for this role" + }, + { + "code": 7208, + "name": "NotUnbonding", + "msg": "Unbond not requested for this role" + }, + { + "code": 7209, + "name": "NotBonded", + "msg": "User has no active bonds" + }, + { + "code": 7210, + "name": "MissingRole", + "msg": "Actor does not have required role" + }, + { + "code": 7211, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7212, + "name": "Underflow", + "msg": "Arithmetic underflow" + }, + { + "code": 7213, + "name": "InvalidWarmupDuration", + "msg": "Invalid warmup duration" + }, + { + "code": 7300, + "name": "DepositTooSmall", + "msg": "Deposit amount is below minimum required" + }, + { + "code": 7301, + "name": "NotInitialized", + "msg": "Deposit Router not initialized" + }, + { + "code": 7302, + "name": "InvalidAuthority", + "msg": "Invalid authority" + }, + { + "code": 7303, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 7304, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7305, + "name": "CalculationFailure", + "msg": "Calculation failure" + }, + { + "code": 7306, + "name": "NothingToMint", + "msg": "Cannot mint zero tokens" + }, + { + "code": 7307, + "name": "InvalidAccount", + "msg": "Invalid account provided" + }, + { + "code": 7308, + "name": "InsufficientFundsForStake", + "msg": "Insufficient funds remaining after reserving fees to proceed with staking" + }, + { + "code": 7309, + "name": "UnauthorizedProgram", + "msg": "Unauthorized program attempting to call this instruction" + }, + { + "code": 7310, + "name": "DepositsDisabled", + "msg": "Deposits are currently disabled" + }, + { + "code": 7400, + "name": "NoRewardsToClaim", + "msg": "No rewards to claim" + }, + { + "code": 7401, + "name": "InsufficientBalance", + "msg": "Insufficient balance" + }, + { + "code": 7402, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 7403, + "name": "Unauthorized", + "msg": "Unauthorized - caller is not the distribution authority" + }, + { + "code": 7404, + "name": "InvalidMint", + "msg": "Invalid mint" + }, + { + "code": 7405, + "name": "InvalidOwner", + "msg": "Invalid owner" + }, + { + "code": 7406, + "name": "InvalidBucketAccount", + "msg": "Invalid bucket token account" + }, + { + "code": 7407, + "name": "InvalidUserRecord", + "msg": "Invalid user record" + }, + { + "code": 7408, + "name": "InvalidWithdrawal", + "msg": "Invalid withdrawal - balance increased instead of decreased" + }, + { + "code": 7409, + "name": "InvalidWithdrawalAmount", + "msg": "Invalid withdrawal - request must be greater than 0" + }, + { + "code": 7410, + "name": "InvalidProgramId", + "msg": "Invalid program ID" + }, + { + "code": 7411, + "name": "InstructionIntrospectionFailed", + "msg": "Instruction introspection failed" + }, + { + "code": 7412, + "name": "TransferNotInProgress", + "msg": "Transfer hook not active for this token account" + }, + { + "code": 7413, + "name": "ShareZeroTransfer", + "msg": "Amount too small resulting in zero share transfer" + }, + { + "code": 7414, + "name": "ReceiptFulfilled", + "msg": "Receipt already fulfilled" + }, + { + "code": 7415, + "name": "InsufficientBucketBalance", + "msg": "Insufficient bucket balance to fulfill claim" + }, + { + "code": 7416, + "name": "ClaimCalculationError", + "msg": "Claim calculation error" + }, + { + "code": 7417, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7418, + "name": "Underflow", + "msg": "Arithmetic underflow" + }, + { + "code": 7419, + "name": "BalanceBelowTracked", + "msg": "Balance below tracked amount — possible token burn detected" + }, + { + "code": 7420, + "name": "LegacyUserRecordMigrationRequired", + "msg": "Legacy user record must be migrated via register_user or migrate_user_record before claiming or transfers" + }, + { + "code": 7421, + "name": "AmountExceedsEntitled", + "msg": "Requested amount exceeds share-backed entitlement — cap at max_withdrawable or use full-ATA withdraw" + }, + { + "code": 7500, + "name": "Unauthorized", + "msg": "Unauthorized: The authority does not match the controller state's authority." + }, + { + "code": 7501, + "name": "NoUpgradeAuthority", + "msg": "Program has no upgrade authority (immutable)." + }, + { + "code": 7502, + "name": "PercentOutOfRange", + "msg": "Percent config value must be in 0..=100" + }, + { + "code": 7503, + "name": "PercentInversion", + "msg": "Percent config would invert hysteresis: entry must be <= exit" + }, + { + "code": 7504, + "name": "UnstakeDeltaBelowSplitMinimum", + "msg": "min_rebalance_unstake_delta must be >= MIN_STAKE_DELEGATION (1 SOL)" + }, + { + "code": 7600, + "name": "InsufficientFunds", + "msg": "Insufficient funds" + }, + { + "code": 7601, + "name": "InvalidValidator", + "msg": "Invalid validator" + }, + { + "code": 7602, + "name": "NoSuitableValidator", + "msg": "No suitable validator found" + }, + { + "code": 7603, + "name": "TicketNotFound", + "msg": "Unstake ticket not found" + }, + { + "code": 7604, + "name": "TicketNotClaimable", + "msg": "Ticket not claimable yet" + }, + { + "code": 7605, + "name": "Unauthorized", + "msg": "Unauthorized" + }, + { + "code": 7606, + "name": "ArithmeticOverflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7607, + "name": "AccountAlreadyExists", + "msg": "Account already exists" + }, + { + "code": 7608, + "name": "InvalidStakeAccount", + "msg": "Invalid stake account" + }, + { + "code": 7609, + "name": "InvalidThreshold", + "msg": "Invalid threshold value" + }, + { + "code": 7610, + "name": "InvalidAccountData", + "msg": "Invalid account data" + }, + { + "code": 7611, + "name": "InvalidVoteAccount", + "msg": "Invalid vote account" + }, + { + "code": 7612, + "name": "StakesNotYetActive", + "msg": "Stakes not yet active" + }, + { + "code": 7613, + "name": "EpochDistributionAlreadyDone", + "msg": "Invalid epoch" + }, + { + "code": 7614, + "name": "EpochAlreadyResolved", + "msg": "Epoch already resolved" + }, + { + "code": 7615, + "name": "MergeFailed", + "msg": "Merge failed" + }, + { + "code": 7616, + "name": "ReservePoolNotInitialized", + "msg": "Reserve pool not initialized" + }, + { + "code": 7617, + "name": "InvalidEphemeralAccount", + "msg": "Invalid ephemeral account" + }, + { + "code": 7618, + "name": "InvalidStakeAccount0", + "msg": "Invalid stake account 0" + }, + { + "code": 7619, + "name": "EpochNotReadyForResolution", + "msg": "Epoch Table Not Ready To be resolved" + }, + { + "code": 7620, + "name": "InsufficientSlotsElapsed", + "msg": "Function called too soon in epoch, should be called close to epoch boundary" + }, + { + "code": 7621, + "name": "EpochRewardsActive", + "msg": "Epoch rewards distribution is active - stake operations blocked" + }, + { + "code": 7622, + "name": "ValidatorSyncRequired", + "msg": "Validator sync required - please call sync_validator_stakes first" + }, + { + "code": 7623, + "name": "TooSmallDeposit", + "msg": "Deposit amount too small" + }, + { + "code": 7624, + "name": "AllocationsNotCalculated", + "msg": "Allocations not calculated for current epoch - please run rebalance_validators first" + }, + { + "code": 7625, + "name": "InvalidAccountCount", + "msg": "Invalid account count - expected different number of accounts" + }, + { + "code": 7626, + "name": "InvalidValidatorInfo", + "msg": "Invalid ValidatorInfo account" + }, + { + "code": 7627, + "name": "UnstakeAllocationsNotCalculated", + "msg": "Unstake allocations must be calculated before validator allocations - please run calculate_unstake_allocations first" + }, + { + "code": 7628, + "name": "InvalidReservePoolAccount", + "msg": "Invalid reserve pool account" + }, + { + "code": 7629, + "name": "PreReqsUnmet", + "msg": "Some Pre Req Not Met, Look at Solana Logs for details" + }, + { + "code": 7630, + "name": "SystemBusy", + "msg": "System busy: stake metrics are stale from a recent unstake — please retry shortly" + }, + { + "code": 7631, + "name": "UpdateInProgress", + "msg": "Update in progress: stake metrics are being refreshed for this epoch — please retry shortly" + }, + { + "code": 7632, + "name": "MaintenanceMergeRequired", + "msg": "Maintenance Merge Transients Failed - please run merge_activating_stakes first" + }, + { + "code": 7633, + "name": "UnstakeTooSMall", + "msg": "Unstake Request Too Small" + }, + { + "code": 7634, + "name": "OperationInProgress", + "msg": "Operation already in progress" + }, + { + "code": 7635, + "name": "NoOperationInProgress", + "msg": "No operation currently in progress" + }, + { + "code": 7636, + "name": "InvalidSequence", + "msg": "Invalid sequence - expected different index or rank" + }, + { + "code": 7637, + "name": "ValidatorNotFound", + "msg": "Validator not found in leaderboard" + }, + { + "code": 7638, + "name": "InvalidRank", + "msg": "Invalid rank - exceeds validator count" + }, + { + "code": 7639, + "name": "NoValidatorsInLeaderboard", + "msg": "No validators in leaderboard" + }, + { + "code": 7640, + "name": "NoValidatorsFound", + "msg": "No validators found in active list" + }, + { + "code": 7641, + "name": "GraveyardFull", + "msg": "Graveyard list is full" + }, + { + "code": 7642, + "name": "ValidatorHasActiveStake", + "msg": "Validator still has active stake - cannot cleanup until stake is repatriated" + }, + { + "code": 7643, + "name": "ValidatorHasPendingDeactivations", + "msg": "Validator has pending deactivations - cannot cleanup until all deactivations complete" + }, + { + "code": 7644, + "name": "ValidatorNotUndelegated", + "msg": "Validator is not in NotDelegated state - stake must be fully deactivated before cleanup" + }, + { + "code": 7645, + "name": "BatchSizeTooLarge", + "msg": "Batch size exceeds maximum allowed" + }, + { + "code": 7646, + "name": "StakingDisabled", + "msg": "Staking is currently disabled" + }, + { + "code": 7647, + "name": "WithdrawalsDisabled", + "msg": "Withdrawals are currently disabled" + }, + { + "code": 7648, + "name": "EmergencyModeActive", + "msg": "Emergency mode is active" + }, + { + "code": 7649, + "name": "ProcessStakeOrdersDisabled", + "msg": "Process stake orders is currently disabled" + }, + { + "code": 7650, + "name": "ProcessUnstakeOrdersDisabled", + "msg": "Process unstake orders is currently disabled" + }, + { + "code": 7651, + "name": "ProcessPayCycleDisabled", + "msg": "Process pay cycle is currently disabled" + }, + { + "code": 7652, + "name": "ValidatorRecordNotUpdated", + "msg": "Validator record not updated for current epoch" + }, + { + "code": 7653, + "name": "LateEpochSlotGateNotMet", + "msg": "Late epoch operation called too early - minimum slots not yet elapsed" + }, + { + "code": 7654, + "name": "IndexOutOfBounds", + "msg": "Index out of bounds" + }, + { + "code": 7655, + "name": "AccountAlreadyMigrated", + "msg": "Account already at target size, migration not needed" + }, + { + "code": 7656, + "name": "TreasuryRentUnfunded", + "msg": "Treasury can't cover stake-account rent and caller opted out of fronting it" + }, + { + "code": 7700, + "name": "InvalidChainlinkProgram", + "msg": "Invalid Chainlink program account" + }, + { + "code": 7701, + "name": "InvalidChainlinkFeed", + "msg": "Invalid Chainlink feed account" + }, + { + "code": 7702, + "name": "ArithmeticOverflow", + "msg": "Arithmetic overflow in calculation" + }, + { + "code": 7703, + "name": "InvalidCalculation", + "msg": "Invalid calculation result" + }, + { + "code": 7704, + "name": "DecimalPrecisionMismatch", + "msg": "Decimal precision mismatch" + }, + { + "code": 7705, + "name": "MissingNextTranche", + "msg": "Next tranche account required but not provided" + }, + { + "code": 7706, + "name": "InsufficientNextTrancheSupply", + "msg": "Insufficient pretokens in next tranche" + }, + { + "code": 7707, + "name": "TrancheExhausted", + "msg": "Current tranche exhausted" + }, + { + "code": 7708, + "name": "InvalidPretokenPrice", + "msg": "Invalid pretoken price" + }, + { + "code": 7709, + "name": "ChainlinkPriceFetchFailed", + "msg": "Failed to fetch SOL price from Chainlink" + }, + { + "code": 7710, + "name": "StalePrice", + "msg": "Chainlink price data is stale" + }, + { + "code": 7711, + "name": "PriceOutOfBounds", + "msg": "Price out of valid bounds" + }, + { + "code": 7712, + "name": "InvalidGrowthBps", + "msg": "Invalid growth BPS value (must be <= 10000)" + }, + { + "code": 7713, + "name": "Unauthorized", + "msg": "Unauthorized: caller is not admin" + }, + { + "code": 7714, + "name": "EmptyPriceHistory", + "msg": "Price history is empty" + }, + { + "code": 7715, + "name": "InsufficientFunds", + "msg": "Insufficient funds for pretoken purchase" + }, + { + "code": 7716, + "name": "ExceededTrancheLimit", + "msg": "Exceeded tranche limit, split purchase into multiple transactions" + }, + { + "code": 7717, + "name": "ZeroPretokensPurchased", + "msg": "Deposit too small to purchase any pretokens at current tranche price" + }, + { + "code": 7718, + "name": "InvalidRoundData", + "msg": "Invalid round data from Chainlink feed" + }, + { + "code": 7719, + "name": "InvalidStaleness", + "msg": "max_staleness_seconds must be > 0 - any non-positive value would brick price reads" + }, + { + "code": 7800, + "name": "Unauthorized", + "msg": "Unauthorized access" + }, + { + "code": 7801, + "name": "MaxValidatorsReached", + "msg": "Maximum validators reached" + }, + { + "code": 7802, + "name": "ValidatorAlreadyExists", + "msg": "Validator already exists" + }, + { + "code": 7803, + "name": "ValidatorNotFound", + "msg": "Validator not found" + }, + { + "code": 7804, + "name": "InvalidStakeUpdateType", + "msg": "Invalid stake update type" + }, + { + "code": 7805, + "name": "InvalidVoteAccount", + "msg": "Invalid vote account provided" + }, + { + "code": 7806, + "name": "InvalidInputLength", + "msg": "Invalid input length - all vectors must have same length" + }, + { + "code": 7807, + "name": "InvalidStakeAccount", + "msg": "Invalid Stake Account" + }, + { + "code": 7808, + "name": "ArithmeticOverflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7809, + "name": "InsufficientTransientStake", + "msg": "Insufficient transient stake" + }, + { + "code": 7810, + "name": "TransientTrackingFull", + "msg": "Transient tracking is full (100 entries max)" + }, + { + "code": 7811, + "name": "ValidatorStillInCooldown", + "msg": "Validator is still in cooldown period" + }, + { + "code": 7812, + "name": "InvalidVppScore", + "msg": "VPP score must be between 0 and 100" + }, + { + "code": 7900, + "name": "Unauthorized", + "msg": "Unauthorized admin attempting to call this instruction" + }, + { + "code": 7901, + "name": "InvalidAmount", + "msg": "Invalid amount" + }, + { + "code": 7902, + "name": "DDayNotSet", + "msg": "D-Day is not set" + }, + { + "code": 7903, + "name": "DDayActive", + "msg": "D-Day is active - stakes not allowed" + }, + { + "code": 7904, + "name": "InvalidLiqsolMint", + "msg": "Invalid liqSOL mint address" + }, + { + "code": 7905, + "name": "InsufficientFunds", + "msg": "Insufficient funds in user account" + }, + { + "code": 7906, + "name": "InsufficientStake", + "msg": "Insufficient staked amount for withdrawal" + }, + { + "code": 7907, + "name": "InsufficientShares", + "msg": "Insufficient shares for withdrawal" + }, + { + "code": 7908, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 7909, + "name": "Underflow", + "msg": "Arithmetic underflow" + }, + { + "code": 7910, + "name": "EmptyLiqsolPool", + "msg": "No liqSOL deposits registered in the pool" + }, + { + "code": 7911, + "name": "NoLiqsolPosition", + "msg": "No liqSOL position recorded for this user" + }, + { + "code": 7912, + "name": "NoStakeDeposit", + "msg": "No stake deposit found (only pretoken purchases exist)" + }, + { + "code": 7913, + "name": "RawSolBucketUnimplemented", + "msg": "Raw SOL bucket handling is not implemented yet" + }, + { + "code": 7914, + "name": "NoAccumulatedYield", + "msg": "No accumulated yield available to consume" + }, + { + "code": 7915, + "name": "RefundsNotActive", + "msg": "Refunds are not active" + }, + { + "code": 7916, + "name": "NoRefundablePosition", + "msg": "No refundable position found for this user" + }, + { + "code": 7917, + "name": "SystemPaused", + "msg": "System is currently paused" + }, + { + "code": 7918, + "name": "RefundsActive", + "msg": "Refunds are active - operation not allowed" + }, + { + "code": 7919, + "name": "ReceiptLocked", + "msg": "OutpostAccount is locked by an active bond" + }, + { + "code": 7920, + "name": "InvalidWireState", + "msg": "Invalid wire state for this operation" + }, + { + "code": 8000, + "name": "InvalidUserRecord", + "msg": "Invalid user record" + }, + { + "code": 8001, + "name": "InsufficientBalance", + "msg": "Insufficient balance" + }, + { + "code": 8002, + "name": "Overflow", + "msg": "Arithmetic overflow" + }, + { + "code": 8003, + "name": "ArithmeticUnderflow", + "msg": "Arithmetic underflow" + }, + { + "code": 8004, + "name": "AlreadyFulfilled", + "msg": "Receipt already fulfilled" + }, + { + "code": 8005, + "name": "NotYetServiceable", + "msg": "Receipt not yet serviceable" + }, + { + "code": 8006, + "name": "BadFrontierOrder", + "msg": "Frontier receipts out of order or unexpected id" + }, + { + "code": 8007, + "name": "MissingNftToken", + "msg": "User does not hold the NFT receipt token" + }, + { + "code": 8008, + "name": "WithdrawalsDisabled", + "msg": "Withdrawals are currently disabled" + }, + { + "code": 8009, + "name": "ClaimWithdrawalsDisabled", + "msg": "Claim withdrawals are currently disabled" + } + ], + "types": [ + { + "name": "AttestationData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "attestation_type", + "type": "i32" + }, + { + "name": "data", + "type": "bytes" + } + ] + } + }, + { + "name": "BatchOrchestrator", + "docs": [ + "Holds resume positions for batched ops - cursors only, no value.", + "", + "Rule of thumb for what lives here vs StakeAllocationState: this account is", + "for WIPEABLE positions. Completion truth is in MaintenanceLedger, so a stale", + "cursor's staleness response is just \"zero it\" (sweep_stale_cursors does that", + "blanket at every epoch boundary). Anything that carries money/accounting and", + "needs abort/recover on staleness belongs on StakeAllocationState next to its", + "cycle, not here. The aggregation temps are the one grandfathered exception -", + "they carry value, so they sit outside the sweep behind their own mode-tag +", + "started_epoch guard.", + "", + "On liveness: ops here have no in_progress bools - a nonzero cursor/mode-tag", + "IS the liveness signal (see graveyard_locked, WIN-60). That inference works", + "because zero is out-of-band by construction for these fields: cursor at 0 =", + "no progress = idle, same state. Don't copy this pattern to fields where zero", + "is a real value (epochs, amounts) - those need an explicit bool." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "validators_processed_this_epoch", + "type": "u8" + }, + { + "name": "validators_merge_processed_this_epoch", + "type": "u16" + }, + { + "name": "validators_deactivating_merge_processed", + "type": "u16" + }, + { + "name": "validators_sync_processed_this_epoch", + "type": "u16" + }, + { + "name": "validators_unstake_processed_this_epoch", + "type": "u16" + }, + { + "name": "validators_aggregate_processed_this_epoch", + "type": "u16" + }, + { + "name": "temp_total_active_stake", + "type": "u64" + }, + { + "name": "temp_total_transient_stake", + "type": "u64" + }, + { + "name": "temp_total_reward", + "type": "u64" + }, + { + "name": "temp_total_unstakeable_stake", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "infra_next_index", + "docs": [ + "Next active_list index to process for PDA setup" + ], + "type": "u16" + }, + { + "name": "infos_next_index", + "docs": [ + "Next active_list index to process for infos sync" + ], + "type": "u16" + }, + { + "name": "leaderboard_scores_next_index", + "docs": [ + "Next leaderboard registry index to process for score sync" + ], + "type": "u16" + }, + { + "name": "removal_next_index", + "docs": [ + "Next index in active list to check for removal" + ], + "type": "u16" + }, + { + "name": "addition_next_rank", + "docs": [ + "Next rank in leaderboard to check for addition" + ], + "type": "u16" + }, + { + "name": "addition_target_rank", + "docs": [ + "Target (inclusive) leaderboard rank to process up to" + ], + "type": "u16" + }, + { + "name": "graveyard_next_index", + "docs": [ + "Next index in graveyard list to process" + ], + "type": "u16" + }, + { + "name": "graveyard_cleanup_next_index", + "docs": [ + "Next index in graveyard list to check for cleanup" + ], + "type": "u16" + }, + { + "name": "aggregate_mode_tag", + "docs": [ + "Tracks which aggregation mode currently owns the shared temp fields.", + "0 = idle,", + "1 = Normal,", + "2 = PostSync,", + "3 = PostLateEpoch.", + "Prevents cross-mode state contamination when modes share the same vars." + ], + "type": "u8" + }, + { + "name": "aggregation_started_epoch", + "docs": [ + "The epoch when the current aggregation batch started.", + "Prevents stale partial accumulators from being committed if an epoch boundary is crossed mid-aggregation." + ], + "type": "u64" + }, + { + "name": "mev_claims_next_index", + "docs": [ + "Next active_list index to process for MEV tip claims" + ], + "type": "u16" + }, + { + "name": "temp_total_mev_reward", + "docs": [ + "Temporary accumulator for MEV rewards across batches" + ], + "type": "u64" + }, + { + "name": "temp_total_outstanding_amount_to_unstake", + "docs": [ + "Temporary accumulator for sum of validators' amount_to_unstake across batches" + ], + "type": "u64" + }, + { + "name": "validators_sync_started_epoch", + "docs": [ + "Owns validators_sync_processed_this_epoch." + ], + "type": "u16" + }, + { + "name": "leaderboard_scores_started_epoch", + "docs": [ + "Owns leaderboard_scores_next_index." + ], + "type": "u16" + }, + { + "name": "graveyard_cleanup_started_epoch", + "docs": [ + "Owns graveyard_cleanup_next_index." + ], + "type": "u16" + }, + { + "name": "addition_started_epoch", + "docs": [ + "Owns addition_next_rank + addition_target_rank." + ], + "type": "u16" + }, + { + "name": "unstake_started_epoch", + "docs": [ + "Owns validators_unstake_processed_this_epoch. A nonzero cursor from a", + "dead epoch is not a real lock — this pin lets consumers tell stale", + "leftovers apart from a live in-epoch traversal." + ], + "type": "u16" + }, + { + "name": "cursors_epoch", + "docs": [ + "Every cursor on this account is a per-epoch resume position — at an", + "epoch boundary any nonzero one is stale garbage. The first batch op to", + "touch this account in a new epoch wipes them all in one swing via", + "sweep_stale_cursors, so no op ever resumes against a list that", + "selection reshuffled since. Backstop for the per-op pins above." + ], + "type": "u16" + }, + { + "name": "_reserved", + "type": { + "array": [ + "u8", + 60 + ] + } + } + ] + } + }, + { + "name": "CollateralEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "depositor", + "type": "pubkey" + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "ConfigKeyBool", + "docs": [ + "Keys for bool config values (feature flags) - stored as bits in a u16", + "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,", + "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "DepositsEnabled" + }, + { + "name": "WithdrawalsEnabled" + }, + { + "name": "ClaimWithdrawalsEnabled" + }, + { + "name": "ProcessStakeOrdersEnabled" + }, + { + "name": "ProcessUnstakeOrdersEnabled" + }, + { + "name": "ProcessPayCycleEnabled" + }, + { + "name": "RebalancingEnabled" + } + ] + } + }, + { + "name": "ConfigKeyU16", + "docs": [ + "Keys for u16 config values (small counts, thresholds, ranks)" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "CooldownEpochs" + }, + { + "name": "DepositFeeEpochsMultiplier" + }, + { + "name": "MinVppEntry" + }, + { + "name": "MinVppExit" + }, + { + "name": "TinyNetworkThreshold" + }, + { + "name": "SmallNetworkThreshold" + }, + { + "name": "MediumNetworkThreshold" + }, + { + "name": "LargeNetworkEntryRank" + }, + { + "name": "LargeNetworkExitRank" + } + ] + } + }, + { + "name": "ConfigKeyU64", + "docs": [ + "Keys for u64 config values (large amounts, rates)" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "MinUserDeposit" + }, + { + "name": "MinUnstakeRequest" + }, + { + "name": "MinRebalanceStakeDelta" + }, + { + "name": "MinRebalanceUnstakeDelta" + }, + { + "name": "TransientThreshold" + }, + { + "name": "MinLateEpochSlotGate" + } + ] + } + }, + { + "name": "ConfigKeyU8", + "docs": [ + "Keys for u8 config values (percentages 0-100)" + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "SmallNetworkEntryPercent" + }, + { + "name": "SmallNetworkExitPercent" + }, + { + "name": "MediumNetworkEntryPercent" + }, + { + "name": "MediumNetworkExitPercent" + } + ] + } + }, + { + "name": "DistributionState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "liqsol_mint", + "type": "pubkey" + }, + { + "name": "current_index", + "type": "u64" + }, + { + "name": "total_shares", + "docs": [ + "Sum of all user shares across the system" + ], + "type": "u64" + }, + { + "name": "last_bucket_balance", + "docs": [ + "Last observed bucket balance used for incremental index updates" + ], + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "bucket_bump", + "docs": [ + "Cached bucket authority bump to avoid repeated find_program_address calls" + ], + "type": "u8" + }, + { + "name": "pool_bump", + "docs": [ + "Cached pool authority bump to avoid repeated find_program_address calls" + ], + "type": "u8" + }, + { + "name": "bucket_authority", + "docs": [ + "Cached bucket authority pubkey for transfer-hook optimization" + ], + "type": "pubkey" + }, + { + "name": "pool_authority", + "docs": [ + "Cached pool authority pubkey for transfer-hook optimization" + ], + "type": "pubkey" + } + ] + } + }, + { + "name": "EnvelopeChunks", + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "operator", + "type": "pubkey" + }, + { + "name": "total_chunks", + "type": "u16" + }, + { + "name": "total_bytes", + "type": "u32" + }, + { + "name": "received_chunks", + "type": "u16" + }, + { + "name": "data", + "type": "bytes" + } + ] + } + }, + { + "name": "EnvelopeLog", + "type": { + "kind": "struct", + "fields": [ + { + "name": "envelopes", + "type": { + "vec": { + "defined": { + "name": "EnvelopeRecord" + } + } + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "EnvelopeRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "emitted_at", + "type": "u64" + }, + { + "name": "checksum", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "EpochDeliveries", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "deliveries", + "type": { + "vec": { + "defined": { + "name": "OperatorDelivery" + } + } + } + }, + { + "name": "consensus_reached", + "type": "bool" + }, + { + "name": "consensus_hash", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "EpochResolved", + "type": { + "kind": "struct", + "fields": [ + { + "name": "validator", + "type": "pubkey" + }, + { + "name": "epoch", + "type": "u64" + }, + { + "name": "total_stake_amount", + "type": "u64" + }, + { + "name": "max_index", + "type": "u32" + } + ] + } + }, + { + "name": "FailedSwapRemit", + "type": { + "kind": "struct", + "fields": [ + { + "name": "original_swap_remit_id", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "recipient_address", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "token_code", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "reason_len", + "type": "u8" + }, + { + "name": "reason", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "Global", + "docs": [ + "Global operator state. Epoch-based model: receipts are serviceable", + "when `epoch <= serviceable_epoch` as reported by an external runtime." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "authority", + "docs": [ + "DEPRECATED: Originally intended as authority for serviceable_epoch updates,", + "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.", + "Retained to preserve account layout." + ], + "type": "pubkey" + }, + { + "name": "liqsol_mint", + "docs": [ + "Token-2022 liqSOL mint burned on withdraw." + ], + "type": "pubkey" + }, + { + "name": "serviceable_epoch", + "docs": [ + "Highest epoch that is currently claimable." + ], + "type": "u64" + }, + { + "name": "total_encumbered_funds", + "docs": [ + "Total SOL encumbered for pending withdrawal requests.", + "This amount is reserved from the reserve pool and will be paid out when receipts are claimed." + ], + "type": "u64" + }, + { + "name": "next_receipt_id", + "docs": [ + "Monotonic counter for generating unique receipt IDs" + ], + "type": "u64" + } + ] + } + }, + { + "name": "GlobalConfig", + "docs": [ + "Zero-copy global config PDA" + ], + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "_padding", + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "admin", + "type": "pubkey" + }, + { + "name": "cranky", + "type": "pubkey" + }, + { + "name": "_reserved_pubkey", + "type": { + "array": [ + "pubkey", + 1 + ] + } + }, + { + "name": "min_user_deposit", + "docs": [ + "Minimum SOL amount a user can deposit" + ], + "type": "u64" + }, + { + "name": "min_unstake_request", + "docs": [ + "Minimum SOL amount for an unstake/withdrawal request" + ], + "type": "u64" + }, + { + "name": "min_rebalance_stake_delta", + "docs": [ + "Minimum stake delta to trigger a stake rebalance order" + ], + "type": "u64" + }, + { + "name": "min_rebalance_unstake_delta", + "docs": [ + "Minimum unstake delta to trigger an unstake rebalance order" + ], + "type": "u64" + }, + { + "name": "transient_threshold", + "docs": [ + "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.", + "Rebalance now counts all transient stake on both sides of the delta equation,", + "so the per-validator threshold gate was removed." + ], + "type": "u64" + }, + { + "name": "min_late_epoch_slot_gate", + "docs": [ + "Minimum slots that must have elapsed in the epoch before late epoch operations can execute" + ], + "type": "u64" + }, + { + "name": "_reserved_u64", + "type": { + "array": [ + "u64", + 2 + ] + } + }, + { + "name": "cooldown_epochs", + "docs": [ + "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change" + ], + "type": "u16" + }, + { + "name": "deposit_fee_multiplier", + "docs": [ + "Multiplier for deposit fee calculation, this would be average \"pay rate x number of epochs we expect the stake to warm up\"" + ], + "type": "u16" + }, + { + "name": "min_vpp_entry", + "docs": [ + "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small" + ], + "type": "u16" + }, + { + "name": "min_vpp_exit", + "docs": [ + "VPP score threshold below which a validator is removed from active set, again a fall back" + ], + "type": "u16" + }, + { + "name": "tiny_network_threshold", + "docs": [ + "Max validators for \"tiny\" network band (uses fixed VPP thresholds) as above" + ], + "type": "u16" + }, + { + "name": "small_network_threshold", + "docs": [ + "Max validators for \"small\" network band (uses percentile-based selection)" + ], + "type": "u16" + }, + { + "name": "medium_network_threshold", + "docs": [ + "Max validators for \"medium\" network band (uses percentile-based selection)" + ], + "type": "u16" + }, + { + "name": "large_network_entry_rank", + "docs": [ + "Fixed rank threshold to enter active set in large networks (0-indexed)" + ], + "type": "u16" + }, + { + "name": "large_network_exit_rank", + "docs": [ + "Fixed rank threshold to exit active set in large networks (0-indexed)" + ], + "type": "u16" + }, + { + "name": "_reserved_u16", + "type": { + "array": [ + "u16", + 3 + ] + } + }, + { + "name": "small_network_entry_percent", + "docs": [ + "Percentile rank required to enter active set in small networks" + ], + "type": "u8" + }, + { + "name": "small_network_exit_percent", + "docs": [ + "Percentile rank below which validators exit in small networks" + ], + "type": "u8" + }, + { + "name": "medium_network_entry_percent", + "docs": [ + "Percentile rank required to enter active set in medium networks" + ], + "type": "u8" + }, + { + "name": "medium_network_exit_percent", + "docs": [ + "Percentile rank below which validators exit in medium networks" + ], + "type": "u8" + }, + { + "name": "_reserved_u8", + "type": { + "array": [ + "u8", + 2 + ] + } + }, + { + "name": "feature_flags", + "docs": [ + "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,", + "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,", + "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved" + ], + "type": "u16" + }, + { + "name": "_reserved_flags", + "type": { + "array": [ + "u16", + 1 + ] + } + }, + { + "name": "_reserved_trailing", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "GlobalState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "deployed_at", + "docs": [ + "Legacy refund timer fields retained to preserve account layout.", + "Refund activation is controlled exclusively through `wire_state`." + ], + "type": "i64" + }, + { + "name": "refund_delay_seconds", + "type": "i64" + }, + { + "name": "paused", + "docs": [ + "Global pause flag - when true, all operations except refunds are disabled" + ], + "type": "bool" + }, + { + "name": "total_staked_liqsol", + "docs": [ + "Aggregate liqSOL staked through pretokens (maps to distribution tracked balance)" + ], + "type": "u64" + }, + { + "name": "total_purchased_liqsol", + "docs": [ + "Aggregate liqSOL pretoken purchases (part of distribution tracked balance)" + ], + "type": "u64" + }, + { + "name": "total_shares", + "docs": [ + "Total shares issued to all users (for share/index yield isolation)" + ], + "type": "u64" + }, + { + "name": "protocol_shares", + "docs": [ + "Total shares issued to protocol (for share/index yield isolation)" + ], + "type": "u64" + }, + { + "name": "current_index", + "docs": [ + "Current share-to-token exchange rate (scaled by INDEX_SCALE = 1e12)", + "Starts at INDEX_SCALE (1.0) and grows as yield accrues" + ], + "type": "u64" + }, + { + "name": "expected_pool_balance", + "docs": [ + "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).", + "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield." + ], + "type": "u64" + }, + { + "name": "yield_accumulated_liqsol", + "docs": [ + "Accumulated liqSOL yield available for protocol pretoken purchases" + ], + "type": "u64" + }, + { + "name": "role_principals", + "docs": [ + "Required principal (liqSOL) per role [YieldOp, BatchOp, Underwriter, PoolOp]" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + }, + { + "name": "role_warmup_duration", + "docs": [ + "Warmup duration in seconds (applies when ANY new role is bonded)" + ], + "type": "i64" + }, + { + "name": "wire_state", + "type": { + "defined": { + "name": "WireState" + } + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "GraveyardDeactivationQueuedEvent", + "docs": [ + "Event emitted when a graveyard validator's main stake deactivation is queued" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "amount_to_unstake", + "type": "u64" + } + ] + } + }, + { + "name": "GraveyardValidatorCleanedEvent", + "docs": [ + "Event emitted when a graveyard validator is cleaned up" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "epochs_since_state_change", + "type": "u16" + } + ] + } + }, + { + "name": "LatestOutboundEnvelope", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch_index", + "type": "u32" + }, + { + "name": "checksum", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "data", + "type": "bytes" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "LeaderboardState", + "docs": [ + "Central leaderboard state using parallel arrays for efficient ranking and CPI access", + "Stores VPP scores and sorted rankings for up to 1024 validators", + "Uses zero-copy for efficient access from other programs via CPI" + ], + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "scores", + "docs": [ + "VPP scores indexed by registry_index (0-100 range)", + "registry_index is assigned on first validator registration and never changes" + ], + "type": { + "array": [ + "u8", + 1024 + ] + } + }, + { + "name": "sorted_indices", + "docs": [ + "Validator indices sorted by VPP score descending", + "sorted_indices[0] = registry_index of highest VPP validator", + "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc." + ], + "type": { + "array": [ + "u16", + 1024 + ] + } + }, + { + "name": "vote_accounts", + "docs": [ + "Vote account pubkeys indexed by registry_index", + "Allows CPI callers to get vote accounts for top N validators" + ], + "type": { + "array": [ + { + "defined": { + "name": "PubkeyBytes" + } + }, + 1024 + ] + } + }, + { + "name": "num_validators", + "docs": [ + "Number of active validators currently in the leaderboard" + ], + "type": "u16" + }, + { + "name": "bump", + "docs": [ + "PDA bump seed" + ], + "type": "u8" + }, + { + "name": "_align", + "docs": [ + "Alignment byte (keeps u16 fields below properly aligned)" + ], + "type": "u8" + }, + { + "name": "crank_next_index", + "docs": [ + "Next validator index to process during crank_update_scores" + ], + "type": "u16" + }, + { + "name": "last_crank_epoch", + "docs": [ + "Last epoch when crank_update_scores completed all validators" + ], + "type": "u16" + }, + { + "name": "crank_started_epoch", + "docs": [ + "Epoch when start_crank was called (signals an active crank cycle)" + ], + "type": "u16" + } + ] + } + }, + { + "name": "LiqReceiptData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "receipt_id", + "type": "u64" + }, + { + "name": "liqports", + "type": "u64" + }, + { + "name": "epoch", + "type": "u64" + }, + { + "name": "fulfilled", + "type": "bool" + } + ] + } + }, + { + "name": "MaintenanceLedger", + "type": { + "kind": "struct", + "fields": [ + { + "name": "last_sync_epoch", + "type": "u16" + }, + { + "name": "last_validator_score_sync_epoch", + "type": "u16" + }, + { + "name": "last_leaderboard_scores_sync_epoch", + "type": "u16" + }, + { + "name": "last_active_infos_synced_epoch", + "docs": [ + "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout." + ], + "type": "u16" + }, + { + "name": "last_updated_stake_metrics_epoch", + "type": "u64" + }, + { + "name": "last_distribution_epoch", + "type": { + "option": "u64" + } + }, + { + "name": "last_distribution_slot", + "docs": [ + "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout." + ], + "type": { + "option": "u64" + } + }, + { + "name": "last_merge_deactivating_transients_epoch", + "type": "u64" + }, + { + "name": "last_rebalance_allocation_epoch", + "type": "u64" + }, + { + "name": "last_merge_activating_transients_epoch", + "type": "u64" + }, + { + "name": "last_unstake_epoch", + "type": { + "option": "u64" + } + }, + { + "name": "last_unstake_allocation_epoch", + "type": "u64" + }, + { + "name": "min_max_resolved_epoch_deactivations", + "type": "u16" + }, + { + "name": "last_threshold_sync_epoch", + "type": "u16" + }, + { + "name": "last_validator_removal_selection_epoch", + "type": "u16" + }, + { + "name": "last_validator_addition_selection_epoch", + "type": "u16" + }, + { + "name": "last_validator_pda_setup_epoch", + "type": "u16" + }, + { + "name": "last_graveyard_processing_epoch", + "type": "u16" + }, + { + "name": "last_post_sync_stake_metrics_refresh_epoch", + "type": "u16" + }, + { + "name": "last_graveyard_cleanup_epoch", + "type": "u16" + }, + { + "name": "last_post_late_epoch_stake_metrics_refresh_epoch", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "MetadataArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "OperatorDelivery", + "type": { + "kind": "struct", + "fields": [ + { + "name": "operator", + "type": "pubkey" + }, + { + "name": "envelope_hash", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "OperatorGroup", + "type": { + "kind": "struct", + "fields": [ + { + "name": "members", + "type": { + "vec": "pubkey" + } + } + ] + } + }, + { + "name": "OperatorMapping", + "type": { + "kind": "struct", + "fields": [ + { + "name": "wire_name", + "type": "u64" + }, + { + "name": "sol_address", + "type": "pubkey" + }, + { + "name": "role", + "type": "u32" + }, + { + "name": "status", + "type": "u32" + }, + { + "name": "slashed_at", + "type": "i64" + }, + { + "name": "terminated_at", + "type": "i64" + } + ] + } + }, + { + "name": "OperatorRegistry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "active_group_index", + "type": "u32" + }, + { + "name": "groups", + "type": { + "vec": { + "defined": { + "name": "OperatorGroup" + } + } + } + }, + { + "name": "operators", + "type": { + "vec": { + "defined": { + "name": "OperatorMapping" + } + } + } + }, + { + "name": "collateral_by_code", + "type": { + "vec": { + "defined": { + "name": "CollateralEntry" + } + } + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "OutboundMessageBuffer", + "type": { + "kind": "struct", + "fields": [ + { + "name": "attestation_count", + "type": "u16" + }, + { + "name": "used_data_bytes", + "type": "u32" + }, + { + "name": "entries", + "type": { + "vec": { + "defined": { + "name": "AttestationData" + } + } + } + }, + { + "name": "next_swap_id", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "OutpostAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "staked_liqsol", + "docs": [ + "STAKE deposits (withdrawable pre-D-Day)", + "Principal amount staked (for display/tracking)" + ], + "type": "u64" + }, + { + "name": "staked_shares", + "docs": [ + "Shares from staking (actual accounting for yield isolation)" + ], + "type": "u64" + }, + { + "name": "purchased_liqsol", + "docs": [ + "WARRANT_PURCHASE deposits with liqSOL (permanent)", + "Principal amount spent on pretokens (for display/tracking)" + ], + "type": "u64" + }, + { + "name": "purchased_shares", + "docs": [ + "Shares from liqSOL pretoken purchases (actual accounting for yield isolation)" + ], + "type": "u64" + }, + { + "name": "bonded_principals", + "docs": [ + "LiqSOL locked by bonds per role" + ], + "type": { + "array": [ + "u64", + 4 + ] + } + }, + { + "name": "bonded_roles", + "docs": [ + "Bitmap of bonded roles (bits 0-3 for YieldOp, BatchOp, Underwriter, PoolOp)" + ], + "type": "u8" + }, + { + "name": "unbond_requested", + "docs": [ + "Bitmap of roles with pending unbond requests (bits 0-3)" + ], + "type": "u8" + }, + { + "name": "warmup_ends_at", + "docs": [ + "Warmup end timestamp - has_role returns false until this time" + ], + "type": "i64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "accumulated_pretoken_yield", + "type": { + "option": "u64" + } + }, + { + "name": "last_epoch_synd_liqsol", + "type": { + "option": "u64" + } + }, + { + "name": "last_synd_epoch", + "type": { + "option": "u64" + } + } + ] + } + }, + { + "name": "OutpostConfig", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "chain_code", + "type": "u64" + }, + { + "name": "next_epoch_index", + "type": "u32" + }, + { + "name": "previous_epoch_hash", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "previous_outbound_epoch_hash", + "docs": [ + "Chain tip for the OUTBOUND (outpost → depot) stream: the canonical", + "epoch digest (`keccak256(encoded envelope)`, `envelope_hash` empty) of", + "this outpost's own previous emit. Stamped into each outbound", + "envelope's `previous_envelope_hash` and advanced after every emit —", + "SEC-114 per-stream chaining; the depot's inbound verification drops a", + "cross-stream link (the inbound tip `previous_epoch_hash`) as a chain", + "break. All-zero = genesis (no emit on this stream yet)." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "epoch_duration_sec", + "type": "u32" + }, + { + "name": "current_epoch_started_at", + "type": "i64" + }, + { + "name": "registry_initialized", + "type": "bool" + }, + { + "name": "last_message_id", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "last_message_timestamp", + "type": "u64" + }, + { + "name": "envelope_retention_epochs", + "type": "u32" + }, + { + "name": "token_addresses_by_code", + "type": { + "vec": { + "defined": { + "name": "TokenAddressEntry" + } + } + } + }, + { + "name": "precision_by_token_code", + "type": { + "vec": { + "defined": { + "name": "TokenPrecisionEntry" + } + } + } + }, + { + "name": "config_version", + "type": "u8" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PayRateEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "scaled_rate", + "type": "u64" + } + ] + } + }, + { + "name": "PayRateHistory", + "type": { + "kind": "struct", + "fields": [ + { + "name": "current_index", + "type": "u16" + }, + { + "name": "total_entries_added", + "type": "u64" + }, + { + "name": "entries", + "type": { + "vec": { + "defined": { + "name": "PayRateEntry" + } + } + } + }, + { + "name": "max_entries", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PayoutState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_yield_paid_out_epoch", + "type": "u64" + }, + { + "name": "fees_remaining_to_distribute", + "type": "u64" + }, + { + "name": "total_fees_deposited", + "type": "u64" + }, + { + "name": "total_cumulative_payout_alltime", + "type": "u128" + }, + { + "name": "total_cumulative_payout_epoch", + "type": "u64" + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "epoch", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PretokenPurchaseHistory", + "serialization": "bytemuck", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "starting_epoch", + "type": "u64" + }, + { + "name": "latest_epoch", + "type": "u64" + }, + { + "name": "purchased_per_epoch", + "type": { + "array": [ + "u64", + 100 + ] + } + }, + { + "name": "synd_per_epoch", + "type": { + "array": [ + "u64", + 100 + ] + } + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "_padding", + "type": { + "array": [ + "u8", + 7 + ] + } + } + ] + } + }, + { + "name": "PretokenPurchased", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "tranche_number", + "type": "u64" + }, + { + "name": "pretokens_purchased", + "type": "u64" + } + ] + } + }, + { + "name": "PriceHistory", + "docs": [ + "Price history for windowed moving average calculations", + "All prices stored in 8-decimal precision" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "window_size", + "docs": [ + "Number of prices to keep in the moving average window" + ], + "type": "u8" + }, + { + "name": "prices", + "docs": [ + "Circular buffer of recent prices (fixed size, 8-dec each)" + ], + "type": { + "array": [ + "u64", + 10 + ] + } + }, + { + "name": "count", + "docs": [ + "Number of valid entries in the prices array (0-10)" + ], + "type": "u8" + }, + { + "name": "next_index", + "type": "u8" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "PubkeyBytes", + "docs": [ + "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.", + "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`." + ], + "serialization": "bytemuck", + "repr": { + "kind": "transparent" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "bytes", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "Reserve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "reserve_code", + "type": "u64" + }, + { + "name": "external_token_amount", + "type": "u64" + }, + { + "name": "requested_wire_amount", + "type": "u64" + }, + { + "name": "connector_weight_bps", + "type": "u32" + }, + { + "name": "status", + "type": { + "defined": { + "name": "ReserveStatus" + } + } + }, + { + "name": "creator", + "type": "pubkey" + }, + { + "name": "custody_mint", + "docs": [ + "Mint/native mode pinned at reserve creation. `NATIVE_TOKEN_MARKER`", + "means the reserve custodies lamports; any other pubkey is the SPL mint", + "held by the `reserve_vault`. Terminal handlers (SwapRemit, SwapRevert,", + "ReserveCreateCancelled) read this instead of the mutable", + "`OutpostConfig.token_addresses_by_code`, so an admin re-point of a", + "token_code between creation and dispatch cannot change how an", + "already-created reserve settles." + ], + "type": "pubkey" + }, + { + "name": "custody_decimals", + "docs": [ + "Chain-side decimals pinned at reserve creation. Native reserves use", + "`DEPOT_PRECISION_DECIMALS`; SPL reserves use the source mint's", + "`decimals` at creation time." + ], + "type": "u8" + }, + { + "name": "name_len", + "type": "u8" + }, + { + "name": "name_bytes", + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "description_len", + "type": "u16" + }, + { + "name": "description_bytes", + "type": { + "array": [ + "u8", + 256 + ] + } + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "ReserveAggregate", + "type": { + "kind": "struct", + "fields": [ + { + "name": "failed_remits", + "type": { + "array": [ + { + "defined": { + "name": "FailedSwapRemit" + } + }, + 8 + ] + } + }, + { + "name": "failed_remits_head", + "type": "u8" + }, + { + "name": "failed_remits_total", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "ReserveStatus", + "docs": [ + "Local Borsh enum (NOT the proto enum): tags Pending=0, Active=1, Cancelled=2." + ], + "type": { + "kind": "enum", + "variants": [ + { + "name": "Pending" + }, + { + "name": "Active" + }, + { + "name": "Cancelled" + } + ] + } + }, + { + "name": "Role", + "repr": { + "kind": "rust" + }, + "type": { + "kind": "enum", + "variants": [ + { + "name": "YieldOperator" + }, + { + "name": "BatchOperator" + }, + { + "name": "Underwriter" + }, + { + "name": "PoolOperator" + } + ] + } + }, + { + "name": "StakeAllocationState", + "docs": [ + "Stake allocation state tracking for validator stake distribution and unstake orders", + "Tracks both staking allocations (VPP-based) and unstake order batching", + "", + "Rule of thumb for what lives here vs BatchOrchestrator: this account holds", + "CONSERVED-VALUE cycles (frozen amounts, distributed totals, snapshots) - you", + "can never blanket-zero these, a stale cycle gets aborted/recovered instead", + "(see start_unstake_allocation's remainder recovery and abort_rebalance).", + "That's also why the *_started_epoch pins live here and not on BO: the pin is", + "part of its cycle record and must be stamped/cleared atomically with it by", + "the cycle's own start/abort methods, so pin and cycle can't desync. Pure", + "resume cursors with no value attached belong on BatchOrchestrator, where the", + "epoch sweep can wipe them for free.", + "", + "The in_progress bools here are deliberately explicit, NOT inferred like BO", + "does with its cursors. Inference needs a signal whose zero is out-of-band,", + "and every candidate here has a meaningful zero: epoch 0 is real (localnet),", + "an unstake-only rebalance legitimately distributes 0, and the processed", + "counter being nonzero-while-open is an accident of call sites, not a", + "guarantee. Plus these cycles have a state BO ops don't: open-but-stale with", + "recoverable frozen value - stale here means recover, not wipe, so it must", + "stay distinguishable from idle." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "total_active_vpp", + "docs": [ + "Sum of all VPP scores (0-100 each) for Trusted validators in the active list.", + "Max with 200 validators at 100 each = 20,000, fits in u32.", + "", + "Authoritatively recomputed by `conclude_addition_selection` from the active", + "list's `vpp` fields at the end of every addition-selection cycle, so any", + "intra-cycle drift from removals/score updates is wiped before allocation", + "uses this as a denominator. Do not maintain incrementally." + ], + "type": "u32" + }, + { + "name": "bump", + "docs": [ + "Bump seed for PDA" + ], + "type": "u8" + }, + { + "name": "initial_reserve_balance", + "docs": [ + "Initial reserve balance when distribution cycle started (for batched distribution)" + ], + "type": "u64" + }, + { + "name": "pending_unstake_amount_this_epoch", + "docs": [ + "Accumulates unstake requests during the epoch (before allocation starts)", + "Resets to 0 when allocation cycle begins" + ], + "type": "u64" + }, + { + "name": "unstake_allocation_in_progress", + "docs": [ + "Whether unstake allocation is currently in progress (batched processing)" + ], + "type": "bool" + }, + { + "name": "validators_processed_this_unstake_allocation", + "docs": [ + "Number of validators processed in the current unstake allocation batch" + ], + "type": "u16" + }, + { + "name": "processing_unstake_amount_this_allocation", + "docs": [ + "FROZEN amount being allocated across all batches this cycle", + "Set at start of allocation, prevents race conditions with new requests" + ], + "type": "u64" + }, + { + "name": "amount_distributed_this_unstake_allocation", + "docs": [ + "Tracks cumulative amount distributed across all batches in current unstake allocation cycle" + ], + "type": "u64" + }, + { + "name": "rebalance_in_progress", + "docs": [ + "Whether rebalancing is currently in progress (batched processing)" + ], + "type": "bool" + }, + { + "name": "validators_processed_this_rebalance", + "docs": [ + "Number of validators processed in the current rebalance cycle" + ], + "type": "u16" + }, + { + "name": "total_amount_to_distribute_this_rebalance", + "docs": [ + "Total amount to distribute for this rebalance cycle (after subtracting encumbered funds and buffer)", + "Saved at the start to ensure consistency across all batches" + ], + "type": "u64" + }, + { + "name": "cumulative_stake_requested_this_rebalance", + "docs": [ + "Tracks cumulative stake requested (sum of positive deltas) across all batches in current rebalance cycle" + ], + "type": "u64" + }, + { + "name": "rebalance_stake_scale_factor", + "docs": [ + "Scale factor to apply during process_stake_orders (uses PAY_RATE_SCALE_FACTOR precision)", + "Set to PAY_RATE_SCALE_FACTOR (1.0) if no scaling needed, or lower if cumulative > available" + ], + "type": "u64" + }, + { + "name": "is_small_distribution_mode", + "docs": [ + "Whether we're in small distribution mode (not enough for VPP-based distribution)", + "In this mode, we distribute evenly to first N validators instead of using VPP ratios" + ], + "type": "bool" + }, + { + "name": "validators_to_fund_this_rebalance", + "docs": [ + "Number of validators to fund in small distribution mode", + "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)" + ], + "type": "u16" + }, + { + "name": "amount_per_validator_this_rebalance", + "docs": [ + "Amount each validator gets in small distribution mode", + "Calculated as total_to_distribute / validators_to_fund" + ], + "type": "u64" + }, + { + "name": "selection_entry_threshold_vpp", + "docs": [ + "Entry threshold VPP from leaderboard (validators must meet this to be added, 0-100)" + ], + "type": "u8" + }, + { + "name": "selection_exit_threshold_vpp", + "docs": [ + "Exit threshold VPP from leaderboard (validators below this are removed, 0-100)" + ], + "type": "u8" + }, + { + "name": "addition_in_progress", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always false." + ], + "type": "bool" + }, + { + "name": "unstake_allocation_started_epoch", + "docs": [ + "Epoch in which the current unstake allocation cycle was started.", + "Used to detect stale cycles that span epoch boundaries — if the epoch", + "has advanced, the cycle is reset and restarted to avoid resuming", + "against a mutated validator active list.", + "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)" + ], + "type": "u16" + }, + { + "name": "rebalance_started_epoch", + "docs": [ + "Epoch in which the current rebalance cycle was started. Same job as", + "unstake_allocation_started_epoch above — a cycle whose epoch no longer", + "matches is stale (active list may have been reshuffled by selection)", + "and gets aborted + restarted instead of resumed.", + "(Repurposed from the deprecated addition_target_rank field — always 0 on mainnet.)" + ], + "type": "u16" + }, + { + "name": "validators_added_this_selection", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always 0." + ], + "type": "u16" + }, + { + "name": "removal_in_progress", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always false." + ], + "type": "bool" + }, + { + "name": "removal_next_index", + "docs": [ + "DEPRECATED — see BatchOrchestrator.removal_next_index. Always 0." + ], + "type": "u16" + }, + { + "name": "removal_active_list_snapshot", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always 0." + ], + "type": "u16" + }, + { + "name": "validators_removed_this_selection", + "docs": [ + "DEPRECATED — see BatchOrchestrator. Always 0." + ], + "type": "u16" + } + ] + } + }, + { + "name": "StakeControllerState", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "vault_initialized", + "type": "bool" + }, + { + "name": "reserve_pool_initialized", + "type": "bool" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "StakeMetrics", + "type": { + "kind": "struct", + "fields": [ + { + "name": "current_active_stake", + "type": "u64" + }, + { + "name": "transient_active_stake", + "type": "u64" + }, + { + "name": "actual_system_yield_received", + "type": "u64" + }, + { + "name": "sol_system_pay_rate", + "type": "u64" + }, + { + "name": "unstakeable_stake", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "mev_reward", + "docs": [ + "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)" + ], + "type": "u64" + }, + { + "name": "total_outstanding_amount_to_unstake", + "docs": [ + "WNS-16: total amount_to_unstake across all validators at last metrics refresh.", + "Represents allocated-but-not-yet-deactivated unstake obligations.", + "Subtracted from unstakeable_stake in admission control to prevent double-promising." + ], + "type": "u64" + }, + { + "name": "_reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 24 + ] + } + } + ] + } + }, + { + "name": "StakesMerged", + "type": { + "kind": "struct", + "fields": [ + { + "name": "validator", + "type": "pubkey" + }, + { + "name": "epoch", + "type": "u64" + }, + { + "name": "count", + "type": "u32" + }, + { + "name": "amount", + "type": "u64" + } + ] + } + }, + { + "name": "TokenAddressEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "mint", + "type": "pubkey" + } + ] + } + }, + { + "name": "TokenMetadata", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "symbol", + "type": "string" + }, + { + "name": "uri", + "type": "string" + } + ] + } + }, + { + "name": "TokenPrecisionEntry", + "type": { + "kind": "struct", + "fields": [ + { + "name": "token_code", + "type": "u64" + }, + { + "name": "decimals", + "type": "u8" + } + ] + } + }, + { + "name": "TrancheState", + "docs": [ + "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)", + "Example: $193.32 is stored as 19332000000" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "current_tranche_number", + "type": "u64" + }, + { + "name": "current_tranche_supply", + "type": "u64" + }, + { + "name": "current_tranche_price_usd", + "type": "u64" + }, + { + "name": "total_pretokens_sold", + "type": "u64" + }, + { + "name": "initial_tranche_supply", + "type": "u64" + }, + { + "name": "supply_growth_bps", + "docs": [ + "Supply growth in basis points (e.g., 100 = 1%, max 10000)" + ], + "type": "u16" + }, + { + "name": "price_growth_cents", + "docs": [ + "Price growth in cents per tranche (0.01 USD units)" + ], + "type": "u16" + }, + { + "name": "min_price_usd", + "docs": [ + "Minimum valid SOL/USD price for validation (8-dec)" + ], + "type": "u64" + }, + { + "name": "max_price_usd", + "docs": [ + "Maximum valid SOL/USD price for validation (8-dec)" + ], + "type": "u64" + }, + { + "name": "max_staleness_seconds", + "docs": [ + "Maximum staleness in seconds for Chainlink data" + ], + "type": "i64" + }, + { + "name": "chainlink_program", + "docs": [ + "Chainlink program address" + ], + "type": "pubkey" + }, + { + "name": "chainlink_feed", + "docs": [ + "Chainlink price feed PDA" + ], + "type": "pubkey" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "UserPretokenRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "total_sol_deposited", + "type": "u64" + }, + { + "name": "total_pretokens_purchased", + "type": "u64" + }, + { + "name": "last_tranche_number", + "type": "u64" + }, + { + "name": "last_tranche_price_usd", + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + } + ] + } + }, + { + "name": "UserRecord", + "type": { + "kind": "struct", + "fields": [ + { + "name": "shares", + "docs": [ + "User's share of the distribution pool", + "entitled_balance = shares * current_index / INDEX_SCALE" + ], + "type": "u64" + }, + { + "name": "bump", + "type": "u8" + }, + { + "name": "tracked_balance", + "docs": [ + "Last reconciled liqSOL token balance for this user ATA" + ], + "type": "u64" + } + ] + } + }, + { + "name": "ValidatorAddedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "vpp", + "type": "u8" + } + ] + } + }, + { + "name": "ValidatorInfoAccount", + "docs": [ + "Per-validator information account", + "Seed: [\"validator_info\", vote_account]" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "docs": [ + "Vote account this info belongs to" + ], + "type": "pubkey" + }, + { + "name": "vpp", + "docs": [ + "Validator Performance Points (0-100 score)" + ], + "type": "u8" + }, + { + "name": "bump", + "docs": [ + "Bump seed for PDA" + ], + "type": "u8" + }, + { + "name": "current_active_stake", + "docs": [ + "Fully active stake earning rewards" + ], + "type": "u64" + }, + { + "name": "epoch_reward", + "docs": [ + "Rewards earned in the last epoch", + "This is update in the function: sync_validator_stakes_v2 and is a simple subtraction of current - previous active stake. This does cater for deactivations etc. so", + "no worries" + ], + "type": "u64" + }, + { + "name": "transient_active_stake", + "docs": [ + "Stake warming up (activating), not fully active yet" + ], + "type": "u64" + }, + { + "name": "transient_deactivating_stake", + "docs": [ + "Stake cooling down (deactivating), no longer earning rewards" + ], + "type": "u64" + }, + { + "name": "last_chain_sync_epoch", + "docs": [ + "When was this entry last updated from the chain?", + "This is update in the function: sync_validator_stakes_v2" + ], + "type": "u16" + }, + { + "name": "last_score_sync_epoch", + "docs": [ + "When was this VPP score last updated from our Validator Leaderboard program?" + ], + "type": "u16" + }, + { + "name": "last_state_change_epoch", + "docs": [ + "When was the validator state last changed? (helps determine cooldowns)" + ], + "type": "u16" + }, + { + "name": "amount_to_stake", + "docs": [ + "The amount of stake to stake" + ], + "type": "u64" + }, + { + "name": "amount_to_unstake", + "docs": [ + "The amount of stake to unstake" + ], + "type": "u64" + }, + { + "name": "validator_repute", + "docs": [ + "State of the validator" + ], + "type": { + "defined": { + "name": "ValidatorReputation" + } + } + }, + { + "name": "validator_state", + "type": { + "defined": { + "name": "ValidatorState" + } + } + }, + { + "name": "state_transition_trigger_stake_amount", + "type": "u64" + }, + { + "name": "mev_earned", + "docs": [ + "MEV reward swept for this validator in the current epoch" + ], + "type": "u64" + }, + { + "name": "rebalance_unstake_pending", + "docs": [ + "The share of amount_to_unstake that came from rebalance this epoch.", + "amount_to_unstake mixes two things with different rules: user-withdrawal", + "shares are DEBT (back receipts, never resettable) while the rebalance", + "share is INTENT (recomputed from target-vs-effective every cycle,", + "replaceable). This field makes the intent part separable so a new", + "rebalance cycle can drop a dead cycle's contribution instead of adding", + "on top of it, without ever touching user debt.", + "(Carved from _reserved - those bytes are structurally zero: introduced", + "via realloc(len, true) in migrate_validator_info_batch and zeroed by", + "initialize() on fresh PDAs, never written since. Zero = \"all existing", + "amount_to_unstake is debt\", which is exactly today's safe behavior.)" + ], + "type": "u64" + }, + { + "name": "rebalance_unstake_epoch", + "docs": [ + "Epoch the rebalance component was stamped. A mismatch with the current", + "epoch means the component is a dead cycle's intent - subtract and re-add." + ], + "type": "u16" + }, + { + "name": "_reserved", + "docs": [ + "Reserved space for future use" + ], + "type": { + "array": [ + "u8", + 14 + ] + } + } + ] + } + }, + { + "name": "ValidatorList", + "docs": [ + "Zero-copy validator list account", + "Stores a fixed-capacity array of validator vote account pubkeys" + ], + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "count", + "docs": [ + "Current number of validators in the list" + ], + "type": "u32" + }, + { + "name": "capacity", + "docs": [ + "Maximum capacity of the list" + ], + "type": "u32" + }, + { + "name": "bump", + "docs": [ + "PDA bump seed" + ], + "type": "u8" + }, + { + "name": "_padding", + "docs": [ + "Padding for alignment" + ], + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "validators", + "docs": [ + "Fixed array of validator vote account pubkeys", + "Using Option to allow for empty slots (None = empty)" + ], + "type": { + "array": [ + { + "defined": { + "name": "ValidatorListEntry" + } + }, + 200 + ] + } + } + ] + } + }, + { + "name": "ValidatorListEntry", + "serialization": "bytemuckunsafe", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "docs": [ + "Vote account pubkey (all zeros = empty slot)" + ], + "type": "pubkey" + }, + { + "name": "registry_index", + "docs": [ + "Immutable index into the validator leaderboard arrays (u16::MAX = unknown)" + ], + "type": "u16" + }, + { + "name": "pdas_initialized", + "docs": [ + "Whether per-validator PDAs (info/transient) are initialized" + ], + "type": "bool" + }, + { + "name": "vpp", + "docs": [ + "Cached VPP score (0-100) refreshed at the start of a maintenance run" + ], + "type": "u8" + }, + { + "name": "_pad", + "docs": [ + "Padding to keep 8-byte alignment (32 + 2 + 1 + 1 + 4 = 40 bytes)" + ], + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, + { + "name": "ValidatorRemovedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "type": "pubkey" + }, + { + "name": "vpp", + "type": "u8" + } + ] + } + }, + { + "name": "ValidatorReputation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Trusted" + }, + { + "name": "Blacklisted" + }, + { + "name": "UnderPerforming" + } + ] + } + }, + { + "name": "ValidatorState", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Warming" + }, + { + "name": "NotDelegated" + }, + { + "name": "Cooling" + }, + { + "name": "Warm" + }, + { + "name": "ReadyToCool" + } + ] + } + }, + { + "name": "ValidatorSwappedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "removed_vote", + "type": "pubkey" + }, + { + "name": "removed_vpp", + "type": "u8" + }, + { + "name": "added_vote", + "type": "pubkey" + }, + { + "name": "added_vpp", + "type": "u8" + } + ] + } + }, + { + "name": "ValidatorTransientAccount", + "docs": [ + "Per-validator transient stake tracking account", + "Seed: [\"validator_transient\", vote_account]", + "", + "This account tracks the resolution status of transient stake accounts", + "(both activating and deactivating) for a specific validator." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "vote_account", + "docs": [ + "Vote account this transient tracking belongs to" + ], + "type": "pubkey" + }, + { + "name": "bump", + "docs": [ + "Bump seed for PDA" + ], + "type": "u8" + }, + { + "name": "_padding", + "docs": [ + "Padding for alignment" + ], + "type": { + "array": [ + "u8", + 7 + ] + } + }, + { + "name": "max_resolved_epoch_deactivations", + "docs": [ + "The epoch number for which we have resolved the deactivating stakes", + "(resolved = deactivated and merged into the stake pool reserve)" + ], + "type": "u16" + }, + { + "name": "max_resolved_activating_stake", + "docs": [ + "The epoch number for which we have resolved the activating stakes", + "(resolved = fully activated and merged into the main stake account)" + ], + "type": "u16" + }, + { + "name": "last_updated_epoch_activations", + "docs": [ + "When did we last check if there are pending activated transient stakes that need to be merged in" + ], + "type": "u16" + }, + { + "name": "last_updated_epoch_deactivations", + "docs": [ + "When did we last check if there were pending deactivated stakes that need to be merged into the reserve pool" + ], + "type": "u16" + } + ] + } + }, + { + "name": "ValidatorsSyncedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "updated_count", + "type": "u32" + }, + { + "name": "not_found_count", + "type": "u32" + }, + { + "name": "epoch", + "type": "u64" + } + ] + } + }, + { + "name": "WireState", + "type": { + "kind": "enum", + "variants": [ + { + "name": "PreLaunch" + }, + { + "name": "PostLaunch" + }, + { + "name": "Refund" + } + ] + } + }, + { + "name": "WithdrawClaimed", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "user", + "type": "pubkey" + } + ] + } + }, + { + "name": "WithdrawRequested", + "type": { + "kind": "struct", + "fields": [ + { + "name": "epoch", + "type": "u64" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "user", + "type": "pubkey" + }, + { + "name": "receipt_id", + "type": "u64" + } + ] + } + } + ] +} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts index 818b13e..8b39e88 100644 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts @@ -459,6 +459,22 @@ const _abi = [ name: "WIRE_BasisPointsTooHigh", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "derived", + type: "address", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_DepositorKeyMismatch", + type: "error", + }, { inputs: [], name: "WIRE_Erc20DepositValueNonZero", @@ -517,11 +533,60 @@ const _abi = [ name: "WIRE_InsufficientEthBalance", type: "error", }, + { + inputs: [ + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + ], + name: "WIRE_InvalidDepositorKey", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "WIRE_InvalidNodeTier", + type: "error", + }, { inputs: [], name: "WIRE_InvalidPrice", type: "error", }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + ], + name: "WIRE_InvalidWireAccountName", + type: "error", + }, + { + inputs: [ + { + internalType: "WireKeyType", + name: "keyType", + type: "uint8", + }, + { + internalType: "uint256", + name: "keyLength", + type: "uint256", + }, + ], + name: "WIRE_InvalidWireKey", + type: "error", + }, { inputs: [ { @@ -579,6 +644,27 @@ const _abi = [ name: "WIRE_NoYield", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "nftAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_NodeTokenNotOwned", + type: "error", + }, { inputs: [ { @@ -789,6 +875,27 @@ const _abi = [ name: "WIRE_UnexpectedError", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "WIRE_UnexpectedTokenDeposit", + type: "error", + }, + { + inputs: [], + name: "WIRE_WireNodesContractNotSet", + type: "error", + }, { inputs: [], name: "WIRE_ZeroAmount", diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts index 8df24f7..f579d2f 100644 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts +++ b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts @@ -436,6 +436,22 @@ const _abi = [ name: "WIRE_BasisPointsTooHigh", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "derived", + type: "address", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_DepositorKeyMismatch", + type: "error", + }, { inputs: [], name: "WIRE_Erc20DepositValueNonZero", @@ -494,11 +510,60 @@ const _abi = [ name: "WIRE_InsufficientEthBalance", type: "error", }, + { + inputs: [ + { + internalType: "uint256", + name: "length", + type: "uint256", + }, + ], + name: "WIRE_InvalidDepositorKey", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "WIRE_InvalidNodeTier", + type: "error", + }, { inputs: [], name: "WIRE_InvalidPrice", type: "error", }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + ], + name: "WIRE_InvalidWireAccountName", + type: "error", + }, + { + inputs: [ + { + internalType: "WireKeyType", + name: "keyType", + type: "uint8", + }, + { + internalType: "uint256", + name: "keyLength", + type: "uint256", + }, + ], + name: "WIRE_InvalidWireKey", + type: "error", + }, { inputs: [ { @@ -556,6 +621,27 @@ const _abi = [ name: "WIRE_NoYield", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "nftAddress", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "address", + name: "caller", + type: "address", + }, + ], + name: "WIRE_NodeTokenNotOwned", + type: "error", + }, { inputs: [ { @@ -766,6 +852,27 @@ const _abi = [ name: "WIRE_UnexpectedError", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "WIRE_UnexpectedTokenDeposit", + type: "error", + }, + { + inputs: [], + name: "WIRE_WireNodesContractNotSet", + type: "error", + }, { inputs: [], name: "WIRE_ZeroAmount", diff --git a/packages/sdk-outpost/src/deployments/Registry.ts b/packages/sdk-outpost/src/deployments/Registry.ts index 997a438..91a7642 100644 --- a/packages/sdk-outpost/src/deployments/Registry.ts +++ b/packages/sdk-outpost/src/deployments/Registry.ts @@ -1,10 +1,26 @@ import { ChainId, ChainIdType } from "@wireio/sdk-core" -import { Sim2Deployment } from "./Sim2.js" -import { OutpostDeployment } from "./Schema.js" +import { + CurrentOutpostDeploymentId, + OutpostDeploymentDocuments +} from "./generated/Catalog.js" +import { OutpostDeployment, parseOutpostDeployment } from "./Schema.js" /** Deployment bundles available to SDK consumers. */ -export const OutpostDeployments: readonly OutpostDeployment[] = [Sim2Deployment] +export const OutpostDeployments: readonly OutpostDeployment[] = + OutpostDeploymentDocuments.map(parseOutpostDeployment) + +/** Resolve a deployment by its stable catalog id or throw. */ +export function getOutpostDeployment(id: string): OutpostDeployment { + const deployment = OutpostDeployments.find(candidate => candidate.id === id) + if (deployment == null) throw new Error(`No outpost deployment named ${id}`) + return deployment +} + +/** Deployment whose artifacts own the package's generated client types. */ +export const CurrentOutpostDeployment = getOutpostDeployment( + CurrentOutpostDeploymentId +) /** Resolve a deployment by its parent Wire chain identity or throw. */ export function assertOutpostDeployment( diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index 7a4c960..183b3b9 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -4,11 +4,7 @@ import { z } from "zod" import { ChainId } from "@wireio/sdk-core" -import { - EthereumContractName, - OutpostDeploymentId, - SolanaProgramName -} from "./Types.js" +import { EthereumContractName, SolanaProgramName } from "./Types.js" const SourceRevisionSchema = z.string().regex(/^[0-9a-f]{8,40}$/), Sha256Schema = z.string().regex(/^[0-9a-f]{64}$/), @@ -42,6 +38,9 @@ export const ArtifactSourceSchema = z.object({ export const ArtifactBundleSchema = z.object({ generatedAt: z.iso.datetime(), sourceArchiveSha256: Sha256Schema, + clusterManifestSha256: Sha256Schema, + deploymentChecksum: Sha256Schema, + snapshotChecksum: Sha256Schema, platformRelease: z.object({ tag: z.string().regex(/^v\d+\.\d+\.\d+$/), url: z.url(), @@ -71,7 +70,7 @@ export const SolanaProgramDeploymentSchema = z.object({ /** Complete deployment schema for a Wire network group. */ export const OutpostDeploymentSchema = z.object({ schemaVersion: z.literal(1), - id: z.enum(OutpostDeploymentId), + id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), artifactBundle: ArtifactBundleSchema, wire: z.object({ chainId: WireChainIdSchema diff --git a/packages/sdk-outpost/src/deployments/Sim2.ts b/packages/sdk-outpost/src/deployments/Sim2.ts deleted file mode 100644 index 8d46824..0000000 --- a/packages/sdk-outpost/src/deployments/Sim2.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { parseOutpostDeployment } from "./Schema.js" -import { - EthereumContractName, - OutpostDeploymentId, - SolanaProgramName -} from "./Types.js" - -const Sim2DeploymentDocument = { - schemaVersion: 1, - id: OutpostDeploymentId.sim2, - artifactBundle: { - generatedAt: "2026-07-31T15:47:46Z", - sourceArchiveSha256: - "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", - platformRelease: { - tag: "v1.0.0", - url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - manifest: { - repository: "Wire-Network/wire-platform-manifest", - revision: "78ed083740e62a03d9ea873ff0a9a44db23ca195" - }, - libraries: { - repository: "Wire-Network/wire-libraries-ts", - revision: "3cfda4a238e4e8d98bda836e857e6679b85f44fa" - } - }, - sources: { - wireTools: { - repository: "Wire-Network/wire-tools-ts", - revision: "ac4ea7a2783f81d03f13a62ead2fa173cf12094f" - }, - wireSysio: { - repository: "Wire-Network/wire-sysio", - revision: "235501b0ad4612ee842c428182f84cd66ef803fc" - }, - wireEthereum: { - repository: "Wire-Network/wire-ethereum", - revision: "c1ea82b2b3cffacecec35e5c186e82e381f6be67" - }, - wireSolana: { - repository: "Wire-Network/wire-solana", - revision: "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" - } - } - }, - wire: { - chainId: "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023" - }, - ethereum: { - chainId: 31_337, - contracts: { - [EthereumContractName.OPP]: { - address: "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - artifactSha256: - "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" - }, - [EthereumContractName.OPPInbound]: { - address: "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - artifactSha256: - "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" - }, - [EthereumContractName.OperatorRegistry]: { - address: "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - artifactSha256: - "d9ce20dce4d4f5b039bdd52df69037c8c289f9a419b420efdac6c02cafbd5607" - }, - [EthereumContractName.ReserveManager]: { - address: "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - artifactSha256: - "1df4221be4fc24617d3368877e5962214ae55330362bb644028e56518d12b17f" - } - } - }, - solana: { - genesisHash: "3rVuMvjfU8SGyyfYWsmkhJNHSsrbxaGLLzdwnYZvWadc", - programs: { - [SolanaProgramName.liqsolCore]: { - address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - artifactSha256: - "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" - } - } - } -} - -/** Validated sim2 deployment and artifact provenance. */ -export const Sim2Deployment = parseOutpostDeployment(Sim2DeploymentDocument) diff --git a/packages/sdk-outpost/src/deployments/Types.ts b/packages/sdk-outpost/src/deployments/Types.ts index c77fc0f..fe6a4ef 100644 --- a/packages/sdk-outpost/src/deployments/Types.ts +++ b/packages/sdk-outpost/src/deployments/Types.ts @@ -4,11 +4,6 @@ export enum OutpostChainFamily { solana = "solana" } -/** Versioned deployment bundles shipped by the SDK. */ -export enum OutpostDeploymentId { - sim2 = "sim2" -} - /** Ethereum contracts owned by the current outpost deployment. */ export enum EthereumContractName { OPP = "OPP", diff --git a/packages/sdk-outpost/src/deployments/current.json b/packages/sdk-outpost/src/deployments/current.json new file mode 100644 index 0000000..89db309 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/current.json @@ -0,0 +1,3 @@ +{ + "id": "sim2-2026-08-03-ca8d3a9d" +} diff --git a/packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json b/packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json new file mode 100644 index 0000000..6cc0545 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json @@ -0,0 +1,74 @@ +{ + "schemaVersion": 1, + "id": "sim2-2026-07-31-365c4416", + "artifactBundle": { + "generatedAt": "2026-07-31T15:47:46Z", + "sourceArchiveSha256": "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", + "clusterManifestSha256": "2e650017d311678ac427d671e5289a0875751eef6829f9239d8eb0e25b821030", + "deploymentChecksum": "274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509", + "snapshotChecksum": "95bde008eb560dd173c410e1010a885c9660e3dd2399d554c97210d0caa7ef6a", + "platformRelease": { + "tag": "v1.0.0", + "url": "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + "manifest": { + "repository": "Wire-Network/wire-platform-manifest", + "revision": "78ed083740e62a03d9ea873ff0a9a44db23ca195" + }, + "libraries": { + "repository": "Wire-Network/wire-libraries-ts", + "revision": "3cfda4a238e4e8d98bda836e857e6679b85f44fa" + } + }, + "sources": { + "wireTools": { + "repository": "Wire-Network/wire-tools-ts", + "revision": "ac4ea7a2783f81d03f13a62ead2fa173cf12094f" + }, + "wireSysio": { + "repository": "Wire-Network/wire-sysio", + "revision": "235501b0ad4612ee842c428182f84cd66ef803fc" + }, + "wireEthereum": { + "repository": "Wire-Network/wire-ethereum", + "revision": "c1ea82b2b3cffacecec35e5c186e82e381f6be67" + }, + "wireSolana": { + "repository": "Wire-Network/wire-solana", + "revision": "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" + } + } + }, + "wire": { + "chainId": "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023" + }, + "ethereum": { + "chainId": 31337, + "contracts": { + "OPP": { + "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + "artifactSha256": "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" + }, + "OPPInbound": { + "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + "artifactSha256": "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" + }, + "OperatorRegistry": { + "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + "artifactSha256": "d9ce20dce4d4f5b039bdd52df69037c8c289f9a419b420efdac6c02cafbd5607" + }, + "ReserveManager": { + "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + "artifactSha256": "1df4221be4fc24617d3368877e5962214ae55330362bb644028e56518d12b17f" + } + } + }, + "solana": { + "genesisHash": "3rVuMvjfU8SGyyfYWsmkhJNHSsrbxaGLLzdwnYZvWadc", + "programs": { + "liqsolCore": { + "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + "artifactSha256": "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" + } + } + } +} diff --git a/packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json b/packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json new file mode 100644 index 0000000..f38d251 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json @@ -0,0 +1,74 @@ +{ + "schemaVersion": 1, + "id": "sim2-2026-08-03-ca8d3a9d", + "artifactBundle": { + "generatedAt": "2026-08-03T15:21:41Z", + "sourceArchiveSha256": "74f854b94f24830b76fdb749bbb229b4f725f06e67b7d3fcc00cc3b0c4db95ea", + "clusterManifestSha256": "8ee35815b7d23d1eb8ee02fd2e5d7d941c8aa2c96fe55ba20d124c8a94364d19", + "deploymentChecksum": "467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6", + "snapshotChecksum": "30f6df4c6b02cff393040599507b6894c04e9e7af473d7425b295f1a18e61434", + "platformRelease": { + "tag": "v1.0.0", + "url": "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + "manifest": { + "repository": "Wire-Network/wire-platform-manifest", + "revision": "4f556be5d7bdba5a23c87e39f91aa2ddace9c2b4" + }, + "libraries": { + "repository": "Wire-Network/wire-libraries-ts", + "revision": "1b8025381a105bf96a95bbdd58a1cfc012f79509" + } + }, + "sources": { + "wireTools": { + "repository": "Wire-Network/wire-tools-ts", + "revision": "763dda36c0a05cd2cfcc07191f06d7f04cf43f14" + }, + "wireSysio": { + "repository": "Wire-Network/wire-sysio", + "revision": "7dede884e0150d36fa788e85a119e10653ade8ca" + }, + "wireEthereum": { + "repository": "Wire-Network/wire-ethereum", + "revision": "d892c9458ad666adbccca913863ddf4e5e3d37a4" + }, + "wireSolana": { + "repository": "Wire-Network/wire-solana", + "revision": "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" + } + } + }, + "wire": { + "chainId": "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96" + }, + "ethereum": { + "chainId": 31337, + "contracts": { + "OPP": { + "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + "artifactSha256": "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" + }, + "OPPInbound": { + "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + "artifactSha256": "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" + }, + "OperatorRegistry": { + "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + "artifactSha256": "2caf33014eb645412eee872c2868faa3cd5543a07b14b931e3c14018da03b34d" + }, + "ReserveManager": { + "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + "artifactSha256": "42d640e0fae007112c8b920b80901e43dcd4e1896ed670a8331f2ba1bc41a29e" + } + } + }, + "solana": { + "genesisHash": "6sk74BT2qUhnAVQ2fBH87Yyh3kLyZmVJkQDWCfjS5v6a", + "programs": { + "liqsolCore": { + "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + "artifactSha256": "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" + } + } + } +} diff --git a/packages/sdk-outpost/src/deployments/generated/Catalog.ts b/packages/sdk-outpost/src/deployments/generated/Catalog.ts new file mode 100644 index 0000000..502b492 --- /dev/null +++ b/packages/sdk-outpost/src/deployments/generated/Catalog.ts @@ -0,0 +1,177 @@ +/* Autogenerated file. Do not edit manually. */ +/* eslint-disable */ + +/** Untrusted deployment documents validated by Registry at module load. */ +export const OutpostDeploymentDocuments: readonly unknown[] = [ + { + schemaVersion: 1, + id: "sim2-2026-07-31-365c4416", + artifactBundle: { + generatedAt: "2026-07-31T15:47:46Z", + sourceArchiveSha256: + "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", + clusterManifestSha256: + "2e650017d311678ac427d671e5289a0875751eef6829f9239d8eb0e25b821030", + deploymentChecksum: + "274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509", + snapshotChecksum: + "95bde008eb560dd173c410e1010a885c9660e3dd2399d554c97210d0caa7ef6a", + platformRelease: { + tag: "v1.0.0", + url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + manifest: { + repository: "Wire-Network/wire-platform-manifest", + revision: "78ed083740e62a03d9ea873ff0a9a44db23ca195" + }, + libraries: { + repository: "Wire-Network/wire-libraries-ts", + revision: "3cfda4a238e4e8d98bda836e857e6679b85f44fa" + } + }, + sources: { + wireTools: { + repository: "Wire-Network/wire-tools-ts", + revision: "ac4ea7a2783f81d03f13a62ead2fa173cf12094f" + }, + wireSysio: { + repository: "Wire-Network/wire-sysio", + revision: "235501b0ad4612ee842c428182f84cd66ef803fc" + }, + wireEthereum: { + repository: "Wire-Network/wire-ethereum", + revision: "c1ea82b2b3cffacecec35e5c186e82e381f6be67" + }, + wireSolana: { + repository: "Wire-Network/wire-solana", + revision: "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" + } + } + }, + wire: { + chainId: + "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023" + }, + ethereum: { + chainId: 31337, + contracts: { + OPP: { + address: "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + artifactSha256: + "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" + }, + OPPInbound: { + address: "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + artifactSha256: + "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" + }, + OperatorRegistry: { + address: "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + artifactSha256: + "d9ce20dce4d4f5b039bdd52df69037c8c289f9a419b420efdac6c02cafbd5607" + }, + ReserveManager: { + address: "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + artifactSha256: + "1df4221be4fc24617d3368877e5962214ae55330362bb644028e56518d12b17f" + } + } + }, + solana: { + genesisHash: "3rVuMvjfU8SGyyfYWsmkhJNHSsrbxaGLLzdwnYZvWadc", + programs: { + liqsolCore: { + address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + artifactSha256: + "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" + } + } + } + }, + { + schemaVersion: 1, + id: "sim2-2026-08-03-ca8d3a9d", + artifactBundle: { + generatedAt: "2026-08-03T15:21:41Z", + sourceArchiveSha256: + "74f854b94f24830b76fdb749bbb229b4f725f06e67b7d3fcc00cc3b0c4db95ea", + clusterManifestSha256: + "8ee35815b7d23d1eb8ee02fd2e5d7d941c8aa2c96fe55ba20d124c8a94364d19", + deploymentChecksum: + "467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6", + snapshotChecksum: + "30f6df4c6b02cff393040599507b6894c04e9e7af473d7425b295f1a18e61434", + platformRelease: { + tag: "v1.0.0", + url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + manifest: { + repository: "Wire-Network/wire-platform-manifest", + revision: "4f556be5d7bdba5a23c87e39f91aa2ddace9c2b4" + }, + libraries: { + repository: "Wire-Network/wire-libraries-ts", + revision: "1b8025381a105bf96a95bbdd58a1cfc012f79509" + } + }, + sources: { + wireTools: { + repository: "Wire-Network/wire-tools-ts", + revision: "763dda36c0a05cd2cfcc07191f06d7f04cf43f14" + }, + wireSysio: { + repository: "Wire-Network/wire-sysio", + revision: "7dede884e0150d36fa788e85a119e10653ade8ca" + }, + wireEthereum: { + repository: "Wire-Network/wire-ethereum", + revision: "d892c9458ad666adbccca913863ddf4e5e3d37a4" + }, + wireSolana: { + repository: "Wire-Network/wire-solana", + revision: "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" + } + } + }, + wire: { + chainId: + "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96" + }, + ethereum: { + chainId: 31337, + contracts: { + OPP: { + address: "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", + artifactSha256: + "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" + }, + OPPInbound: { + address: "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", + artifactSha256: + "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" + }, + OperatorRegistry: { + address: "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", + artifactSha256: + "2caf33014eb645412eee872c2868faa3cd5543a07b14b931e3c14018da03b34d" + }, + ReserveManager: { + address: "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + artifactSha256: + "42d640e0fae007112c8b920b80901e43dcd4e1896ed670a8331f2ba1bc41a29e" + } + } + }, + solana: { + genesisHash: "6sk74BT2qUhnAVQ2fBH87Yyh3kLyZmVJkQDWCfjS5v6a", + programs: { + liqsolCore: { + address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + artifactSha256: + "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" + } + } + } + } +] + +/** Deployment whose ABI and IDL surfaces own the generated client types. */ +export const CurrentOutpostDeploymentId = "sim2-2026-08-03-ca8d3a9d" diff --git a/packages/sdk-outpost/src/deployments/index.ts b/packages/sdk-outpost/src/deployments/index.ts index e1a0f95..f087137 100644 --- a/packages/sdk-outpost/src/deployments/index.ts +++ b/packages/sdk-outpost/src/deployments/index.ts @@ -1,4 +1,3 @@ export * from "./Registry.js" export * from "./Schema.js" -export * from "./Sim2.js" export * from "./Types.js" From f5a997ff795cc825ce18ad4680f5a75e6efb953d Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 15:18:09 -0400 Subject: [PATCH 06/48] test(sdk-outpost): verify historical and current deployment compatibility --- .../scripts/generate-deployment-catalog.mjs | 1 - .../src/deployments/generated/Catalog.ts | 1 - .../tests/assets/Artifacts.test.ts | 85 ++++++++++++++----- .../tests/clients/OutpostClient.test.ts | 10 +-- .../ethereum/EthereumOutpostClient.test.ts | 52 +++++++----- .../solana/SolanaOutpostClient.test.ts | 42 +++++---- .../tests/deployments/Registry.test.ts | 22 +++-- .../tests/deployments/Schema.test.ts | 8 +- 8 files changed, 142 insertions(+), 79 deletions(-) diff --git a/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs b/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs index 4045c06..ec9f7cd 100644 --- a/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs +++ b/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs @@ -33,7 +33,6 @@ await writeTypescript( GeneratedCatalogFile, ` /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ /** Untrusted deployment documents validated by Registry at module load. */ export const OutpostDeploymentDocuments: readonly unknown[] = ${JSON.stringify(documents, null, 2)} diff --git a/packages/sdk-outpost/src/deployments/generated/Catalog.ts b/packages/sdk-outpost/src/deployments/generated/Catalog.ts index 502b492..a606855 100644 --- a/packages/sdk-outpost/src/deployments/generated/Catalog.ts +++ b/packages/sdk-outpost/src/deployments/generated/Catalog.ts @@ -1,5 +1,4 @@ /* Autogenerated file. Do not edit manually. */ -/* eslint-disable */ /** Untrusted deployment documents validated by Registry at module load. */ export const OutpostDeploymentDocuments: readonly unknown[] = [ diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index 36ab082..4a9cf44 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -3,46 +3,87 @@ import Fs from "node:fs" import Path from "node:path" import { + CurrentOutpostDeployment, EthereumContractName, OPP__factory, - Sim2Deployment, + OperatorRegistry__factory, + OutpostDeployments, + ReserveManager__factory, SolanaProgramName, liqsolCoreIdl } from "@wireio/sdk-outpost" -const PackagePath = Path.resolve(__dirname, "../.."), - EthereumAssetPath = Path.join(PackagePath, "src/assets/ethereum/sim2"), - SolanaAssetPath = Path.join(PackagePath, "src/assets/solana/sim2") +const PackagePath = Path.resolve(__dirname, "../..") function sha256(file: string): string { return Crypto.createHash("sha256").update(Fs.readFileSync(file)).digest("hex") } -describe("sim2 assets", () => { - it("matches every recorded Ethereum ABI digest", () => { - Object.values(EthereumContractName).forEach(contractName => { - const deployment = Sim2Deployment.ethereum.contracts[contractName] +describe("versioned deployment assets", () => { + it.each(OutpostDeployments)( + "matches every $id artifact digest", + deployment => { + Object.values(EthereumContractName).forEach(contractName => { + const contract = deployment.ethereum.contracts[contractName] - expect(sha256(Path.join(EthereumAssetPath, `${contractName}.json`))).toBe( - deployment.artifactSha256 - ) - }) - }) + expect( + sha256( + Path.join( + PackagePath, + "src/assets/ethereum", + deployment.id, + `${contractName}.json` + ) + ) + ).toBe(contract.artifactSha256) + }) - it("matches the recorded Solana IDL and program identity", () => { - const deployment = - Sim2Deployment.solana.programs[SolanaProgramName.liqsolCore] + const program = deployment.solana.programs[SolanaProgramName.liqsolCore] - expect(sha256(Path.join(SolanaAssetPath, "liqsol_core.json"))).toBe( - deployment.artifactSha256 - ) - expect(liqsolCoreIdl.address).toBe(deployment.address) - }) + expect( + sha256( + Path.join( + PackagePath, + "src/assets/solana", + deployment.id, + "liqsol_core.json" + ) + ) + ).toBe(program.artifactSha256) + } + ) - it("generates callable Ethereum factories from the runtime ABI", () => { + it("generates the current callable swap and collateral surfaces", () => { + expect(liqsolCoreIdl.address).toBe( + CurrentOutpostDeployment.solana.programs[SolanaProgramName.liqsolCore] + .address + ) expect(OPP__factory.abi.length).toBeGreaterThan(0) expect( OPP__factory.createInterface().getFunction("addAttestation") ).toBeDefined() + expect( + ReserveManager__factory.createInterface().getFunction("requestSwap") + ).toBeDefined() + expect( + ReserveManager__factory.createInterface().getFunction( + "requestSwapErc20WithApproval" + ) + ).toBeDefined() + expect( + OperatorRegistry__factory.createInterface().getFunction("deposit") + ).toBeDefined() + expect( + OperatorRegistry__factory.createInterface().getFunction("commit") + ).toBeDefined() + expect( + liqsolCoreIdl.instructions.map(instruction => instruction.name) + ).toEqual( + expect.arrayContaining([ + "requestSwap", + "requestSwapSpl", + "commitUnderwrite" + ]) + ) }) }) diff --git a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts index 16426f9..31e8594 100644 --- a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts @@ -3,10 +3,10 @@ import { Connection, Keypair, SystemProgram } from "@solana/web3.js" import { providers } from "ethers" import { + CurrentOutpostDeployment, EthereumOutpostClient, OutpostChainFamily, OutpostClient, - Sim2Deployment, SolanaOutpostClient } from "@wireio/sdk-outpost" @@ -16,7 +16,7 @@ function createSolanaProvider(): AnchorProvider { jest .spyOn(connection, "getGenesisHash") - .mockResolvedValue(Sim2Deployment.solana.genesisHash) + .mockResolvedValue(CurrentOutpostDeployment.solana.genesisHash) jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ data: Buffer.alloc(0), executable: true, @@ -31,7 +31,7 @@ describe("OutpostClient", () => { it("preserves the precise Ethereum client type", async () => { const provider = new providers.JsonRpcProvider() jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: Sim2Deployment.ethereum.chainId, + chainId: CurrentOutpostDeployment.ethereum.chainId, name: "sim2" }) jest.spyOn(provider, "getCode").mockResolvedValue("0x01") @@ -39,7 +39,7 @@ describe("OutpostClient", () => { const client = await OutpostClient.create({ family: OutpostChainFamily.ethereum, options: { - deployment: Sim2Deployment, + deployment: CurrentOutpostDeployment, connection: provider } }) @@ -51,7 +51,7 @@ describe("OutpostClient", () => { const client = await OutpostClient.create({ family: OutpostChainFamily.solana, options: { - deployment: Sim2Deployment, + deployment: CurrentOutpostDeployment, provider: createSolanaProvider() } }) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 2e5c609..38deff8 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -3,15 +3,18 @@ import { providers } from "ethers" import { EthereumContractName, EthereumOutpostClient, - Sim2Deployment + OutpostDeployments, + type OutpostDeployment } from "@wireio/sdk-outpost" const DeployedCode = "0x01" -function createProvider(): providers.JsonRpcProvider { +function createProvider( + deployment: OutpostDeployment +): providers.JsonRpcProvider { const provider = new providers.JsonRpcProvider() jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: Sim2Deployment.ethereum.chainId, + chainId: deployment.ethereum.chainId, name: "sim2" }) jest.spyOn(provider, "getCode").mockResolvedValue(DeployedCode) @@ -19,25 +22,29 @@ function createProvider(): providers.JsonRpcProvider { } describe("EthereumOutpostClient", () => { - it("verifies the deployment and returns a generated contract type", async () => { - const provider = createProvider(), - client = await EthereumOutpostClient.create({ - deployment: Sim2Deployment, - connection: provider - }), - reserveManager = client.contract(EthereumContractName.ReserveManager) + it.each(OutpostDeployments)( + "verifies $id and returns a generated contract type", + async deployment => { + const provider = createProvider(deployment), + client = await EthereumOutpostClient.create({ + deployment, + connection: provider + }), + reserveManager = client.contract(EthereumContractName.ReserveManager) - expect(reserveManager.address).toBe( - Sim2Deployment.ethereum.contracts[EthereumContractName.ReserveManager] - .address - ) - expect(provider.getCode).toHaveBeenCalledTimes( - Object.values(EthereumContractName).length - ) - }) + expect(reserveManager.address).toBe( + deployment.ethereum.contracts[EthereumContractName.ReserveManager] + .address + ) + expect(provider.getCode).toHaveBeenCalledTimes( + Object.values(EthereumContractName).length + ) + } + ) it("rejects the wrong Ethereum chain", async () => { - const provider = createProvider() + const deployment = OutpostDeployments[0], + provider = createProvider(deployment) jest.spyOn(provider, "getNetwork").mockResolvedValue({ chainId: 1, name: "mainnet" @@ -45,19 +52,20 @@ describe("EthereumOutpostClient", () => { await expect( EthereumOutpostClient.create({ - deployment: Sim2Deployment, + deployment, connection: provider }) ).rejects.toThrow("Ethereum chain mismatch") }) it("rejects a configured contract without bytecode", async () => { - const provider = createProvider() + const deployment = OutpostDeployments[0], + provider = createProvider(deployment) jest.spyOn(provider, "getCode").mockResolvedValue("0x") await expect( EthereumOutpostClient.create({ - deployment: Sim2Deployment, + deployment, connection: provider }) ).rejects.toThrow("is not deployed") diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index 1e60fd8..1119b6d 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -2,18 +2,19 @@ import { AnchorProvider, Wallet } from "@coral-xyz/anchor" import { Connection, Keypair, SystemProgram } from "@solana/web3.js" import { - Sim2Deployment, + OutpostDeployments, + type OutpostDeployment, SolanaOutpostClient, SolanaProgramName } from "@wireio/sdk-outpost" -function createProvider(): AnchorProvider { +function createProvider(deployment: OutpostDeployment): AnchorProvider { const connection = new Connection("http://127.0.0.1:8899"), provider = new AnchorProvider(connection, new Wallet(Keypair.generate())) jest .spyOn(connection, "getGenesisHash") - .mockResolvedValue(Sim2Deployment.solana.genesisHash) + .mockResolvedValue(deployment.solana.genesisHash) jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ data: Buffer.alloc(0), executable: true, @@ -25,40 +26,45 @@ function createProvider(): AnchorProvider { } describe("SolanaOutpostClient", () => { - it("verifies the deployment and returns a generated program type", async () => { - const provider = createProvider(), - client = await SolanaOutpostClient.create({ - deployment: Sim2Deployment, - provider - }), - program = client.program(SolanaProgramName.liqsolCore) + it.each(OutpostDeployments)( + "verifies $id and returns a generated program type", + async deployment => { + const provider = createProvider(deployment), + client = await SolanaOutpostClient.create({ + deployment, + provider + }), + program = client.program(SolanaProgramName.liqsolCore) - expect(program.programId.toBase58()).toBe( - Sim2Deployment.solana.programs[SolanaProgramName.liqsolCore].address - ) - }) + expect(program.programId.toBase58()).toBe( + deployment.solana.programs[SolanaProgramName.liqsolCore].address + ) + } + ) it("rejects the wrong Solana cluster", async () => { - const provider = createProvider() + const deployment = OutpostDeployments[0], + provider = createProvider(deployment) jest .spyOn(provider.connection, "getGenesisHash") .mockResolvedValue("9".repeat(32)) await expect( SolanaOutpostClient.create({ - deployment: Sim2Deployment, + deployment, provider }) ).rejects.toThrow("Solana genesis mismatch") }) it("rejects a configured program that is not executable", async () => { - const provider = createProvider() + const deployment = OutpostDeployments[0], + provider = createProvider(deployment) jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue(null) await expect( SolanaOutpostClient.create({ - deployment: Sim2Deployment, + deployment, provider }) ).rejects.toThrow("is not executable") diff --git a/packages/sdk-outpost/tests/deployments/Registry.test.ts b/packages/sdk-outpost/tests/deployments/Registry.test.ts index 787ee0f..cb29fe5 100644 --- a/packages/sdk-outpost/tests/deployments/Registry.test.ts +++ b/packages/sdk-outpost/tests/deployments/Registry.test.ts @@ -1,14 +1,22 @@ import { - OutpostDeploymentId, - Sim2Deployment, - assertOutpostDeployment + CurrentOutpostDeployment, + OutpostDeployments, + assertOutpostDeployment, + getOutpostDeployment } from "@wireio/sdk-outpost" describe("assertOutpostDeployment", () => { - it("resolves the deployment from the parent Wire chain", () => { - expect(assertOutpostDeployment(Sim2Deployment.wire.chainId).id).toBe( - OutpostDeploymentId.sim2 - ) + it.each(OutpostDeployments)( + "resolves $id from its parent Wire chain", + deployment => { + expect(assertOutpostDeployment(deployment.wire.chainId)).toBe(deployment) + expect(getOutpostDeployment(deployment.id)).toBe(deployment) + } + ) + + it("keeps the generated deployment explicit", () => { + expect(OutpostDeployments).toContain(CurrentOutpostDeployment) + expect(OutpostDeployments).toHaveLength(2) }) it("rejects an unsupported Wire chain", () => { diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index 223a855..1104872 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -1,6 +1,5 @@ import { EthereumContractName, - OutpostDeploymentId, parseOutpostDeployment } from "@wireio/sdk-outpost" @@ -17,10 +16,13 @@ function createDeploymentFixture() { } return { schemaVersion: 1, - id: OutpostDeploymentId.sim2, + id: "sim2-2026-08-03-ca8d3a9d", artifactBundle: { generatedAt: "2026-07-31T15:47:46Z", sourceArchiveSha256: Hash, + clusterManifestSha256: Hash, + deploymentChecksum: Hash, + snapshotChecksum: Hash, platformRelease: { tag: "v1.0.0", url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", @@ -78,7 +80,7 @@ describe("OutpostDeploymentSchema", () => { it("parses a valid deployment into sdk-core chain identity", () => { const deployment = parseOutpostDeployment(createDeploymentFixture()) - expect(deployment.id).toBe(OutpostDeploymentId.sim2) + expect(deployment.id).toBe("sim2-2026-08-03-ca8d3a9d") expect(deployment.wire.chainId.hexString).toBe(WireChainId) expect( deployment.ethereum.contracts[EthereumContractName.ReserveManager].address From 4c3bd37e40b0726c1a8035b9ee6f8ca557ded2dc Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 15:18:34 -0400 Subject: [PATCH 07/48] docs(sdk-outpost): document repeatable deployment refreshes and Hub boundaries --- CLAUDE.md | 8 ++++++ packages/sdk-outpost/README.md | 46 +++++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 697fdc0..aafe86b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -225,6 +225,14 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - Add a deployment bundle only with its source revisions, archive/artifact digests, and verified on-chain identities. A checked-in artifact does not by itself prove a contract or program is deployed. - `sdk-outpost` clients accept caller-owned Ethers/Anchor providers, verify chain identity and deployed bytecode/program executability during asynchronous creation, and expose one typed `OutpostClient` facade. Do not hard-code RPC transport into deployment records. - Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. +- `sdk-outpost` deployment refreshes are append-only. Import archives with `packages/sdk-outpost/scripts/import-deployment.mjs`; do not hand-edit catalog data or versioned ABI/IDL folders. +- Each refreshed cluster gets a stable `--` deployment id. Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same deployment. +- The current ABI/IDL-generated surface must cover every cataloged deployment. If a refresh removes callable functions or events, introduce an explicit version-specific client instead of weakening types or silently dropping history. +- Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; legacy staking remains isolated until its dedicated replacement work. +- `sdk-outpost` deployment refreshes are append-only. Import archives with `packages/sdk-outpost/scripts/import-deployment.mjs`; do not hand-edit catalog data or versioned ABI/IDL folders. +- Each refreshed cluster gets a stable `--` deployment id. Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same deployment. +- The current ABI/IDL-generated surface must cover every cataloged deployment. If a refresh removes callable functions or events, introduce an explicit version-specific client instead of weakening types or silently dropping history. +- Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; legacy staking remains isolated until its dedicated replacement work. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 1cb518e..ae7d668 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -10,12 +10,13 @@ applications. ## Status -This is a preview package. Its first deployment bundle is sourced from the sim2 -artifacts generated on July 31, 2026 and records the compatible Wire platform -release and every source revision. A deployment is exposed only when the -supplied artifacts and live chain state prove it exists. +This is a preview package. Its deployment catalog preserves each sim2 refresh +as a distinct record keyed by the parent Wire chain ID. The catalog currently +contains the July 31 and August 3, 2026 sim2 deployments; August 3 owns the +generated contract and program types. Every record includes its source archive, +cluster manifest, deployment, snapshot, ABI/IDL, and source-revision digests. -| Family | sim2 assets | +| Family | Versioned sim2 assets | | -------- | --------------------------------------------------------- | | Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager` | | Solana | `liqsol_core` | @@ -69,10 +70,37 @@ const solana = await OutpostClient.create({ const liqsol = solana.program(SolanaProgramName.liqsolCore) ``` -Zod validates versioned deployment data at the handwritten data boundary. +Zod validates versioned deployment data at the generated catalog boundary. Contract and program call types come directly from generator-owned ABI and IDL outputs; the package does not wrap or re-declare them. +## Deployment refreshes + +Import each rebuilt cluster as a new immutable deployment. The importer reads +the archived cluster manifest, verifies the optional standalone manifest, +copies only the runtime ABIs/IDL used by this package, records exact provenance, +regenerates the catalog and clients, and verifies that the current generated +surface still covers older deployments. + +```bash +pnpm --dir packages/sdk-outpost run import:deployment -- \ + --archive /path/to/sim2-artifacts.tar.gz \ + --manifest /path/to/sim2-cluster-manifest.json \ + --platform-manifest-revision \ + --libraries-revision \ + --current +``` + +The default ID is `--`. Use `--id` when a +release requires a more specific label. Existing IDs are protected; `--replace` +is reserved for an intentional correction to the same deployment. Omitting +`--current` adds history without changing generated client ownership. + +The checked-in `current.json` is the only current-version pointer. Tests and +`verify:deployments` traverse every catalog entry, so switching it between the +July and August records exercises both artifact generations without deleting +history. + ## Hub integration sequence 1. Install the published preview beside `@wireio/sdk-core`. @@ -95,6 +123,7 @@ pnpm --dir packages/sdk-outpost run compile pnpm --dir packages/sdk-outpost run test pnpm --dir packages/sdk-outpost run generate:ethereum pnpm --dir packages/sdk-outpost run generate:solana +pnpm --dir packages/sdk-outpost run verify:deployments ``` Generated contract and program types must be regenerated from checked-in @@ -102,5 +131,10 @@ artifacts. Do not hand-edit generated files or re-declare their shapes. Generated outputs live under each chain's `generated/` directory and are excluded from handwritten-code lint rules. +Swap consumers use `ReserveManager`, `OperatorRegistry`, and `liqsol_core` from +this package. Wire quote, reserve, underwriter, and settlement state remains in +`@wireio/sdk-core`. Retired or placeholder staking surfaces are not restored by +a deployment import. + The TypeChain generator is isolated on its compatible Prettier 2 dependency; the repository and Solana generator remain on the pinned Prettier 3 toolchain. From 8dd095df841ff30b83e285639192b0d164b9e7c0 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 15:23:08 -0400 Subject: [PATCH 08/48] docs(sdk-outpost): clarify clean package boundaries --- CLAUDE.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index aafe86b..2f3edbd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -228,11 +228,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `sdk-outpost` deployment refreshes are append-only. Import archives with `packages/sdk-outpost/scripts/import-deployment.mjs`; do not hand-edit catalog data or versioned ABI/IDL folders. - Each refreshed cluster gets a stable `--` deployment id. Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same deployment. - The current ABI/IDL-generated surface must cover every cataloged deployment. If a refresh removes callable functions or events, introduce an explicit version-specific client instead of weakening types or silently dropping history. -- Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; legacy staking remains isolated until its dedicated replacement work. -- `sdk-outpost` deployment refreshes are append-only. Import archives with `packages/sdk-outpost/scripts/import-deployment.mjs`; do not hand-edit catalog data or versioned ABI/IDL folders. -- Each refreshed cluster gets a stable `--` deployment id. Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same deployment. -- The current ABI/IDL-generated surface must cover every cataloged deployment. If a refresh removes callable functions or events, introduce an explicit version-specific client instead of weakening types or silently dropping history. -- Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; legacy staking remains isolated until its dedicated replacement work. +- Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; staking migration remains separate scope. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) From 23bcadfc4a413bf713d28a333a78ee376eb295e0 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 16:04:25 -0400 Subject: [PATCH 09/48] refactor(sdk-outpost): key deployment assets by Wire chain identity --- .../sdk-outpost/scripts/deployment-utils.mjs | 28 +++++++-- .../scripts/generate-ethereum-types.mjs | 14 ++++- .../scripts/generate-solana-types.mjs | 14 ++++- .../sdk-outpost/scripts/import-deployment.mjs | 42 +++++++++---- .../scripts/verify-deployments.mjs | 8 +-- .../ethereum}/OPP.json | 0 .../ethereum}/OPPInbound.json | 0 .../ethereum}/OperatorRegistry.json | 0 .../ethereum}/ReserveManager.json | 0 .../solana}/liqsol_core.json | 0 .../ethereum}/OPP.json | 0 .../ethereum}/OPPInbound.json | 0 .../ethereum}/OperatorRegistry.json | 0 .../ethereum}/ReserveManager.json | 0 .../solana}/liqsol_core.json | 0 .../sdk-outpost/src/deployments/Registry.ts | 30 ++++++--- .../sdk-outpost/src/deployments/Schema.ts | 61 +++++++++++-------- .../sdk-outpost/src/deployments/current.json | 2 +- ...7e4dbe4b66186b6188156a67b25278455509.json} | 2 +- ...9e89f356421bdbed4f4d11c87f29afd977d6.json} | 2 +- .../src/deployments/generated/Catalog.ts | 7 ++- .../tests/assets/Artifacts.test.ts | 12 ++-- .../tests/clients/OutpostClient.test.ts | 2 +- .../ethereum/EthereumOutpostClient.test.ts | 2 +- .../tests/deployments/Registry.test.ts | 8 +++ .../tests/deployments/Schema.test.ts | 17 ++++-- 26 files changed, 171 insertions(+), 80 deletions(-) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-07-31-365c4416 => 365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum}/OPP.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-07-31-365c4416 => 365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum}/OPPInbound.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-07-31-365c4416 => 365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum}/OperatorRegistry.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-07-31-365c4416 => 365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum}/ReserveManager.json (100%) rename packages/sdk-outpost/src/assets/{solana/sim2-2026-07-31-365c4416 => 365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana}/liqsol_core.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-08-03-ca8d3a9d => ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum}/OPP.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-08-03-ca8d3a9d => ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum}/OPPInbound.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-08-03-ca8d3a9d => ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum}/OperatorRegistry.json (100%) rename packages/sdk-outpost/src/assets/{ethereum/sim2-2026-08-03-ca8d3a9d => ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum}/ReserveManager.json (100%) rename packages/sdk-outpost/src/assets/{solana/sim2-2026-08-03-ca8d3a9d => ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana}/liqsol_core.json (100%) rename packages/sdk-outpost/src/deployments/data/{sim2-2026-07-31-365c4416.json => 365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json} (96%) rename packages/sdk-outpost/src/deployments/data/{sim2-2026-08-03-ca8d3a9d.json => ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json} (96%) diff --git a/packages/sdk-outpost/scripts/deployment-utils.mjs b/packages/sdk-outpost/scripts/deployment-utils.mjs index ca4c62c..c447e98 100644 --- a/packages/sdk-outpost/scripts/deployment-utils.mjs +++ b/packages/sdk-outpost/scripts/deployment-utils.mjs @@ -43,11 +43,8 @@ export async function writeJson(path, value) { } export async function readDeploymentDocuments() { - const entries = await Fs.readdir(DeploymentDataPath, { withFileTypes: true }) const documents = await Promise.all( - entries - .filter(entry => entry.isFile() && entry.name.endsWith(".json")) - .map(entry => readJson(Path.join(DeploymentDataPath, entry.name))) + (await jsonFiles(DeploymentDataPath)).map(readJson) ) return documents.sort((left, right) => @@ -57,6 +54,19 @@ export async function readDeploymentDocuments() { ) } +async function jsonFiles(root) { + const entries = await Fs.readdir(root, { withFileTypes: true }), + paths = await Promise.all( + entries.map(entry => { + const path = Path.join(root, entry.name) + if (entry.isDirectory()) return jsonFiles(path) + return entry.isFile() && entry.name.endsWith(".json") ? [path] : [] + }) + ) + + return paths.flat() +} + export async function readCurrentDeploymentId() { const current = await readJson(CurrentDeploymentFile) if (typeof current.id !== "string" || current.id.length === 0) { @@ -76,6 +86,12 @@ export async function writeTypescript(path, source) { await Fs.writeFile(path, formatted) } -export function deploymentAssetPath(family, deploymentId) { - return Path.join(PackagePath, "src/assets", family, deploymentId) +export function deploymentAssetPath(deployment, family) { + return Path.join( + PackagePath, + "src/assets", + deployment.wire.chainId, + deployment.artifactBundle.deploymentChecksum, + family + ) } diff --git a/packages/sdk-outpost/scripts/generate-ethereum-types.mjs b/packages/sdk-outpost/scripts/generate-ethereum-types.mjs index 5560a46..919d3f8 100644 --- a/packages/sdk-outpost/scripts/generate-ethereum-types.mjs +++ b/packages/sdk-outpost/scripts/generate-ethereum-types.mjs @@ -5,12 +5,20 @@ import Path from "node:path" import { PackagePath, deploymentAssetPath, - readCurrentDeploymentId + readCurrentDeploymentId, + readDeploymentDocuments } from "./deployment-utils.mjs" const deploymentId = await readCurrentDeploymentId(), - assetGlob = Path.join( - deploymentAssetPath("ethereum", deploymentId), + deployment = (await readDeploymentDocuments()).find( + candidate => candidate.id === deploymentId + ) + +if (deployment == null) + throw new Error(`Unknown current deployment ${deploymentId}`) + +const assetGlob = Path.join( + deploymentAssetPath(deployment, "ethereum"), "*.json" ), outputPath = Path.join(PackagePath, "src/contracts/ethereum/generated"), diff --git a/packages/sdk-outpost/scripts/generate-solana-types.mjs b/packages/sdk-outpost/scripts/generate-solana-types.mjs index b77f61e..85e4b13 100644 --- a/packages/sdk-outpost/scripts/generate-solana-types.mjs +++ b/packages/sdk-outpost/scripts/generate-solana-types.mjs @@ -7,12 +7,20 @@ import { format } from "prettier" import { PackagePath, deploymentAssetPath, - readCurrentDeploymentId + readCurrentDeploymentId, + readDeploymentDocuments } from "./deployment-utils.mjs" const deploymentId = await readCurrentDeploymentId(), - idlFile = Path.join( - deploymentAssetPath("solana", deploymentId), + deployment = (await readDeploymentDocuments()).find( + candidate => candidate.id === deploymentId + ) + +if (deployment == null) + throw new Error(`Unknown current deployment ${deploymentId}`) + +const idlFile = Path.join( + deploymentAssetPath(deployment, "solana"), "liqsol_core.json" ), outputFile = Path.join( diff --git a/packages/sdk-outpost/scripts/import-deployment.mjs b/packages/sdk-outpost/scripts/import-deployment.mjs index 05823a8..21ff158 100644 --- a/packages/sdk-outpost/scripts/import-deployment.mjs +++ b/packages/sdk-outpost/scripts/import-deployment.mjs @@ -20,7 +20,6 @@ const ContractNames = [ "OperatorRegistry", "ReserveManager" ], - IdPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/, RevisionPattern = /^[0-9a-f]{40}$/, argumentsByName = parseArguments(process.argv.slice(2)), archive = requiredPath("archive"), @@ -43,12 +42,9 @@ try { manifest = await readJson(manifestPath), generatedAt = await readGeneratedAt(readmePath), wireChainId = requiredValue(manifest, "identity.chains.wire.chain_id"), - defaultId = `${requiredValue(manifest, "prefix")}-${generatedAt.slice(0, 10)}-${wireChainId.slice(0, 8)}`, - id = argumentsByName.get("id") ?? defaultId + deploymentChecksum = requiredValue(manifest, "deployment_checksum"), + id = `${wireChainId}-${deploymentChecksum.slice(0, 12)}` - if (!IdPattern.test(id)) { - throw new Error(`Invalid deployment id ${id}`) - } if (standaloneManifest != null) { const [embeddedHash, standaloneHash] = await Promise.all([ sha256(manifestPath), @@ -59,16 +55,24 @@ try { } } - const deploymentPath = Path.join(DeploymentDataPath, `${id}.json`) + const deploymentPath = Path.join( + DeploymentDataPath, + wireChainId, + `${deploymentChecksum}.json` + ) if ((await pathExists(deploymentPath)) && !replace) { throw new Error( `Deployment ${id} already exists; use --replace only for an intentional correction` ) } - const ethereumContracts = {}, - ethereumAssetPath = deploymentAssetPath("ethereum", id), - solanaAssetPath = deploymentAssetPath("solana", id) + const assetIdentity = { + artifactBundle: { deploymentChecksum }, + wire: { chainId: wireChainId } + }, + ethereumContracts = {}, + ethereumAssetPath = deploymentAssetPath(assetIdentity, "ethereum"), + solanaAssetPath = deploymentAssetPath(assetIdentity, "solana") await Fs.mkdir(ethereumAssetPath, { recursive: true }) await Fs.mkdir(solanaAssetPath, { recursive: true }) @@ -124,7 +128,7 @@ try { generatedAt, sourceArchiveSha256: await sha256(archive), clusterManifestSha256: await sha256(manifestPath), - deploymentChecksum: requiredValue(manifest, "deployment_checksum"), + deploymentChecksum, snapshotChecksum: requiredValue(manifest, "snapshot_checksum"), platformRelease: { tag: platformRelease, @@ -188,17 +192,29 @@ try { } function parseArguments(values) { - const parsed = new Map() + const booleanArguments = ["current", "replace"], + valueArguments = [ + "archive", + "libraries-revision", + "manifest", + "platform-manifest-revision", + "platform-release" + ], + parsed = new Map() for (let index = 0; index < values.length; index += 1) { const value = values[index] + if (value === "--") continue if (!value.startsWith("--")) { throw new Error(`Unexpected argument ${value}`) } const name = value.slice(2) - if (["current", "replace"].includes(name)) { + if (booleanArguments.includes(name)) { parsed.set(name, "true") continue } + if (!valueArguments.includes(name)) { + throw new Error(`Unknown argument --${name}`) + } const next = values[index + 1] if (next == null || next.startsWith("--")) { throw new Error(`Missing value for --${name}`) diff --git a/packages/sdk-outpost/scripts/verify-deployments.mjs b/packages/sdk-outpost/scripts/verify-deployments.mjs index 2569d54..860fe7c 100644 --- a/packages/sdk-outpost/scripts/verify-deployments.mjs +++ b/packages/sdk-outpost/scripts/verify-deployments.mjs @@ -23,7 +23,7 @@ if (current == null) throw new Error(`Unknown current deployment ${currentId}`) for (const deployment of documents) { for (const contractName of ContractNames) { const path = Path.join( - deploymentAssetPath("ethereum", deployment.id), + deploymentAssetPath(deployment, "ethereum"), `${contractName}.json` ), actualHash = await sha256(path), @@ -34,7 +34,7 @@ for (const deployment of documents) { } const solanaPath = Path.join( - deploymentAssetPath("solana", deployment.id), + deploymentAssetPath(deployment, "solana"), "liqsol_core.json" ), solanaHash = await sha256(solanaPath) @@ -48,13 +48,13 @@ for (const deployment of documents) { for (const contractName of ContractNames) { const previous = await readJson( Path.join( - deploymentAssetPath("ethereum", deployment.id), + deploymentAssetPath(deployment, "ethereum"), `${contractName}.json` ) ), currentArtifact = await readJson( Path.join( - deploymentAssetPath("ethereum", current.id), + deploymentAssetPath(current, "ethereum"), `${contractName}.json` ) ) diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPP.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPP.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPP.json rename to packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPP.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPPInbound.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPPInbound.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OPPInbound.json rename to packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPPInbound.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OperatorRegistry.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OperatorRegistry.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/OperatorRegistry.json rename to packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OperatorRegistry.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/ReserveManager.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/ReserveManager.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-07-31-365c4416/ReserveManager.json rename to packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/ReserveManager.json diff --git a/packages/sdk-outpost/src/assets/solana/sim2-2026-07-31-365c4416/liqsol_core.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana/liqsol_core.json similarity index 100% rename from packages/sdk-outpost/src/assets/solana/sim2-2026-07-31-365c4416/liqsol_core.json rename to packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana/liqsol_core.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPP.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPP.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPP.json rename to packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPP.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPPInbound.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPPInbound.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OPPInbound.json rename to packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPPInbound.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OperatorRegistry.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OperatorRegistry.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/OperatorRegistry.json rename to packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OperatorRegistry.json diff --git a/packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/ReserveManager.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/ReserveManager.json similarity index 100% rename from packages/sdk-outpost/src/assets/ethereum/sim2-2026-08-03-ca8d3a9d/ReserveManager.json rename to packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/ReserveManager.json diff --git a/packages/sdk-outpost/src/assets/solana/sim2-2026-08-03-ca8d3a9d/liqsol_core.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana/liqsol_core.json similarity index 100% rename from packages/sdk-outpost/src/assets/solana/sim2-2026-08-03-ca8d3a9d/liqsol_core.json rename to packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana/liqsol_core.json diff --git a/packages/sdk-outpost/src/deployments/Registry.ts b/packages/sdk-outpost/src/deployments/Registry.ts index 91a7642..d94b9cd 100644 --- a/packages/sdk-outpost/src/deployments/Registry.ts +++ b/packages/sdk-outpost/src/deployments/Registry.ts @@ -1,5 +1,3 @@ -import { ChainId, ChainIdType } from "@wireio/sdk-core" - import { CurrentOutpostDeploymentId, OutpostDeploymentDocuments @@ -22,17 +20,33 @@ export const CurrentOutpostDeployment = getOutpostDeployment( CurrentOutpostDeploymentId ) +/** Structural identity implemented by sdk-core ChainId objects. */ +export interface WireChainIdLike { + readonly hexString: string +} + +/** Wire chain identity accepted from a hex string or sdk-core ChainId object. */ +export type WireChainIdInput = string | WireChainIdLike + /** Resolve a deployment by its parent Wire chain identity or throw. */ export function assertOutpostDeployment( - wireChainId: ChainIdType + wireChainId: WireChainIdInput ): OutpostDeployment { - const chainId = ChainId.from(wireChainId), - deployment = OutpostDeployments.find(candidate => - candidate.wire.chainId.equals(chainId) - ) + const chainId = + typeof wireChainId === "string" + ? wireChainId.toLowerCase() + : wireChainId.hexString.toLowerCase() + + if (!/^[0-9a-f]{64}$/.test(chainId)) { + throw new Error(`Invalid Wire chain id ${chainId}`) + } + + const deployment = OutpostDeployments.find( + candidate => candidate.wire.chainId === chainId + ) if (deployment == null) { - throw new Error(`No outpost deployment for Wire chain ${chainId.hexString}`) + throw new Error(`No outpost deployment for Wire chain ${chainId}`) } return deployment } diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index 183b3b9..4aa7569 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -2,16 +2,11 @@ import { PublicKey } from "@solana/web3.js" import { utils as ethersUtils } from "ethers" import { z } from "zod" -import { ChainId } from "@wireio/sdk-core" - import { EthereumContractName, SolanaProgramName } from "./Types.js" const SourceRevisionSchema = z.string().regex(/^[0-9a-f]{8,40}$/), Sha256Schema = z.string().regex(/^[0-9a-f]{64}$/), - WireChainIdSchema = z - .string() - .regex(/^[0-9a-f]{64}$/) - .transform(value => ChainId.from(value)), + WireChainIdSchema = z.string().regex(/^[0-9a-f]{64}$/), EthereumAddressSchema = z .string() .refine(ethersUtils.isAddress, "Invalid Ethereum address"), @@ -68,29 +63,41 @@ export const SolanaProgramDeploymentSchema = z.object({ }) /** Complete deployment schema for a Wire network group. */ -export const OutpostDeploymentSchema = z.object({ - schemaVersion: z.literal(1), - id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), - artifactBundle: ArtifactBundleSchema, - wire: z.object({ - chainId: WireChainIdSchema - }), - ethereum: z.object({ - chainId: z.number().int().positive(), - contracts: z.object({ - [EthereumContractName.OPP]: EthereumContractDeploymentSchema, - [EthereumContractName.OPPInbound]: EthereumContractDeploymentSchema, - [EthereumContractName.OperatorRegistry]: EthereumContractDeploymentSchema, - [EthereumContractName.ReserveManager]: EthereumContractDeploymentSchema - }) - }), - solana: z.object({ - genesisHash: SolanaAddressSchema, - programs: z.object({ - [SolanaProgramName.liqsolCore]: SolanaProgramDeploymentSchema +export const OutpostDeploymentSchema = z + .object({ + schemaVersion: z.literal(1), + id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), + artifactBundle: ArtifactBundleSchema, + wire: z.object({ + chainId: WireChainIdSchema + }), + ethereum: z.object({ + chainId: z.number().int().positive(), + contracts: z.object({ + [EthereumContractName.OPP]: EthereumContractDeploymentSchema, + [EthereumContractName.OPPInbound]: EthereumContractDeploymentSchema, + [EthereumContractName.OperatorRegistry]: + EthereumContractDeploymentSchema, + [EthereumContractName.ReserveManager]: EthereumContractDeploymentSchema + }) + }), + solana: z.object({ + genesisHash: SolanaAddressSchema, + programs: z.object({ + [SolanaProgramName.liqsolCore]: SolanaProgramDeploymentSchema + }) }) }) -}) + .superRefine((deployment, context) => { + const expectedId = `${deployment.wire.chainId}-${deployment.artifactBundle.deploymentChecksum.slice(0, 12)}` + if (deployment.id !== expectedId) { + context.addIssue({ + code: "custom", + message: `Deployment id must be ${expectedId}`, + path: ["id"] + }) + } + }) /** Parsed source-repository identity. */ export type ArtifactSource = z.infer diff --git a/packages/sdk-outpost/src/deployments/current.json b/packages/sdk-outpost/src/deployments/current.json index 89db309..ba18902 100644 --- a/packages/sdk-outpost/src/deployments/current.json +++ b/packages/sdk-outpost/src/deployments/current.json @@ -1,3 +1,3 @@ { - "id": "sim2-2026-08-03-ca8d3a9d" + "id": "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361" } diff --git a/packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json b/packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json similarity index 96% rename from packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json rename to packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json index 6cc0545..8a3f4bb 100644 --- a/packages/sdk-outpost/src/deployments/data/sim2-2026-07-31-365c4416.json +++ b/packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "id": "sim2-2026-07-31-365c4416", + "id": "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023-274b3c60e7da", "artifactBundle": { "generatedAt": "2026-07-31T15:47:46Z", "sourceArchiveSha256": "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", diff --git a/packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json b/packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json similarity index 96% rename from packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json rename to packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json index f38d251..2e48851 100644 --- a/packages/sdk-outpost/src/deployments/data/sim2-2026-08-03-ca8d3a9d.json +++ b/packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "id": "sim2-2026-08-03-ca8d3a9d", + "id": "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361", "artifactBundle": { "generatedAt": "2026-08-03T15:21:41Z", "sourceArchiveSha256": "74f854b94f24830b76fdb749bbb229b4f725f06e67b7d3fcc00cc3b0c4db95ea", diff --git a/packages/sdk-outpost/src/deployments/generated/Catalog.ts b/packages/sdk-outpost/src/deployments/generated/Catalog.ts index a606855..8c59178 100644 --- a/packages/sdk-outpost/src/deployments/generated/Catalog.ts +++ b/packages/sdk-outpost/src/deployments/generated/Catalog.ts @@ -4,7 +4,7 @@ export const OutpostDeploymentDocuments: readonly unknown[] = [ { schemaVersion: 1, - id: "sim2-2026-07-31-365c4416", + id: "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023-274b3c60e7da", artifactBundle: { generatedAt: "2026-07-31T15:47:46Z", sourceArchiveSha256: @@ -88,7 +88,7 @@ export const OutpostDeploymentDocuments: readonly unknown[] = [ }, { schemaVersion: 1, - id: "sim2-2026-08-03-ca8d3a9d", + id: "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361", artifactBundle: { generatedAt: "2026-08-03T15:21:41Z", sourceArchiveSha256: @@ -173,4 +173,5 @@ export const OutpostDeploymentDocuments: readonly unknown[] = [ ] /** Deployment whose ABI and IDL surfaces own the generated client types. */ -export const CurrentOutpostDeploymentId = "sim2-2026-08-03-ca8d3a9d" +export const CurrentOutpostDeploymentId = + "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361" diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index 4a9cf44..a0d9d99 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -30,8 +30,10 @@ describe("versioned deployment assets", () => { sha256( Path.join( PackagePath, - "src/assets/ethereum", - deployment.id, + "src/assets", + deployment.wire.chainId, + deployment.artifactBundle.deploymentChecksum, + "ethereum", `${contractName}.json` ) ) @@ -44,8 +46,10 @@ describe("versioned deployment assets", () => { sha256( Path.join( PackagePath, - "src/assets/solana", - deployment.id, + "src/assets", + deployment.wire.chainId, + deployment.artifactBundle.deploymentChecksum, + "solana", "liqsol_core.json" ) ) diff --git a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts index 31e8594..68be32e 100644 --- a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts @@ -32,7 +32,7 @@ describe("OutpostClient", () => { const provider = new providers.JsonRpcProvider() jest.spyOn(provider, "getNetwork").mockResolvedValue({ chainId: CurrentOutpostDeployment.ethereum.chainId, - name: "sim2" + name: "wire-outpost" }) jest.spyOn(provider, "getCode").mockResolvedValue("0x01") diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 38deff8..8cb8039 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -15,7 +15,7 @@ function createProvider( const provider = new providers.JsonRpcProvider() jest.spyOn(provider, "getNetwork").mockResolvedValue({ chainId: deployment.ethereum.chainId, - name: "sim2" + name: "wire-outpost" }) jest.spyOn(provider, "getCode").mockResolvedValue(DeployedCode) return provider diff --git a/packages/sdk-outpost/tests/deployments/Registry.test.ts b/packages/sdk-outpost/tests/deployments/Registry.test.ts index cb29fe5..3963089 100644 --- a/packages/sdk-outpost/tests/deployments/Registry.test.ts +++ b/packages/sdk-outpost/tests/deployments/Registry.test.ts @@ -19,6 +19,14 @@ describe("assertOutpostDeployment", () => { expect(OutpostDeployments).toHaveLength(2) }) + it("accepts sdk-core compatible chain identity objects", () => { + const deployment = OutpostDeployments[0] + + expect( + assertOutpostDeployment({ hexString: deployment.wire.chainId }) + ).toBe(deployment) + }) + it("rejects an unsupported Wire chain", () => { const unsupportedChainId = "f".repeat(64) diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index 1104872..2c4c1e4 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -16,7 +16,7 @@ function createDeploymentFixture() { } return { schemaVersion: 1, - id: "sim2-2026-08-03-ca8d3a9d", + id: `${WireChainId}-${Hash.slice(0, 12)}`, artifactBundle: { generatedAt: "2026-07-31T15:47:46Z", sourceArchiveSha256: Hash, @@ -77,11 +77,11 @@ function createDeploymentFixture() { } describe("OutpostDeploymentSchema", () => { - it("parses a valid deployment into sdk-core chain identity", () => { + it("parses a valid deployment with its Wire chain identity", () => { const deployment = parseOutpostDeployment(createDeploymentFixture()) - expect(deployment.id).toBe("sim2-2026-08-03-ca8d3a9d") - expect(deployment.wire.chainId.hexString).toBe(WireChainId) + expect(deployment.id).toBe(`${WireChainId}-${Hash.slice(0, 12)}`) + expect(deployment.wire.chainId).toBe(WireChainId) expect( deployment.ethereum.contracts[EthereumContractName.ReserveManager].address ).toBe(EthereumAddress) @@ -104,4 +104,13 @@ describe("OutpostDeploymentSchema", () => { "Invalid Solana address" ) }) + + it("rejects an environment-specific deployment id", () => { + const fixture = createDeploymentFixture() + fixture.id = "named-environment" + + expect(() => parseOutpostDeployment(fixture)).toThrow( + "Deployment id must be" + ) + }) }) From 9c8de46d664d815528a65bf9428f26094977bab0 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 16:04:50 -0400 Subject: [PATCH 10/48] build(sdk-outpost): gate reproducible npm releases --- .github/workflows/ci.yaml | 6 ++ .github/workflows/noop/publish-npm.yaml | 6 ++ .gitignore | 1 + package.json | 2 +- packages/sdk-outpost/jest.config.ts | 2 - packages/sdk-outpost/package.json | 25 +++-- packages/sdk-outpost/scripts/clean-build.mjs | 6 ++ .../sdk-outpost/scripts/verify-generated.mjs | 63 +++++++++++++ .../sdk-outpost/scripts/verify-package.mjs | 94 +++++++++++++++++++ .../clients/ethereum/EthereumOutpostClient.ts | 14 +-- packages/sdk-outpost/tsconfig.cjs.jest.json | 7 +- packages/sdk-outpost/tsconfig.cjs.json | 3 - packages/sdk-outpost/tsconfig.esm.json | 3 - packages/sdk-outpost/tsconfig.json | 1 - pnpm-lock.yaml | 6 -- 15 files changed, 200 insertions(+), 39 deletions(-) create mode 100644 packages/sdk-outpost/scripts/clean-build.mjs create mode 100644 packages/sdk-outpost/scripts/verify-generated.mjs create mode 100644 packages/sdk-outpost/scripts/verify-package.mjs diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e601abc..0264906 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,6 +42,12 @@ jobs: JEST_JUNIT_OUTPUT_NAME: jest-junit.xml run: pnpm run test:ci + - name: Verify sdk-outpost release + run: pnpm --dir packages/sdk-outpost run verify:release + + - name: Inspect sdk-outpost package + run: pnpm --dir packages/sdk-outpost pack --dry-run + - name: Upload test results (JUnit XML) if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/.github/workflows/noop/publish-npm.yaml b/.github/workflows/noop/publish-npm.yaml index 867927a..82868dd 100644 --- a/.github/workflows/noop/publish-npm.yaml +++ b/.github/workflows/noop/publish-npm.yaml @@ -54,6 +54,12 @@ jobs: JEST_JUNIT_OUTPUT_NAME: jest-junit.xml run: pnpm run test:ci + - name: Verify sdk-outpost release + run: pnpm --dir packages/sdk-outpost run verify:release + + - name: Inspect sdk-outpost package + run: pnpm --dir packages/sdk-outpost pack --dry-run + - name: Upload test results (JUnit XML) if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/.gitignore b/.gitignore index 1e2b3be..ec50cb5 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ yarn-error.log* # JUnit test-result output (CI artifact) /reports/ +/junit.xml # oh-my-claudecode runtime state (operational artifacts, never committed) .omc/ diff --git a/package.json b/package.json index 8da1100..0044bc0 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w --preserveWatchOutput", - "build": "pnpm run compile", + "build": "pnpm --dir packages/sdk-outpost run clean && pnpm run compile && pnpm -r --if-present run fix:hybrid:exports", "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", diff --git a/packages/sdk-outpost/jest.config.ts b/packages/sdk-outpost/jest.config.ts index 80dce34..b247257 100644 --- a/packages/sdk-outpost/jest.config.ts +++ b/packages/sdk-outpost/jest.config.ts @@ -14,8 +14,6 @@ const config: Config = { ] }, moduleNameMapper: { - "^@wireio/sdk-core$": "/../sdk-core/src/index", - "^@wireio/sdk-core/(.*)$": "/../sdk-core/src/$1", "^@wireio/sdk-outpost$": "/src/index", "^@wireio/sdk-outpost/(.*)$": "/src/$1", "^(\\.\\.?/.*)\\.js$": "$1" diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 86a123b..b827d85 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -11,11 +11,16 @@ "publishConfig": { "access": "public" }, - "files": [ - "lib/cjs", - "lib/esm", - "README.md" - ], + "homepage": "https://github.com/Wire-Network/wire-libraries-ts/tree/master/packages/sdk-outpost", + "bugs": { + "url": "https://github.com/Wire-Network/wire-libraries-ts/issues" + }, + "keywords": ["wire", "ethereum", "solana", "outpost", "sdk"], + "engines": { + "node": ">=22" + }, + "sideEffects": false, + "files": ["lib/cjs", "lib/esm", "README.md"], "types": "lib/esm/index.d.ts", "main": "lib/cjs/index.js", "module": "lib/esm/index.js", @@ -36,6 +41,8 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w", + "clean": "node scripts/clean-build.mjs", + "build": "pnpm run clean && pnpm run compile && pnpm run fix:hybrid:exports", "test": "jest", "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", "import:deployment": "node scripts/import-deployment.mjs", @@ -43,16 +50,18 @@ "generate:ethereum": "node scripts/generate-ethereum-types.mjs", "generate:solana": "node scripts/generate-solana-types.mjs", "generate": "pnpm run generate:deployments && pnpm run generate:ethereum && pnpm run generate:solana", - "verify:deployments": "node scripts/verify-deployments.mjs" + "verify:generated": "node scripts/verify-generated.mjs", + "verify:deployments": "node scripts/verify-deployments.mjs", + "verify:package": "node scripts/verify-package.mjs", + "verify:release": "pnpm run verify:generated && pnpm run verify:deployments && pnpm run build && pnpm run verify:package", + "prepack": "pnpm run verify:release" }, "dependencies": { "@coral-xyz/anchor": "^0.32.1", "@ethersproject/abi": "^5.8.0", "@ethersproject/providers": "^5.8.0", "@solana/web3.js": "^1.98.4", - "@wireio/sdk-core": "workspace:*", "ethers": "^5.8.0", - "lodash": "^4.18.1", "ts-pattern": "^5.9.0", "zod": "^4.4.3" }, diff --git a/packages/sdk-outpost/scripts/clean-build.mjs b/packages/sdk-outpost/scripts/clean-build.mjs new file mode 100644 index 0000000..79d898a --- /dev/null +++ b/packages/sdk-outpost/scripts/clean-build.mjs @@ -0,0 +1,6 @@ +import Fs from "node:fs/promises" +import Path from "node:path" + +import { PackagePath } from "./deployment-utils.mjs" + +await Fs.rm(Path.join(PackagePath, "lib"), { force: true, recursive: true }) diff --git a/packages/sdk-outpost/scripts/verify-generated.mjs b/packages/sdk-outpost/scripts/verify-generated.mjs new file mode 100644 index 0000000..e925541 --- /dev/null +++ b/packages/sdk-outpost/scripts/verify-generated.mjs @@ -0,0 +1,63 @@ +import ChildProcess from "node:child_process" +import Fs from "node:fs/promises" +import Path from "node:path" + +import { PackagePath, sha256 } from "./deployment-utils.mjs" + +const GeneratedPaths = [ + "src/contracts/ethereum/generated", + "src/deployments/generated/Catalog.ts", + "src/programs/solana/generated/LiqsolCore.ts" + ], + before = await snapshot() + +for (const script of [ + "generate-deployment-catalog.mjs", + "generate-ethereum-types.mjs", + "generate-solana-types.mjs" +]) { + ChildProcess.execFileSync( + process.execPath, + [Path.join(PackagePath, "scripts", script)], + { stdio: "inherit" } + ) +} + +const after = await snapshot() +if (JSON.stringify(before) !== JSON.stringify(after)) { + throw new Error( + "Generated sdk-outpost sources were stale and have been refreshed; review and commit them" + ) +} + +process.stdout.write(`Verified ${after.length} generated sdk-outpost files\n`) + +async function snapshot() { + const files = ( + await Promise.all( + GeneratedPaths.map(path => filesUnder(Path.join(PackagePath, path))) + ) + ) + .flat() + .sort(), + entries = await Promise.all( + files.map(async path => [ + Path.relative(PackagePath, path), + await sha256(path) + ]) + ) + + return entries +} + +async function filesUnder(path) { + const stat = await Fs.stat(path) + if (stat.isFile()) return [path] + + const entries = await Fs.readdir(path, { withFileTypes: true }), + children = await Promise.all( + entries.map(entry => filesUnder(Path.join(path, entry.name))) + ) + + return children.flat() +} diff --git a/packages/sdk-outpost/scripts/verify-package.mjs b/packages/sdk-outpost/scripts/verify-package.mjs new file mode 100644 index 0000000..d1c0ae7 --- /dev/null +++ b/packages/sdk-outpost/scripts/verify-package.mjs @@ -0,0 +1,94 @@ +import Fs from "node:fs/promises" +import { createRequire } from "node:module" +import Path from "node:path" +import { pathToFileURL } from "node:url" + +import { PackagePath, readJson } from "./deployment-utils.mjs" + +const packageJson = await readJson(Path.join(PackagePath, "package.json")), + readme = await Fs.readFile(Path.join(PackagePath, "README.md"), "utf8"), + expectedRepository = "https://github.com/Wire-Network/wire-libraries-ts", + expectedExports = [ + "CurrentOutpostDeployment", + "EthereumOutpostClient", + "OutpostClient", + "OutpostDeployments", + "SolanaOutpostClient", + "assertOutpostDeployment" + ] + +assert(packageJson.name === "@wireio/sdk-outpost", "Unexpected package name") +assert(packageJson.private === false, "Package must be public") +assert( + packageJson.publishConfig?.access === "public", + "Package access must be public" +) +assert( + packageJson.repository?.url === expectedRepository, + "Repository URL must match provenance source" +) +assert( + packageJson.repository?.directory === "packages/sdk-outpost", + "Repository directory is incorrect" +) +assert( + packageJson.license === "FSL-1.1-Apache-2.0", + "Package license is missing" +) +assert( + JSON.stringify(packageJson.files) === + JSON.stringify(["lib/cjs", "lib/esm", "README.md"]), + "Published files must stay limited to built outputs and README" +) +assert( + !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(readme), + "Public README contains an environment-specific release label" +) + +for (const path of [ + "lib/cjs/index.js", + "lib/cjs/index.d.ts", + "lib/cjs/package.json", + "lib/esm/index.js", + "lib/esm/index.d.ts", + "lib/esm/package.json" +]) { + await Fs.access(Path.join(PackagePath, path)) +} + +const publishedOutputPaths = await filesUnder(Path.join(PackagePath, "lib")) +assert( + publishedOutputPaths.every( + path => !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(path) + ), + "Built output contains an environment-specific release label" +) + +const require = createRequire(import.meta.url), + cjs = require(Path.join(PackagePath, packageJson.main)), + esm = await import(pathToFileURL(Path.join(PackagePath, packageJson.module))) + +for (const name of expectedExports) { + assert(name in cjs, `CommonJS entrypoint is missing ${name}`) + assert(name in esm, `ES module entrypoint is missing ${name}`) +} + +process.stdout.write( + "Verified sdk-outpost CommonJS and ES module entrypoints\n" +) + +function assert(condition, message) { + if (!condition) throw new Error(message) +} + +async function filesUnder(path) { + const entries = await Fs.readdir(path, { withFileTypes: true }), + paths = await Promise.all( + entries.map(entry => { + const child = Path.join(path, entry.name) + return entry.isDirectory() ? filesUnder(child) : [child] + }) + ) + + return paths.flat() +} diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 686a04d..918518a 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -1,5 +1,4 @@ import { providers, Signer } from "ethers" -import { identity } from "lodash" import { match } from "ts-pattern" import { @@ -14,14 +13,11 @@ import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" function resolveProvider( connection: providers.Provider | Signer ): providers.Provider { - return match(connection) - .when(Signer.isSigner, signer => { - if (signer.provider == null) { - throw new Error("Ethereum signer must be connected to a provider") - } - return signer.provider - }) - .otherwise(identity) + if (!Signer.isSigner(connection)) return connection + if (connection.provider == null) { + throw new Error("Ethereum signer must be connected to a provider") + } + return connection.provider } /** Strictly typed access to one verified Ethereum outpost deployment. */ diff --git a/packages/sdk-outpost/tsconfig.cjs.jest.json b/packages/sdk-outpost/tsconfig.cjs.jest.json index 1138dc0..9a5a5f8 100644 --- a/packages/sdk-outpost/tsconfig.cjs.jest.json +++ b/packages/sdk-outpost/tsconfig.cjs.jest.json @@ -11,15 +11,10 @@ "strict": true, "noImplicitAny": true, "paths": { - "@wireio/sdk-core": ["../sdk-core/src"], - "@wireio/sdk-core/*": ["../sdk-core/src/*"], "@wireio/sdk-outpost": ["./src"], "@wireio/sdk-outpost/*": ["./src/*"] } }, - "references": [ - { "path": "../sdk-core/tsconfig.cjs.json" }, - { "path": "./tsconfig.cjs.json" } - ], + "references": [{ "path": "./tsconfig.cjs.json" }], "include": ["tests"] } diff --git a/packages/sdk-outpost/tsconfig.cjs.json b/packages/sdk-outpost/tsconfig.cjs.json index 9134e1b..b15a1fa 100644 --- a/packages/sdk-outpost/tsconfig.cjs.json +++ b/packages/sdk-outpost/tsconfig.cjs.json @@ -9,8 +9,5 @@ "strict": true, "noImplicitAny": true }, - "references": [ - { "path": "../sdk-core/tsconfig.cjs.json" } - ], "include": ["src"] } diff --git a/packages/sdk-outpost/tsconfig.esm.json b/packages/sdk-outpost/tsconfig.esm.json index ef92c2e..35ab683 100644 --- a/packages/sdk-outpost/tsconfig.esm.json +++ b/packages/sdk-outpost/tsconfig.esm.json @@ -6,8 +6,5 @@ "strict": true, "noImplicitAny": true }, - "references": [ - { "path": "../sdk-core/tsconfig.esm.json" } - ], "include": ["src"] } diff --git a/packages/sdk-outpost/tsconfig.json b/packages/sdk-outpost/tsconfig.json index 480b117..75e4065 100644 --- a/packages/sdk-outpost/tsconfig.json +++ b/packages/sdk-outpost/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../etc/tsconfig/tsconfig.base.json", "files": [], "references": [ - { "path": "../sdk-core/tsconfig.json" }, { "path": "./tsconfig.esm.json" }, { "path": "./tsconfig.cjs.json" }, { "path": "./tsconfig.cjs.jest.json" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 554f49a..c1425e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -206,15 +206,9 @@ importers: '@solana/web3.js': specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) - '@wireio/sdk-core': - specifier: workspace:* - version: link:../sdk-core ethers: specifier: ^5.8.0 version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - lodash: - specifier: 4.18.1 - version: 4.18.1 ts-pattern: specifier: ^5.9.0 version: 5.9.0 From 54ef04eaf2b670449367bb025f87fd1bcfe87daf Mon Sep 17 00:00:00 2001 From: joshglogau Date: Mon, 3 Aug 2026 16:05:19 -0400 Subject: [PATCH 11/48] docs(sdk-outpost): document first public release --- CLAUDE.md | 4 +- README.md | 6 +- packages/sdk-outpost/README.md | 142 +++++++++++++++--------------- packages/sdk-outpost/RELEASING.md | 87 ++++++++++++++++++ 4 files changed, 166 insertions(+), 73 deletions(-) create mode 100644 packages/sdk-outpost/RELEASING.md diff --git a/CLAUDE.md b/CLAUDE.md index 2f3edbd..16fc624 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -226,9 +226,11 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `sdk-outpost` clients accept caller-owned Ethers/Anchor providers, verify chain identity and deployed bytecode/program executability during asynchronous creation, and expose one typed `OutpostClient` facade. Do not hard-code RPC transport into deployment records. - Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. - `sdk-outpost` deployment refreshes are append-only. Import archives with `packages/sdk-outpost/scripts/import-deployment.mjs`; do not hand-edit catalog data or versioned ABI/IDL folders. -- Each refreshed cluster gets a stable `--` deployment id. Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same deployment. +- Group imported assets by the full parent Wire chain id and deployment checksum. The default record id is `-`; public ids and docs must not encode environment names. +- Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same chain/checksum record. - The current ABI/IDL-generated surface must cover every cataloged deployment. If a refresh removes callable functions or events, introduce an explicit version-specific client instead of weakening types or silently dropping history. - Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; staking migration remains separate scope. +- `sdk-outpost` releases run through the repository-wide patch workflow. Keep `prepack` and both CI release checks passing; do not manually bump or publish the package outside the documented first-release recovery path. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/README.md b/README.md index 30e31ae..952ea3f 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi ## Requirements -- **Node.js** >= 24 -- **pnpm** >= 9 +- **Node.js** 24 for CI and releases +- **pnpm** 10.34.5 through Corepack ## Getting Started @@ -46,7 +46,7 @@ pnpm test ## Publishing -GitHub Actions publishes non-private workspace packages to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. +GitHub Actions builds hybrid package outputs, verifies `sdk-outpost` generated sources and entrypoints, increments every publishable workspace package, and publishes to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. See [`packages/sdk-outpost/RELEASING.md`](packages/sdk-outpost/RELEASING.md) for its first-publication checklist. ## Project Structure diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index ae7d668..93a0227 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -1,37 +1,55 @@ # `@wireio/sdk-outpost` -Strictly typed access to the Ethereum contracts and Solana programs that form a -Wire outpost. +Strictly typed access to the Ethereum contracts and Solana programs deployed +alongside a Wire chain. -The package extends `@wireio/sdk-core`: core owns Wire-chain identity, signing, -and `sysio.*` contract workflows; this package owns external-chain deployment -artifacts and their typed clients. Product orchestration remains in consuming +`@wireio/sdk-core` owns Wire-chain identity, signing, and `sysio.*` workflows. +This package owns external-chain deployment records, generated contract and +program types, and verified clients. Product orchestration remains in consuming applications. -## Status +Available on npm: -This is a preview package. Its deployment catalog preserves each sim2 refresh -as a distinct record keyed by the parent Wire chain ID. The catalog currently -contains the July 31 and August 3, 2026 sim2 deployments; August 3 owns the -generated contract and program types. Every record includes its source archive, -cluster manifest, deployment, snapshot, ABI/IDL, and source-revision digests. +## Install -| Family | Versioned sim2 assets | +```sh +npm install @wireio/sdk-outpost +``` + +Node.js 22 or newer is supported. The package publishes CommonJS and native ES +module entrypoints with TypeScript declarations. + +## Supported surfaces + +| Family | Generated clients | | -------- | --------------------------------------------------------- | | Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager` | | Solana | `liqsol_core` | -The package does not infer support from an ABI, IDL, RPC URL, or configured -address alone. Client creation verifies the external chain identity and every -configured contract or program before returning. Higher-level stake, swap, -settlement, and retry workflows stay gated until the platform capabilities that -back those flows are proven operational. +The package does not infer availability from an ABI, IDL, RPC URL, or address +alone. Client creation verifies the external chain identity and every configured +contract or program before returning. Higher-level feature gates must still +verify the complete platform lifecycle required by an application. + +## Deployment catalog + +Each catalog record represents one immutable Wire network group: + +- the full parent Wire chain ID; +- the external Ethereum chain ID and deployed contract addresses; +- the external Solana genesis hash and program addresses; +- the platform release and exact source revisions; +- the source archive, manifest, deployment, snapshot, ABI, and IDL digests. + +Artifacts are grouped by full Wire chain ID and deployment checksum. Public +record IDs use `-` and do not depend +on environment names, RPC hostnames, or mutable labels. RPC selection remains +caller-owned. ## Usage -Resolve a deployment from the selected parent Wire chain, then provide the -current external-chain provider. RPC selection remains caller-owned so a Hub -network change can rebuild clients from its live network-group configuration. +Resolve the deployment from the selected Wire chain and provide the matching +external-chain provider: ```ts import { providers } from "ethers" @@ -70,71 +88,57 @@ const solana = await OutpostClient.create({ const liqsol = solana.program(SolanaProgramName.liqsolCore) ``` -Zod validates versioned deployment data at the generated catalog boundary. -Contract and program call types come directly from generator-owned ABI and IDL -outputs; the package does not wrap or re-declare them. +Zod validates deployment documents at the generated catalog boundary. Contract +and program call types come directly from generator-owned ABI and IDL outputs; +the package does not wrap or re-declare those shapes. -## Deployment refreshes +## Importing a deployment -Import each rebuilt cluster as a new immutable deployment. The importer reads -the archived cluster manifest, verifies the optional standalone manifest, -copies only the runtime ABIs/IDL used by this package, records exact provenance, -regenerates the catalog and clients, and verifies that the current generated -surface still covers older deployments. +Import every rebuilt network group as a new immutable record. The importer +validates the archived manifest, copies only supported runtime assets, records +exact provenance, regenerates the catalog and client types, and verifies that +the current type surface still covers older records. -```bash +```sh pnpm --dir packages/sdk-outpost run import:deployment -- \ - --archive /path/to/sim2-artifacts.tar.gz \ - --manifest /path/to/sim2-cluster-manifest.json \ + --archive /path/to/outpost-artifacts.tar.gz \ + --manifest /path/to/cluster-manifest.json \ --platform-manifest-revision \ --libraries-revision \ --current ``` -The default ID is `--`. Use `--id` when a -release requires a more specific label. Existing IDs are protected; `--replace` -is reserved for an intentional correction to the same deployment. Omitting -`--current` adds history without changing generated client ownership. - -The checked-in `current.json` is the only current-version pointer. Tests and -`verify:deployments` traverse every catalog entry, so switching it between the -July and August records exercises both artifact generations without deleting -history. +Existing chain/checksum records are protected. Use `--replace` only to correct +that exact record. Omitting `--current` adds history without changing which +artifacts generate the exported contract and program types. -## Hub integration sequence +Do not hand-edit generated files or re-declare ABI/IDL shapes. -1. Install the published preview beside `@wireio/sdk-core`. -2. Resolve the deployment from the selected Wire `ChainId`. -3. Build Ethers and Anchor providers from the Hub's current network-group RPCs. -4. Recreate both clients when that network-group observable changes; feed - verification failures into the existing top-level capability gate. -5. Replace local external-chain ABI/IDL connections with these typed clients, - while retaining Hub product state and transaction orchestration services. -6. Enable stake or swap actions only when both SDK verification and the - platform's flow-specific capability checks pass. +## Consumer boundaries -This keeps network transport dynamic, deployment identity versioned, and feature -availability honest without moving application concerns into the SDK. +- Use this package for typed external `ReserveManager`, `OperatorRegistry`, + `OPP`, `OPPInbound`, and `liqsol_core` access. +- Use `@wireio/sdk-core` for Wire transaction construction, reserve and token + registries, underwriting state, and settlement correlation. +- Rebuild external clients whenever the selected Wire network group changes. +- Combine SDK deployment verification with flow-specific capability gates before + enabling a product action. -## Development +## Maintainer commands -```bash -pnpm --dir packages/sdk-outpost run compile -pnpm --dir packages/sdk-outpost run test -pnpm --dir packages/sdk-outpost run generate:ethereum -pnpm --dir packages/sdk-outpost run generate:solana +```sh +pnpm --dir packages/sdk-outpost run generate +pnpm --dir packages/sdk-outpost run verify:generated pnpm --dir packages/sdk-outpost run verify:deployments +pnpm --dir packages/sdk-outpost run test +pnpm --dir packages/sdk-outpost run verify:release +pnpm --dir packages/sdk-outpost pack --dry-run ``` -Generated contract and program types must be regenerated from checked-in -artifacts. Do not hand-edit generated files or re-declare their shapes. -Generated outputs live under each chain's `generated/` directory and are -excluded from handwritten-code lint rules. +Release versions are managed by the monorepo-wide patch workflow. See +[`RELEASING.md`](RELEASING.md) for the first-publication and verification +checklist. -Swap consumers use `ReserveManager`, `OperatorRegistry`, and `liqsol_core` from -this package. Wire quote, reserve, underwriter, and settlement state remains in -`@wireio/sdk-core`. Retired or placeholder staking surfaces are not restored by -a deployment import. +## License -The TypeChain generator is isolated on its compatible Prettier 2 dependency; the -repository and Solana generator remain on the pinned Prettier 3 toolchain. +FSL-1.1-Apache-2.0 diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md new file mode 100644 index 0000000..73e484f --- /dev/null +++ b/packages/sdk-outpost/RELEASING.md @@ -0,0 +1,87 @@ +# Releasing `@wireio/sdk-outpost` + +`@wireio/sdk-outpost` participates in the same repository-wide release as +`@wireio/sdk-core`. Do not manually change its version or publish a workspace +directory outside this process. + +## Release requirements + +- Use Node.js 24 and the repository-pinned pnpm version through Corepack. +- Keep the lockfile unchanged after a frozen install. +- Import deployment assets through `import:deployment`; never edit generated + ABI, IDL, catalog, or client files by hand. +- Confirm the package contains no secrets, RPC credentials, private keys, or + mutable environment configuration. +- Keep `repository.url` exactly equal to + `https://github.com/Wire-Network/wire-libraries-ts` for npm provenance. + +Codespaces and local checkouts are verification environments, not publishing +authorities. Run the checks there, but let the protected GitHub Actions workflow +create the release. + +## Before merge + +From the repository root: + +```sh +corepack pnpm install --frozen-lockfile --ignore-scripts +corepack pnpm run lint +corepack pnpm run test:ci +corepack pnpm --dir packages/sdk-outpost run verify:release +corepack pnpm --dir packages/sdk-outpost pack --dry-run +``` + +Inspect the package listing from the dry run. It must contain only the README, +package metadata, and the CJS/ESM build outputs. + +## First npm listing + +The first successful publish creates the npm package page. Before merging: + +1. Confirm the `wireio` organization exists on npm and the release owner can + publish public packages in that scope. +2. Confirm npm two-factor authentication is enabled for the release owner. +3. Confirm the GitHub repository secret `NPM_TOKEN` is a valid granular token + with read/write access to the `wireio` organization and permission to publish + with the organization's required 2FA policy. +4. Merge the reviewed pull request into `master`. + +The `publish-npm.yaml` workflow then: + +1. installs the frozen workspace with Node.js 24 and pnpm 10.34.5; +2. builds and tests every package; +3. verifies generated deployment sources and both package entrypoints; +4. changes `sdk-outpost` from `0.0.0` to `0.0.1` as part of the shared patch + increment; +5. commits the workspace version update with `[skip release]`; +6. publishes every changed public package with public access and provenance. + +Do not create `0.0.1` manually. A failed publish must be corrected in source and +released as the next patch; published npm versions are immutable. + +## After the first publication + +Verify the listing and install path: + +```sh +npm view @wireio/sdk-outpost version dist-tags repository --json +npm install @wireio/sdk-outpost +``` + +Then configure npm trusted publishing for the package: + +- provider: GitHub Actions +- organization: `Wire-Network` +- repository: `wire-libraries-ts` +- workflow filename: `publish-npm.yaml` +- allowed action: `npm publish` + +After a trusted publish succeeds, remove the long-lived write token from the +publish step and restrict token-based publishing in npm package settings. Keep +`id-token: write`; npm will generate provenance automatically for the public +package from the public repository. + +References: + +- +- From c389a21bd66f05c3142781cf5c0a987340320509 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 4 Aug 2026 14:48:01 -0400 Subject: [PATCH 12/48] refactor(sdk-outpost): consume source-owned artifacts --- .gitignore | 3 + CLAUDE.md | 17 +- README.md | 4 +- eslint.config.mjs | 1 + package.json | 5 +- packages/sdk-outpost/README.md | 92 +- packages/sdk-outpost/RELEASING.md | 82 +- packages/sdk-outpost/package.json | 21 +- packages/sdk-outpost/scripts/clean-build.mjs | 6 - .../sdk-outpost/scripts/deployment-utils.mjs | 97 - .../scripts/generate-deployment-catalog.mjs | 43 - .../scripts/generate-ethereum-types.mjs | 39 - .../scripts/generate-solana-types.mjs | 52 - .../sdk-outpost/scripts/import-deployment.mjs | 278 - .../scripts/verify-deployments.mjs | 93 - .../sdk-outpost/scripts/verify-generated.mjs | 63 - .../sdk-outpost/scripts/verify-package.mjs | 94 - .../src/artifacts/Compatibility.ts | 50 + packages/sdk-outpost/src/artifacts/index.ts | 2 + .../ethereum/OPP.json | 1081 -- .../ethereum/OPPInbound.json | 1414 --- .../ethereum/OperatorRegistry.json | 1657 --- .../ethereum/ReserveManager.json | 2456 ---- .../solana/liqsol_core.json | 10161 ---------------- .../ethereum/OPP.json | 1081 -- .../ethereum/OPPInbound.json | 1414 --- .../ethereum/OperatorRegistry.json | 1764 --- .../ethereum/ReserveManager.json | 2563 ---- .../solana/liqsol_core.json | 10161 ---------------- .../clients/ethereum/EthereumOutpostClient.ts | 8 +- .../src/clients/solana/SolanaOutpostClient.ts | 16 +- .../src/contracts/ethereum/generated/OPP.ts | 1084 -- .../ethereum/generated/OPPInbound.ts | 1660 --- .../ethereum/generated/OperatorRegistry.ts | 1433 --- .../ethereum/generated/ReserveManager.ts | 2323 ---- .../contracts/ethereum/generated/common.ts | 44 - .../factories/OPPInbound__factory.ts | 1431 --- .../generated/factories/OPP__factory.ts | 1095 -- .../factories/OperatorRegistry__factory.ts | 1784 --- .../factories/ReserveManager__factory.ts | 2583 ---- .../ethereum/generated/factories/index.ts | 7 - .../src/contracts/ethereum/generated/index.ts | 12 - .../sdk-outpost/src/deployments/Registry.ts | 52 - .../sdk-outpost/src/deployments/current.json | 3 - ...07e4dbe4b66186b6188156a67b25278455509.json | 74 - ...29e89f356421bdbed4f4d11c87f29afd977d6.json | 74 - .../src/deployments/generated/Catalog.ts | 177 - packages/sdk-outpost/src/deployments/index.ts | 1 - packages/sdk-outpost/src/index.ts | 1 + .../programs/solana/generated/LiqsolCore.ts | 8509 ------------- .../src/programs/solana/generated/index.ts | 1 - packages/sdk-outpost/tests/Fixtures.ts | 89 + .../tests/assets/Artifacts.test.ts | 92 +- .../tests/clients/OutpostClient.test.ts | 20 +- .../ethereum/EthereumOutpostClient.test.ts | 39 +- .../solana/SolanaOutpostClient.test.ts | 32 +- .../tests/deployments/Registry.test.ts | 37 - .../tests/deployments/Schema.test.ts | 85 +- pnpm-lock.yaml | 10 + scripts/sdk-outpost/clean.mjs | 8 + scripts/sdk-outpost/config.mjs | 30 + scripts/sdk-outpost/generate.mjs | 149 + scripts/sdk-outpost/verify-package.mjs | 93 + 63 files changed, 663 insertions(+), 57187 deletions(-) delete mode 100644 packages/sdk-outpost/scripts/clean-build.mjs delete mode 100644 packages/sdk-outpost/scripts/deployment-utils.mjs delete mode 100644 packages/sdk-outpost/scripts/generate-deployment-catalog.mjs delete mode 100644 packages/sdk-outpost/scripts/generate-ethereum-types.mjs delete mode 100644 packages/sdk-outpost/scripts/generate-solana-types.mjs delete mode 100644 packages/sdk-outpost/scripts/import-deployment.mjs delete mode 100644 packages/sdk-outpost/scripts/verify-deployments.mjs delete mode 100644 packages/sdk-outpost/scripts/verify-generated.mjs delete mode 100644 packages/sdk-outpost/scripts/verify-package.mjs create mode 100644 packages/sdk-outpost/src/artifacts/Compatibility.ts create mode 100644 packages/sdk-outpost/src/artifacts/index.ts delete mode 100644 packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPP.json delete mode 100644 packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPPInbound.json delete mode 100644 packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OperatorRegistry.json delete mode 100644 packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/ReserveManager.json delete mode 100644 packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana/liqsol_core.json delete mode 100644 packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPP.json delete mode 100644 packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPPInbound.json delete mode 100644 packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OperatorRegistry.json delete mode 100644 packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/ReserveManager.json delete mode 100644 packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana/liqsol_core.json delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/common.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/generated/index.ts delete mode 100644 packages/sdk-outpost/src/deployments/Registry.ts delete mode 100644 packages/sdk-outpost/src/deployments/current.json delete mode 100644 packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json delete mode 100644 packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json delete mode 100644 packages/sdk-outpost/src/deployments/generated/Catalog.ts delete mode 100644 packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts delete mode 100644 packages/sdk-outpost/src/programs/solana/generated/index.ts create mode 100644 packages/sdk-outpost/tests/Fixtures.ts delete mode 100644 packages/sdk-outpost/tests/deployments/Registry.test.ts create mode 100644 scripts/sdk-outpost/clean.mjs create mode 100644 scripts/sdk-outpost/config.mjs create mode 100644 scripts/sdk-outpost/generate.mjs create mode 100644 scripts/sdk-outpost/verify-package.mjs diff --git a/.gitignore b/.gitignore index ec50cb5..1890c88 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ tsconfig.tsbuildinfo out/ build dist +/packages/sdk-outpost/src/artifacts/generated/ +/packages/sdk-outpost/src/contracts/ethereum/generated/ +/packages/sdk-outpost/src/programs/solana/generated/ # Debug diff --git a/CLAUDE.md b/CLAUDE.md index 16fc624..06ea477 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,7 +36,7 @@ pnpm workspaces with TypeScript composite project references. No Lerna/Nx. | `@wireio/shared-web` | Web-specific utilities | No | ESM | | `@wireio/shared-node` | Node.js utilities | Yes | Hybrid ESM+CJS | | `@wireio/sdk-core` | Wire blockchain SDK types/primitives | Yes | Hybrid ESM+CJS | -| `@wireio/sdk-outpost` | Typed, versioned external-chain outpost artifacts and clients | Yes | Hybrid ESM+CJS | +| `@wireio/sdk-outpost` | Typed, verified external-chain outpost clients | Yes | Hybrid ESM+CJS | | `@wireio/wallet-ext-sdk` | Wallet extension client SDK | Yes | ESM | | `@wireio/wallet-browser-ext` | Chrome extension developer wallet | No | Webpack bundle | @@ -46,8 +46,9 @@ pnpm workspaces with TypeScript composite project references. No Lerna/Nx. shared ──→ shared-web ──→ shared-node -sdk-core ──→ sdk-outpost - ──→ wallet-ext-sdk ──→ wallet-browser-ext +sdk-core ──→ wallet-ext-sdk ──→ wallet-browser-ext + +sdk-outpost (source artifact packages ──→ generated external-chain clients) ``` Protoc plugins and bundler are standalone (no internal deps). @@ -220,15 +221,13 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns external-chain ABI/IDL assets, their deployment provenance, and strictly typed Ethereum/Solana clients. It extends `sdk-core`; it must not duplicate Wire-chain contract types or import generated OPP model packages. +- `packages/sdk-outpost` owns strictly typed Ethereum/Solana clients and validates caller-supplied runtime deployments. Canonical ABIs and IDLs are published by `wire-ethereum` and `wire-solana`; do not copy their outputs into this repository or import generated OPP model packages. - `sdk-outpost` deployment payloads are untrusted data boundaries validated with Zod. ABI/IDL-derived contract and program types remain generator-owned and must never be re-declared as Zod schemas. -- Add a deployment bundle only with its source revisions, archive/artifact digests, and verified on-chain identities. A checked-in artifact does not by itself prove a contract or program is deployed. +- `scripts/sdk-outpost/` consumes exact producer artifact package versions with `zx`. Generated TypeChain, Anchor, and artifact-manifest sources are ignored build outputs compiled into the release; never edit or commit them. - `sdk-outpost` clients accept caller-owned Ethers/Anchor providers, verify chain identity and deployed bytecode/program executability during asynchronous creation, and expose one typed `OutpostClient` facade. Do not hard-code RPC transport into deployment records. - Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. -- `sdk-outpost` deployment refreshes are append-only. Import archives with `packages/sdk-outpost/scripts/import-deployment.mjs`; do not hand-edit catalog data or versioned ABI/IDL folders. -- Group imported assets by the full parent Wire chain id and deployment checksum. The default record id is `-`; public ids and docs must not encode environment names. -- Change `current.json` only when that deployment should own generated types; use `--replace` only to correct the same chain/checksum record. -- The current ABI/IDL-generated surface must cover every cataloged deployment. If a refresh removes callable functions or events, introduce an explicit version-specific client instead of weakening types or silently dropping history. +- Runtime addresses, chain identities, deployment provenance, and artifact digests come from the platform manifest pipeline. A cluster respin with unchanged interfaces must not require a producer artifact or SDK release. +- Client creation rejects runtime deployment digests that do not match the producer artifacts compiled into the SDK. If a producer interface changes, publish an immutable artifact version and update the exact sdk-outpost build dependency. - Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; staking migration remains separate scope. - `sdk-outpost` releases run through the repository-wide patch workflow. Keep `prepack` and both CI release checks passing; do not manually bump or publish the package outside the documented first-release recovery path. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 diff --git a/README.md b/README.md index 952ea3f..03359c4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi | [`@wireio/shared-web`](packages/shared-web/) | Web-specific utilities | *private* | | [`@wireio/shared-node`](packages/shared-node/) | Node.js-specific utilities | *private* | | [`@wireio/sdk-core`](packages/sdk-core/) | Wire blockchain SDK core types, primitives, signing helpers, generated `sysio` contract proxy, and domain workflows such as multisig and reserves | [![npm](https://img.shields.io/npm/v/@wireio/sdk-core)](https://www.npmjs.com/package/@wireio/sdk-core) | -| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed, versioned Ethereum and Solana outpost artifacts and clients | [![npm](https://img.shields.io/npm/v/@wireio/sdk-outpost)](https://www.npmjs.com/package/@wireio/sdk-outpost) | +| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed Ethereum and Solana outpost clients generated from source-owned artifact packages | [![npm](https://img.shields.io/npm/v/@wireio/sdk-outpost)](https://www.npmjs.com/package/@wireio/sdk-outpost) | | [`@wireio/wallet-ext-sdk`](packages/wallet-ext-sdk/) | Client SDK for the Wire Wallet browser extension | [![npm](https://img.shields.io/npm/v/@wireio/wallet-ext-sdk)](https://www.npmjs.com/package/@wireio/wallet-ext-sdk) | | [`@wireio/wallet-browser-ext`](packages/wallet-browser-ext/) | Chrome extension developer wallet for Wire | *private* | @@ -46,7 +46,7 @@ pnpm test ## Publishing -GitHub Actions builds hybrid package outputs, verifies `sdk-outpost` generated sources and entrypoints, increments every publishable workspace package, and publishes to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. See [`packages/sdk-outpost/RELEASING.md`](packages/sdk-outpost/RELEASING.md) for its first-publication checklist. +GitHub Actions builds hybrid package outputs, generates `sdk-outpost` clients from the exact `wire-ethereum` and `wire-solana` artifact packages, verifies its entrypoints, increments every publishable workspace package, and publishes to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. See [`packages/sdk-outpost/RELEASING.md`](packages/sdk-outpost/RELEASING.md) for its artifact prerequisites and first-publication checklist. ## Project Structure diff --git a/eslint.config.mjs b/eslint.config.mjs index 1a302b9..70e59c2 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -424,6 +424,7 @@ export default tseslint.config( "**/node_modules/**", "**/coverage/**", "**/*.d.ts", + "packages/sdk-outpost/src/artifacts/generated/**", "packages/sdk-outpost/src/contracts/ethereum/generated/**", "packages/sdk-outpost/src/programs/solana/generated/**", // TypeScript is the enforcement target: the style laws + tsconfig diff --git a/package.json b/package.json index 0044bc0..fe61981 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w --preserveWatchOutput", - "build": "pnpm --dir packages/sdk-outpost run clean && pnpm run compile && pnpm -r --if-present run fix:hybrid:exports", + "build": "pnpm --dir packages/sdk-outpost run prepare:compile && pnpm run compile && pnpm -r --if-present run fix:hybrid:exports", "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", @@ -31,7 +31,8 @@ "ts-jest": "^29.4.6", "ts-node": "^10.9.2", "typescript": "^6.0.2", - "typescript-eslint": "^8.64.0" + "typescript-eslint": "^8.64.0", + "zx": "^8.8.5" }, "packageManager": "pnpm@10.34.5", "engines": { diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 93a0227..c66b650 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -4,9 +4,9 @@ Strictly typed access to the Ethereum contracts and Solana programs deployed alongside a Wire chain. `@wireio/sdk-core` owns Wire-chain identity, signing, and `sysio.*` workflows. -This package owns external-chain deployment records, generated contract and -program types, and verified clients. Product orchestration remains in consuming -applications. +This package owns verified external-chain clients. Contract ABIs are published +by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and runtime +deployment data remains caller-supplied. Available on npm: @@ -26,30 +26,42 @@ module entrypoints with TypeScript declarations. | Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager` | | Solana | `liqsol_core` | -The package does not infer availability from an ABI, IDL, RPC URL, or address -alone. Client creation verifies the external chain identity and every configured -contract or program before returning. Higher-level feature gates must still -verify the complete platform lifecycle required by an application. +Client creation verifies all three boundaries before returning: -## Deployment catalog +- the supplied deployment digests match the ABI/IDL packages compiled into this + SDK release; +- the provider is connected to the expected external chain; +- every configured contract has bytecode and every configured Solana program is + executable. -Each catalog record represents one immutable Wire network group: +These checks prove deployment compatibility, not end-to-end feature readiness. +Applications must still gate swaps, staking, settlement, retry, funding, and +underwriting using platform capability evidence. + +## Runtime deployment data + +The SDK does not contain a network catalog. Resolve the selected Wire network +group in the application, load its deployment document from the platform +manifest pipeline, and validate that untrusted input with +`parseOutpostDeployment`. + +A deployment document carries: - the full parent Wire chain ID; -- the external Ethereum chain ID and deployed contract addresses; -- the external Solana genesis hash and program addresses; -- the platform release and exact source revisions; -- the source archive, manifest, deployment, snapshot, ABI, and IDL digests. +- the Ethereum chain ID and deployed contract addresses; +- the Solana genesis hash and deployed program addresses; +- platform and source provenance; +- deployment and interface digests used for compatibility checks. -Artifacts are grouped by full Wire chain ID and deployment checksum. Public -record IDs use `-` and do not depend -on environment names, RPC hostnames, or mutable labels. RPC selection remains -caller-owned. +RPC URLs, private keys, wallet state, and mutable capability results are not SDK +data. A cluster respin updates the runtime deployment document without requiring +an SDK or interface-package release when the underlying ABI and IDL are +unchanged. ## Usage -Resolve the deployment from the selected Wire chain and provide the matching -external-chain provider: +Validate caller-owned deployment data and provide the matching external-chain +provider: ```ts import { providers } from "ethers" @@ -58,10 +70,10 @@ import { EthereumContractName, OutpostChainFamily, OutpostClient, - assertOutpostDeployment + parseOutpostDeployment } from "@wireio/sdk-outpost" -const deployment = assertOutpostDeployment(wireChainId) +const deployment = parseOutpostDeployment(clusterManifest.outpost) const ethereum = await OutpostClient.create({ family: OutpostChainFamily.ethereum, options: { @@ -72,7 +84,8 @@ const ethereum = await OutpostClient.create({ const reserves = ethereum.contract(EthereumContractName.ReserveManager) ``` -Solana uses the same facade and returns the precise Anchor program type: +Solana uses the same facade and returns the precise Anchor program type at the +runtime program address: ```ts import { @@ -88,31 +101,14 @@ const solana = await OutpostClient.create({ const liqsol = solana.program(SolanaProgramName.liqsolCore) ``` -Zod validates deployment documents at the generated catalog boundary. Contract -and program call types come directly from generator-owned ABI and IDL outputs; -the package does not wrap or re-declare those shapes. - -## Importing a deployment - -Import every rebuilt network group as a new immutable record. The importer -validates the archived manifest, copies only supported runtime assets, records -exact provenance, regenerates the catalog and client types, and verifies that -the current type surface still covers older records. - -```sh -pnpm --dir packages/sdk-outpost run import:deployment -- \ - --archive /path/to/outpost-artifacts.tar.gz \ - --manifest /path/to/cluster-manifest.json \ - --platform-manifest-revision \ - --libraries-revision \ - --current -``` - -Existing chain/checksum records are protected. Use `--replace` only to correct -that exact record. Omitting `--current` adds history without changing which -artifacts generate the exported contract and program types. +## Artifact ownership -Do not hand-edit generated files or re-declare ABI/IDL shapes. +`@wireio/outpost-ethereum-artifacts` and `@wireio/outpost-solana-artifacts` are +build-time inputs. Their exact manifests are compiled into +`OutpostArtifactManifests` for deployment compatibility and readiness reporting. +Generated TypeChain and Anchor sources are ignored local build outputs; they are +compiled into the published package and are never maintained by hand in this +repository. ## Consumer boundaries @@ -128,15 +124,13 @@ Do not hand-edit generated files or re-declare ABI/IDL shapes. ```sh pnpm --dir packages/sdk-outpost run generate -pnpm --dir packages/sdk-outpost run verify:generated -pnpm --dir packages/sdk-outpost run verify:deployments pnpm --dir packages/sdk-outpost run test pnpm --dir packages/sdk-outpost run verify:release pnpm --dir packages/sdk-outpost pack --dry-run ``` Release versions are managed by the monorepo-wide patch workflow. See -[`RELEASING.md`](RELEASING.md) for the first-publication and verification +[`RELEASING.md`](RELEASING.md) for artifact prerequisites and the verification checklist. ## License diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index 73e484f..5ab7196 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -4,20 +4,37 @@ `@wireio/sdk-core`. Do not manually change its version or publish a workspace directory outside this process. +## Artifact prerequisites + +The package consumes exact build-time versions of: + +- `@wireio/outpost-ethereum-artifacts`, published from `wire-ethereum`; +- `@wireio/outpost-solana-artifacts`, published from `wire-solana`. + +Publish a new producer package only when its source ABI or IDL changes. A new +deployment, address, endpoint, or network-group respin belongs in the runtime +platform manifest and does not require these packages or `sdk-outpost` to be +republished. + +Before updating either dependency, verify its npm provenance, source revision, +artifact checksums, and immutable version. Keep both versions exact in +`packages/sdk-outpost/package.json` and update `pnpm-lock.yaml` through a frozen +pnpm-compatible install. + ## Release requirements - Use Node.js 24 and the repository-pinned pnpm version through Corepack. - Keep the lockfile unchanged after a frozen install. -- Import deployment assets through `import:deployment`; never edit generated - ABI, IDL, catalog, or client files by hand. -- Confirm the package contains no secrets, RPC credentials, private keys, or - mutable environment configuration. +- Generate clients only through `scripts/sdk-outpost/generate.mjs`; never edit + generated TypeChain, Anchor, or artifact-manifest sources by hand. +- Confirm the package contains no secrets, RPC credentials, private keys, + addresses, or mutable environment configuration. - Keep `repository.url` exactly equal to `https://github.com/Wire-Network/wire-libraries-ts` for npm provenance. -Codespaces and local checkouts are verification environments, not publishing -authorities. Run the checks there, but let the protected GitHub Actions workflow -create the release. +Local checkouts are verification environments, not publishing authorities. Run +the checks there, but let the protected GitHub Actions workflow create the +release. ## Before merge @@ -31,33 +48,30 @@ corepack pnpm --dir packages/sdk-outpost run verify:release corepack pnpm --dir packages/sdk-outpost pack --dry-run ``` -Inspect the package listing from the dry run. It must contain only the README, -package metadata, and the CJS/ESM build outputs. +Inspect the dry-run listing. It must contain only the README, package metadata, +and CJS/ESM build outputs. Raw producer packages and generated source trees must +not be published by `sdk-outpost`. ## First npm listing The first successful publish creates the npm package page. Before merging: -1. Confirm the `wireio` organization exists on npm and the release owner can +1. Confirm both exact producer artifact versions are publicly installable. +2. Confirm the `wireio` organization exists on npm and the release owner can publish public packages in that scope. -2. Confirm npm two-factor authentication is enabled for the release owner. -3. Confirm the GitHub repository secret `NPM_TOKEN` is a valid granular token - with read/write access to the `wireio` organization and permission to publish - with the organization's required 2FA policy. -4. Merge the reviewed pull request into `master`. - -The `publish-npm.yaml` workflow then: +3. Confirm npm two-factor authentication is enabled for the release owner. +4. Confirm the GitHub repository secret `NPM_TOKEN` can publish to the `wireio` + organization under its required authentication policy. +5. Merge the reviewed pull request into `master`. -1. installs the frozen workspace with Node.js 24 and pnpm 10.34.5; -2. builds and tests every package; -3. verifies generated deployment sources and both package entrypoints; -4. changes `sdk-outpost` from `0.0.0` to `0.0.1` as part of the shared patch - increment; -5. commits the workspace version update with `[skip release]`; -6. publishes every changed public package with public access and provenance. +The `publish-npm.yaml` workflow installs the frozen workspace, generates clients +from the producer packages, builds and tests every package, verifies the public +entrypoints, increments the workspace patch versions, and publishes with npm +provenance. -Do not create `0.0.1` manually. A failed publish must be corrected in source and -released as the next patch; published npm versions are immutable. +Do not create the first `sdk-outpost` version manually. A failed publish must be +corrected in source and released as the next patch; published npm versions are +immutable. ## After the first publication @@ -68,18 +82,10 @@ npm view @wireio/sdk-outpost version dist-tags repository --json npm install @wireio/sdk-outpost ``` -Then configure npm trusted publishing for the package: - -- provider: GitHub Actions -- organization: `Wire-Network` -- repository: `wire-libraries-ts` -- workflow filename: `publish-npm.yaml` -- allowed action: `npm publish` - -After a trusted publish succeeds, remove the long-lived write token from the -publish step and restrict token-based publishing in npm package settings. Keep -`id-token: write`; npm will generate provenance automatically for the public -package from the public repository. +Then configure npm trusted publishing for `publish-npm.yaml`. After a trusted +publish succeeds, remove the long-lived write token from the publish step and +restrict token-based publishing in npm package settings. Keep `id-token: write` +so npm can generate provenance. References: diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index b827d85..489a4a5 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -41,19 +41,14 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w", - "clean": "node scripts/clean-build.mjs", - "build": "pnpm run clean && pnpm run compile && pnpm run fix:hybrid:exports", - "test": "jest", + "clean": "zx ../../scripts/sdk-outpost/clean.mjs", + "generate": "zx ../../scripts/sdk-outpost/generate.mjs", + "prepare:compile": "pnpm run clean && pnpm run generate", + "build": "pnpm run prepare:compile && pnpm run compile && pnpm run fix:hybrid:exports", + "test": "pnpm run generate && jest", "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", - "import:deployment": "node scripts/import-deployment.mjs", - "generate:deployments": "node scripts/generate-deployment-catalog.mjs", - "generate:ethereum": "node scripts/generate-ethereum-types.mjs", - "generate:solana": "node scripts/generate-solana-types.mjs", - "generate": "pnpm run generate:deployments && pnpm run generate:ethereum && pnpm run generate:solana", - "verify:generated": "node scripts/verify-generated.mjs", - "verify:deployments": "node scripts/verify-deployments.mjs", - "verify:package": "node scripts/verify-package.mjs", - "verify:release": "pnpm run verify:generated && pnpm run verify:deployments && pnpm run build && pnpm run verify:package", + "verify:package": "zx ../../scripts/sdk-outpost/verify-package.mjs", + "verify:release": "pnpm run build && pnpm run verify:package", "prepack": "pnpm run verify:release" }, "dependencies": { @@ -66,6 +61,8 @@ "zod": "^4.4.3" }, "devDependencies": { + "@wireio/outpost-ethereum-artifacts": "0.1.0", + "@wireio/outpost-solana-artifacts": "0.1.0", "@typechain/ethers-v5": "^11.1.2", "prettier": "3.8.1", "typechain": "^8.3.2", diff --git a/packages/sdk-outpost/scripts/clean-build.mjs b/packages/sdk-outpost/scripts/clean-build.mjs deleted file mode 100644 index 79d898a..0000000 --- a/packages/sdk-outpost/scripts/clean-build.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import Fs from "node:fs/promises" -import Path from "node:path" - -import { PackagePath } from "./deployment-utils.mjs" - -await Fs.rm(Path.join(PackagePath, "lib"), { force: true, recursive: true }) diff --git a/packages/sdk-outpost/scripts/deployment-utils.mjs b/packages/sdk-outpost/scripts/deployment-utils.mjs deleted file mode 100644 index c447e98..0000000 --- a/packages/sdk-outpost/scripts/deployment-utils.mjs +++ /dev/null @@ -1,97 +0,0 @@ -import Crypto from "node:crypto" -import Fs from "node:fs/promises" -import Path from "node:path" -import { fileURLToPath } from "node:url" - -import { format } from "prettier" - -export const PackagePath = Path.resolve( - Path.dirname(fileURLToPath(import.meta.url)), - ".." - ), - DeploymentDataPath = Path.join(PackagePath, "src/deployments/data"), - CurrentDeploymentFile = Path.join( - PackagePath, - "src/deployments/current.json" - ), - GeneratedCatalogFile = Path.join( - PackagePath, - "src/deployments/generated/Catalog.ts" - ) - -export async function pathExists(path) { - try { - await Fs.access(path) - return true - } catch { - return false - } -} - -export async function sha256(path) { - const contents = await Fs.readFile(path) - return Crypto.createHash("sha256").update(contents).digest("hex") -} - -export async function readJson(path) { - return JSON.parse(await Fs.readFile(path, "utf8")) -} - -export async function writeJson(path, value) { - await Fs.mkdir(Path.dirname(path), { recursive: true }) - await Fs.writeFile(path, `${JSON.stringify(value, null, 2)}\n`) -} - -export async function readDeploymentDocuments() { - const documents = await Promise.all( - (await jsonFiles(DeploymentDataPath)).map(readJson) - ) - - return documents.sort((left, right) => - left.artifactBundle.generatedAt.localeCompare( - right.artifactBundle.generatedAt - ) - ) -} - -async function jsonFiles(root) { - const entries = await Fs.readdir(root, { withFileTypes: true }), - paths = await Promise.all( - entries.map(entry => { - const path = Path.join(root, entry.name) - if (entry.isDirectory()) return jsonFiles(path) - return entry.isFile() && entry.name.endsWith(".json") ? [path] : [] - }) - ) - - return paths.flat() -} - -export async function readCurrentDeploymentId() { - const current = await readJson(CurrentDeploymentFile) - if (typeof current.id !== "string" || current.id.length === 0) { - throw new Error("Current deployment id is missing") - } - return current.id -} - -export async function writeTypescript(path, source) { - const formatted = await format(source, { - parser: "typescript", - semi: false, - singleQuote: false, - trailingComma: "none" - }) - await Fs.mkdir(Path.dirname(path), { recursive: true }) - await Fs.writeFile(path, formatted) -} - -export function deploymentAssetPath(deployment, family) { - return Path.join( - PackagePath, - "src/assets", - deployment.wire.chainId, - deployment.artifactBundle.deploymentChecksum, - family - ) -} diff --git a/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs b/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs deleted file mode 100644 index ec9f7cd..0000000 --- a/packages/sdk-outpost/scripts/generate-deployment-catalog.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import { - GeneratedCatalogFile, - readCurrentDeploymentId, - readDeploymentDocuments, - writeTypescript -} from "./deployment-utils.mjs" - -const documents = await readDeploymentDocuments(), - currentId = await readCurrentDeploymentId(), - ids = new Set(), - wireChainIds = new Set() - -for (const document of documents) { - if (ids.has(document.id)) { - throw new Error(`Duplicate outpost deployment id ${document.id}`) - } - if (wireChainIds.has(document.wire.chainId)) { - throw new Error( - `Duplicate outpost deployment Wire chain ${document.wire.chainId}` - ) - } - ids.add(document.id) - wireChainIds.add(document.wire.chainId) -} - -if (!ids.has(currentId)) { - throw new Error( - `Current outpost deployment ${currentId} is not in the catalog` - ) -} - -await writeTypescript( - GeneratedCatalogFile, - ` - /* Autogenerated file. Do not edit manually. */ - - /** Untrusted deployment documents validated by Registry at module load. */ - export const OutpostDeploymentDocuments: readonly unknown[] = ${JSON.stringify(documents, null, 2)} - - /** Deployment whose ABI and IDL surfaces own the generated client types. */ - export const CurrentOutpostDeploymentId = ${JSON.stringify(currentId)} - ` -) diff --git a/packages/sdk-outpost/scripts/generate-ethereum-types.mjs b/packages/sdk-outpost/scripts/generate-ethereum-types.mjs deleted file mode 100644 index 919d3f8..0000000 --- a/packages/sdk-outpost/scripts/generate-ethereum-types.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import ChildProcess from "node:child_process" -import Fs from "node:fs/promises" -import Path from "node:path" - -import { - PackagePath, - deploymentAssetPath, - readCurrentDeploymentId, - readDeploymentDocuments -} from "./deployment-utils.mjs" - -const deploymentId = await readCurrentDeploymentId(), - deployment = (await readDeploymentDocuments()).find( - candidate => candidate.id === deploymentId - ) - -if (deployment == null) - throw new Error(`Unknown current deployment ${deploymentId}`) - -const assetGlob = Path.join( - deploymentAssetPath(deployment, "ethereum"), - "*.json" - ), - outputPath = Path.join(PackagePath, "src/contracts/ethereum/generated"), - typechain = Path.join(PackagePath, "node_modules/.bin/typechain") - -await Fs.rm(outputPath, { force: true, recursive: true }) -ChildProcess.execFileSync( - typechain, - [ - "--target", - "ethers-v5", - "--node16-modules", - "--out-dir", - outputPath, - assetGlob - ], - { stdio: "inherit" } -) diff --git a/packages/sdk-outpost/scripts/generate-solana-types.mjs b/packages/sdk-outpost/scripts/generate-solana-types.mjs deleted file mode 100644 index 85e4b13..0000000 --- a/packages/sdk-outpost/scripts/generate-solana-types.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import Fs from "node:fs/promises" -import Path from "node:path" - -import { convertIdlToCamelCase } from "@coral-xyz/anchor/dist/cjs/idl.js" -import { format } from "prettier" - -import { - PackagePath, - deploymentAssetPath, - readCurrentDeploymentId, - readDeploymentDocuments -} from "./deployment-utils.mjs" - -const deploymentId = await readCurrentDeploymentId(), - deployment = (await readDeploymentDocuments()).find( - candidate => candidate.id === deploymentId - ) - -if (deployment == null) - throw new Error(`Unknown current deployment ${deploymentId}`) - -const idlFile = Path.join( - deploymentAssetPath(deployment, "solana"), - "liqsol_core.json" - ), - outputFile = Path.join( - PackagePath, - "src/programs/solana/generated/LiqsolCore.ts" - ), - rawIdl = JSON.parse(await Fs.readFile(idlFile, "utf8")), - idl = convertIdlToCamelCase(rawIdl), - source = ` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ - import type { Idl } from "@coral-xyz/anchor" - - const liqsolCoreIdlValue = ${JSON.stringify(idl, null, 2)} as const - - /** Strict Anchor IDL type generated from the checked-in liqsol_core artifact. */ - export type LiqsolCore = Idl & typeof liqsolCoreIdlValue - - /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ - export const liqsolCoreIdl = liqsolCoreIdlValue as LiqsolCore - `, - formattedSource = await format(source, { - parser: "typescript", - semi: false, - singleQuote: false, - trailingComma: "none" - }) - -await Fs.writeFile(outputFile, formattedSource) diff --git a/packages/sdk-outpost/scripts/import-deployment.mjs b/packages/sdk-outpost/scripts/import-deployment.mjs deleted file mode 100644 index 21ff158..0000000 --- a/packages/sdk-outpost/scripts/import-deployment.mjs +++ /dev/null @@ -1,278 +0,0 @@ -import ChildProcess from "node:child_process" -import Fs from "node:fs/promises" -import Os from "node:os" -import Path from "node:path" - -import { - CurrentDeploymentFile, - DeploymentDataPath, - PackagePath, - deploymentAssetPath, - pathExists, - readJson, - sha256, - writeJson -} from "./deployment-utils.mjs" - -const ContractNames = [ - "OPP", - "OPPInbound", - "OperatorRegistry", - "ReserveManager" - ], - RevisionPattern = /^[0-9a-f]{40}$/, - argumentsByName = parseArguments(process.argv.slice(2)), - archive = requiredPath("archive"), - platformManifestRevision = requiredRevision("platform-manifest-revision"), - librariesRevision = requiredRevision("libraries-revision"), - platformRelease = argumentsByName.get("platform-release") ?? "v1.0.0", - standaloneManifest = argumentsByName.get("manifest"), - replace = argumentsByName.has("replace"), - makeCurrent = argumentsByName.has("current"), - tempPath = await Fs.mkdtemp(Path.join(Os.tmpdir(), "sdk-outpost-import-")) - -try { - ChildProcess.execFileSync("tar", ["-xzf", archive, "-C", tempPath], { - stdio: "ignore" - }) - - const artifactRoot = await locateArtifactRoot(tempPath), - manifestPath = Path.join(artifactRoot, "cluster-manifest.json"), - readmePath = Path.join(artifactRoot, "README.txt"), - manifest = await readJson(manifestPath), - generatedAt = await readGeneratedAt(readmePath), - wireChainId = requiredValue(manifest, "identity.chains.wire.chain_id"), - deploymentChecksum = requiredValue(manifest, "deployment_checksum"), - id = `${wireChainId}-${deploymentChecksum.slice(0, 12)}` - - if (standaloneManifest != null) { - const [embeddedHash, standaloneHash] = await Promise.all([ - sha256(manifestPath), - sha256(Path.resolve(standaloneManifest)) - ]) - if (embeddedHash !== standaloneHash) { - throw new Error("Standalone and archived cluster manifests do not match") - } - } - - const deploymentPath = Path.join( - DeploymentDataPath, - wireChainId, - `${deploymentChecksum}.json` - ) - if ((await pathExists(deploymentPath)) && !replace) { - throw new Error( - `Deployment ${id} already exists; use --replace only for an intentional correction` - ) - } - - const assetIdentity = { - artifactBundle: { deploymentChecksum }, - wire: { chainId: wireChainId } - }, - ethereumContracts = {}, - ethereumAssetPath = deploymentAssetPath(assetIdentity, "ethereum"), - solanaAssetPath = deploymentAssetPath(assetIdentity, "solana") - - await Fs.mkdir(ethereumAssetPath, { recursive: true }) - await Fs.mkdir(solanaAssetPath, { recursive: true }) - - for (const contractName of ContractNames) { - const sourcePath = Path.join( - artifactRoot, - "ethereum/runtime-abis", - `${contractName}.json` - ), - expectedHash = - manifest.identity?.evm_abis?.[`${contractName}.json`]?.sha256, - actualHash = await sha256(sourcePath) - - if (typeof expectedHash !== "string" || actualHash !== expectedHash) { - throw new Error(`${contractName} ABI does not match the cluster manifest`) - } - await Fs.copyFile( - sourcePath, - Path.join(ethereumAssetPath, `${contractName}.json`) - ) - ethereumContracts[contractName] = { - address: requiredValue( - manifest, - `identity.evm_contracts.${contractName}.address` - ), - artifactSha256: actualHash - } - } - - const solanaSourcePath = Path.join( - artifactRoot, - "solana/runtime-idls/liqsol_core.json" - ), - solanaHash = await sha256(solanaSourcePath), - expectedSolanaHash = requiredValue( - manifest, - "identity.svm_programs.liqsol_core.idl_sha256" - ) - - if (solanaHash !== expectedSolanaHash) { - throw new Error("liqsol_core IDL does not match the cluster manifest") - } - await Fs.copyFile( - solanaSourcePath, - Path.join(solanaAssetPath, "liqsol_core.json") - ) - - const document = { - schemaVersion: 1, - id, - artifactBundle: { - generatedAt, - sourceArchiveSha256: await sha256(archive), - clusterManifestSha256: await sha256(manifestPath), - deploymentChecksum, - snapshotChecksum: requiredValue(manifest, "snapshot_checksum"), - platformRelease: { - tag: platformRelease, - url: `https://github.com/Wire-Network/wire-platform-build-system/releases/tag/${platformRelease}`, - manifest: { - repository: "Wire-Network/wire-platform-manifest", - revision: platformManifestRevision - }, - libraries: { - repository: "Wire-Network/wire-libraries-ts", - revision: librariesRevision - } - }, - sources: { - wireTools: sourceRevision(manifest, "wire-tools-ts"), - wireSysio: sourceRevision(manifest, "wire-sysio"), - wireEthereum: sourceRevision(manifest, "wire-ethereum"), - wireSolana: sourceRevision(manifest, "wire-solana") - } - }, - wire: { chainId: wireChainId }, - ethereum: { - chainId: Number(requiredValue(manifest, "identity.chains.evm.chain_id")), - contracts: ethereumContracts - }, - solana: { - genesisHash: requiredValue(manifest, "identity.chains.svm.genesis"), - programs: { - liqsolCore: { - address: requiredValue( - manifest, - "identity.svm_programs.liqsol_core.program_id" - ), - artifactSha256: solanaHash - } - } - } - } - - await writeJson(deploymentPath, document) - if (makeCurrent || !(await pathExists(CurrentDeploymentFile))) { - await writeJson(CurrentDeploymentFile, { id }) - } - - for (const script of [ - "generate-deployment-catalog.mjs", - "generate-ethereum-types.mjs", - "generate-solana-types.mjs", - "verify-deployments.mjs" - ]) { - ChildProcess.execFileSync( - process.execPath, - [Path.join(PackagePath, "scripts", script)], - { stdio: "inherit" } - ) - } - - process.stdout.write(`Imported ${id}${makeCurrent ? " as current" : ""}\n`) -} finally { - await Fs.rm(tempPath, { force: true, recursive: true }) -} - -function parseArguments(values) { - const booleanArguments = ["current", "replace"], - valueArguments = [ - "archive", - "libraries-revision", - "manifest", - "platform-manifest-revision", - "platform-release" - ], - parsed = new Map() - for (let index = 0; index < values.length; index += 1) { - const value = values[index] - if (value === "--") continue - if (!value.startsWith("--")) { - throw new Error(`Unexpected argument ${value}`) - } - const name = value.slice(2) - if (booleanArguments.includes(name)) { - parsed.set(name, "true") - continue - } - if (!valueArguments.includes(name)) { - throw new Error(`Unknown argument --${name}`) - } - const next = values[index + 1] - if (next == null || next.startsWith("--")) { - throw new Error(`Missing value for --${name}`) - } - parsed.set(name, next) - index += 1 - } - return parsed -} - -function requiredPath(name) { - const value = argumentsByName.get(name) - if (value == null) throw new Error(`Missing --${name}`) - return Path.resolve(value) -} - -function requiredRevision(name) { - const value = argumentsByName.get(name) - if (value == null || !RevisionPattern.test(value)) { - throw new Error(`--${name} must be a full Git revision`) - } - return value -} - -async function locateArtifactRoot(root) { - const entries = await Fs.readdir(root, { withFileTypes: true }) - for (const entry of entries) { - if (!entry.isDirectory()) continue - const candidate = Path.join(root, entry.name) - if (await pathExists(Path.join(candidate, "cluster-manifest.json"))) { - return candidate - } - } - throw new Error("Archive does not contain a cluster-manifest.json") -} - -async function readGeneratedAt(readmePath) { - const readme = await Fs.readFile(readmePath, "utf8"), - match = readme.match(/regenerated\s+(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)/) - if (match == null) - throw new Error("Artifact README does not record generated time") - return match[1] -} - -function requiredValue(value, path) { - let current = value - for (const part of path.split(".")) { - current = current?.[part] - } - if (current == null || current === "") { - throw new Error(`Cluster manifest is missing ${path}`) - } - return current -} - -function sourceRevision(manifest, repository) { - return { - repository: `Wire-Network/${repository}`, - revision: requiredValue(manifest, `identity.sources.${repository}`) - } -} diff --git a/packages/sdk-outpost/scripts/verify-deployments.mjs b/packages/sdk-outpost/scripts/verify-deployments.mjs deleted file mode 100644 index 860fe7c..0000000 --- a/packages/sdk-outpost/scripts/verify-deployments.mjs +++ /dev/null @@ -1,93 +0,0 @@ -import Path from "node:path" - -import { - deploymentAssetPath, - readCurrentDeploymentId, - readDeploymentDocuments, - readJson, - sha256 -} from "./deployment-utils.mjs" - -const ContractNames = [ - "OPP", - "OPPInbound", - "OperatorRegistry", - "ReserveManager" - ], - documents = await readDeploymentDocuments(), - currentId = await readCurrentDeploymentId(), - current = documents.find(document => document.id === currentId) - -if (current == null) throw new Error(`Unknown current deployment ${currentId}`) - -for (const deployment of documents) { - for (const contractName of ContractNames) { - const path = Path.join( - deploymentAssetPath(deployment, "ethereum"), - `${contractName}.json` - ), - actualHash = await sha256(path), - expectedHash = deployment.ethereum.contracts[contractName].artifactSha256 - if (actualHash !== expectedHash) { - throw new Error(`${deployment.id} ${contractName} ABI digest mismatch`) - } - } - - const solanaPath = Path.join( - deploymentAssetPath(deployment, "solana"), - "liqsol_core.json" - ), - solanaHash = await sha256(solanaPath) - if (solanaHash !== deployment.solana.programs.liqsolCore.artifactSha256) { - throw new Error(`${deployment.id} liqsol_core IDL digest mismatch`) - } -} - -for (const deployment of documents) { - if (deployment.id === current.id) continue - for (const contractName of ContractNames) { - const previous = await readJson( - Path.join( - deploymentAssetPath(deployment, "ethereum"), - `${contractName}.json` - ) - ), - currentArtifact = await readJson( - Path.join( - deploymentAssetPath(current, "ethereum"), - `${contractName}.json` - ) - ) - assertSurfaceCovered( - `${deployment.id} ${contractName}`, - callableSurface(previous.abi), - callableSurface(currentArtifact.abi) - ) - } -} - -process.stdout.write( - `Verified ${documents.length} outpost deployments; current=${current.id}\n` -) - -function callableSurface(abi) { - return new Set( - abi - .filter(entry => entry.type === "function" || entry.type === "event") - .map( - entry => - `${entry.type}:${entry.name}(${(entry.inputs ?? []).map(input => input.type).join(",")})` - ) - ) -} - -function assertSurfaceCovered(label, previous, currentSurface) { - const missing = [...previous].filter( - signature => !currentSurface.has(signature) - ) - if (missing.length > 0) { - throw new Error( - `${label} is not covered by the current generated types: ${missing.join(", ")}` - ) - } -} diff --git a/packages/sdk-outpost/scripts/verify-generated.mjs b/packages/sdk-outpost/scripts/verify-generated.mjs deleted file mode 100644 index e925541..0000000 --- a/packages/sdk-outpost/scripts/verify-generated.mjs +++ /dev/null @@ -1,63 +0,0 @@ -import ChildProcess from "node:child_process" -import Fs from "node:fs/promises" -import Path from "node:path" - -import { PackagePath, sha256 } from "./deployment-utils.mjs" - -const GeneratedPaths = [ - "src/contracts/ethereum/generated", - "src/deployments/generated/Catalog.ts", - "src/programs/solana/generated/LiqsolCore.ts" - ], - before = await snapshot() - -for (const script of [ - "generate-deployment-catalog.mjs", - "generate-ethereum-types.mjs", - "generate-solana-types.mjs" -]) { - ChildProcess.execFileSync( - process.execPath, - [Path.join(PackagePath, "scripts", script)], - { stdio: "inherit" } - ) -} - -const after = await snapshot() -if (JSON.stringify(before) !== JSON.stringify(after)) { - throw new Error( - "Generated sdk-outpost sources were stale and have been refreshed; review and commit them" - ) -} - -process.stdout.write(`Verified ${after.length} generated sdk-outpost files\n`) - -async function snapshot() { - const files = ( - await Promise.all( - GeneratedPaths.map(path => filesUnder(Path.join(PackagePath, path))) - ) - ) - .flat() - .sort(), - entries = await Promise.all( - files.map(async path => [ - Path.relative(PackagePath, path), - await sha256(path) - ]) - ) - - return entries -} - -async function filesUnder(path) { - const stat = await Fs.stat(path) - if (stat.isFile()) return [path] - - const entries = await Fs.readdir(path, { withFileTypes: true }), - children = await Promise.all( - entries.map(entry => filesUnder(Path.join(path, entry.name))) - ) - - return children.flat() -} diff --git a/packages/sdk-outpost/scripts/verify-package.mjs b/packages/sdk-outpost/scripts/verify-package.mjs deleted file mode 100644 index d1c0ae7..0000000 --- a/packages/sdk-outpost/scripts/verify-package.mjs +++ /dev/null @@ -1,94 +0,0 @@ -import Fs from "node:fs/promises" -import { createRequire } from "node:module" -import Path from "node:path" -import { pathToFileURL } from "node:url" - -import { PackagePath, readJson } from "./deployment-utils.mjs" - -const packageJson = await readJson(Path.join(PackagePath, "package.json")), - readme = await Fs.readFile(Path.join(PackagePath, "README.md"), "utf8"), - expectedRepository = "https://github.com/Wire-Network/wire-libraries-ts", - expectedExports = [ - "CurrentOutpostDeployment", - "EthereumOutpostClient", - "OutpostClient", - "OutpostDeployments", - "SolanaOutpostClient", - "assertOutpostDeployment" - ] - -assert(packageJson.name === "@wireio/sdk-outpost", "Unexpected package name") -assert(packageJson.private === false, "Package must be public") -assert( - packageJson.publishConfig?.access === "public", - "Package access must be public" -) -assert( - packageJson.repository?.url === expectedRepository, - "Repository URL must match provenance source" -) -assert( - packageJson.repository?.directory === "packages/sdk-outpost", - "Repository directory is incorrect" -) -assert( - packageJson.license === "FSL-1.1-Apache-2.0", - "Package license is missing" -) -assert( - JSON.stringify(packageJson.files) === - JSON.stringify(["lib/cjs", "lib/esm", "README.md"]), - "Published files must stay limited to built outputs and README" -) -assert( - !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(readme), - "Public README contains an environment-specific release label" -) - -for (const path of [ - "lib/cjs/index.js", - "lib/cjs/index.d.ts", - "lib/cjs/package.json", - "lib/esm/index.js", - "lib/esm/index.d.ts", - "lib/esm/package.json" -]) { - await Fs.access(Path.join(PackagePath, path)) -} - -const publishedOutputPaths = await filesUnder(Path.join(PackagePath, "lib")) -assert( - publishedOutputPaths.every( - path => !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(path) - ), - "Built output contains an environment-specific release label" -) - -const require = createRequire(import.meta.url), - cjs = require(Path.join(PackagePath, packageJson.main)), - esm = await import(pathToFileURL(Path.join(PackagePath, packageJson.module))) - -for (const name of expectedExports) { - assert(name in cjs, `CommonJS entrypoint is missing ${name}`) - assert(name in esm, `ES module entrypoint is missing ${name}`) -} - -process.stdout.write( - "Verified sdk-outpost CommonJS and ES module entrypoints\n" -) - -function assert(condition, message) { - if (!condition) throw new Error(message) -} - -async function filesUnder(path) { - const entries = await Fs.readdir(path, { withFileTypes: true }), - paths = await Promise.all( - entries.map(entry => { - const child = Path.join(path, entry.name) - return entry.isDirectory() ? filesUnder(child) : [child] - }) - ) - - return paths.flat() -} diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts new file mode 100644 index 0000000..40297fc --- /dev/null +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -0,0 +1,50 @@ +import { match } from "ts-pattern" + +import { + EthereumContractName, + OutpostChainFamily, + OutpostDeployment, + SolanaProgramName +} from "../deployments/index.js" +import { OutpostArtifactManifests } from "./generated/index.js" + +/** Assert that one deployment digest matches the interface compiled into the SDK. */ +function assertArtifactDigest( + actual: string, + expected: string, + label: string +): void { + if (actual !== expected) { + throw new Error( + `${label} artifact mismatch: expected ${expected}, received ${actual}` + ) + } +} + +/** Verify that a runtime deployment matches this SDK's source-owned artifacts. */ +export function assertOutpostArtifactCompatibility( + deployment: OutpostDeployment, + family: OutpostChainFamily +): void { + match(family) + .with(OutpostChainFamily.ethereum, () => + Object.values(EthereumContractName).forEach(contractName => + assertArtifactDigest( + deployment.ethereum.contracts[contractName].artifactSha256, + OutpostArtifactManifests.ethereum.contracts[contractName] + .artifactSha256, + `Ethereum ${contractName}` + ) + ) + ) + .with(OutpostChainFamily.solana, () => + Object.values(SolanaProgramName).forEach(programName => + assertArtifactDigest( + deployment.solana.programs[programName].artifactSha256, + OutpostArtifactManifests.solana.programs[programName].idlSha256, + `Solana ${programName}` + ) + ) + ) + .exhaustive() +} diff --git a/packages/sdk-outpost/src/artifacts/index.ts b/packages/sdk-outpost/src/artifacts/index.ts new file mode 100644 index 0000000..24b24c3 --- /dev/null +++ b/packages/sdk-outpost/src/artifacts/index.ts @@ -0,0 +1,2 @@ +export * from "./Compatibility.js" +export * from "./generated/index.js" diff --git a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPP.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPP.json deleted file mode 100644 index e82f293..0000000 --- a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPP.json +++ /dev/null @@ -1,1081 +0,0 @@ -{ - "contractName": "OPP", - "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionCatchUpPruned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "previousRetentionEpochs", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionConfigUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OPPEnvelope", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_ENVELOPE_BYTES", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "addAttestation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "allAuthorizedSenders", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "authorizedSenders", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "wireEpochIndex", - "type": "uint32" - } - ], - "name": "emitOutboundEnvelope", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tag", - "type": "uint256" - } - ], - "name": "enterSendMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tag", - "type": "uint256" - } - ], - "name": "exitSendMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getLatestOutboundEnvelope", - "outputs": [ - { - "internalType": "uint32", - "name": "epoch_", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data_", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "getOutboundEnvelope", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inSendMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_authority", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastMessageID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastMessageTimestamp", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestOutboundEnvelope", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestOutboundEpoch", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "name": "outboundEnvelopes", - "outputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outboundRetentionConfig", - "outputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingAttestationCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "pruneOutboundEnvelope", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "queuedMessageCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "sendModeTag", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "start", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "end", - "type": "tuple" - } - ], - "internalType": "struct Endpoints", - "name": "endpoints", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "messageId", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "previousMessageId", - "type": "bytes" - }, - { - "internalType": "uint32", - "name": "payloadSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "payloadChecksum", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "headerChecksum", - "type": "bytes" - } - ], - "internalType": "struct MessageHeader", - "name": "header", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "version", - "type": "uint32" - }, - { - "components": [ - { - "internalType": "AttestationType", - "name": "type_", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "dataSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AttestationEntry[]", - "name": "attestations", - "type": "tuple[]" - } - ], - "internalType": "struct MessagePayload", - "name": "payload", - "type": "tuple" - } - ], - "name": "serializeMessage", - "outputs": [ - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "start", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "end", - "type": "tuple" - } - ], - "internalType": "struct Endpoints", - "name": "endpoints", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "messageId", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "previousMessageId", - "type": "bytes" - }, - { - "internalType": "uint32", - "name": "payloadSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "payloadChecksum", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "headerChecksum", - "type": "bytes" - } - ], - "internalType": "struct MessageHeader", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "setEnvelopeRetentionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPPInbound.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPPInbound.json deleted file mode 100644 index ac08035..0000000 --- a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OPPInbound.json +++ /dev/null @@ -1,1414 +0,0 @@ -{ - "contractName": "OPPInbound", - "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "messageID", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "AttestationBlackholed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "handler", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "messageID", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "AttestationDelivered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "address", - "name": "handler", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldHandler", - "type": "address" - } - ], - "name": "AttestationHandlerSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionCatchUpPruned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "previousRetentionEpochs", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionConfigUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "EpochComplete", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "deliveryCount", - "type": "uint32" - } - ], - "name": "EpochConsensus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator_", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - } - ], - "name": "EpochDelivery", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "messageCount", - "type": "uint256" - } - ], - "name": "EpochReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newReserveManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldReserveManager", - "type": "address" - } - ], - "name": "ReserveManagerAddressSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_ENVELOPE_BYTES", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_SIG_WEIGHT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "activeGroupIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "name": "attestationHandlers", - "outputs": [ - { - "internalType": "contract IOPPReceiver", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "batchOpGroups", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "consensusReached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentEpochStartedAt", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "epochDeliveries", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "name": "epochDeliveryCount", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "epochDigestCount", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochDurationSec", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "epochIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "getInboundEnvelope", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "name": "inboundEnvelopes", - "outputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inboundRetentionConfig", - "outputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oppManager", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator_", - "type": "address" - } - ], - "name": "isActiveOperator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastMessageID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nextEpochIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "operatorEthAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppContract", - "outputs": [ - { - "internalType": "contract IOPP", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingConsensus", - "outputs": [ - { - "internalType": "uint32", - "name": "nextEpoch", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "deliveries", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "groupSize", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "currentEpochStartedAtTs", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "epochDurationSec_", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "pendingConsensusForDigest", - "outputs": [ - { - "internalType": "uint32", - "name": "nextEpoch", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "agreeing", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "groupSize", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "currentEpochStartedAtTs", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "epochDurationSec_", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingEpoch", - "outputs": [ - { - "internalType": "bytes", - "name": "envelopeHash", - "type": "bytes" - }, - { - "components": [ - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "start", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "end", - "type": "tuple" - } - ], - "internalType": "struct Endpoints", - "name": "endpoints", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "epochTimestamp", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "epochEnvelopeIndex", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingEpochHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingMessageCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "previousEpochHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "pruneInboundEnvelope", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "pubkeyAddressCache", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "reserveManagerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rosterInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "address", - "name": "handler", - "type": "address" - } - ], - "name": "setAttestationHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "setEnvelopeRetentionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "durationSec", - "type": "uint32" - } - ], - "name": "setEpochDurationSec", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "opp", - "type": "address" - } - ], - "name": "setOPPContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newReserveManager", - "type": "address" - } - ], - "name": "setReserveManagerAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OperatorRegistry.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OperatorRegistry.json deleted file mode 100644 index 9a933b2..0000000 --- a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/OperatorRegistry.json +++ /dev/null @@ -1,1657 +0,0 @@ -{ - "contractName": "OperatorRegistry", - "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "provided", - "type": "address" - } - ], - "name": "WIRE_BadContractAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "bps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBps", - "type": "uint256" - } - ], - "name": "WIRE_BasisPointsTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20DepositValueNonZero", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_EthSendFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_FeeOnTransferUnsupported", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_GoLiveInProgress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - } - ], - "name": "WIRE_InsufficientEthBalance", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_LiqEthTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_MultipleNativeTrackedCodes", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NativeDepositValueMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "actor", - "type": "address" - }, - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - } - ], - "name": "WIRE_NoBonds", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoPricesRecorded", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoYield", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_NotReceiptOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_OnlyOPPInboundLib", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OppInboundCallerUnauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OutpostChainCodeUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "innerRevert", - "type": "bytes" - } - ], - "name": "WIRE_PermitFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_PrecisionOverflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_PrecisionUnsetForRefund", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "WIRE_PriceOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - } - ], - "name": "WIRE_ReceiptNotWithdrawable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingInProgress", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingOnly", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveBadParam", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveCancelNotCreator", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveNotCancellable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapEmptyRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceNotNative", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceReserveUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_SwapSourceTokenNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapUnknownSlugName", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapZeroSourceAmount", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TokenAddressUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "provided", - "type": "uint8" - } - ], - "name": "WIRE_TokenPrecisionOutOfRange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_TokenPrecisionUnset", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TrackedCodeZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "WIRE_UnexpectedError", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ZeroAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "refundedToDepositor", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "penaltyToReserve", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "originalMessageId", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "DepositReverted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "LiqTokenCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "NativeTokenCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "OperatorDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "reserveTarget", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "OperatorSlashed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "OutpostChainCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "underwriter", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "uicBytes", - "type": "bytes" - } - ], - "name": "UnderwriteCommitRelayed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "requestId", - "type": "uint64" - } - ], - "name": "WithdrawRemitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "requestId", - "type": "uint64" - } - ], - "name": "WithdrawRequested", - "type": "event" - }, - { - "inputs": [], - "name": "DEPOSIT_REVERT_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEPOSIT_REVERT_GAS_MULTIPLIER", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR_ACTION_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OPPAttestationIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "UNDERWRITE_INTENT_COMMIT_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "__OPPEndpointManaged_init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "uicBytes", - "type": "bytes" - } - ], - "name": "commit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "compressedPubkey", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "compressedPubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositNonNative", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "depositedByCode", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSummaryAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "AttestationType", - "name": "type_", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "dataSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AttestationEntry[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_authority", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "liqToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "liqTokenCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nativeTokenCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "operators", - "outputs": [ - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "internalType": "OperatorStatus", - "name": "status", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppInboundAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outpostChainCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outpostId", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "reserveManagerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_liqToken", - "type": "address" - } - ], - "name": "setLiqToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "setLiqTokenCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "setNativeTokenCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_oppAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_oppInboundAddress", - "type": "address" - } - ], - "name": "setOPPAddresses", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "setOutpostChainCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "_outpostId", - "type": "uint64" - } - ], - "name": "setOutpostId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_reserveManager", - "type": "address" - } - ], - "name": "setReserveManagerAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "slash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "compressedPubkey", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/ReserveManager.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/ReserveManager.json deleted file mode 100644 index 6d60a0f..0000000 --- a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/ethereum/ReserveManager.json +++ /dev/null @@ -1,2456 +0,0 @@ -{ - "contractName": "ReserveManager", - "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "EnforcedPause", - "type": "error" - }, - { - "inputs": [], - "name": "ExpectedPause", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "provided", - "type": "address" - } - ], - "name": "WIRE_BadContractAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "bps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBps", - "type": "uint256" - } - ], - "name": "WIRE_BasisPointsTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20DepositValueNonZero", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_EthSendFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_FeeOnTransferUnsupported", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_GoLiveInProgress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - } - ], - "name": "WIRE_InsufficientEthBalance", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_LiqEthTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_MultipleNativeTrackedCodes", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NativeDepositValueMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "actor", - "type": "address" - }, - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - } - ], - "name": "WIRE_NoBonds", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoPricesRecorded", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoYield", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_NotReceiptOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_OnlyOPPInboundLib", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OppInboundCallerUnauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OutpostChainCodeUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "innerRevert", - "type": "bytes" - } - ], - "name": "WIRE_PermitFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_PrecisionOverflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_PrecisionUnsetForRefund", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "WIRE_PriceOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - } - ], - "name": "WIRE_ReceiptNotWithdrawable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingInProgress", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingOnly", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveBadParam", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveCancelNotCreator", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveNotCancellable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapEmptyRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceNotNative", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceReserveUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_SwapSourceTokenNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapUnknownSlugName", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapZeroSourceAmount", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TokenAddressUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "provided", - "type": "uint8" - } - ], - "name": "WIRE_TokenPrecisionOutOfRange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_TokenPrecisionUnset", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TrackedCodeZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "WIRE_UnexpectedError", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ZeroAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "BalanceSheetEmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "OutpostChainCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "ReserveActivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - } - ], - "name": "ReserveCancelRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "refundedAmount", - "type": "uint256" - } - ], - "name": "ReserveCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - } - ], - "name": "ReserveCreateRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "id", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - } - ], - "name": "SwapDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalMessageId", - "type": "bytes32" - } - ], - "name": "SwapRemitPaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "depotAmount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "SwapRemitUnpayable", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "name": "SwapRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalSwapMessageId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "errData", - "type": "bytes" - } - ], - "name": "SwapRevertError", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalSwapMessageId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "SwapReverted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "TokenAddressSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "TrackedCodesUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [], - "name": "BALANCE_SHEET_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OPPAttestationIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "RESERVE_CREATE_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RESERVE_CREATE_CANCEL_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SWAP_REQUEST_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "__OPPEndpointManaged_init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "_payRemit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "cancel_create_reserve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "bool", - "name": "isPrivate", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "creatorPubKey", - "type": "bytes" - } - ], - "name": "create_reserve", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "emitBalanceSheet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "getReserve", - "outputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "enum ReserveManager.LocalReserveStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "bool", - "name": "exists", - "type": "bool" - } - ], - "internalType": "struct ReserveManager.ReserveRecord", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSummaryAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "AttestationType", - "name": "type_", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "dataSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AttestationEntry[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_authority", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nativeTokenCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "onReserveCreateCancelled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "onReserveReady", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "depotAmount", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "originalSwapMessageId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "onSwapRevert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "oppAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppInboundAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outpostChainCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "bool", - "name": "isPrivate", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "creatorPubKey", - "type": "bytes" - } - ], - "internalType": "struct ReserveManagerLib.ReserveCreateArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "requestReserveCreateErc20WithApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "bool", - "name": "isPrivate", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "creatorPubKey", - "type": "bytes" - } - ], - "internalType": "struct ReserveManagerLib.ReserveCreateArgs", - "name": "args", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct ReserveManagerLib.PermitSig", - "name": "permitSig", - "type": "tuple" - } - ], - "name": "requestReserveCreateErc20WithPermit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "name": "requestSwap", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "internalType": "struct ReserveManagerLib.SwapArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "requestSwapErc20WithApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "internalType": "struct ReserveManagerLib.SwapArgs", - "name": "args", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct ReserveManagerLib.PermitSig", - "name": "permitSig", - "type": "tuple" - } - ], - "name": "requestSwapErc20WithPermit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "reserves", - "outputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "enum ReserveManager.LocalReserveStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "bool", - "name": "exists", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_oppAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_oppInboundAddress", - "type": "address" - } - ], - "name": "setOPPAddresses", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "setOutpostChainCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "address", - "name": "tokenAddr", - "type": "address" - }, - { - "internalType": "uint8", - "name": "precision", - "type": "uint8" - } - ], - "internalType": "struct ReserveManager.TrackedCodeEntry[]", - "name": "entries", - "type": "tuple[]" - } - ], - "name": "setTrackedCodes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "swapDepositCounter", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "tokenAddressesByCode", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "tokenPrecisionByCode", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "trackedCodesCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "trackedReserveCodes", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "trackedTokenCodes", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana/liqsol_core.json b/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana/liqsol_core.json deleted file mode 100644 index 0e01656..0000000 --- a/packages/sdk-outpost/src/assets/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509/solana/liqsol_core.json +++ /dev/null @@ -1,10161 +0,0 @@ -{ - "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - "metadata": { - "name": "liqsol_core", - "version": "0.1.0", - "spec": "0.1.0", - "description": "Created with Anchor" - }, - "instructions": [ - { - "name": "add_attestation", - "discriminator": [ - 206, - 82, - 129, - 170, - 54, - 159, - 161, - 156 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "outbound_message_buffer", - "writable": true - } - ], - "args": [ - { - "name": "attestation_type", - "type": "i32" - }, - { - "name": "data", - "type": "bytes" - } - ] - }, - { - "name": "add_top_performers_batch", - "docs": [ - "Process batch of ranks for addition (top performers from leaderboard)" - ], - "discriminator": [ - 152, - 7, - 241, - 69, - 197, - 73, - 32, - 12 - ], - "accounts": [ - { - "name": "allocation_state", - "writable": true - }, - { - "name": "active_list", - "writable": true - }, - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "leaderboard_state" - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for threshold parameters" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "admin_force_unbond_role", - "discriminator": [ - 80, - 107, - 27, - 49, - 126, - 25, - 31, - 238 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state" - }, - { - "name": "user", - "docs": [ - "The user whose role bond is being force-unbonded" - ] - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "aggregate_stake_metrics", - "docs": [ - "V2: Aggregate stake metrics across all validators using PDA architecture" - ], - "discriminator": [ - 13, - 245, - 47, - 202, - 170, - 73, - 98, - 207 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list" - } - ], - "args": [] - }, - { - "name": "bond_role", - "discriminator": [ - 143, - 136, - 20, - 230, - 136, - 103, - 107, - 167 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state" - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "calculate_unstake_allocations", - "docs": [ - "Calculate unstake allocations across validators (batched, up to 10 per call)", - "Distributes the FROZEN processing amount proportionally based on active stake", - "Call this after accumulating requests via accumulate_unstake_request" - ], - "discriminator": [ - 156, - 232, - 48, - 116, - 107, - 60, - 136, - 140 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - to track unstake allocation batching" - ], - "writable": true - }, - { - "name": "stake_metrics", - "docs": [ - "Stake metrics - to validate total unstake amount is available" - ] - }, - { - "name": "active_list", - "docs": [ - "Active validator list - to verify validators are in active list" - ] - }, - { - "name": "maintenance_ledger", - "docs": [ - "Maintenance ledger - to track last unstake allocation epoch" - ], - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - } - ], - "args": [] - }, - { - "name": "calculate_validator_allocations", - "discriminator": [ - 48, - 217, - 8, - 168, - 228, - 221, - 140, - 112 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - to track rebalancing progress" - ], - "writable": true - }, - { - "name": "stake_metrics", - "docs": [ - "Stake metrics - to get current total active stake" - ] - }, - { - "name": "active_list", - "docs": [ - "Active validator list - to verify validators are in active list" - ] - }, - { - "name": "reserve_pool", - "docs": [ - "Reserve pool - to read current balance" - ], - "writable": true - }, - { - "name": "maintenance_ledger", - "docs": [ - "Maintenance ledger - to track last rebalance epoch" - ], - "writable": true - }, - { - "name": "clock" - }, - { - "name": "global", - "docs": [ - "Global withdraw operator state - to read total_encumbered_funds" - ] - }, - { - "name": "global_config", - "docs": [ - "Global config for rebalancing thresholds" - ] - } - ], - "args": [] - }, - { - "name": "cancel_create_reserve", - "discriminator": [ - 218, - 158, - 127, - 156, - 61, - 162, - 19, - 255 - ], - "accounts": [ - { - "name": "creator", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve" - }, - { - "name": "outbound_message_buffer", - "writable": true - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - } - ] - }, - { - "name": "claim_rewards", - "discriminator": [ - 4, - 144, - 132, - 71, - 116, - 23, - 151, - 80 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_mint" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account holding liqSOL" - ], - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "claim_withdraw", - "docs": [ - "Pay user (stub) and close/burn the receipt via CPI to nft_factory." - ], - "discriminator": [ - 232, - 89, - 154, - 117, - 16, - 204, - 182, - 224 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global", - "docs": [ - "Global operator state" - ], - "writable": true - }, - { - "name": "mint_authority" - }, - { - "name": "receipt_data", - "writable": true - }, - { - "name": "mint_account", - "writable": true - }, - { - "name": "owner_ata", - "writable": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "global_config", - "docs": [ - "Global config for claim_withdrawals_enabled check" - ] - }, - { - "name": "token_program" - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "associated_token_program" - } - ], - "args": [] - }, - { - "name": "cleanup_envelope_chunks", - "discriminator": [ - 224, - 118, - 156, - 99, - 9, - 136, - 14, - 207 - ], - "accounts": [ - { - "name": "reaper", - "signer": true - }, - { - "name": "config" - }, - { - "name": "latest_outbound_envelope" - }, - { - "name": "chunk_buffer", - "writable": true - }, - { - "name": "uploader", - "writable": true - } - ], - "args": [ - { - "name": "epoch_index", - "type": "u32" - } - ] - }, - { - "name": "cleanup_graveyard_batch", - "docs": [ - "Cleanup graveyard validators batch: remove validators that have been NotDelegated for > 10 epochs", - "This function should be called after aggregate_stake_metrics.", - "Validators meeting the cleanup criteria will have their PDAs closed and rent returned to admin." - ], - "discriminator": [ - 241, - 120, - 180, - 4, - 160, - 109, - 206, - 71 - ], - "accounts": [ - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "global_config" - }, - { - "name": "clock" - }, - { - "name": "cranky", - "writable": true, - "signer": true - } - ], - "args": [] - }, - { - "name": "commit_underwrite", - "discriminator": [ - 88, - 172, - 141, - 118, - 9, - 74, - 188, - 117 - ], - "accounts": [ - { - "name": "underwriter", - "writable": true, - "signer": true - }, - { - "name": "operator_registry" - }, - { - "name": "outbound_message_buffer", - "writable": true - } - ], - "args": [ - { - "name": "uic_bytes", - "type": "bytes" - } - ] - }, - { - "name": "complete_unbond_role", - "discriminator": [ - 204, - 50, - 36, - 17, - 192, - 156, - 246, - 64 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state" - }, - { - "name": "user", - "docs": [ - "The user whose unbond is being completed" - ] - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "complete_withdraw", - "discriminator": [ - 172, - 129, - 141, - 17, - 95, - 253, - 251, - 98 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "user", - "writable": true - }, - { - "name": "outpost_account", - "writable": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "user_key", - "type": "pubkey" - }, - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "conclude_merge_activating", - "docs": [ - "Conclude merge activating - marks merge complete if all validators processed or 0 validators" - ], - "discriminator": [ - 207, - 32, - 222, - 98, - 243, - 188, - 38, - 67 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "graveyard_list" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "conclude_merge_deactivating", - "docs": [ - "Conclude merge deactivating - marks merge complete if all validators processed or 0 validators" - ], - "discriminator": [ - 66, - 206, - 43, - 71, - 122, - 97, - 33, - 24 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "withdraw_global", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "graveyard_list" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "conclude_sync_stakes", - "docs": [ - "Conclude sync stakes - marks sync complete if all validators processed or 0 validators" - ], - "discriminator": [ - 77, - 127, - 231, - 78, - 151, - 23, - 237, - 207 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "graveyard_list" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "create_reserve", - "discriminator": [ - 26, - 161, - 211, - 19, - 90, - 218, - 112, - 235 - ], - "accounts": [ - { - "name": "creator", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "reserve_vault", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "creator_ata", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "description", - "type": "string" - }, - { - "name": "is_private", - "type": "bool" - } - ] - }, - { - "name": "create_reserve_native", - "discriminator": [ - 124, - 173, - 189, - 251, - 64, - 230, - 215, - 6 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "description", - "type": "string" - } - ] - }, - { - "name": "create_reserve_spl_authority", - "discriminator": [ - 168, - 158, - 192, - 109, - 179, - 81, - 156, - 173 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "reserve_vault", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "authority_ata", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "description", - "type": "string" - } - ] - }, - { - "name": "deposit", - "discriminator": [ - 242, - 35, - 198, - 137, - 82, - 225, - 242, - 182 - ], - "accounts": [ - { - "name": "depositor", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "operator_type", - "type": "u32" - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "deposit_non_native", - "discriminator": [ - 75, - 182, - 44, - 132, - 167, - 101, - 31, - 138 - ], - "accounts": [ - { - "name": "depositor", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "depositor_ata", - "writable": true - }, - { - "name": "collateral_vault", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "chain_code", - "type": "u64" - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "operator_type", - "type": "u32" - }, - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "deposit_to_reserve", - "discriminator": [ - 8, - 79, - 123, - 129, - 146, - 140, - 178, - 128 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "depositor", - "writable": true, - "signer": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "ephemeral_stake", - "writable": true - }, - { - "name": "controller_state" - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - }, - { - "name": "seed", - "type": "u32" - } - ] - }, - { - "name": "desynd", - "discriminator": [ - 12, - 71, - 102, - 46, - 8, - 179, - 29, - 190 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "outpost_account", - "docs": [ - "User's outpost account" - ], - "writable": true - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "discard_envelope_chunks", - "discriminator": [ - 180, - 10, - 216, - 16, - 101, - 165, - 10, - 70 - ], - "accounts": [ - { - "name": "uploader", - "docs": [ - "The operator that uploaded (and rent-paid) the buffer. Authorization is", - "structural: the buffer PDA's third seed is this signer's key, so the", - "account constraint can only ever resolve the signer's OWN buffer —", - "no other operator's in-flight upload is reachable from here." - ], - "writable": true, - "signer": true - }, - { - "name": "chunk_buffer", - "writable": true - } - ], - "args": [ - { - "name": "epoch_index", - "type": "u32" - } - ] - }, - { - "name": "emit_outbound_envelope", - "discriminator": [ - 142, - 109, - 163, - 152, - 3, - 80, - 224, - 157 - ], - "accounts": [ - { - "name": "authority", - "docs": [ - "The outpost authority. The standalone emit is a recovery escape hatch", - "only — an open signer here could advance the outbound chain tip to a", - "digest the depot never accepted, so it is gated exactly like the other", - "admin instructions. Even the authority is bound by the guards in", - "`emit_outbound_inner`: the emitted epoch must be exactly the next", - "outbound slot AND already accepted by the inbound cursor, so a", - "recovery emit can only fill an accepted-but-unemitted gap and can", - "never preempt a pending epoch's consensus-triggered emit." - ], - "writable": true, - "signer": true - }, - { - "name": "config", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "outbound_envelopes", - "writable": true - }, - { - "name": "latest_outbound_envelope", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "wire_epoch_index", - "type": "u32" - } - ] - }, - { - "name": "epoch_in", - "discriminator": [ - 85, - 70, - 55, - 132, - 50, - 198, - 135, - 115 - ], - "accounts": [ - { - "name": "operator", - "writable": true, - "signer": true - }, - { - "name": "config", - "writable": true - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "epoch_deliveries", - "writable": true - }, - { - "name": "chunk_buffer", - "writable": true - }, - { - "name": "inbound_envelopes", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "outbound_envelopes", - "writable": true - }, - { - "name": "latest_outbound_envelope", - "writable": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "reserve_aggregate", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "chunk_index", - "type": "u16" - }, - { - "name": "total_chunks", - "type": "u16" - }, - { - "name": "total_bytes", - "type": "u32" - }, - { - "name": "chunk_data", - "type": "bytes" - } - ] - }, - { - "name": "finalize_outpost_account", - "discriminator": [ - 181, - 14, - 39, - 201, - 210, - 148, - 241, - 187 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "pool_authority" - }, - { - "name": "outpost_account", - "writable": true - }, - { - "name": "pretoken_purchase_history" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "get_min_max_resolved_epoch_deactivations", - "docs": [ - "Get minimum max_resolved_epoch_deactivations from MaintenanceLedger", - "This is designed to be called via CPI from other programs" - ], - "discriminator": [ - 171, - 169, - 39, - 207, - 181, - 67, - 86, - 73 - ], - "accounts": [ - { - "name": "epoch_state" - } - ], - "args": [], - "returns": "u16" - }, - { - "name": "has_role", - "discriminator": [ - 218, - 136, - 44, - 87, - 142, - 247, - 141, - 195 - ], - "accounts": [ - { - "name": "user", - "docs": [ - "User whose role status is being checked." - ] - }, - { - "name": "outpost_account" - }, - { - "name": "global_state" - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ], - "returns": "bool" - }, - { - "name": "init_bucket", - "docs": [ - "Done///" - ], - "discriminator": [ - 237, - 69, - 61, - 218, - 18, - 60, - 21, - 236 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "liqsol_mint" - }, - { - "name": "system_program" - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - } - ], - "args": [] - }, - { - "name": "init_reserve", - "discriminator": [ - 138, - 245, - 71, - 225, - 153, - 4, - 3, - 43 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve_aggregate", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "init_tranche_state", - "discriminator": [ - 87, - 134, - 47, - 11, - 241, - 14, - 118, - 201 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "chainlink_feed" - }, - { - "name": "chainlink_program" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "init_wire_config", - "discriminator": [ - 109, - 159, - 158, - 174, - 192, - 150, - 14, - 34 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize", - "discriminator": [ - 175, - 175, - 109, - 31, - 13, - 152, - 155, - 237 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint" - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "pool_authority" - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [] - }, - { - "name": "initialize_active_list", - "docs": [ - "Initialize the active validator list (zero-copy)" - ], - "discriminator": [ - 222, - 123, - 57, - 119, - 223, - 4, - 150, - 36 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "active_list", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_epoch_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 139, - 122, - 53, - 254, - 85, - 205, - 138, - 245 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_global_config", - "discriminator": [ - 113, - 216, - 122, - 131, - 225, - 209, - 22, - 55 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "program" - }, - { - "name": "program_data" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_graveyard_list", - "docs": [ - "Initialize the graveyard validator list (zero-copy)" - ], - "discriminator": [ - 178, - 8, - 179, - 111, - 75, - 19, - 130, - 176 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_outpost", - "discriminator": [ - 9, - 54, - 169, - 104, - 32, - 218, - 81, - 11 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "config", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "inbound_envelopes", - "writable": true - }, - { - "name": "outbound_envelopes", - "writable": true - }, - { - "name": "latest_outbound_envelope", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "chain_code", - "type": "u64" - } - ] - }, - { - "name": "initialize_pay_rate_history", - "docs": [ - "Done///" - ], - "discriminator": [ - 157, - 190, - 74, - 135, - 91, - 232, - 250, - 122 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "pay_rate_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_payout_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 105, - 120, - 7, - 121, - 238, - 221, - 62, - 160 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "payout_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_pretoken_purchase_history", - "docs": [ - "Admin-only: initialize PretokenPurchaseHistory PDA for a pool" - ], - "discriminator": [ - 140, - 166, - 196, - 128, - 189, - 240, - 159, - 1 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "pool_pretoken_record", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_processing_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 228, - 202, - 164, - 194, - 29, - 134, - 125, - 242 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_reserve_pool", - "docs": [ - "Done///" - ], - "discriminator": [ - 4, - 7, - 171, - 131, - 156, - 172, - 150, - 220 - ], - "accounts": [ - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "controller_state", - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [] - }, - { - "name": "initialize_stake_allocation_state", - "discriminator": [ - 159, - 99, - 175, - 136, - 251, - 241, - 88, - 82 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "writable": true - }, - { - "name": "clock" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_stake_controller_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 220, - 247, - 13, - 165, - 202, - 250, - 102, - 197 - ], - "accounts": [ - { - "name": "controller_state", - "writable": true - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_stake_metrics", - "docs": [ - "Done///" - ], - "discriminator": [ - 203, - 209, - 129, - 123, - 12, - 17, - 20, - 175 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_vault", - "docs": [ - "Done///" - ], - "discriminator": [ - 48, - 191, - 163, - 44, - 71, - 129, - 63, - 164 - ], - "accounts": [ - { - "name": "vault", - "writable": true - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "controller_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_withdraw_global", - "discriminator": [ - 110, - 0, - 210, - 101, - 59, - 75, - 224, - 158 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "docs": [ - "liqSOL Token-2022 mint" - ] - }, - { - "name": "global", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [] - }, - { - "name": "initialize_withdraw_metadata", - "discriminator": [ - 0, - 170, - 135, - 3, - 35, - 58, - 213, - 75 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "metadata", - "writable": true - }, - { - "name": "global_config" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "args", - "type": { - "defined": { - "name": "MetadataArgs" - } - } - } - ] - }, - { - "name": "merge_activating_stakes", - "docs": [ - "V2: Merge activating transient stakes using PDA architecture", - "Returns the number of epochs successfully merged" - ], - "discriminator": [ - 181, - 183, - 76, - 92, - 57, - 11, - 212, - 189 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "treasury", - "docs": [ - "(treasury funded it at creation), closing the rent loop within the protocol." - ], - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validators list (zero-copy)" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validators list (zero-copy) - needed to check validators in cooldown" - ] - }, - { - "name": "validator_info", - "docs": [ - "Validator info PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "validator_transient", - "docs": [ - "Validator transient tracking PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - } - ], - "args": [ - { - "name": "vote_account", - "type": "pubkey" - } - ], - "returns": "u16" - }, - { - "name": "merge_deactivated_stakes", - "docs": [ - "V2: Merge fully deactivated stakes back to reserve" - ], - "discriminator": [ - 160, - 255, - 180, - 104, - 216, - 98, - 248, - 73 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "cranky", - "signer": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validators list (zero-copy)" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validators list (zero-copy) - needed to check validators in cooldown" - ] - }, - { - "name": "validator_info", - "docs": [ - "Validator info PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "validator_transient", - "docs": [ - "Validator transient tracking PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "withdraw_global", - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "reserve_pool", - "docs": [ - "(principal stays). The merged-in rent is then withdrawn to treasury." - ], - "writable": true - }, - { - "name": "treasury", - "docs": [ - "back from reserve, closing the rent loop (treasury funded it at creation)." - ], - "writable": true - } - ], - "args": [ - { - "name": "vote_account", - "type": "pubkey" - } - ] - }, - { - "name": "migrate_batch_orchestrator", - "docs": [ - "One-shot migration: realloc BatchOrchestrator for the four per-op", - "`*_started_epoch: u16` fields + restored `_reserved` buffer.", - "Idempotent, ungated. `payer` covers the rent delta." - ], - "discriminator": [ - 130, - 240, - 40, - 175, - 53, - 209, - 232, - 11 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "batch_orchestrator", - "docs": [ - "is the only authorization needed; the op is idempotent." - ], - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "migrate_batch_orchestrator_v1_6", - "docs": [ - "One-shot migration: stamp BatchOrchestrator's v1.6.0 epoch pins", - "(unstake_started_epoch + cursors_epoch) to the current epoch so a", - "mid-epoch upgrade doesn't wipe live cursors. Admin-gated, idempotent", - "within an epoch; refuses re-runs after an epoch boundary (a late", - "re-stamp would bless dead cursors as live)." - ], - "discriminator": [ - 124, - 12, - 96, - 155, - 218, - 4, - 229, - 56 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "batch_orchestrator", - "writable": true - } - ], - "args": [] - }, - { - "name": "migrate_stake_allocation_state", - "docs": [ - "One-shot migration: explicitly zero StakeAllocationState.rebalance_started_epoch", - "(repurposed from the deprecated addition_target_rank slot). Admin-gated, idempotent." - ], - "discriminator": [ - 40, - 175, - 21, - 85, - 88, - 249, - 223, - 73 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "writable": true - } - ], - "args": [] - }, - { - "name": "migrate_stake_metrics", - "docs": [ - "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)" - ], - "discriminator": [ - 183, - 154, - 168, - 221, - 78, - 179, - 112, - 165 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "migrate_user_record", - "discriminator": [ - 6, - 118, - 249, - 178, - 209, - 106, - 197, - 25 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "user_ata" - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "migrate_validator_info_batch", - "docs": [ - "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)", - "Pass validator_info PDAs via remaining_accounts" - ], - "discriminator": [ - 250, - 77, - 53, - 116, - 38, - 22, - 12, - 100 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "process_graveyard_validators_batch", - "docs": [ - "Process graveyard validators batch: check transient resolution, queue main stake deactivation", - "Validators in graveyard with resolved transients will have their main stake queued for deactivation" - ], - "discriminator": [ - 141, - 178, - 8, - 118, - 133, - 183, - 86, - 233 - ], - "accounts": [ - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "clock" - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "process_pay_cycle", - "docs": [ - "Done///" - ], - "discriminator": [ - 98, - 183, - 240, - 247, - 39, - 248, - 198, - 224 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "payout_state", - "writable": true - }, - { - "name": "pay_rate_history", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "stake_controller_authority", - "writable": true - }, - { - "name": "mint_authority" - }, - { - "name": "liqsol_program" - }, - { - "name": "token_program" - }, - { - "name": "instructions" - }, - { - "name": "global_config", - "docs": [ - "Global config for process_pay_cycle_enabled check" - ] - } - ], - "args": [] - }, - { - "name": "process_stake_orders", - "docs": [ - "V2: Process stake orders using PDA architecture with pre-calculated allocations", - "Validators must be sent contiguously from the active list starting at validators_processed_this_epoch" - ], - "discriminator": [ - 92, - 161, - 223, - 219, - 54, - 232, - 40, - 16 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "treasury", - "docs": [ - "(system transfer, treasury signs). Falls back to admin only if treasury is dry." - ], - "writable": true - }, - { - "name": "vault" - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validator list - used to get total validator count" - ] - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - to verify allocations have been calculated for current epoch" - ], - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "stake_config" - }, - { - "name": "rent" - }, - { - "name": "global_config", - "docs": [ - "Global config for process_stake_orders_enabled check" - ] - } - ], - "args": [ - { - "name": "caller_funds_rent", - "type": "bool" - } - ] - }, - { - "name": "process_transfer_hook", - "discriminator": [ - 167, - 45, - 151, - 64, - 209, - 186, - 192, - 78 - ], - "accounts": [ - { - "name": "source_token" - }, - { - "name": "destination_token" - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_token_account" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "process_unstake_orders", - "docs": [ - "V2: Process unstake orders by splitting and deactivating stakes", - "Validators must be sent contiguously: first from active list, then graveyard list" - ], - "discriminator": [ - 44, - 122, - 251, - 185, - 253, - 193, - 250, - 191 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "treasury", - "docs": [ - "here (system transfer, treasury signs). Falls back to admin only if dry.", - "Reserve no longer sources rent, so it's not needed by this instruction." - ], - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validator list - used to get total validator count" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validator list - allows unstaking from graveyard validators" - ] - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "stake_config" - }, - { - "name": "rent" - }, - { - "name": "system_program" - }, - { - "name": "stake_program" - }, - { - "name": "global_config", - "docs": [ - "Global config for process_unstake_orders_enabled check" - ] - } - ], - "args": [ - { - "name": "caller_funds_rent", - "type": "bool" - } - ] - }, - { - "name": "purchase", - "discriminator": [ - 21, - 93, - 113, - 154, - 193, - 160, - 242, - 168 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "buyer_ata", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "outpost_account", - "docs": [ - "User's pretoken deposit record" - ], - "writable": true - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "user_pretoken_record", - "writable": true - }, - { - "name": "chainlink_feed" - }, - { - "name": "chainlink_program" - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - }, - { - "name": "pretoken_purchase_history", - "writable": true - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "purchase_from_yield", - "discriminator": [ - 232, - 143, - 47, - 77, - 246, - 113, - 31, - 202 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "liqsol_mint" - }, - { - "name": "pool_authority", - "docs": [ - "Pool authority PDA" - ] - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "liqsol_pool_ata", - "docs": [ - "Pool's liqSOL ATA - deterministically derived from pool_authority + liqsol_mint" - ], - "writable": true - }, - { - "name": "liqsol_pool_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "pool_pretoken_record", - "writable": true - }, - { - "name": "chainlink_feed" - }, - { - "name": "chainlink_program" - }, - { - "name": "pretoken_purchase_history", - "writable": true - } - ], - "args": [] - }, - { - "name": "record_price", - "discriminator": [ - 210, - 113, - 46, - 101, - 107, - 218, - 83, - 51 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "tranche_state" - }, - { - "name": "price_history", - "writable": true - }, - { - "name": "chainlink_program" - }, - { - "name": "chainlink_feed" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "refresh_stake_metrics_post_late_epoch", - "docs": [ - "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)", - "Requires Distribution + UnstakeOrder as prerequisites", - "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch" - ], - "discriminator": [ - 11, - 226, - 87, - 114, - 47, - 159, - 99, - 157 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - } - ], - "args": [] - }, - { - "name": "refresh_stake_metrics_post_sync", - "docs": [ - "V2: Refresh stake metrics after removal selection + PDA setup", - "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites", - "Tracks completion in last_post_sync_stake_metrics_refresh_epoch" - ], - "discriminator": [ - 177, - 250, - 32, - 155, - 196, - 199, - 199, - 249 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - } - ], - "args": [] - }, - { - "name": "refund", - "discriminator": [ - 2, - 96, - 183, - 251, - 63, - 208, - 46, - 46 - ], - "accounts": [ - { - "name": "associated_token_program" - }, - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "outpost_account", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "refund_liqsol_ata", - "writable": true - }, - { - "name": "liqsol_pool_user_record", - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_mint" - }, - { - "name": "token_program" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "register_system_pda", - "discriminator": [ - 110, - 93, - 36, - 156, - 179, - 69, - 54, - 210 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "pda_owner", - "docs": [ - "The PDA whose user record we're creating — must be system-owned (no program data)." - ] - }, - { - "name": "pda_ata" - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account holding liqSOL (for index sync)" - ], - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "register_user", - "discriminator": [ - 2, - 241, - 150, - 223, - 99, - 214, - 116, - 97 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "user_ata" - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account holding liqSOL (for index sync)" - ], - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "remove_low_performers_batch", - "docs": [ - "Process batch of validators for removal (below exit threshold)" - ], - "discriminator": [ - 91, - 142, - 166, - 98, - 245, - 245, - 159, - 44 - ], - "accounts": [ - { - "name": "active_list", - "writable": true - }, - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "allocation_state" - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "request_swap", - "discriminator": [ - 170, - 167, - 97, - 14, - 88, - 175, - 39, - 108 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "source_token_code", - "type": "u64" - }, - { - "name": "source_reserve_code", - "type": "u64" - }, - { - "name": "source_amount", - "type": "u64" - }, - { - "name": "target_chain_code", - "type": "u64" - }, - { - "name": "target_token_code", - "type": "u64" - }, - { - "name": "target_reserve_code", - "type": "u64" - }, - { - "name": "target_recipient", - "type": "bytes" - }, - { - "name": "target_amount", - "type": "u64" - }, - { - "name": "target_tolerance_bps", - "type": "u32" - } - ] - }, - { - "name": "request_swap_spl", - "discriminator": [ - 119, - 83, - 153, - 185, - 164, - 202, - 45, - 38 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "reserve_vault", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "token_program" - } - ], - "args": [ - { - "name": "source_token_code", - "type": "u64" - }, - { - "name": "source_reserve_code", - "type": "u64" - }, - { - "name": "source_amount", - "type": "u64" - }, - { - "name": "target_chain_code", - "type": "u64" - }, - { - "name": "target_token_code", - "type": "u64" - }, - { - "name": "target_reserve_code", - "type": "u64" - }, - { - "name": "target_recipient", - "type": "bytes" - }, - { - "name": "target_amount", - "type": "u64" - }, - { - "name": "target_tolerance_bps", - "type": "u32" - } - ] - }, - { - "name": "request_unbond_role", - "discriminator": [ - 223, - 225, - 84, - 83, - 115, - 183, - 80, - 33 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state" - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "request_withdraw", - "discriminator": [ - 137, - 95, - 187, - 96, - 250, - 138, - 31, - 182 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "owner", - "docs": [ - "Recipient of the NFT receipt (can be user)" - ], - "writable": true - }, - { - "name": "global", - "docs": [ - "Global operator state" - ], - "writable": true - }, - { - "name": "liqsol_mint", - "docs": [ - "liqSOL mint reference (must match Global.liqsol_mint so we can read decimals)" - ], - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "docs": [ - "Distribution state for index tracking" - ], - "writable": true - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's token account holding liqSOL (for sync_index balance)" - ], - "writable": true - }, - { - "name": "reserve_pool", - "docs": [ - "Reserve pool - to check available balance for instant withdrawals" - ], - "writable": true - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - for accumulate_unstake_request" - ], - "writable": true - }, - { - "name": "stake_metrics", - "docs": [ - "Stake metrics - for accumulate_unstake_request" - ] - }, - { - "name": "maintenance_ledger", - "docs": [ - "Maintenance ledger - for accumulate_unstake_request" - ] - }, - { - "name": "global_config", - "docs": [ - "Global config for min_unstake_request setting" - ] - }, - { - "name": "clock" - }, - { - "name": "mint_authority" - }, - { - "name": "receipt_data", - "writable": true - }, - { - "name": "metadata", - "writable": true - }, - { - "name": "nft_mint", - "docs": [ - "Uses global.next_receipt_id for deterministic, collision-free address generation" - ], - "writable": true - }, - { - "name": "nft_ata", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "token_interface" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "set_admin", - "discriminator": [ - 251, - 163, - 0, - 52, - 91, - 194, - 187, - 92 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - }, - { - "name": "new_authority" - } - ], - "args": [] - }, - { - "name": "set_cranky", - "discriminator": [ - 232, - 48, - 178, - 74, - 194, - 60, - 143, - 164 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - }, - { - "name": "new_authority" - } - ], - "args": [] - }, - { - "name": "set_paused", - "discriminator": [ - 91, - 60, - 125, - 192, - 176, - 225, - 166, - 218 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "paused", - "type": "bool" - } - ] - }, - { - "name": "set_retention_config", - "discriminator": [ - 224, - 115, - 230, - 164, - 16, - 100, - 30, - 234 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config", - "writable": true - } - ], - "args": [ - { - "name": "retention_epochs", - "type": "u32" - } - ] - }, - { - "name": "set_role_principal", - "discriminator": [ - 33, - 199, - 203, - 50, - 60, - 167, - 90, - 92 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - }, - { - "name": "principal", - "type": "u64" - } - ] - }, - { - "name": "set_role_warmup_duration", - "discriminator": [ - 229, - 188, - 179, - 162, - 56, - 173, - 228, - 68 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "duration_seconds", - "type": "i64" - } - ] - }, - { - "name": "set_token_address", - "discriminator": [ - 231, - 130, - 7, - 149, - 155, - 155, - 110, - 53 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config", - "writable": true - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "mint", - "type": "pubkey" - } - ] - }, - { - "name": "set_token_precision", - "discriminator": [ - 202, - 218, - 56, - 157, - 228, - 15, - 175, - 107 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config", - "writable": true - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "decimals", - "type": "u8" - } - ] - }, - { - "name": "set_wire_state", - "discriminator": [ - 62, - 194, - 254, - 126, - 251, - 69, - 35, - 228 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "wire_state", - "type": { - "defined": { - "name": "WireState" - } - } - } - ] - }, - { - "name": "setup_validator_pdas_batch", - "discriminator": [ - 115, - 37, - 9, - 246, - 144, - 224, - 178, - 79 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "active_list", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "allocation_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "system_program", - "docs": [ - "Needed for manual PDA creation" - ] - } - ], - "args": [] - }, - { - "name": "slash_bond", - "discriminator": [ - 143, - 246, - 51, - 243, - 88, - 198, - 217, - 48 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "user", - "docs": [ - "The user being slashed" - ] - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [] - }, - { - "name": "sol_to_liqsol", - "discriminator": [ - 250, - 110, - 1, - 100, - 71, - 3, - 235, - 113 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "deposit_authority", - "writable": true - }, - { - "name": "system_program" - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "liqsol_program" - }, - { - "name": "pay_rate_history" - }, - { - "name": "stake_program" - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "liqsol_mint_authority" - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "ephemeral_stake", - "writable": true - }, - { - "name": "controller_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for deposit settings" - ] - }, - { - "name": "payout_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account" - ], - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "instructions_sysvar" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - }, - { - "name": "seed", - "type": "u32" - } - ] - }, - { - "name": "sync_active_scores", - "discriminator": [ - 38, - 188, - 30, - 93, - 139, - 1, - 140, - 168 - ], - "accounts": [ - { - "name": "active_list", - "writable": true - }, - { - "name": "leaderboard_state" - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "sync_leaderboard_scores_batch", - "docs": [ - "region: Validator Leaderboard Syncing" - ], - "discriminator": [ - 52, - 11, - 210, - 173, - 90, - 5, - 48, - 50 - ], - "accounts": [ - { - "name": "leaderboard_state" - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "sync_main_stake_accounts", - "docs": [ - "V2: Sync main stake accounts using PDA architecture (batched)", - "Processes validators in batches via remaining_accounts (batch size is enforced client-side)", - "Note: Only syncs primary delegated stakes, not transient stakes" - ], - "discriminator": [ - 159, - 17, - 201, - 39, - 89, - 62, - 65, - 135 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "docs": [ - "Processing state for tracking batch progress" - ], - "writable": true - }, - { - "name": "epoch_state", - "docs": [ - "Epoch state to mark completion" - ], - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validator list - to check validator counts and membership" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validator list - graveyard validators also need syncing for merge operations" - ] - }, - { - "name": "stake_history" - }, - { - "name": "vault", - "writable": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "sync_validator_selection_thresholds", - "docs": [ - "Calculate and store entry/exit thresholds from validator leaderboard" - ], - "discriminator": [ - 102, - 171, - 32, - 136, - 205, - 105, - 208, - 225 - ], - "accounts": [ - { - "name": "leaderboard_state" - }, - { - "name": "allocation_state", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for min_vpp_entry and min_vpp_exit" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "synd", - "discriminator": [ - 153, - 175, - 231, - 40, - 44, - 65, - 175, - 172 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "outpost_account", - "docs": [ - "User's pretoken deposit record" - ], - "writable": true - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "update_config_bool", - "discriminator": [ - 79, - 36, - 65, - 239, - 188, - 35, - 13, - 160 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyBool" - } - } - }, - { - "name": "value", - "type": "bool" - } - ] - }, - { - "name": "update_config_u16", - "discriminator": [ - 149, - 9, - 244, - 25, - 46, - 136, - 59, - 173 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyU16" - } - } - }, - { - "name": "value", - "type": "u16" - } - ] - }, - { - "name": "update_config_u64", - "discriminator": [ - 120, - 43, - 124, - 106, - 97, - 80, - 208, - 123 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyU64" - } - } - }, - { - "name": "value", - "type": "u64" - } - ] - }, - { - "name": "update_config_u8", - "discriminator": [ - 17, - 160, - 31, - 134, - 222, - 250, - 229, - 253 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyU8" - } - } - }, - { - "name": "value", - "type": "u8" - } - ] - }, - { - "name": "update_growth_parameters", - "discriminator": [ - 172, - 187, - 237, - 233, - 250, - 160, - 115, - 239 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "price_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "supply_growth_bps", - "type": "u16" - }, - { - "name": "price_growth_cents", - "type": "u16" - } - ] - }, - { - "name": "update_price_bounds", - "discriminator": [ - 241, - 116, - 141, - 65, - 61, - 95, - 232, - 28 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "price_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "min_price_usd", - "type": "u64" - }, - { - "name": "max_price_usd", - "type": "u64" - }, - { - "name": "max_staleness_seconds", - "type": "i64" - } - ] - } - ], - "accounts": [ - { - "name": "BatchOrchestrator", - "discriminator": [ - 70, - 163, - 206, - 225, - 7, - 189, - 73, - 94 - ] - }, - { - "name": "DistributionState", - "discriminator": [ - 7, - 25, - 94, - 15, - 208, - 170, - 4, - 103 - ] - }, - { - "name": "EnvelopeChunks", - "discriminator": [ - 51, - 126, - 62, - 161, - 85, - 175, - 66, - 63 - ] - }, - { - "name": "EnvelopeLog", - "discriminator": [ - 73, - 107, - 128, - 29, - 76, - 210, - 155, - 113 - ] - }, - { - "name": "EpochDeliveries", - "discriminator": [ - 134, - 83, - 77, - 28, - 26, - 189, - 174, - 190 - ] - }, - { - "name": "Global", - "discriminator": [ - 167, - 232, - 232, - 177, - 200, - 108, - 114, - 127 - ] - }, - { - "name": "GlobalConfig", - "discriminator": [ - 149, - 8, - 156, - 202, - 160, - 252, - 176, - 217 - ] - }, - { - "name": "GlobalState", - "discriminator": [ - 163, - 46, - 74, - 168, - 216, - 123, - 133, - 98 - ] - }, - { - "name": "LatestOutboundEnvelope", - "discriminator": [ - 74, - 80, - 163, - 159, - 178, - 236, - 249, - 15 - ] - }, - { - "name": "LeaderboardState", - "discriminator": [ - 211, - 181, - 29, - 120, - 189, - 4, - 106, - 111 - ] - }, - { - "name": "LiqReceiptData", - "discriminator": [ - 75, - 119, - 90, - 79, - 25, - 200, - 9, - 46 - ] - }, - { - "name": "MaintenanceLedger", - "discriminator": [ - 140, - 250, - 92, - 173, - 147, - 65, - 26, - 39 - ] - }, - { - "name": "OperatorRegistry", - "discriminator": [ - 194, - 188, - 172, - 240, - 220, - 209, - 36, - 100 - ] - }, - { - "name": "OutboundMessageBuffer", - "discriminator": [ - 133, - 145, - 100, - 61, - 28, - 106, - 209, - 197 - ] - }, - { - "name": "OutpostAccount", - "discriminator": [ - 87, - 205, - 242, - 192, - 212, - 51, - 26, - 93 - ] - }, - { - "name": "OutpostConfig", - "discriminator": [ - 211, - 233, - 11, - 174, - 26, - 119, - 188, - 182 - ] - }, - { - "name": "PayRateHistory", - "discriminator": [ - 139, - 8, - 65, - 111, - 71, - 41, - 187, - 218 - ] - }, - { - "name": "PayoutState", - "discriminator": [ - 106, - 54, - 13, - 167, - 203, - 44, - 168, - 150 - ] - }, - { - "name": "PretokenPurchaseHistory", - "discriminator": [ - 33, - 71, - 113, - 206, - 33, - 180, - 236, - 131 - ] - }, - { - "name": "PriceHistory", - "discriminator": [ - 38, - 241, - 40, - 19, - 42, - 228, - 93, - 152 - ] - }, - { - "name": "Reserve", - "discriminator": [ - 43, - 242, - 204, - 202, - 26, - 247, - 59, - 127 - ] - }, - { - "name": "ReserveAggregate", - "discriminator": [ - 46, - 66, - 28, - 2, - 223, - 209, - 19, - 45 - ] - }, - { - "name": "StakeAllocationState", - "discriminator": [ - 23, - 238, - 120, - 198, - 156, - 165, - 151, - 119 - ] - }, - { - "name": "StakeControllerState", - "discriminator": [ - 218, - 168, - 114, - 136, - 80, - 186, - 29, - 218 - ] - }, - { - "name": "StakeMetrics", - "discriminator": [ - 91, - 84, - 217, - 97, - 98, - 38, - 18, - 143 - ] - }, - { - "name": "TokenMetadata", - "discriminator": [ - 237, - 215, - 132, - 182, - 24, - 127, - 175, - 173 - ] - }, - { - "name": "TrancheState", - "discriminator": [ - 212, - 231, - 254, - 24, - 238, - 63, - 92, - 105 - ] - }, - { - "name": "UserPretokenRecord", - "discriminator": [ - 117, - 99, - 159, - 251, - 98, - 253, - 6, - 238 - ] - }, - { - "name": "UserRecord", - "discriminator": [ - 210, - 252, - 132, - 218, - 191, - 85, - 173, - 167 - ] - }, - { - "name": "ValidatorInfoAccount", - "discriminator": [ - 195, - 243, - 81, - 187, - 172, - 232, - 57, - 59 - ] - }, - { - "name": "ValidatorList", - "discriminator": [ - 131, - 181, - 125, - 127, - 46, - 36, - 40, - 167 - ] - }, - { - "name": "ValidatorTransientAccount", - "discriminator": [ - 97, - 207, - 155, - 142, - 86, - 170, - 118, - 161 - ] - } - ], - "events": [ - { - "name": "EpochResolved", - "discriminator": [ - 62, - 81, - 212, - 223, - 209, - 104, - 51, - 65 - ] - }, - { - "name": "GraveyardDeactivationQueuedEvent", - "discriminator": [ - 131, - 241, - 122, - 229, - 108, - 21, - 67, - 37 - ] - }, - { - "name": "GraveyardValidatorCleanedEvent", - "discriminator": [ - 3, - 252, - 58, - 228, - 135, - 135, - 104, - 34 - ] - }, - { - "name": "PretokenPurchased", - "discriminator": [ - 39, - 1, - 143, - 191, - 8, - 14, - 80, - 41 - ] - }, - { - "name": "StakesMerged", - "discriminator": [ - 3, - 16, - 51, - 153, - 152, - 186, - 19, - 97 - ] - }, - { - "name": "ValidatorAddedEvent", - "discriminator": [ - 71, - 123, - 103, - 213, - 174, - 178, - 82, - 130 - ] - }, - { - "name": "ValidatorRemovedEvent", - "discriminator": [ - 49, - 23, - 179, - 208, - 124, - 3, - 231, - 59 - ] - }, - { - "name": "ValidatorSwappedEvent", - "discriminator": [ - 33, - 50, - 10, - 35, - 69, - 113, - 96, - 180 - ] - }, - { - "name": "ValidatorsSyncedEvent", - "discriminator": [ - 119, - 121, - 49, - 120, - 230, - 132, - 109, - 214 - ] - }, - { - "name": "WithdrawClaimed", - "discriminator": [ - 77, - 130, - 89, - 38, - 239, - 172, - 174, - 85 - ] - }, - { - "name": "WithdrawRequested", - "discriminator": [ - 114, - 16, - 240, - 206, - 93, - 128, - 151, - 39 - ] - } - ], - "errors": [ - { - "code": 6000, - "name": "EnvelopeDecodeFailed", - "msg": "Envelope protobuf decode failed" - }, - { - "code": 6001, - "name": "AttestationDecodeFailed", - "msg": "Attestation protobuf decode failed" - }, - { - "code": 6002, - "name": "NonSequentialEpoch", - "msg": "Non-sequential epoch index" - }, - { - "code": 6003, - "name": "EpochHashMismatch", - "msg": "Previous envelope hash mismatch" - }, - { - "code": 6004, - "name": "OperatorAlreadyDelivered", - "msg": "Operator already delivered this epoch" - }, - { - "code": 6005, - "name": "NotActiveOperator", - "msg": "Caller is not an active batch operator" - }, - { - "code": 6006, - "name": "EmptyOperatorGroups", - "msg": "Operator group list cannot be empty while roster is initialized" - }, - { - "code": 6007, - "name": "OutboundMessageBufferOverflow", - "msg": "Outbound message buffer capacity exceeded" - }, - { - "code": 6008, - "name": "Unauthorized", - "msg": "Unauthorized caller for attestation" - }, - { - "code": 6009, - "name": "OperatorRegistryFull", - "msg": "Operator registry is full; cannot add another operator" - }, - { - "code": 6010, - "name": "OperatorGroupListFull", - "msg": "Operator group count exceeds configured maximum" - }, - { - "code": 6011, - "name": "OperatorGroupFull", - "msg": "Operator group member count exceeds configured maximum" - }, - { - "code": 6012, - "name": "InvalidSolanaAddressLength", - "msg": "Solana address in Operators entry is not 32 bytes" - }, - { - "code": 6013, - "name": "EpochDeliveryListFull", - "msg": "Epoch delivery count exceeds configured maximum" - }, - { - "code": 6014, - "name": "UnsupportedAttestationType", - "msg": "Attestation type not supported by this outpost" - }, - { - "code": 6015, - "name": "ZeroAmount", - "msg": "Amount must be greater than zero" - }, - { - "code": 6016, - "name": "InvalidOperatorType", - "msg": "Invalid OperatorType for Solana outpost" - }, - { - "code": 6017, - "name": "InvalidTokenKind", - "msg": "Invalid TokenKind for deposit" - }, - { - "code": 6018, - "name": "InvalidWireNameLength", - "msg": "WIRE account name exceeds 13 characters" - }, - { - "code": 6019, - "name": "EnvelopeTooLarge", - "msg": "Envelope data exceeds MAX_ENVELOPE_BYTES" - }, - { - "code": 6020, - "name": "InvalidRetentionConfig", - "msg": "Retention config invalid: full_retention_seconds < data_retention_epochs * epoch_duration_seconds" - }, - { - "code": 6021, - "name": "InvalidEpochDuration", - "msg": "Epoch duration must be non-zero" - }, - { - "code": 6022, - "name": "EnvelopeKindMismatch", - "msg": "Envelope kind does not match account type" - }, - { - "code": 6023, - "name": "EnvelopeStillInRetention", - "msg": "Envelope pruning attempted on record still inside retention window" - }, - { - "code": 6024, - "name": "InvalidChunkCount", - "msg": "Chunk count must be in 1..=MAX_CHUNKS" - }, - { - "code": 6025, - "name": "ChunkIndexOutOfRange", - "msg": "Chunk index out of range for declared total_chunks" - }, - { - "code": 6026, - "name": "ChunkTooLarge", - "msg": "Chunk payload exceeds MAX_CHUNK_BYTES" - }, - { - "code": 6027, - "name": "ChunkSizeMismatch", - "msg": "Chunk size does not match the declared envelope shape" - }, - { - "code": 6028, - "name": "ChunkOutOfOrder", - "msg": "Chunk arrived out of order; chunks must be submitted sequentially" - }, - { - "code": 6029, - "name": "ChunkBufferEpochMismatch", - "msg": "Chunk buffer header locked to a different epoch" - }, - { - "code": 6030, - "name": "ChunkBufferShapeMismatch", - "msg": "Chunk buffer header locked to a different total_chunks/total_bytes" - }, - { - "code": 6031, - "name": "ChunkBufferOperatorMismatch", - "msg": "Chunk buffer was opened by a different operator" - }, - { - "code": 6032, - "name": "ChunkCleanupNotYetEligible", - "msg": "Chunk cleanup is not eligible until the epoch has advanced" - }, - { - "code": 6033, - "name": "OversizedQueuedMessage", - "msg": "A single queued outbound message exceeds MAX_ENVELOPE_BYTES; cannot pack into an envelope" - }, - { - "code": 6034, - "name": "CollateralLedgerOverflow", - "msg": "Collateral ledger has reached MAX_COLLATERAL_ENTRIES capacity" - }, - { - "code": 6035, - "name": "CallerNotRegistered", - "msg": "Caller is not present in the operator registry" - }, - { - "code": 6036, - "name": "WrongOperatorType", - "msg": "Caller's operator role does not match the action's required role" - }, - { - "code": 6037, - "name": "OperatorNotActive", - "msg": "Caller's operator status is not ACTIVE" - }, - { - "code": 6038, - "name": "ReserveNotFound", - "msg": "Reserve PDA not found for the supplied (token_code, reserve_code)" - }, - { - "code": 6039, - "name": "ReserveWrongStatus", - "msg": "Reserve is not in the status required by the action" - }, - { - "code": 6040, - "name": "ReserveNotCreator", - "msg": "Caller does not match the reserve's creator" - }, - { - "code": 6041, - "name": "TokenCodeNotConfigured", - "msg": "Token code is not configured in outpost_config.token_addresses_by_code" - }, - { - "code": 6042, - "name": "BadConnectorWeight", - "msg": "Connector weight must be in 1..=10_000 basis points" - }, - { - "code": 6043, - "name": "ReserveNameTooLong", - "msg": "Reserve name exceeds RESERVE_NAME_MAX_BYTES" - }, - { - "code": 6044, - "name": "ReserveDescriptionTooLong", - "msg": "Reserve description exceeds RESERVE_DESCRIPTION_MAX_BYTES" - }, - { - "code": 6045, - "name": "TokenAddressesFull", - "msg": "Token addresses table is full; cannot register another entry" - }, - { - "code": 6046, - "name": "ZeroReserveAmount", - "msg": "Reserve external_token_amount must be greater than zero" - }, - { - "code": 6047, - "name": "SwapUnknownSlugName", - "msg": "requestSwap: slug_name parameter is UNKNOWN (zero)" - }, - { - "code": 6048, - "name": "SwapEmptyRecipient", - "msg": "requestSwap: target_recipient is empty" - }, - { - "code": 6049, - "name": "SwapZeroSourceAmount", - "msg": "requestSwap: source_amount must be > 0" - }, - { - "code": 6050, - "name": "SwapSourceNotNative", - "msg": "requestSwap: source token must be native (this pass)" - }, - { - "code": 6051, - "name": "SwapSourceReserveUnavailable", - "msg": "requestSwap: source reserve unavailable" - }, - { - "code": 6052, - "name": "ArithmeticOverflow", - "msg": "arithmetic overflow during reserve accounting" - }, - { - "code": 6053, - "name": "SwapSourceIsNative", - "msg": "requestSwapSpl: source token must be SPL, not native" - }, - { - "code": 6054, - "name": "SwapSplMintMismatch", - "msg": "SPL mint does not match outpost_config binding for this token_code" - }, - { - "code": 6055, - "name": "PrecisionUnconfigured", - "msg": "token precision not configured — call set_token_precision first" - }, - { - "code": 6056, - "name": "RecipientAtaCreationFailed", - "msg": "handle_swap_remit: recipient ATA creation failed on-chain" - }, - { - "code": 6057, - "name": "TerminalChunkNotEmpty", - "msg": "epoch_in: the terminal finalize call must carry no chunk data" - }, - { - "code": 6058, - "name": "TerminalChunkBeforeDataComplete", - "msg": "epoch_in: terminal finalize before every data chunk was uploaded" - }, - { - "code": 6059, - "name": "EnvelopeEpochMismatch", - "msg": "Decoded envelope epoch does not match the epoch_in instruction epoch" - }, - { - "code": 6060, - "name": "NonCanonicalPreviousEnvelopeHash", - "msg": "previous_envelope_hash is not in canonical form" - }, - { - "code": 6061, - "name": "ReserveCreatorAtaNotCanonical", - "msg": "createReserve: creator ATA is not the canonical account for this mint" - }, - { - "code": 6062, - "name": "EmitBeforeEpochAccepted", - "msg": "Outbound emit for an epoch the inbound cursor has not accepted" - }, - { - "code": 6063, - "name": "EnvelopeWrongDestination", - "msg": "envelope destination is not an SVM chain" - }, - { - "code": 7000, - "name": "DestinationAccountDoesNotExist", - "msg": "Destination stake account does not exist" - }, - { - "code": 7001, - "name": "SourceAccountDoesNotExist", - "msg": "Source stake account does not exist" - }, - { - "code": 7002, - "name": "InvalidDestinationOwner", - "msg": "Destination account not owned by stake program" - }, - { - "code": 7003, - "name": "InvalidSourceOwner", - "msg": "Source account not owned by stake program" - }, - { - "code": 7004, - "name": "ClockBorrowFailed", - "msg": "Failed to borrow clock data" - }, - { - "code": 7005, - "name": "ClockDeserializeFailed", - "msg": "Failed to deserialize clock" - }, - { - "code": 7006, - "name": "DestinationAnalysisFailed", - "msg": "Failed to analyze destination stake account" - }, - { - "code": 7007, - "name": "SourceAnalysisFailed", - "msg": "Failed to analyze source stake account" - }, - { - "code": 7008, - "name": "DestinationStillActivating", - "msg": "Destination stake is still activating" - }, - { - "code": 7009, - "name": "DestinationDeactivating", - "msg": "Destination stake is deactivating" - }, - { - "code": 7010, - "name": "SourceStillActivating", - "msg": "Source stake is still activating" - }, - { - "code": 7011, - "name": "SourceDeactivating", - "msg": "Source stake is deactivating" - }, - { - "code": 7012, - "name": "DestinationBorrowFailed", - "msg": "Failed to borrow destination account data" - }, - { - "code": 7013, - "name": "DestinationParseFailed", - "msg": "Failed to parse destination stake state" - }, - { - "code": 7014, - "name": "SourceBorrowFailed", - "msg": "Failed to borrow source account data" - }, - { - "code": 7015, - "name": "SourceParseFailed", - "msg": "Failed to parse source stake state" - }, - { - "code": 7016, - "name": "DifferentValidators", - "msg": "Stakes are delegated to different validators" - }, - { - "code": 7017, - "name": "DifferentStakers", - "msg": "Stakes have different staker authorities" - }, - { - "code": 7018, - "name": "DifferentWithdrawers", - "msg": "Stakes have different withdrawer authorities" - }, - { - "code": 7019, - "name": "AuthoritiesNotFound", - "msg": "Could not extract authorities from accounts" - }, - { - "code": 7020, - "name": "MergeInstructionFailed", - "msg": "Merge instruction failed" - }, - { - "code": 7021, - "name": "EpochRewardsActive", - "msg": "Epoch rewards distribution is active - stake operations blocked" - }, - { - "code": 7022, - "name": "DifferentCreditsObserved", - "msg": "Stakes have different credits_observed - cannot merge until both earn same rewards" - }, - { - "code": 7100, - "name": "AccountBorrowFailed", - "msg": "Util Acc borrow Failed" - }, - { - "code": 7200, - "name": "InvalidAuthority", - "msg": "Only the configured admin may perform this action" - }, - { - "code": 7201, - "name": "InvalidAccountOwner", - "msg": "OutpostAccount does not belong to the signer" - }, - { - "code": 7202, - "name": "RoleNotEnabled", - "msg": "Role is not enabled (principal is 0)" - }, - { - "code": 7203, - "name": "AlreadyBondedForRole", - "msg": "Already bonded for this role" - }, - { - "code": 7204, - "name": "NotBondedForRole", - "msg": "Not bonded for this role" - }, - { - "code": 7205, - "name": "InsufficientStakedLiqsol", - "msg": "Insufficient staked liqSOL for bonding" - }, - { - "code": 7206, - "name": "BondStillInWarmup", - "msg": "Bond still in warmup period" - }, - { - "code": 7207, - "name": "AlreadyUnbonding", - "msg": "Unbond already requested for this role" - }, - { - "code": 7208, - "name": "NotUnbonding", - "msg": "Unbond not requested for this role" - }, - { - "code": 7209, - "name": "NotBonded", - "msg": "User has no active bonds" - }, - { - "code": 7210, - "name": "MissingRole", - "msg": "Actor does not have required role" - }, - { - "code": 7211, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7212, - "name": "Underflow", - "msg": "Arithmetic underflow" - }, - { - "code": 7213, - "name": "InvalidWarmupDuration", - "msg": "Invalid warmup duration" - }, - { - "code": 7300, - "name": "DepositTooSmall", - "msg": "Deposit amount is below minimum required" - }, - { - "code": 7301, - "name": "NotInitialized", - "msg": "Deposit Router not initialized" - }, - { - "code": 7302, - "name": "InvalidAuthority", - "msg": "Invalid authority" - }, - { - "code": 7303, - "name": "InsufficientFunds", - "msg": "Insufficient funds" - }, - { - "code": 7304, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7305, - "name": "CalculationFailure", - "msg": "Calculation failure" - }, - { - "code": 7306, - "name": "NothingToMint", - "msg": "Cannot mint zero tokens" - }, - { - "code": 7307, - "name": "InvalidAccount", - "msg": "Invalid account provided" - }, - { - "code": 7308, - "name": "InsufficientFundsForStake", - "msg": "Insufficient funds remaining after reserving fees to proceed with staking" - }, - { - "code": 7309, - "name": "UnauthorizedProgram", - "msg": "Unauthorized program attempting to call this instruction" - }, - { - "code": 7310, - "name": "DepositsDisabled", - "msg": "Deposits are currently disabled" - }, - { - "code": 7400, - "name": "NoRewardsToClaim", - "msg": "No rewards to claim" - }, - { - "code": 7401, - "name": "InsufficientBalance", - "msg": "Insufficient balance" - }, - { - "code": 7402, - "name": "InsufficientFunds", - "msg": "Insufficient funds" - }, - { - "code": 7403, - "name": "Unauthorized", - "msg": "Unauthorized - caller is not the distribution authority" - }, - { - "code": 7404, - "name": "InvalidMint", - "msg": "Invalid mint" - }, - { - "code": 7405, - "name": "InvalidOwner", - "msg": "Invalid owner" - }, - { - "code": 7406, - "name": "InvalidBucketAccount", - "msg": "Invalid bucket token account" - }, - { - "code": 7407, - "name": "InvalidUserRecord", - "msg": "Invalid user record" - }, - { - "code": 7408, - "name": "InvalidWithdrawal", - "msg": "Invalid withdrawal - balance increased instead of decreased" - }, - { - "code": 7409, - "name": "InvalidWithdrawalAmount", - "msg": "Invalid withdrawal - request must be greater than 0" - }, - { - "code": 7410, - "name": "InvalidProgramId", - "msg": "Invalid program ID" - }, - { - "code": 7411, - "name": "InstructionIntrospectionFailed", - "msg": "Instruction introspection failed" - }, - { - "code": 7412, - "name": "TransferNotInProgress", - "msg": "Transfer hook not active for this token account" - }, - { - "code": 7413, - "name": "ShareZeroTransfer", - "msg": "Amount too small resulting in zero share transfer" - }, - { - "code": 7414, - "name": "ReceiptFulfilled", - "msg": "Receipt already fulfilled" - }, - { - "code": 7415, - "name": "InsufficientBucketBalance", - "msg": "Insufficient bucket balance to fulfill claim" - }, - { - "code": 7416, - "name": "ClaimCalculationError", - "msg": "Claim calculation error" - }, - { - "code": 7417, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7418, - "name": "Underflow", - "msg": "Arithmetic underflow" - }, - { - "code": 7419, - "name": "BalanceBelowTracked", - "msg": "Balance below tracked amount — possible token burn detected" - }, - { - "code": 7420, - "name": "LegacyUserRecordMigrationRequired", - "msg": "Legacy user record must be migrated via register_user or migrate_user_record before claiming or transfers" - }, - { - "code": 7421, - "name": "AmountExceedsEntitled", - "msg": "Requested amount exceeds share-backed entitlement — cap at max_withdrawable or use full-ATA withdraw" - }, - { - "code": 7500, - "name": "Unauthorized", - "msg": "Unauthorized: The authority does not match the controller state's authority." - }, - { - "code": 7501, - "name": "NoUpgradeAuthority", - "msg": "Program has no upgrade authority (immutable)." - }, - { - "code": 7502, - "name": "PercentOutOfRange", - "msg": "Percent config value must be in 0..=100" - }, - { - "code": 7503, - "name": "PercentInversion", - "msg": "Percent config would invert hysteresis: entry must be <= exit" - }, - { - "code": 7504, - "name": "UnstakeDeltaBelowSplitMinimum", - "msg": "min_rebalance_unstake_delta must be >= MIN_STAKE_DELEGATION (1 SOL)" - }, - { - "code": 7600, - "name": "InsufficientFunds", - "msg": "Insufficient funds" - }, - { - "code": 7601, - "name": "InvalidValidator", - "msg": "Invalid validator" - }, - { - "code": 7602, - "name": "NoSuitableValidator", - "msg": "No suitable validator found" - }, - { - "code": 7603, - "name": "TicketNotFound", - "msg": "Unstake ticket not found" - }, - { - "code": 7604, - "name": "TicketNotClaimable", - "msg": "Ticket not claimable yet" - }, - { - "code": 7605, - "name": "Unauthorized", - "msg": "Unauthorized" - }, - { - "code": 7606, - "name": "ArithmeticOverflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7607, - "name": "AccountAlreadyExists", - "msg": "Account already exists" - }, - { - "code": 7608, - "name": "InvalidStakeAccount", - "msg": "Invalid stake account" - }, - { - "code": 7609, - "name": "InvalidThreshold", - "msg": "Invalid threshold value" - }, - { - "code": 7610, - "name": "InvalidAccountData", - "msg": "Invalid account data" - }, - { - "code": 7611, - "name": "InvalidVoteAccount", - "msg": "Invalid vote account" - }, - { - "code": 7612, - "name": "StakesNotYetActive", - "msg": "Stakes not yet active" - }, - { - "code": 7613, - "name": "EpochDistributionAlreadyDone", - "msg": "Invalid epoch" - }, - { - "code": 7614, - "name": "EpochAlreadyResolved", - "msg": "Epoch already resolved" - }, - { - "code": 7615, - "name": "MergeFailed", - "msg": "Merge failed" - }, - { - "code": 7616, - "name": "ReservePoolNotInitialized", - "msg": "Reserve pool not initialized" - }, - { - "code": 7617, - "name": "InvalidEphemeralAccount", - "msg": "Invalid ephemeral account" - }, - { - "code": 7618, - "name": "InvalidStakeAccount0", - "msg": "Invalid stake account 0" - }, - { - "code": 7619, - "name": "EpochNotReadyForResolution", - "msg": "Epoch Table Not Ready To be resolved" - }, - { - "code": 7620, - "name": "InsufficientSlotsElapsed", - "msg": "Function called too soon in epoch, should be called close to epoch boundary" - }, - { - "code": 7621, - "name": "EpochRewardsActive", - "msg": "Epoch rewards distribution is active - stake operations blocked" - }, - { - "code": 7622, - "name": "ValidatorSyncRequired", - "msg": "Validator sync required - please call sync_validator_stakes first" - }, - { - "code": 7623, - "name": "TooSmallDeposit", - "msg": "Deposit amount too small" - }, - { - "code": 7624, - "name": "AllocationsNotCalculated", - "msg": "Allocations not calculated for current epoch - please run rebalance_validators first" - }, - { - "code": 7625, - "name": "InvalidAccountCount", - "msg": "Invalid account count - expected different number of accounts" - }, - { - "code": 7626, - "name": "InvalidValidatorInfo", - "msg": "Invalid ValidatorInfo account" - }, - { - "code": 7627, - "name": "UnstakeAllocationsNotCalculated", - "msg": "Unstake allocations must be calculated before validator allocations - please run calculate_unstake_allocations first" - }, - { - "code": 7628, - "name": "InvalidReservePoolAccount", - "msg": "Invalid reserve pool account" - }, - { - "code": 7629, - "name": "PreReqsUnmet", - "msg": "Some Pre Req Not Met, Look at Solana Logs for details" - }, - { - "code": 7630, - "name": "SystemBusy", - "msg": "System busy: stake metrics are stale from a recent unstake — please retry shortly" - }, - { - "code": 7631, - "name": "UpdateInProgress", - "msg": "Update in progress: stake metrics are being refreshed for this epoch — please retry shortly" - }, - { - "code": 7632, - "name": "MaintenanceMergeRequired", - "msg": "Maintenance Merge Transients Failed - please run merge_activating_stakes first" - }, - { - "code": 7633, - "name": "UnstakeTooSMall", - "msg": "Unstake Request Too Small" - }, - { - "code": 7634, - "name": "OperationInProgress", - "msg": "Operation already in progress" - }, - { - "code": 7635, - "name": "NoOperationInProgress", - "msg": "No operation currently in progress" - }, - { - "code": 7636, - "name": "InvalidSequence", - "msg": "Invalid sequence - expected different index or rank" - }, - { - "code": 7637, - "name": "ValidatorNotFound", - "msg": "Validator not found in leaderboard" - }, - { - "code": 7638, - "name": "InvalidRank", - "msg": "Invalid rank - exceeds validator count" - }, - { - "code": 7639, - "name": "NoValidatorsInLeaderboard", - "msg": "No validators in leaderboard" - }, - { - "code": 7640, - "name": "NoValidatorsFound", - "msg": "No validators found in active list" - }, - { - "code": 7641, - "name": "GraveyardFull", - "msg": "Graveyard list is full" - }, - { - "code": 7642, - "name": "ValidatorHasActiveStake", - "msg": "Validator still has active stake - cannot cleanup until stake is repatriated" - }, - { - "code": 7643, - "name": "ValidatorHasPendingDeactivations", - "msg": "Validator has pending deactivations - cannot cleanup until all deactivations complete" - }, - { - "code": 7644, - "name": "ValidatorNotUndelegated", - "msg": "Validator is not in NotDelegated state - stake must be fully deactivated before cleanup" - }, - { - "code": 7645, - "name": "BatchSizeTooLarge", - "msg": "Batch size exceeds maximum allowed" - }, - { - "code": 7646, - "name": "StakingDisabled", - "msg": "Staking is currently disabled" - }, - { - "code": 7647, - "name": "WithdrawalsDisabled", - "msg": "Withdrawals are currently disabled" - }, - { - "code": 7648, - "name": "EmergencyModeActive", - "msg": "Emergency mode is active" - }, - { - "code": 7649, - "name": "ProcessStakeOrdersDisabled", - "msg": "Process stake orders is currently disabled" - }, - { - "code": 7650, - "name": "ProcessUnstakeOrdersDisabled", - "msg": "Process unstake orders is currently disabled" - }, - { - "code": 7651, - "name": "ProcessPayCycleDisabled", - "msg": "Process pay cycle is currently disabled" - }, - { - "code": 7652, - "name": "ValidatorRecordNotUpdated", - "msg": "Validator record not updated for current epoch" - }, - { - "code": 7653, - "name": "LateEpochSlotGateNotMet", - "msg": "Late epoch operation called too early - minimum slots not yet elapsed" - }, - { - "code": 7654, - "name": "IndexOutOfBounds", - "msg": "Index out of bounds" - }, - { - "code": 7655, - "name": "AccountAlreadyMigrated", - "msg": "Account already at target size, migration not needed" - }, - { - "code": 7656, - "name": "TreasuryRentUnfunded", - "msg": "Treasury can't cover stake-account rent and caller opted out of fronting it" - }, - { - "code": 7700, - "name": "InvalidChainlinkProgram", - "msg": "Invalid Chainlink program account" - }, - { - "code": 7701, - "name": "InvalidChainlinkFeed", - "msg": "Invalid Chainlink feed account" - }, - { - "code": 7702, - "name": "ArithmeticOverflow", - "msg": "Arithmetic overflow in calculation" - }, - { - "code": 7703, - "name": "InvalidCalculation", - "msg": "Invalid calculation result" - }, - { - "code": 7704, - "name": "DecimalPrecisionMismatch", - "msg": "Decimal precision mismatch" - }, - { - "code": 7705, - "name": "MissingNextTranche", - "msg": "Next tranche account required but not provided" - }, - { - "code": 7706, - "name": "InsufficientNextTrancheSupply", - "msg": "Insufficient pretokens in next tranche" - }, - { - "code": 7707, - "name": "TrancheExhausted", - "msg": "Current tranche exhausted" - }, - { - "code": 7708, - "name": "InvalidPretokenPrice", - "msg": "Invalid pretoken price" - }, - { - "code": 7709, - "name": "ChainlinkPriceFetchFailed", - "msg": "Failed to fetch SOL price from Chainlink" - }, - { - "code": 7710, - "name": "StalePrice", - "msg": "Chainlink price data is stale" - }, - { - "code": 7711, - "name": "PriceOutOfBounds", - "msg": "Price out of valid bounds" - }, - { - "code": 7712, - "name": "InvalidGrowthBps", - "msg": "Invalid growth BPS value (must be <= 10000)" - }, - { - "code": 7713, - "name": "Unauthorized", - "msg": "Unauthorized: caller is not admin" - }, - { - "code": 7714, - "name": "EmptyPriceHistory", - "msg": "Price history is empty" - }, - { - "code": 7715, - "name": "InsufficientFunds", - "msg": "Insufficient funds for pretoken purchase" - }, - { - "code": 7716, - "name": "ExceededTrancheLimit", - "msg": "Exceeded tranche limit, split purchase into multiple transactions" - }, - { - "code": 7717, - "name": "ZeroPretokensPurchased", - "msg": "Deposit too small to purchase any pretokens at current tranche price" - }, - { - "code": 7718, - "name": "InvalidRoundData", - "msg": "Invalid round data from Chainlink feed" - }, - { - "code": 7719, - "name": "InvalidStaleness", - "msg": "max_staleness_seconds must be > 0 - any non-positive value would brick price reads" - }, - { - "code": 7800, - "name": "Unauthorized", - "msg": "Unauthorized access" - }, - { - "code": 7801, - "name": "MaxValidatorsReached", - "msg": "Maximum validators reached" - }, - { - "code": 7802, - "name": "ValidatorAlreadyExists", - "msg": "Validator already exists" - }, - { - "code": 7803, - "name": "ValidatorNotFound", - "msg": "Validator not found" - }, - { - "code": 7804, - "name": "InvalidStakeUpdateType", - "msg": "Invalid stake update type" - }, - { - "code": 7805, - "name": "InvalidVoteAccount", - "msg": "Invalid vote account provided" - }, - { - "code": 7806, - "name": "InvalidInputLength", - "msg": "Invalid input length - all vectors must have same length" - }, - { - "code": 7807, - "name": "InvalidStakeAccount", - "msg": "Invalid Stake Account" - }, - { - "code": 7808, - "name": "ArithmeticOverflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7809, - "name": "InsufficientTransientStake", - "msg": "Insufficient transient stake" - }, - { - "code": 7810, - "name": "TransientTrackingFull", - "msg": "Transient tracking is full (100 entries max)" - }, - { - "code": 7811, - "name": "ValidatorStillInCooldown", - "msg": "Validator is still in cooldown period" - }, - { - "code": 7812, - "name": "InvalidVppScore", - "msg": "VPP score must be between 0 and 100" - }, - { - "code": 7900, - "name": "Unauthorized", - "msg": "Unauthorized admin attempting to call this instruction" - }, - { - "code": 7901, - "name": "InvalidAmount", - "msg": "Invalid amount" - }, - { - "code": 7902, - "name": "DDayNotSet", - "msg": "D-Day is not set" - }, - { - "code": 7903, - "name": "DDayActive", - "msg": "D-Day is active - stakes not allowed" - }, - { - "code": 7904, - "name": "InvalidLiqsolMint", - "msg": "Invalid liqSOL mint address" - }, - { - "code": 7905, - "name": "InsufficientFunds", - "msg": "Insufficient funds in user account" - }, - { - "code": 7906, - "name": "InsufficientStake", - "msg": "Insufficient staked amount for withdrawal" - }, - { - "code": 7907, - "name": "InsufficientShares", - "msg": "Insufficient shares for withdrawal" - }, - { - "code": 7908, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7909, - "name": "Underflow", - "msg": "Arithmetic underflow" - }, - { - "code": 7910, - "name": "EmptyLiqsolPool", - "msg": "No liqSOL deposits registered in the pool" - }, - { - "code": 7911, - "name": "NoLiqsolPosition", - "msg": "No liqSOL position recorded for this user" - }, - { - "code": 7912, - "name": "NoStakeDeposit", - "msg": "No stake deposit found (only pretoken purchases exist)" - }, - { - "code": 7913, - "name": "RawSolBucketUnimplemented", - "msg": "Raw SOL bucket handling is not implemented yet" - }, - { - "code": 7914, - "name": "NoAccumulatedYield", - "msg": "No accumulated yield available to consume" - }, - { - "code": 7915, - "name": "RefundsNotActive", - "msg": "Refunds are not active" - }, - { - "code": 7916, - "name": "NoRefundablePosition", - "msg": "No refundable position found for this user" - }, - { - "code": 7917, - "name": "SystemPaused", - "msg": "System is currently paused" - }, - { - "code": 7918, - "name": "RefundsActive", - "msg": "Refunds are active - operation not allowed" - }, - { - "code": 7919, - "name": "ReceiptLocked", - "msg": "OutpostAccount is locked by an active bond" - }, - { - "code": 7920, - "name": "InvalidWireState", - "msg": "Invalid wire state for this operation" - }, - { - "code": 8000, - "name": "InvalidUserRecord", - "msg": "Invalid user record" - }, - { - "code": 8001, - "name": "InsufficientBalance", - "msg": "Insufficient balance" - }, - { - "code": 8002, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 8003, - "name": "ArithmeticUnderflow", - "msg": "Arithmetic underflow" - }, - { - "code": 8004, - "name": "AlreadyFulfilled", - "msg": "Receipt already fulfilled" - }, - { - "code": 8005, - "name": "NotYetServiceable", - "msg": "Receipt not yet serviceable" - }, - { - "code": 8006, - "name": "BadFrontierOrder", - "msg": "Frontier receipts out of order or unexpected id" - }, - { - "code": 8007, - "name": "MissingNftToken", - "msg": "User does not hold the NFT receipt token" - }, - { - "code": 8008, - "name": "WithdrawalsDisabled", - "msg": "Withdrawals are currently disabled" - }, - { - "code": 8009, - "name": "ClaimWithdrawalsDisabled", - "msg": "Claim withdrawals are currently disabled" - } - ], - "types": [ - { - "name": "AttestationData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "attestation_type", - "type": "i32" - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "BatchOrchestrator", - "docs": [ - "Holds resume positions for batched ops - cursors only, no value.", - "", - "Rule of thumb for what lives here vs StakeAllocationState: this account is", - "for WIPEABLE positions. Completion truth is in MaintenanceLedger, so a stale", - "cursor's staleness response is just \"zero it\" (sweep_stale_cursors does that", - "blanket at every epoch boundary). Anything that carries money/accounting and", - "needs abort/recover on staleness belongs on StakeAllocationState next to its", - "cycle, not here. The aggregation temps are the one grandfathered exception -", - "they carry value, so they sit outside the sweep behind their own mode-tag +", - "started_epoch guard.", - "", - "On liveness: ops here have no in_progress bools - a nonzero cursor/mode-tag", - "IS the liveness signal (see graveyard_locked, WIN-60). That inference works", - "because zero is out-of-band by construction for these fields: cursor at 0 =", - "no progress = idle, same state. Don't copy this pattern to fields where zero", - "is a real value (epochs, amounts) - those need an explicit bool." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "validators_processed_this_epoch", - "type": "u8" - }, - { - "name": "validators_merge_processed_this_epoch", - "type": "u16" - }, - { - "name": "validators_deactivating_merge_processed", - "type": "u16" - }, - { - "name": "validators_sync_processed_this_epoch", - "type": "u16" - }, - { - "name": "validators_unstake_processed_this_epoch", - "type": "u16" - }, - { - "name": "validators_aggregate_processed_this_epoch", - "type": "u16" - }, - { - "name": "temp_total_active_stake", - "type": "u64" - }, - { - "name": "temp_total_transient_stake", - "type": "u64" - }, - { - "name": "temp_total_reward", - "type": "u64" - }, - { - "name": "temp_total_unstakeable_stake", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "infra_next_index", - "docs": [ - "Next active_list index to process for PDA setup" - ], - "type": "u16" - }, - { - "name": "infos_next_index", - "docs": [ - "Next active_list index to process for infos sync" - ], - "type": "u16" - }, - { - "name": "leaderboard_scores_next_index", - "docs": [ - "Next leaderboard registry index to process for score sync" - ], - "type": "u16" - }, - { - "name": "removal_next_index", - "docs": [ - "Next index in active list to check for removal" - ], - "type": "u16" - }, - { - "name": "addition_next_rank", - "docs": [ - "Next rank in leaderboard to check for addition" - ], - "type": "u16" - }, - { - "name": "addition_target_rank", - "docs": [ - "Target (inclusive) leaderboard rank to process up to" - ], - "type": "u16" - }, - { - "name": "graveyard_next_index", - "docs": [ - "Next index in graveyard list to process" - ], - "type": "u16" - }, - { - "name": "graveyard_cleanup_next_index", - "docs": [ - "Next index in graveyard list to check for cleanup" - ], - "type": "u16" - }, - { - "name": "aggregate_mode_tag", - "docs": [ - "Tracks which aggregation mode currently owns the shared temp fields.", - "0 = idle,", - "1 = Normal,", - "2 = PostSync,", - "3 = PostLateEpoch.", - "Prevents cross-mode state contamination when modes share the same vars." - ], - "type": "u8" - }, - { - "name": "aggregation_started_epoch", - "docs": [ - "The epoch when the current aggregation batch started.", - "Prevents stale partial accumulators from being committed if an epoch boundary is crossed mid-aggregation." - ], - "type": "u64" - }, - { - "name": "mev_claims_next_index", - "docs": [ - "Next active_list index to process for MEV tip claims" - ], - "type": "u16" - }, - { - "name": "temp_total_mev_reward", - "docs": [ - "Temporary accumulator for MEV rewards across batches" - ], - "type": "u64" - }, - { - "name": "temp_total_outstanding_amount_to_unstake", - "docs": [ - "Temporary accumulator for sum of validators' amount_to_unstake across batches" - ], - "type": "u64" - }, - { - "name": "validators_sync_started_epoch", - "docs": [ - "Owns validators_sync_processed_this_epoch." - ], - "type": "u16" - }, - { - "name": "leaderboard_scores_started_epoch", - "docs": [ - "Owns leaderboard_scores_next_index." - ], - "type": "u16" - }, - { - "name": "graveyard_cleanup_started_epoch", - "docs": [ - "Owns graveyard_cleanup_next_index." - ], - "type": "u16" - }, - { - "name": "addition_started_epoch", - "docs": [ - "Owns addition_next_rank + addition_target_rank." - ], - "type": "u16" - }, - { - "name": "unstake_started_epoch", - "docs": [ - "Owns validators_unstake_processed_this_epoch. A nonzero cursor from a", - "dead epoch is not a real lock — this pin lets consumers tell stale", - "leftovers apart from a live in-epoch traversal." - ], - "type": "u16" - }, - { - "name": "cursors_epoch", - "docs": [ - "Every cursor on this account is a per-epoch resume position — at an", - "epoch boundary any nonzero one is stale garbage. The first batch op to", - "touch this account in a new epoch wipes them all in one swing via", - "sweep_stale_cursors, so no op ever resumes against a list that", - "selection reshuffled since. Backstop for the per-op pins above." - ], - "type": "u16" - }, - { - "name": "_reserved", - "type": { - "array": [ - "u8", - 60 - ] - } - } - ] - } - }, - { - "name": "CollateralEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "depositor", - "type": "pubkey" - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "ConfigKeyBool", - "docs": [ - "Keys for bool config values (feature flags) - stored as bits in a u16", - "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,", - "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "DepositsEnabled" - }, - { - "name": "WithdrawalsEnabled" - }, - { - "name": "ClaimWithdrawalsEnabled" - }, - { - "name": "ProcessStakeOrdersEnabled" - }, - { - "name": "ProcessUnstakeOrdersEnabled" - }, - { - "name": "ProcessPayCycleEnabled" - }, - { - "name": "RebalancingEnabled" - } - ] - } - }, - { - "name": "ConfigKeyU16", - "docs": [ - "Keys for u16 config values (small counts, thresholds, ranks)" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "CooldownEpochs" - }, - { - "name": "DepositFeeEpochsMultiplier" - }, - { - "name": "MinVppEntry" - }, - { - "name": "MinVppExit" - }, - { - "name": "TinyNetworkThreshold" - }, - { - "name": "SmallNetworkThreshold" - }, - { - "name": "MediumNetworkThreshold" - }, - { - "name": "LargeNetworkEntryRank" - }, - { - "name": "LargeNetworkExitRank" - } - ] - } - }, - { - "name": "ConfigKeyU64", - "docs": [ - "Keys for u64 config values (large amounts, rates)" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "MinUserDeposit" - }, - { - "name": "MinUnstakeRequest" - }, - { - "name": "MinRebalanceStakeDelta" - }, - { - "name": "MinRebalanceUnstakeDelta" - }, - { - "name": "TransientThreshold" - }, - { - "name": "MinLateEpochSlotGate" - } - ] - } - }, - { - "name": "ConfigKeyU8", - "docs": [ - "Keys for u8 config values (percentages 0-100)" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "SmallNetworkEntryPercent" - }, - { - "name": "SmallNetworkExitPercent" - }, - { - "name": "MediumNetworkEntryPercent" - }, - { - "name": "MediumNetworkExitPercent" - } - ] - } - }, - { - "name": "DistributionState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "liqsol_mint", - "type": "pubkey" - }, - { - "name": "current_index", - "type": "u64" - }, - { - "name": "total_shares", - "docs": [ - "Sum of all user shares across the system" - ], - "type": "u64" - }, - { - "name": "last_bucket_balance", - "docs": [ - "Last observed bucket balance used for incremental index updates" - ], - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "bucket_bump", - "docs": [ - "Cached bucket authority bump to avoid repeated find_program_address calls" - ], - "type": "u8" - }, - { - "name": "pool_bump", - "docs": [ - "Cached pool authority bump to avoid repeated find_program_address calls" - ], - "type": "u8" - }, - { - "name": "bucket_authority", - "docs": [ - "Cached bucket authority pubkey for transfer-hook optimization" - ], - "type": "pubkey" - }, - { - "name": "pool_authority", - "docs": [ - "Cached pool authority pubkey for transfer-hook optimization" - ], - "type": "pubkey" - } - ] - } - }, - { - "name": "EnvelopeChunks", - "type": { - "kind": "struct", - "fields": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "operator", - "type": "pubkey" - }, - { - "name": "total_chunks", - "type": "u16" - }, - { - "name": "total_bytes", - "type": "u32" - }, - { - "name": "received_chunks", - "type": "u16" - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "EnvelopeLog", - "type": { - "kind": "struct", - "fields": [ - { - "name": "envelopes", - "type": { - "vec": { - "defined": { - "name": "EnvelopeRecord" - } - } - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "EnvelopeRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "emitted_at", - "type": "u64" - }, - { - "name": "checksum", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "EpochDeliveries", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "deliveries", - "type": { - "vec": { - "defined": { - "name": "OperatorDelivery" - } - } - } - }, - { - "name": "consensus_reached", - "type": "bool" - }, - { - "name": "consensus_hash", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "EpochResolved", - "type": { - "kind": "struct", - "fields": [ - { - "name": "validator", - "type": "pubkey" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "total_stake_amount", - "type": "u64" - }, - { - "name": "max_index", - "type": "u32" - } - ] - } - }, - { - "name": "FailedSwapRemit", - "type": { - "kind": "struct", - "fields": [ - { - "name": "original_swap_remit_id", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "recipient_address", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "reason_len", - "type": "u8" - }, - { - "name": "reason", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "Global", - "docs": [ - "Global operator state. Epoch-based model: receipts are serviceable", - "when `epoch <= serviceable_epoch` as reported by an external runtime." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "authority", - "docs": [ - "DEPRECATED: Originally intended as authority for serviceable_epoch updates,", - "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.", - "Retained to preserve account layout." - ], - "type": "pubkey" - }, - { - "name": "liqsol_mint", - "docs": [ - "Token-2022 liqSOL mint burned on withdraw." - ], - "type": "pubkey" - }, - { - "name": "serviceable_epoch", - "docs": [ - "Highest epoch that is currently claimable." - ], - "type": "u64" - }, - { - "name": "total_encumbered_funds", - "docs": [ - "Total SOL encumbered for pending withdrawal requests.", - "This amount is reserved from the reserve pool and will be paid out when receipts are claimed." - ], - "type": "u64" - }, - { - "name": "next_receipt_id", - "docs": [ - "Monotonic counter for generating unique receipt IDs" - ], - "type": "u64" - } - ] - } - }, - { - "name": "GlobalConfig", - "docs": [ - "Zero-copy global config PDA" - ], - "serialization": "bytemuckunsafe", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "_padding", - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "admin", - "type": "pubkey" - }, - { - "name": "cranky", - "type": "pubkey" - }, - { - "name": "_reserved_pubkey", - "type": { - "array": [ - "pubkey", - 1 - ] - } - }, - { - "name": "min_user_deposit", - "docs": [ - "Minimum SOL amount a user can deposit" - ], - "type": "u64" - }, - { - "name": "min_unstake_request", - "docs": [ - "Minimum SOL amount for an unstake/withdrawal request" - ], - "type": "u64" - }, - { - "name": "min_rebalance_stake_delta", - "docs": [ - "Minimum stake delta to trigger a stake rebalance order" - ], - "type": "u64" - }, - { - "name": "min_rebalance_unstake_delta", - "docs": [ - "Minimum unstake delta to trigger an unstake rebalance order" - ], - "type": "u64" - }, - { - "name": "transient_threshold", - "docs": [ - "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.", - "Rebalance now counts all transient stake on both sides of the delta equation,", - "so the per-validator threshold gate was removed." - ], - "type": "u64" - }, - { - "name": "min_late_epoch_slot_gate", - "docs": [ - "Minimum slots that must have elapsed in the epoch before late epoch operations can execute" - ], - "type": "u64" - }, - { - "name": "_reserved_u64", - "type": { - "array": [ - "u64", - 2 - ] - } - }, - { - "name": "cooldown_epochs", - "docs": [ - "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change" - ], - "type": "u16" - }, - { - "name": "deposit_fee_multiplier", - "docs": [ - "Multiplier for deposit fee calculation, this would be average \"pay rate x number of epochs we expect the stake to warm up\"" - ], - "type": "u16" - }, - { - "name": "min_vpp_entry", - "docs": [ - "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small" - ], - "type": "u16" - }, - { - "name": "min_vpp_exit", - "docs": [ - "VPP score threshold below which a validator is removed from active set, again a fall back" - ], - "type": "u16" - }, - { - "name": "tiny_network_threshold", - "docs": [ - "Max validators for \"tiny\" network band (uses fixed VPP thresholds) as above" - ], - "type": "u16" - }, - { - "name": "small_network_threshold", - "docs": [ - "Max validators for \"small\" network band (uses percentile-based selection)" - ], - "type": "u16" - }, - { - "name": "medium_network_threshold", - "docs": [ - "Max validators for \"medium\" network band (uses percentile-based selection)" - ], - "type": "u16" - }, - { - "name": "large_network_entry_rank", - "docs": [ - "Fixed rank threshold to enter active set in large networks (0-indexed)" - ], - "type": "u16" - }, - { - "name": "large_network_exit_rank", - "docs": [ - "Fixed rank threshold to exit active set in large networks (0-indexed)" - ], - "type": "u16" - }, - { - "name": "_reserved_u16", - "type": { - "array": [ - "u16", - 3 - ] - } - }, - { - "name": "small_network_entry_percent", - "docs": [ - "Percentile rank required to enter active set in small networks" - ], - "type": "u8" - }, - { - "name": "small_network_exit_percent", - "docs": [ - "Percentile rank below which validators exit in small networks" - ], - "type": "u8" - }, - { - "name": "medium_network_entry_percent", - "docs": [ - "Percentile rank required to enter active set in medium networks" - ], - "type": "u8" - }, - { - "name": "medium_network_exit_percent", - "docs": [ - "Percentile rank below which validators exit in medium networks" - ], - "type": "u8" - }, - { - "name": "_reserved_u8", - "type": { - "array": [ - "u8", - 2 - ] - } - }, - { - "name": "feature_flags", - "docs": [ - "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,", - "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,", - "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved" - ], - "type": "u16" - }, - { - "name": "_reserved_flags", - "type": { - "array": [ - "u16", - 1 - ] - } - }, - { - "name": "_reserved_trailing", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "GlobalState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "deployed_at", - "docs": [ - "Legacy refund timer fields retained to preserve account layout.", - "Refund activation is controlled exclusively through `wire_state`." - ], - "type": "i64" - }, - { - "name": "refund_delay_seconds", - "type": "i64" - }, - { - "name": "paused", - "docs": [ - "Global pause flag - when true, all operations except refunds are disabled" - ], - "type": "bool" - }, - { - "name": "total_staked_liqsol", - "docs": [ - "Aggregate liqSOL staked through pretokens (maps to distribution tracked balance)" - ], - "type": "u64" - }, - { - "name": "total_purchased_liqsol", - "docs": [ - "Aggregate liqSOL pretoken purchases (part of distribution tracked balance)" - ], - "type": "u64" - }, - { - "name": "total_shares", - "docs": [ - "Total shares issued to all users (for share/index yield isolation)" - ], - "type": "u64" - }, - { - "name": "protocol_shares", - "docs": [ - "Total shares issued to protocol (for share/index yield isolation)" - ], - "type": "u64" - }, - { - "name": "current_index", - "docs": [ - "Current share-to-token exchange rate (scaled by INDEX_SCALE = 1e12)", - "Starts at INDEX_SCALE (1.0) and grows as yield accrues" - ], - "type": "u64" - }, - { - "name": "expected_pool_balance", - "docs": [ - "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).", - "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield." - ], - "type": "u64" - }, - { - "name": "yield_accumulated_liqsol", - "docs": [ - "Accumulated liqSOL yield available for protocol pretoken purchases" - ], - "type": "u64" - }, - { - "name": "role_principals", - "docs": [ - "Required principal (liqSOL) per role [YieldOp, BatchOp, Underwriter, PoolOp]" - ], - "type": { - "array": [ - "u64", - 4 - ] - } - }, - { - "name": "role_warmup_duration", - "docs": [ - "Warmup duration in seconds (applies when ANY new role is bonded)" - ], - "type": "i64" - }, - { - "name": "wire_state", - "type": { - "defined": { - "name": "WireState" - } - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "GraveyardDeactivationQueuedEvent", - "docs": [ - "Event emitted when a graveyard validator's main stake deactivation is queued" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "amount_to_unstake", - "type": "u64" - } - ] - } - }, - { - "name": "GraveyardValidatorCleanedEvent", - "docs": [ - "Event emitted when a graveyard validator is cleaned up" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "epochs_since_state_change", - "type": "u16" - } - ] - } - }, - { - "name": "LatestOutboundEnvelope", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "checksum", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "data", - "type": "bytes" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "LeaderboardState", - "docs": [ - "Central leaderboard state using parallel arrays for efficient ranking and CPI access", - "Stores VPP scores and sorted rankings for up to 1024 validators", - "Uses zero-copy for efficient access from other programs via CPI" - ], - "serialization": "bytemuck", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "scores", - "docs": [ - "VPP scores indexed by registry_index (0-100 range)", - "registry_index is assigned on first validator registration and never changes" - ], - "type": { - "array": [ - "u8", - 1024 - ] - } - }, - { - "name": "sorted_indices", - "docs": [ - "Validator indices sorted by VPP score descending", - "sorted_indices[0] = registry_index of highest VPP validator", - "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc." - ], - "type": { - "array": [ - "u16", - 1024 - ] - } - }, - { - "name": "vote_accounts", - "docs": [ - "Vote account pubkeys indexed by registry_index", - "Allows CPI callers to get vote accounts for top N validators" - ], - "type": { - "array": [ - { - "defined": { - "name": "PubkeyBytes" - } - }, - 1024 - ] - } - }, - { - "name": "num_validators", - "docs": [ - "Number of active validators currently in the leaderboard" - ], - "type": "u16" - }, - { - "name": "bump", - "docs": [ - "PDA bump seed" - ], - "type": "u8" - }, - { - "name": "_align", - "docs": [ - "Alignment byte (keeps u16 fields below properly aligned)" - ], - "type": "u8" - }, - { - "name": "crank_next_index", - "docs": [ - "Next validator index to process during crank_update_scores" - ], - "type": "u16" - }, - { - "name": "last_crank_epoch", - "docs": [ - "Last epoch when crank_update_scores completed all validators" - ], - "type": "u16" - }, - { - "name": "crank_started_epoch", - "docs": [ - "Epoch when start_crank was called (signals an active crank cycle)" - ], - "type": "u16" - } - ] - } - }, - { - "name": "LiqReceiptData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "receipt_id", - "type": "u64" - }, - { - "name": "liqports", - "type": "u64" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "fulfilled", - "type": "bool" - } - ] - } - }, - { - "name": "MaintenanceLedger", - "type": { - "kind": "struct", - "fields": [ - { - "name": "last_sync_epoch", - "type": "u16" - }, - { - "name": "last_validator_score_sync_epoch", - "type": "u16" - }, - { - "name": "last_leaderboard_scores_sync_epoch", - "type": "u16" - }, - { - "name": "last_active_infos_synced_epoch", - "docs": [ - "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout." - ], - "type": "u16" - }, - { - "name": "last_updated_stake_metrics_epoch", - "type": "u64" - }, - { - "name": "last_distribution_epoch", - "type": { - "option": "u64" - } - }, - { - "name": "last_distribution_slot", - "docs": [ - "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout." - ], - "type": { - "option": "u64" - } - }, - { - "name": "last_merge_deactivating_transients_epoch", - "type": "u64" - }, - { - "name": "last_rebalance_allocation_epoch", - "type": "u64" - }, - { - "name": "last_merge_activating_transients_epoch", - "type": "u64" - }, - { - "name": "last_unstake_epoch", - "type": { - "option": "u64" - } - }, - { - "name": "last_unstake_allocation_epoch", - "type": "u64" - }, - { - "name": "min_max_resolved_epoch_deactivations", - "type": "u16" - }, - { - "name": "last_threshold_sync_epoch", - "type": "u16" - }, - { - "name": "last_validator_removal_selection_epoch", - "type": "u16" - }, - { - "name": "last_validator_addition_selection_epoch", - "type": "u16" - }, - { - "name": "last_validator_pda_setup_epoch", - "type": "u16" - }, - { - "name": "last_graveyard_processing_epoch", - "type": "u16" - }, - { - "name": "last_post_sync_stake_metrics_refresh_epoch", - "type": "u16" - }, - { - "name": "last_graveyard_cleanup_epoch", - "type": "u16" - }, - { - "name": "last_post_late_epoch_stake_metrics_refresh_epoch", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "MetadataArgs", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - }, - { - "name": "symbol", - "type": "string" - }, - { - "name": "uri", - "type": "string" - } - ] - } - }, - { - "name": "OperatorDelivery", - "type": { - "kind": "struct", - "fields": [ - { - "name": "operator", - "type": "pubkey" - }, - { - "name": "envelope_hash", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "OperatorGroup", - "type": { - "kind": "struct", - "fields": [ - { - "name": "members", - "type": { - "vec": "pubkey" - } - } - ] - } - }, - { - "name": "OperatorMapping", - "type": { - "kind": "struct", - "fields": [ - { - "name": "wire_name", - "type": "u64" - }, - { - "name": "sol_address", - "type": "pubkey" - }, - { - "name": "role", - "type": "u32" - }, - { - "name": "status", - "type": "u32" - }, - { - "name": "slashed_at", - "type": "i64" - }, - { - "name": "terminated_at", - "type": "i64" - } - ] - } - }, - { - "name": "OperatorRegistry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "active_group_index", - "type": "u32" - }, - { - "name": "groups", - "type": { - "vec": { - "defined": { - "name": "OperatorGroup" - } - } - } - }, - { - "name": "operators", - "type": { - "vec": { - "defined": { - "name": "OperatorMapping" - } - } - } - }, - { - "name": "collateral_by_code", - "type": { - "vec": { - "defined": { - "name": "CollateralEntry" - } - } - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "OutboundMessageBuffer", - "type": { - "kind": "struct", - "fields": [ - { - "name": "attestation_count", - "type": "u16" - }, - { - "name": "used_data_bytes", - "type": "u32" - }, - { - "name": "entries", - "type": { - "vec": { - "defined": { - "name": "AttestationData" - } - } - } - }, - { - "name": "next_swap_id", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "OutpostAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "user", - "type": "pubkey" - }, - { - "name": "staked_liqsol", - "docs": [ - "STAKE deposits (withdrawable pre-D-Day)", - "Principal amount staked (for display/tracking)" - ], - "type": "u64" - }, - { - "name": "staked_shares", - "docs": [ - "Shares from staking (actual accounting for yield isolation)" - ], - "type": "u64" - }, - { - "name": "purchased_liqsol", - "docs": [ - "WARRANT_PURCHASE deposits with liqSOL (permanent)", - "Principal amount spent on pretokens (for display/tracking)" - ], - "type": "u64" - }, - { - "name": "purchased_shares", - "docs": [ - "Shares from liqSOL pretoken purchases (actual accounting for yield isolation)" - ], - "type": "u64" - }, - { - "name": "bonded_principals", - "docs": [ - "LiqSOL locked by bonds per role" - ], - "type": { - "array": [ - "u64", - 4 - ] - } - }, - { - "name": "bonded_roles", - "docs": [ - "Bitmap of bonded roles (bits 0-3 for YieldOp, BatchOp, Underwriter, PoolOp)" - ], - "type": "u8" - }, - { - "name": "unbond_requested", - "docs": [ - "Bitmap of roles with pending unbond requests (bits 0-3)" - ], - "type": "u8" - }, - { - "name": "warmup_ends_at", - "docs": [ - "Warmup end timestamp - has_role returns false until this time" - ], - "type": "i64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "accumulated_pretoken_yield", - "type": { - "option": "u64" - } - }, - { - "name": "last_epoch_synd_liqsol", - "type": { - "option": "u64" - } - }, - { - "name": "last_synd_epoch", - "type": { - "option": "u64" - } - } - ] - } - }, - { - "name": "OutpostConfig", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "pubkey" - }, - { - "name": "chain_code", - "type": "u64" - }, - { - "name": "next_epoch_index", - "type": "u32" - }, - { - "name": "previous_epoch_hash", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "previous_outbound_epoch_hash", - "docs": [ - "Chain tip for the OUTBOUND (outpost → depot) stream: the canonical", - "epoch digest (`keccak256(encoded envelope)`, `envelope_hash` empty) of", - "this outpost's own previous emit. Stamped into each outbound", - "envelope's `previous_envelope_hash` and advanced after every emit —", - "SEC-114 per-stream chaining; the depot's inbound verification drops a", - "cross-stream link (the inbound tip `previous_epoch_hash`) as a chain", - "break. All-zero = genesis (no emit on this stream yet)." - ], - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "epoch_duration_sec", - "type": "u32" - }, - { - "name": "current_epoch_started_at", - "type": "i64" - }, - { - "name": "registry_initialized", - "type": "bool" - }, - { - "name": "last_message_id", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "last_message_timestamp", - "type": "u64" - }, - { - "name": "envelope_retention_epochs", - "type": "u32" - }, - { - "name": "token_addresses_by_code", - "type": { - "vec": { - "defined": { - "name": "TokenAddressEntry" - } - } - } - }, - { - "name": "precision_by_token_code", - "type": { - "vec": { - "defined": { - "name": "TokenPrecisionEntry" - } - } - } - }, - { - "name": "config_version", - "type": "u8" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PayRateEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "scaled_rate", - "type": "u64" - } - ] - } - }, - { - "name": "PayRateHistory", - "type": { - "kind": "struct", - "fields": [ - { - "name": "current_index", - "type": "u16" - }, - { - "name": "total_entries_added", - "type": "u64" - }, - { - "name": "entries", - "type": { - "vec": { - "defined": { - "name": "PayRateEntry" - } - } - } - }, - { - "name": "max_entries", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PayoutState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "total_yield_paid_out_epoch", - "type": "u64" - }, - { - "name": "fees_remaining_to_distribute", - "type": "u64" - }, - { - "name": "total_fees_deposited", - "type": "u64" - }, - { - "name": "total_cumulative_payout_alltime", - "type": "u128" - }, - { - "name": "total_cumulative_payout_epoch", - "type": "u64" - }, - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "epoch", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PretokenPurchaseHistory", - "serialization": "bytemuck", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "starting_epoch", - "type": "u64" - }, - { - "name": "latest_epoch", - "type": "u64" - }, - { - "name": "purchased_per_epoch", - "type": { - "array": [ - "u64", - 100 - ] - } - }, - { - "name": "synd_per_epoch", - "type": { - "array": [ - "u64", - 100 - ] - } - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "_padding", - "type": { - "array": [ - "u8", - 7 - ] - } - } - ] - } - }, - { - "name": "PretokenPurchased", - "type": { - "kind": "struct", - "fields": [ - { - "name": "user", - "type": "pubkey" - }, - { - "name": "tranche_number", - "type": "u64" - }, - { - "name": "pretokens_purchased", - "type": "u64" - } - ] - } - }, - { - "name": "PriceHistory", - "docs": [ - "Price history for windowed moving average calculations", - "All prices stored in 8-decimal precision" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "window_size", - "docs": [ - "Number of prices to keep in the moving average window" - ], - "type": "u8" - }, - { - "name": "prices", - "docs": [ - "Circular buffer of recent prices (fixed size, 8-dec each)" - ], - "type": { - "array": [ - "u64", - 10 - ] - } - }, - { - "name": "count", - "docs": [ - "Number of valid entries in the prices array (0-10)" - ], - "type": "u8" - }, - { - "name": "next_index", - "type": "u8" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PubkeyBytes", - "docs": [ - "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.", - "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`." - ], - "serialization": "bytemuck", - "repr": { - "kind": "transparent" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "bytes", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "Reserve", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "status", - "type": { - "defined": { - "name": "ReserveStatus" - } - } - }, - { - "name": "creator", - "type": "pubkey" - }, - { - "name": "custody_mint", - "docs": [ - "Mint/native mode pinned at reserve creation. `NATIVE_TOKEN_MARKER`", - "means the reserve custodies lamports; any other pubkey is the SPL mint", - "held by the `reserve_vault`. Terminal handlers (SwapRemit, SwapRevert,", - "ReserveCreateCancelled) read this instead of the mutable", - "`OutpostConfig.token_addresses_by_code`, so an admin re-point of a", - "token_code between creation and dispatch cannot change how an", - "already-created reserve settles." - ], - "type": "pubkey" - }, - { - "name": "custody_decimals", - "docs": [ - "Chain-side decimals pinned at reserve creation. Native reserves use", - "`DEPOT_PRECISION_DECIMALS`; SPL reserves use the source mint's", - "`decimals` at creation time." - ], - "type": "u8" - }, - { - "name": "name_len", - "type": "u8" - }, - { - "name": "name_bytes", - "type": { - "array": [ - "u8", - 64 - ] - } - }, - { - "name": "description_len", - "type": "u16" - }, - { - "name": "description_bytes", - "type": { - "array": [ - "u8", - 256 - ] - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "ReserveAggregate", - "type": { - "kind": "struct", - "fields": [ - { - "name": "failed_remits", - "type": { - "array": [ - { - "defined": { - "name": "FailedSwapRemit" - } - }, - 8 - ] - } - }, - { - "name": "failed_remits_head", - "type": "u8" - }, - { - "name": "failed_remits_total", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "ReserveStatus", - "docs": [ - "Local Borsh enum (NOT the proto enum): tags Pending=0, Active=1, Cancelled=2." - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "Pending" - }, - { - "name": "Active" - }, - { - "name": "Cancelled" - } - ] - } - }, - { - "name": "Role", - "repr": { - "kind": "rust" - }, - "type": { - "kind": "enum", - "variants": [ - { - "name": "YieldOperator" - }, - { - "name": "BatchOperator" - }, - { - "name": "Underwriter" - }, - { - "name": "PoolOperator" - } - ] - } - }, - { - "name": "StakeAllocationState", - "docs": [ - "Stake allocation state tracking for validator stake distribution and unstake orders", - "Tracks both staking allocations (VPP-based) and unstake order batching", - "", - "Rule of thumb for what lives here vs BatchOrchestrator: this account holds", - "CONSERVED-VALUE cycles (frozen amounts, distributed totals, snapshots) - you", - "can never blanket-zero these, a stale cycle gets aborted/recovered instead", - "(see start_unstake_allocation's remainder recovery and abort_rebalance).", - "That's also why the *_started_epoch pins live here and not on BO: the pin is", - "part of its cycle record and must be stamped/cleared atomically with it by", - "the cycle's own start/abort methods, so pin and cycle can't desync. Pure", - "resume cursors with no value attached belong on BatchOrchestrator, where the", - "epoch sweep can wipe them for free.", - "", - "The in_progress bools here are deliberately explicit, NOT inferred like BO", - "does with its cursors. Inference needs a signal whose zero is out-of-band,", - "and every candidate here has a meaningful zero: epoch 0 is real (localnet),", - "an unstake-only rebalance legitimately distributes 0, and the processed", - "counter being nonzero-while-open is an accident of call sites, not a", - "guarantee. Plus these cycles have a state BO ops don't: open-but-stale with", - "recoverable frozen value - stale here means recover, not wipe, so it must", - "stay distinguishable from idle." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "total_active_vpp", - "docs": [ - "Sum of all VPP scores (0-100 each) for Trusted validators in the active list.", - "Max with 200 validators at 100 each = 20,000, fits in u32.", - "", - "Authoritatively recomputed by `conclude_addition_selection` from the active", - "list's `vpp` fields at the end of every addition-selection cycle, so any", - "intra-cycle drift from removals/score updates is wiped before allocation", - "uses this as a denominator. Do not maintain incrementally." - ], - "type": "u32" - }, - { - "name": "bump", - "docs": [ - "Bump seed for PDA" - ], - "type": "u8" - }, - { - "name": "initial_reserve_balance", - "docs": [ - "Initial reserve balance when distribution cycle started (for batched distribution)" - ], - "type": "u64" - }, - { - "name": "pending_unstake_amount_this_epoch", - "docs": [ - "Accumulates unstake requests during the epoch (before allocation starts)", - "Resets to 0 when allocation cycle begins" - ], - "type": "u64" - }, - { - "name": "unstake_allocation_in_progress", - "docs": [ - "Whether unstake allocation is currently in progress (batched processing)" - ], - "type": "bool" - }, - { - "name": "validators_processed_this_unstake_allocation", - "docs": [ - "Number of validators processed in the current unstake allocation batch" - ], - "type": "u16" - }, - { - "name": "processing_unstake_amount_this_allocation", - "docs": [ - "FROZEN amount being allocated across all batches this cycle", - "Set at start of allocation, prevents race conditions with new requests" - ], - "type": "u64" - }, - { - "name": "amount_distributed_this_unstake_allocation", - "docs": [ - "Tracks cumulative amount distributed across all batches in current unstake allocation cycle" - ], - "type": "u64" - }, - { - "name": "rebalance_in_progress", - "docs": [ - "Whether rebalancing is currently in progress (batched processing)" - ], - "type": "bool" - }, - { - "name": "validators_processed_this_rebalance", - "docs": [ - "Number of validators processed in the current rebalance cycle" - ], - "type": "u16" - }, - { - "name": "total_amount_to_distribute_this_rebalance", - "docs": [ - "Total amount to distribute for this rebalance cycle (after subtracting encumbered funds and buffer)", - "Saved at the start to ensure consistency across all batches" - ], - "type": "u64" - }, - { - "name": "cumulative_stake_requested_this_rebalance", - "docs": [ - "Tracks cumulative stake requested (sum of positive deltas) across all batches in current rebalance cycle" - ], - "type": "u64" - }, - { - "name": "rebalance_stake_scale_factor", - "docs": [ - "Scale factor to apply during process_stake_orders (uses PAY_RATE_SCALE_FACTOR precision)", - "Set to PAY_RATE_SCALE_FACTOR (1.0) if no scaling needed, or lower if cumulative > available" - ], - "type": "u64" - }, - { - "name": "is_small_distribution_mode", - "docs": [ - "Whether we're in small distribution mode (not enough for VPP-based distribution)", - "In this mode, we distribute evenly to first N validators instead of using VPP ratios" - ], - "type": "bool" - }, - { - "name": "validators_to_fund_this_rebalance", - "docs": [ - "Number of validators to fund in small distribution mode", - "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)" - ], - "type": "u16" - }, - { - "name": "amount_per_validator_this_rebalance", - "docs": [ - "Amount each validator gets in small distribution mode", - "Calculated as total_to_distribute / validators_to_fund" - ], - "type": "u64" - }, - { - "name": "selection_entry_threshold_vpp", - "docs": [ - "Entry threshold VPP from leaderboard (validators must meet this to be added, 0-100)" - ], - "type": "u8" - }, - { - "name": "selection_exit_threshold_vpp", - "docs": [ - "Exit threshold VPP from leaderboard (validators below this are removed, 0-100)" - ], - "type": "u8" - }, - { - "name": "addition_in_progress", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always false." - ], - "type": "bool" - }, - { - "name": "unstake_allocation_started_epoch", - "docs": [ - "Epoch in which the current unstake allocation cycle was started.", - "Used to detect stale cycles that span epoch boundaries — if the epoch", - "has advanced, the cycle is reset and restarted to avoid resuming", - "against a mutated validator active list.", - "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)" - ], - "type": "u16" - }, - { - "name": "rebalance_started_epoch", - "docs": [ - "Epoch in which the current rebalance cycle was started. Same job as", - "unstake_allocation_started_epoch above — a cycle whose epoch no longer", - "matches is stale (active list may have been reshuffled by selection)", - "and gets aborted + restarted instead of resumed.", - "(Repurposed from the deprecated addition_target_rank field — always 0 on mainnet.)" - ], - "type": "u16" - }, - { - "name": "validators_added_this_selection", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always 0." - ], - "type": "u16" - }, - { - "name": "removal_in_progress", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always false." - ], - "type": "bool" - }, - { - "name": "removal_next_index", - "docs": [ - "DEPRECATED — see BatchOrchestrator.removal_next_index. Always 0." - ], - "type": "u16" - }, - { - "name": "removal_active_list_snapshot", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always 0." - ], - "type": "u16" - }, - { - "name": "validators_removed_this_selection", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always 0." - ], - "type": "u16" - } - ] - } - }, - { - "name": "StakeControllerState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "pubkey" - }, - { - "name": "vault_initialized", - "type": "bool" - }, - { - "name": "reserve_pool_initialized", - "type": "bool" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "StakeMetrics", - "type": { - "kind": "struct", - "fields": [ - { - "name": "current_active_stake", - "type": "u64" - }, - { - "name": "transient_active_stake", - "type": "u64" - }, - { - "name": "actual_system_yield_received", - "type": "u64" - }, - { - "name": "sol_system_pay_rate", - "type": "u64" - }, - { - "name": "unstakeable_stake", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "mev_reward", - "docs": [ - "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)" - ], - "type": "u64" - }, - { - "name": "total_outstanding_amount_to_unstake", - "docs": [ - "WNS-16: total amount_to_unstake across all validators at last metrics refresh.", - "Represents allocated-but-not-yet-deactivated unstake obligations.", - "Subtracted from unstakeable_stake in admission control to prevent double-promising." - ], - "type": "u64" - }, - { - "name": "_reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 24 - ] - } - } - ] - } - }, - { - "name": "StakesMerged", - "type": { - "kind": "struct", - "fields": [ - { - "name": "validator", - "type": "pubkey" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "count", - "type": "u32" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "TokenAddressEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "mint", - "type": "pubkey" - } - ] - } - }, - { - "name": "TokenMetadata", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - }, - { - "name": "symbol", - "type": "string" - }, - { - "name": "uri", - "type": "string" - } - ] - } - }, - { - "name": "TokenPrecisionEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "decimals", - "type": "u8" - } - ] - } - }, - { - "name": "TrancheState", - "docs": [ - "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)", - "Example: $193.32 is stored as 19332000000" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "current_tranche_number", - "type": "u64" - }, - { - "name": "current_tranche_supply", - "type": "u64" - }, - { - "name": "current_tranche_price_usd", - "type": "u64" - }, - { - "name": "total_pretokens_sold", - "type": "u64" - }, - { - "name": "initial_tranche_supply", - "type": "u64" - }, - { - "name": "supply_growth_bps", - "docs": [ - "Supply growth in basis points (e.g., 100 = 1%, max 10000)" - ], - "type": "u16" - }, - { - "name": "price_growth_cents", - "docs": [ - "Price growth in cents per tranche (0.01 USD units)" - ], - "type": "u16" - }, - { - "name": "min_price_usd", - "docs": [ - "Minimum valid SOL/USD price for validation (8-dec)" - ], - "type": "u64" - }, - { - "name": "max_price_usd", - "docs": [ - "Maximum valid SOL/USD price for validation (8-dec)" - ], - "type": "u64" - }, - { - "name": "max_staleness_seconds", - "docs": [ - "Maximum staleness in seconds for Chainlink data" - ], - "type": "i64" - }, - { - "name": "chainlink_program", - "docs": [ - "Chainlink program address" - ], - "type": "pubkey" - }, - { - "name": "chainlink_feed", - "docs": [ - "Chainlink price feed PDA" - ], - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "UserPretokenRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "user", - "type": "pubkey" - }, - { - "name": "total_sol_deposited", - "type": "u64" - }, - { - "name": "total_pretokens_purchased", - "type": "u64" - }, - { - "name": "last_tranche_number", - "type": "u64" - }, - { - "name": "last_tranche_price_usd", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "UserRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "shares", - "docs": [ - "User's share of the distribution pool", - "entitled_balance = shares * current_index / INDEX_SCALE" - ], - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "tracked_balance", - "docs": [ - "Last reconciled liqSOL token balance for this user ATA" - ], - "type": "u64" - } - ] - } - }, - { - "name": "ValidatorAddedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "vpp", - "type": "u8" - } - ] - } - }, - { - "name": "ValidatorInfoAccount", - "docs": [ - "Per-validator information account", - "Seed: [\"validator_info\", vote_account]" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "docs": [ - "Vote account this info belongs to" - ], - "type": "pubkey" - }, - { - "name": "vpp", - "docs": [ - "Validator Performance Points (0-100 score)" - ], - "type": "u8" - }, - { - "name": "bump", - "docs": [ - "Bump seed for PDA" - ], - "type": "u8" - }, - { - "name": "current_active_stake", - "docs": [ - "Fully active stake earning rewards" - ], - "type": "u64" - }, - { - "name": "epoch_reward", - "docs": [ - "Rewards earned in the last epoch", - "This is update in the function: sync_validator_stakes_v2 and is a simple subtraction of current - previous active stake. This does cater for deactivations etc. so", - "no worries" - ], - "type": "u64" - }, - { - "name": "transient_active_stake", - "docs": [ - "Stake warming up (activating), not fully active yet" - ], - "type": "u64" - }, - { - "name": "transient_deactivating_stake", - "docs": [ - "Stake cooling down (deactivating), no longer earning rewards" - ], - "type": "u64" - }, - { - "name": "last_chain_sync_epoch", - "docs": [ - "When was this entry last updated from the chain?", - "This is update in the function: sync_validator_stakes_v2" - ], - "type": "u16" - }, - { - "name": "last_score_sync_epoch", - "docs": [ - "When was this VPP score last updated from our Validator Leaderboard program?" - ], - "type": "u16" - }, - { - "name": "last_state_change_epoch", - "docs": [ - "When was the validator state last changed? (helps determine cooldowns)" - ], - "type": "u16" - }, - { - "name": "amount_to_stake", - "docs": [ - "The amount of stake to stake" - ], - "type": "u64" - }, - { - "name": "amount_to_unstake", - "docs": [ - "The amount of stake to unstake" - ], - "type": "u64" - }, - { - "name": "validator_repute", - "docs": [ - "State of the validator" - ], - "type": { - "defined": { - "name": "ValidatorReputation" - } - } - }, - { - "name": "validator_state", - "type": { - "defined": { - "name": "ValidatorState" - } - } - }, - { - "name": "state_transition_trigger_stake_amount", - "type": "u64" - }, - { - "name": "mev_earned", - "docs": [ - "MEV reward swept for this validator in the current epoch" - ], - "type": "u64" - }, - { - "name": "rebalance_unstake_pending", - "docs": [ - "The share of amount_to_unstake that came from rebalance this epoch.", - "amount_to_unstake mixes two things with different rules: user-withdrawal", - "shares are DEBT (back receipts, never resettable) while the rebalance", - "share is INTENT (recomputed from target-vs-effective every cycle,", - "replaceable). This field makes the intent part separable so a new", - "rebalance cycle can drop a dead cycle's contribution instead of adding", - "on top of it, without ever touching user debt.", - "(Carved from _reserved - those bytes are structurally zero: introduced", - "via realloc(len, true) in migrate_validator_info_batch and zeroed by", - "initialize() on fresh PDAs, never written since. Zero = \"all existing", - "amount_to_unstake is debt\", which is exactly today's safe behavior.)" - ], - "type": "u64" - }, - { - "name": "rebalance_unstake_epoch", - "docs": [ - "Epoch the rebalance component was stamped. A mismatch with the current", - "epoch means the component is a dead cycle's intent - subtract and re-add." - ], - "type": "u16" - }, - { - "name": "_reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 14 - ] - } - } - ] - } - }, - { - "name": "ValidatorList", - "docs": [ - "Zero-copy validator list account", - "Stores a fixed-capacity array of validator vote account pubkeys" - ], - "serialization": "bytemuckunsafe", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "count", - "docs": [ - "Current number of validators in the list" - ], - "type": "u32" - }, - { - "name": "capacity", - "docs": [ - "Maximum capacity of the list" - ], - "type": "u32" - }, - { - "name": "bump", - "docs": [ - "PDA bump seed" - ], - "type": "u8" - }, - { - "name": "_padding", - "docs": [ - "Padding for alignment" - ], - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "validators", - "docs": [ - "Fixed array of validator vote account pubkeys", - "Using Option to allow for empty slots (None = empty)" - ], - "type": { - "array": [ - { - "defined": { - "name": "ValidatorListEntry" - } - }, - 200 - ] - } - } - ] - } - }, - { - "name": "ValidatorListEntry", - "serialization": "bytemuckunsafe", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "docs": [ - "Vote account pubkey (all zeros = empty slot)" - ], - "type": "pubkey" - }, - { - "name": "registry_index", - "docs": [ - "Immutable index into the validator leaderboard arrays (u16::MAX = unknown)" - ], - "type": "u16" - }, - { - "name": "pdas_initialized", - "docs": [ - "Whether per-validator PDAs (info/transient) are initialized" - ], - "type": "bool" - }, - { - "name": "vpp", - "docs": [ - "Cached VPP score (0-100) refreshed at the start of a maintenance run" - ], - "type": "u8" - }, - { - "name": "_pad", - "docs": [ - "Padding to keep 8-byte alignment (32 + 2 + 1 + 1 + 4 = 40 bytes)" - ], - "type": { - "array": [ - "u8", - 4 - ] - } - } - ] - } - }, - { - "name": "ValidatorRemovedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "vpp", - "type": "u8" - } - ] - } - }, - { - "name": "ValidatorReputation", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Trusted" - }, - { - "name": "Blacklisted" - }, - { - "name": "UnderPerforming" - } - ] - } - }, - { - "name": "ValidatorState", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Warming" - }, - { - "name": "NotDelegated" - }, - { - "name": "Cooling" - }, - { - "name": "Warm" - }, - { - "name": "ReadyToCool" - } - ] - } - }, - { - "name": "ValidatorSwappedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "removed_vote", - "type": "pubkey" - }, - { - "name": "removed_vpp", - "type": "u8" - }, - { - "name": "added_vote", - "type": "pubkey" - }, - { - "name": "added_vpp", - "type": "u8" - } - ] - } - }, - { - "name": "ValidatorTransientAccount", - "docs": [ - "Per-validator transient stake tracking account", - "Seed: [\"validator_transient\", vote_account]", - "", - "This account tracks the resolution status of transient stake accounts", - "(both activating and deactivating) for a specific validator." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "docs": [ - "Vote account this transient tracking belongs to" - ], - "type": "pubkey" - }, - { - "name": "bump", - "docs": [ - "Bump seed for PDA" - ], - "type": "u8" - }, - { - "name": "_padding", - "docs": [ - "Padding for alignment" - ], - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "max_resolved_epoch_deactivations", - "docs": [ - "The epoch number for which we have resolved the deactivating stakes", - "(resolved = deactivated and merged into the stake pool reserve)" - ], - "type": "u16" - }, - { - "name": "max_resolved_activating_stake", - "docs": [ - "The epoch number for which we have resolved the activating stakes", - "(resolved = fully activated and merged into the main stake account)" - ], - "type": "u16" - }, - { - "name": "last_updated_epoch_activations", - "docs": [ - "When did we last check if there are pending activated transient stakes that need to be merged in" - ], - "type": "u16" - }, - { - "name": "last_updated_epoch_deactivations", - "docs": [ - "When did we last check if there were pending deactivated stakes that need to be merged into the reserve pool" - ], - "type": "u16" - } - ] - } - }, - { - "name": "ValidatorsSyncedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "updated_count", - "type": "u32" - }, - { - "name": "not_found_count", - "type": "u32" - }, - { - "name": "epoch", - "type": "u64" - } - ] - } - }, - { - "name": "WireState", - "type": { - "kind": "enum", - "variants": [ - { - "name": "PreLaunch" - }, - { - "name": "PostLaunch" - }, - { - "name": "Refund" - } - ] - } - }, - { - "name": "WithdrawClaimed", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "user", - "type": "pubkey" - } - ] - } - }, - { - "name": "WithdrawRequested", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "user", - "type": "pubkey" - }, - { - "name": "receipt_id", - "type": "u64" - } - ] - } - } - ] -} diff --git a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPP.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPP.json deleted file mode 100644 index e82f293..0000000 --- a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPP.json +++ /dev/null @@ -1,1081 +0,0 @@ -{ - "contractName": "OPP", - "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionCatchUpPruned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "previousRetentionEpochs", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionConfigUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OPPEnvelope", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_ENVELOPE_BYTES", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "addAttestation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "allAuthorizedSenders", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "authorizedSenders", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "wireEpochIndex", - "type": "uint32" - } - ], - "name": "emitOutboundEnvelope", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tag", - "type": "uint256" - } - ], - "name": "enterSendMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tag", - "type": "uint256" - } - ], - "name": "exitSendMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getLatestOutboundEnvelope", - "outputs": [ - { - "internalType": "uint32", - "name": "epoch_", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data_", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "getOutboundEnvelope", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inSendMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_authority", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastMessageID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastMessageTimestamp", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestOutboundEnvelope", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestOutboundEpoch", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "name": "outboundEnvelopes", - "outputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outboundRetentionConfig", - "outputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingAttestationCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "pruneOutboundEnvelope", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "queuedMessageCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "sendModeTag", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "start", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "end", - "type": "tuple" - } - ], - "internalType": "struct Endpoints", - "name": "endpoints", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "messageId", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "previousMessageId", - "type": "bytes" - }, - { - "internalType": "uint32", - "name": "payloadSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "payloadChecksum", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "headerChecksum", - "type": "bytes" - } - ], - "internalType": "struct MessageHeader", - "name": "header", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "version", - "type": "uint32" - }, - { - "components": [ - { - "internalType": "AttestationType", - "name": "type_", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "dataSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AttestationEntry[]", - "name": "attestations", - "type": "tuple[]" - } - ], - "internalType": "struct MessagePayload", - "name": "payload", - "type": "tuple" - } - ], - "name": "serializeMessage", - "outputs": [ - { - "components": [ - { - "components": [ - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "start", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "end", - "type": "tuple" - } - ], - "internalType": "struct Endpoints", - "name": "endpoints", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "messageId", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "previousMessageId", - "type": "bytes" - }, - { - "internalType": "uint32", - "name": "payloadSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "payloadChecksum", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "headerChecksum", - "type": "bytes" - } - ], - "internalType": "struct MessageHeader", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "setEnvelopeRetentionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPPInbound.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPPInbound.json deleted file mode 100644 index ac08035..0000000 --- a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OPPInbound.json +++ /dev/null @@ -1,1414 +0,0 @@ -{ - "contractName": "OPPInbound", - "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes", - "name": "messageID", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "AttestationBlackholed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "handler", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "messageID", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "AttestationDelivered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "address", - "name": "handler", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldHandler", - "type": "address" - } - ], - "name": "AttestationHandlerSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionCatchUpPruned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "previousRetentionEpochs", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "EnvelopeRetentionConfigUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "EpochComplete", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "deliveryCount", - "type": "uint32" - } - ], - "name": "EpochConsensus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator_", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - } - ], - "name": "EpochDelivery", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "epochHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "messageCount", - "type": "uint256" - } - ], - "name": "EpochReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newReserveManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldReserveManager", - "type": "address" - } - ], - "name": "ReserveManagerAddressSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_ENVELOPE_BYTES", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MIN_SIG_WEIGHT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "activeGroupIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "name": "attestationHandlers", - "outputs": [ - { - "internalType": "contract IOPPReceiver", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "batchOpGroups", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "consensusReached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentEpochStartedAt", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "epochDeliveries", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "name": "epochDeliveryCount", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "epochDigestCount", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "epochDurationSec", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "epochIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "getInboundEnvelope", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "internalType": "struct OPPEnvelopeRetention.EnvelopeRecord", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "name": "inboundEnvelopes", - "outputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "emittedAt", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "checksum", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "inboundRetentionConfig", - "outputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oppManager", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator_", - "type": "address" - } - ], - "name": "isActiveOperator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastMessageID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nextEpochIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "operatorEthAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppContract", - "outputs": [ - { - "internalType": "contract IOPP", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingConsensus", - "outputs": [ - { - "internalType": "uint32", - "name": "nextEpoch", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "deliveries", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "groupSize", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "currentEpochStartedAtTs", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "epochDurationSec_", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "digest", - "type": "bytes32" - } - ], - "name": "pendingConsensusForDigest", - "outputs": [ - { - "internalType": "uint32", - "name": "nextEpoch", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "agreeing", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "groupSize", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "currentEpochStartedAtTs", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "epochDurationSec_", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingEpoch", - "outputs": [ - { - "internalType": "bytes", - "name": "envelopeHash", - "type": "bytes" - }, - { - "components": [ - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "start", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "ChainKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "id", - "type": "uint32" - } - ], - "internalType": "struct ChainId", - "name": "end", - "type": "tuple" - } - ], - "internalType": "struct Endpoints", - "name": "endpoints", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "epochTimestamp", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "epochEnvelopeIndex", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingEpochHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingMessageCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "previousEpochHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex_", - "type": "uint32" - } - ], - "name": "pruneInboundEnvelope", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "pubkeyAddressCache", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "reserveManagerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rosterInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "address", - "name": "handler", - "type": "address" - } - ], - "name": "setAttestationHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "retentionEpochs", - "type": "uint32" - } - ], - "name": "setEnvelopeRetentionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "durationSec", - "type": "uint32" - } - ], - "name": "setEpochDurationSec", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "opp", - "type": "address" - } - ], - "name": "setOPPContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newReserveManager", - "type": "address" - } - ], - "name": "setReserveManagerAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OperatorRegistry.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OperatorRegistry.json deleted file mode 100644 index ce933e6..0000000 --- a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/OperatorRegistry.json +++ /dev/null @@ -1,1764 +0,0 @@ -{ - "contractName": "OperatorRegistry", - "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "provided", - "type": "address" - } - ], - "name": "WIRE_BadContractAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "bps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBps", - "type": "uint256" - } - ], - "name": "WIRE_BasisPointsTooHigh", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "derived", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_DepositorKeyMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20DepositValueNonZero", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_EthSendFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_FeeOnTransferUnsupported", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_GoLiveInProgress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - } - ], - "name": "WIRE_InsufficientEthBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "WIRE_InvalidDepositorKey", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "WIRE_InvalidNodeTier", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "WIRE_InvalidWireAccountName", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "WireKeyType", - "name": "keyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "keyLength", - "type": "uint256" - } - ], - "name": "WIRE_InvalidWireKey", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_LiqEthTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_MultipleNativeTrackedCodes", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NativeDepositValueMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "actor", - "type": "address" - }, - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - } - ], - "name": "WIRE_NoBonds", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoPricesRecorded", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoYield", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nftAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_NodeTokenNotOwned", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_NotReceiptOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_OnlyOPPInboundLib", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OppInboundCallerUnauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OutpostChainCodeUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "innerRevert", - "type": "bytes" - } - ], - "name": "WIRE_PermitFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_PrecisionOverflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_PrecisionUnsetForRefund", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "WIRE_PriceOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - } - ], - "name": "WIRE_ReceiptNotWithdrawable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingInProgress", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingOnly", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveBadParam", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveCancelNotCreator", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveNotCancellable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapEmptyRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceNotNative", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceReserveUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_SwapSourceTokenNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapUnknownSlugName", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapZeroSourceAmount", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TokenAddressUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "provided", - "type": "uint8" - } - ], - "name": "WIRE_TokenPrecisionOutOfRange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_TokenPrecisionUnset", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TrackedCodeZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "WIRE_UnexpectedError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "WIRE_UnexpectedTokenDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_WireNodesContractNotSet", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ZeroAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "refundedToDepositor", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "penaltyToReserve", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "originalMessageId", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "DepositReverted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "LiqTokenCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "NativeTokenCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "OperatorDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "reserveTarget", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "OperatorSlashed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "OutpostChainCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "underwriter", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "uicBytes", - "type": "bytes" - } - ], - "name": "UnderwriteCommitRelayed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "requestId", - "type": "uint64" - } - ], - "name": "WithdrawRemitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "requestId", - "type": "uint64" - } - ], - "name": "WithdrawRequested", - "type": "event" - }, - { - "inputs": [], - "name": "DEPOSIT_REVERT_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEPOSIT_REVERT_GAS_MULTIPLIER", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR_ACTION_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OPPAttestationIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "UNDERWRITE_INTENT_COMMIT_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "__OPPEndpointManaged_init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "uicBytes", - "type": "bytes" - } - ], - "name": "commit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "compressedPubkey", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "compressedPubkey", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositNonNative", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "depositedByCode", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSummaryAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "AttestationType", - "name": "type_", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "dataSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AttestationEntry[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_authority", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "liqToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "liqTokenCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nativeTokenCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "operators", - "outputs": [ - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - }, - { - "internalType": "OperatorStatus", - "name": "status", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppInboundAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outpostChainCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outpostId", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "reserveManagerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_liqToken", - "type": "address" - } - ], - "name": "setLiqToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "setLiqTokenCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "setNativeTokenCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_oppAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_oppInboundAddress", - "type": "address" - } - ], - "name": "setOPPAddresses", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "setOutpostChainCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "_outpostId", - "type": "uint64" - } - ], - "name": "setOutpostId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_reserveManager", - "type": "address" - } - ], - "name": "setReserveManagerAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "slash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "compressedPubkey", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/ReserveManager.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/ReserveManager.json deleted file mode 100644 index 7925177..0000000 --- a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/ethereum/ReserveManager.json +++ /dev/null @@ -1,2563 +0,0 @@ -{ - "contractName": "ReserveManager", - "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AccessManagedInvalidAuthority", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delay", - "type": "uint32" - } - ], - "name": "AccessManagedRequiredDelay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "AccessManagedUnauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "EnforcedPause", - "type": "error" - }, - { - "inputs": [], - "name": "ExpectedPause", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "raw", - "type": "uint64" - } - ], - "name": "InvalidEnumValue", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actualBytes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytes", - "type": "uint256" - } - ], - "name": "OPP_EnvelopeOverCap", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_EpochHashMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeRecordMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "evictBoundary", - "type": "uint32" - } - ], - "name": "OPP_InboundEnvelopeStillInRetention", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "provided", - "type": "uint256" - } - ], - "name": "OPP_InsufficientSignatureWeight", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "expected", - "type": "address" - } - ], - "name": "OPP_InvalidOPPAddress", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_InvalidRetentionConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "expected", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "actual", - "type": "bytes" - } - ], - "name": "OPP_MessageIDMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoAttestationsSent", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NoPendingAttestations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "previousEnvelopeHash", - "type": "bytes" - } - ], - "name": "OPP_NonCanonicalPreviousEpochHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "expected", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "actual", - "type": "uint32" - } - ], - "name": "OPP_NonSequentialEpoch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_NotActiveOperator", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_NotSending", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_OPPAddressNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "epochIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "OPP_OperatorAlreadyDelivered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "OPP_PayloadChecksumMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stack", - "type": "uint256" - } - ], - "name": "OPP_SendStackError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnauthorizedAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - } - ], - "name": "OPP_UnhandledAttestationType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "ChainKind", - "name": "actualKind", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "actualId", - "type": "uint32" - } - ], - "name": "OPP_WrongDestinationChain", - "type": "error" - }, - { - "inputs": [], - "name": "OPP_ZeroTag", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "provided", - "type": "address" - } - ], - "name": "WIRE_BadContractAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "bps", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBps", - "type": "uint256" - } - ], - "name": "WIRE_BasisPointsTooHigh", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "derived", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_DepositorKeyMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20DepositValueNonZero", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_Erc20TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_EthSendFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_FeeOnTransferUnsupported", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_GoLiveInProgress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - } - ], - "name": "WIRE_InsufficientEthBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "WIRE_InvalidDepositorKey", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "WIRE_InvalidNodeTier", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "WIRE_InvalidWireAccountName", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "WireKeyType", - "name": "keyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "keyLength", - "type": "uint256" - } - ], - "name": "WIRE_InvalidWireKey", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "WIRE_LiqEthTransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_MultipleNativeTrackedCodes", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NativeDepositValueMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "actor", - "type": "address" - }, - { - "internalType": "OperatorType", - "name": "operatorType", - "type": "uint8" - } - ], - "name": "WIRE_NoBonds", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoPricesRecorded", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_NoYield", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nftAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_NodeTokenNotOwned", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_NotReceiptOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "WIRE_OnlyOPPInboundLib", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OppInboundCallerUnauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_OutpostChainCodeUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "innerRevert", - "type": "bytes" - } - ], - "name": "WIRE_PermitFailed", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_PrecisionOverflow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_PrecisionUnsetForRefund", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "WIRE_PriceOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "receiptId", - "type": "uint256" - } - ], - "name": "WIRE_ReceiptNotWithdrawable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingInProgress", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_RefundingOnly", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveBadParam", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveCancelNotCreator", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ReserveNotCancellable", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapEmptyRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceNotNative", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapSourceReserveUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_SwapSourceTokenNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapUnknownSlugName", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_SwapZeroSourceAmount", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TokenAddressUnset", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "provided", - "type": "uint8" - } - ], - "name": "WIRE_TokenPrecisionOutOfRange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "WIRE_TokenPrecisionUnset", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_TrackedCodeZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "WIRE_UnexpectedError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "WIRE_UnexpectedTokenDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_WireNodesContractNotSet", - "type": "error" - }, - { - "inputs": [], - "name": "WIRE_ZeroAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "authority", - "type": "address" - } - ], - "name": "AuthorityUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "BalanceSheetEmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "OutpostChainCodeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "ReserveActivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - } - ], - "name": "ReserveCancelRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "refundedAmount", - "type": "uint256" - } - ], - "name": "ReserveCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - } - ], - "name": "ReserveCreateRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "id", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - } - ], - "name": "SwapDeposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalMessageId", - "type": "bytes32" - } - ], - "name": "SwapRemitPaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "depotAmount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "SwapRemitUnpayable", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "name": "SwapRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalSwapMessageId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "errData", - "type": "bytes" - } - ], - "name": "SwapRevertError", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "originalSwapMessageId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "SwapReverted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "TokenAddressSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "TrackedCodesUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [], - "name": "BALANCE_SHEET_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "AttestationType", - "name": "attestationType", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OPPAttestationIn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "RESERVE_CREATE_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RESERVE_CREATE_CANCEL_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SWAP_REQUEST_ATTESTATION", - "outputs": [ - { - "internalType": "AttestationType", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "__OPPEndpointManaged_init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "_payRemit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "authority", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "cancel_create_reserve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "bool", - "name": "isPrivate", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "creatorPubKey", - "type": "bytes" - } - ], - "name": "create_reserve", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "emitBalanceSheet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "getReserve", - "outputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "enum ReserveManager.LocalReserveStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "bool", - "name": "exists", - "type": "bool" - } - ], - "internalType": "struct ReserveManager.ReserveRecord", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSummaryAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "AttestationType", - "name": "type_", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "dataSize", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AttestationEntry[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_authority", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isConsumingScheduledOp", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nativeTokenCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "onReserveCreateCancelled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - } - ], - "name": "onReserveReady", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "depotAmount", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "originalSwapMessageId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "onSwapRevert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "oppAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oppInboundAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "outpostChainCode", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "bool", - "name": "isPrivate", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "creatorPubKey", - "type": "bytes" - } - ], - "internalType": "struct ReserveManagerLib.ReserveCreateArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "requestReserveCreateErc20WithApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - }, - { - "internalType": "bool", - "name": "isPrivate", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "creatorPubKey", - "type": "bytes" - } - ], - "internalType": "struct ReserveManagerLib.ReserveCreateArgs", - "name": "args", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct ReserveManagerLib.PermitSig", - "name": "permitSig", - "type": "tuple" - } - ], - "name": "requestReserveCreateErc20WithPermit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "name": "requestSwap", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "internalType": "struct ReserveManagerLib.SwapArgs", - "name": "args", - "type": "tuple" - } - ], - "name": "requestSwapErc20WithApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceReserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "sourceAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "targetChainCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetTokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "targetReserveCode", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "targetRecipient", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "targetAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "targetToleranceBps", - "type": "uint32" - } - ], - "internalType": "struct ReserveManagerLib.SwapArgs", - "name": "args", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "internalType": "struct ReserveManagerLib.PermitSig", - "name": "permitSig", - "type": "tuple" - } - ], - "name": "requestSwapErc20WithPermit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "reserves", - "outputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "externalTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "requestedWireAmount", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "connectorWeightBps", - "type": "uint32" - }, - { - "internalType": "enum ReserveManager.LocalReserveStatus", - "name": "status", - "type": "uint8" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "bool", - "name": "exists", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAuthority", - "type": "address" - } - ], - "name": "setAuthority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_oppAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_oppInboundAddress", - "type": "address" - } - ], - "name": "setOPPAddresses", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainCode", - "type": "uint64" - } - ], - "name": "setOutpostChainCode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "address", - "name": "tokenAddr", - "type": "address" - }, - { - "internalType": "uint8", - "name": "precision", - "type": "uint8" - } - ], - "internalType": "struct ReserveManager.TrackedCodeEntry[]", - "name": "entries", - "type": "tuple[]" - } - ], - "name": "setTrackedCodes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "swapDepositCounter", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "tokenAddressesByCode", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "tokenPrecisionByCode", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "trackedCodesCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "trackedReserveCodes", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "trackedTokenCodes", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "tokenCode", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "reserveCode", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] -} \ No newline at end of file diff --git a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana/liqsol_core.json b/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana/liqsol_core.json deleted file mode 100644 index 0e01656..0000000 --- a/packages/sdk-outpost/src/assets/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6/solana/liqsol_core.json +++ /dev/null @@ -1,10161 +0,0 @@ -{ - "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - "metadata": { - "name": "liqsol_core", - "version": "0.1.0", - "spec": "0.1.0", - "description": "Created with Anchor" - }, - "instructions": [ - { - "name": "add_attestation", - "discriminator": [ - 206, - 82, - 129, - 170, - 54, - 159, - 161, - 156 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "outbound_message_buffer", - "writable": true - } - ], - "args": [ - { - "name": "attestation_type", - "type": "i32" - }, - { - "name": "data", - "type": "bytes" - } - ] - }, - { - "name": "add_top_performers_batch", - "docs": [ - "Process batch of ranks for addition (top performers from leaderboard)" - ], - "discriminator": [ - 152, - 7, - 241, - 69, - 197, - 73, - 32, - 12 - ], - "accounts": [ - { - "name": "allocation_state", - "writable": true - }, - { - "name": "active_list", - "writable": true - }, - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "leaderboard_state" - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for threshold parameters" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "admin_force_unbond_role", - "discriminator": [ - 80, - 107, - 27, - 49, - 126, - 25, - 31, - 238 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state" - }, - { - "name": "user", - "docs": [ - "The user whose role bond is being force-unbonded" - ] - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "aggregate_stake_metrics", - "docs": [ - "V2: Aggregate stake metrics across all validators using PDA architecture" - ], - "discriminator": [ - 13, - 245, - 47, - 202, - 170, - 73, - 98, - 207 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list" - } - ], - "args": [] - }, - { - "name": "bond_role", - "discriminator": [ - 143, - 136, - 20, - 230, - 136, - 103, - 107, - 167 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state" - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "calculate_unstake_allocations", - "docs": [ - "Calculate unstake allocations across validators (batched, up to 10 per call)", - "Distributes the FROZEN processing amount proportionally based on active stake", - "Call this after accumulating requests via accumulate_unstake_request" - ], - "discriminator": [ - 156, - 232, - 48, - 116, - 107, - 60, - 136, - 140 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - to track unstake allocation batching" - ], - "writable": true - }, - { - "name": "stake_metrics", - "docs": [ - "Stake metrics - to validate total unstake amount is available" - ] - }, - { - "name": "active_list", - "docs": [ - "Active validator list - to verify validators are in active list" - ] - }, - { - "name": "maintenance_ledger", - "docs": [ - "Maintenance ledger - to track last unstake allocation epoch" - ], - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - } - ], - "args": [] - }, - { - "name": "calculate_validator_allocations", - "discriminator": [ - 48, - 217, - 8, - 168, - 228, - 221, - 140, - 112 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - to track rebalancing progress" - ], - "writable": true - }, - { - "name": "stake_metrics", - "docs": [ - "Stake metrics - to get current total active stake" - ] - }, - { - "name": "active_list", - "docs": [ - "Active validator list - to verify validators are in active list" - ] - }, - { - "name": "reserve_pool", - "docs": [ - "Reserve pool - to read current balance" - ], - "writable": true - }, - { - "name": "maintenance_ledger", - "docs": [ - "Maintenance ledger - to track last rebalance epoch" - ], - "writable": true - }, - { - "name": "clock" - }, - { - "name": "global", - "docs": [ - "Global withdraw operator state - to read total_encumbered_funds" - ] - }, - { - "name": "global_config", - "docs": [ - "Global config for rebalancing thresholds" - ] - } - ], - "args": [] - }, - { - "name": "cancel_create_reserve", - "discriminator": [ - 218, - 158, - 127, - 156, - 61, - 162, - 19, - 255 - ], - "accounts": [ - { - "name": "creator", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve" - }, - { - "name": "outbound_message_buffer", - "writable": true - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - } - ] - }, - { - "name": "claim_rewards", - "discriminator": [ - 4, - 144, - 132, - 71, - 116, - 23, - 151, - 80 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_mint" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account holding liqSOL" - ], - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "claim_withdraw", - "docs": [ - "Pay user (stub) and close/burn the receipt via CPI to nft_factory." - ], - "discriminator": [ - 232, - 89, - 154, - 117, - 16, - 204, - 182, - 224 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global", - "docs": [ - "Global operator state" - ], - "writable": true - }, - { - "name": "mint_authority" - }, - { - "name": "receipt_data", - "writable": true - }, - { - "name": "mint_account", - "writable": true - }, - { - "name": "owner_ata", - "writable": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "global_config", - "docs": [ - "Global config for claim_withdrawals_enabled check" - ] - }, - { - "name": "token_program" - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "associated_token_program" - } - ], - "args": [] - }, - { - "name": "cleanup_envelope_chunks", - "discriminator": [ - 224, - 118, - 156, - 99, - 9, - 136, - 14, - 207 - ], - "accounts": [ - { - "name": "reaper", - "signer": true - }, - { - "name": "config" - }, - { - "name": "latest_outbound_envelope" - }, - { - "name": "chunk_buffer", - "writable": true - }, - { - "name": "uploader", - "writable": true - } - ], - "args": [ - { - "name": "epoch_index", - "type": "u32" - } - ] - }, - { - "name": "cleanup_graveyard_batch", - "docs": [ - "Cleanup graveyard validators batch: remove validators that have been NotDelegated for > 10 epochs", - "This function should be called after aggregate_stake_metrics.", - "Validators meeting the cleanup criteria will have their PDAs closed and rent returned to admin." - ], - "discriminator": [ - 241, - 120, - 180, - 4, - 160, - 109, - 206, - 71 - ], - "accounts": [ - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "global_config" - }, - { - "name": "clock" - }, - { - "name": "cranky", - "writable": true, - "signer": true - } - ], - "args": [] - }, - { - "name": "commit_underwrite", - "discriminator": [ - 88, - 172, - 141, - 118, - 9, - 74, - 188, - 117 - ], - "accounts": [ - { - "name": "underwriter", - "writable": true, - "signer": true - }, - { - "name": "operator_registry" - }, - { - "name": "outbound_message_buffer", - "writable": true - } - ], - "args": [ - { - "name": "uic_bytes", - "type": "bytes" - } - ] - }, - { - "name": "complete_unbond_role", - "discriminator": [ - 204, - 50, - 36, - 17, - 192, - 156, - 246, - 64 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state" - }, - { - "name": "user", - "docs": [ - "The user whose unbond is being completed" - ] - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "complete_withdraw", - "discriminator": [ - 172, - 129, - 141, - 17, - 95, - 253, - 251, - 98 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "user", - "writable": true - }, - { - "name": "outpost_account", - "writable": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "user_key", - "type": "pubkey" - }, - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "conclude_merge_activating", - "docs": [ - "Conclude merge activating - marks merge complete if all validators processed or 0 validators" - ], - "discriminator": [ - 207, - 32, - 222, - 98, - 243, - 188, - 38, - 67 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "graveyard_list" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "conclude_merge_deactivating", - "docs": [ - "Conclude merge deactivating - marks merge complete if all validators processed or 0 validators" - ], - "discriminator": [ - 66, - 206, - 43, - 71, - 122, - 97, - 33, - 24 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "withdraw_global", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "graveyard_list" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "conclude_sync_stakes", - "docs": [ - "Conclude sync stakes - marks sync complete if all validators processed or 0 validators" - ], - "discriminator": [ - 77, - 127, - 231, - 78, - 151, - 23, - 237, - 207 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "graveyard_list" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "create_reserve", - "discriminator": [ - 26, - 161, - 211, - 19, - 90, - 218, - 112, - 235 - ], - "accounts": [ - { - "name": "creator", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "reserve_vault", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "creator_ata", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "description", - "type": "string" - }, - { - "name": "is_private", - "type": "bool" - } - ] - }, - { - "name": "create_reserve_native", - "discriminator": [ - 124, - 173, - 189, - 251, - 64, - 230, - 215, - 6 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "description", - "type": "string" - } - ] - }, - { - "name": "create_reserve_spl_authority", - "discriminator": [ - 168, - 158, - 192, - 109, - 179, - 81, - 156, - 173 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "reserve_vault", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "authority_ata", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "description", - "type": "string" - } - ] - }, - { - "name": "deposit", - "discriminator": [ - 242, - 35, - 198, - 137, - 82, - 225, - 242, - 182 - ], - "accounts": [ - { - "name": "depositor", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "operator_type", - "type": "u32" - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "deposit_non_native", - "discriminator": [ - 75, - 182, - 44, - 132, - 167, - 101, - 31, - 138 - ], - "accounts": [ - { - "name": "depositor", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "depositor_ata", - "writable": true - }, - { - "name": "collateral_vault", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "chain_code", - "type": "u64" - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "operator_type", - "type": "u32" - }, - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "deposit_to_reserve", - "discriminator": [ - 8, - 79, - 123, - 129, - 146, - 140, - 178, - 128 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "depositor", - "writable": true, - "signer": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "ephemeral_stake", - "writable": true - }, - { - "name": "controller_state" - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - }, - { - "name": "seed", - "type": "u32" - } - ] - }, - { - "name": "desynd", - "discriminator": [ - 12, - 71, - 102, - 46, - 8, - 179, - 29, - 190 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "outpost_account", - "docs": [ - "User's outpost account" - ], - "writable": true - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "discard_envelope_chunks", - "discriminator": [ - 180, - 10, - 216, - 16, - 101, - 165, - 10, - 70 - ], - "accounts": [ - { - "name": "uploader", - "docs": [ - "The operator that uploaded (and rent-paid) the buffer. Authorization is", - "structural: the buffer PDA's third seed is this signer's key, so the", - "account constraint can only ever resolve the signer's OWN buffer —", - "no other operator's in-flight upload is reachable from here." - ], - "writable": true, - "signer": true - }, - { - "name": "chunk_buffer", - "writable": true - } - ], - "args": [ - { - "name": "epoch_index", - "type": "u32" - } - ] - }, - { - "name": "emit_outbound_envelope", - "discriminator": [ - 142, - 109, - 163, - 152, - 3, - 80, - 224, - 157 - ], - "accounts": [ - { - "name": "authority", - "docs": [ - "The outpost authority. The standalone emit is a recovery escape hatch", - "only — an open signer here could advance the outbound chain tip to a", - "digest the depot never accepted, so it is gated exactly like the other", - "admin instructions. Even the authority is bound by the guards in", - "`emit_outbound_inner`: the emitted epoch must be exactly the next", - "outbound slot AND already accepted by the inbound cursor, so a", - "recovery emit can only fill an accepted-but-unemitted gap and can", - "never preempt a pending epoch's consensus-triggered emit." - ], - "writable": true, - "signer": true - }, - { - "name": "config", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "outbound_envelopes", - "writable": true - }, - { - "name": "latest_outbound_envelope", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "wire_epoch_index", - "type": "u32" - } - ] - }, - { - "name": "epoch_in", - "discriminator": [ - 85, - 70, - 55, - 132, - 50, - 198, - 135, - 115 - ], - "accounts": [ - { - "name": "operator", - "writable": true, - "signer": true - }, - { - "name": "config", - "writable": true - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "epoch_deliveries", - "writable": true - }, - { - "name": "chunk_buffer", - "writable": true - }, - { - "name": "inbound_envelopes", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "outbound_envelopes", - "writable": true - }, - { - "name": "latest_outbound_envelope", - "writable": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "reserve_aggregate", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "chunk_index", - "type": "u16" - }, - { - "name": "total_chunks", - "type": "u16" - }, - { - "name": "total_bytes", - "type": "u32" - }, - { - "name": "chunk_data", - "type": "bytes" - } - ] - }, - { - "name": "finalize_outpost_account", - "discriminator": [ - 181, - 14, - 39, - 201, - 210, - 148, - 241, - 187 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "pool_authority" - }, - { - "name": "outpost_account", - "writable": true - }, - { - "name": "pretoken_purchase_history" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "get_min_max_resolved_epoch_deactivations", - "docs": [ - "Get minimum max_resolved_epoch_deactivations from MaintenanceLedger", - "This is designed to be called via CPI from other programs" - ], - "discriminator": [ - 171, - 169, - 39, - 207, - 181, - 67, - 86, - 73 - ], - "accounts": [ - { - "name": "epoch_state" - } - ], - "args": [], - "returns": "u16" - }, - { - "name": "has_role", - "discriminator": [ - 218, - 136, - 44, - 87, - 142, - 247, - 141, - 195 - ], - "accounts": [ - { - "name": "user", - "docs": [ - "User whose role status is being checked." - ] - }, - { - "name": "outpost_account" - }, - { - "name": "global_state" - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ], - "returns": "bool" - }, - { - "name": "init_bucket", - "docs": [ - "Done///" - ], - "discriminator": [ - 237, - 69, - 61, - 218, - 18, - 60, - 21, - 236 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "liqsol_mint" - }, - { - "name": "system_program" - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - } - ], - "args": [] - }, - { - "name": "init_reserve", - "discriminator": [ - 138, - 245, - 71, - 225, - 153, - 4, - 3, - 43 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve_aggregate", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "init_tranche_state", - "discriminator": [ - 87, - 134, - 47, - 11, - 241, - 14, - 118, - 201 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "chainlink_feed" - }, - { - "name": "chainlink_program" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "init_wire_config", - "discriminator": [ - 109, - 159, - 158, - 174, - 192, - 150, - 14, - 34 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize", - "discriminator": [ - 175, - 175, - 109, - 31, - 13, - 152, - 155, - 237 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint" - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "pool_authority" - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [] - }, - { - "name": "initialize_active_list", - "docs": [ - "Initialize the active validator list (zero-copy)" - ], - "discriminator": [ - 222, - 123, - 57, - 119, - 223, - 4, - 150, - 36 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "active_list", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_epoch_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 139, - 122, - 53, - 254, - 85, - 205, - 138, - 245 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_global_config", - "discriminator": [ - 113, - 216, - 122, - 131, - 225, - 209, - 22, - 55 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "program" - }, - { - "name": "program_data" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_graveyard_list", - "docs": [ - "Initialize the graveyard validator list (zero-copy)" - ], - "discriminator": [ - 178, - 8, - 179, - 111, - 75, - 19, - 130, - 176 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_outpost", - "discriminator": [ - 9, - 54, - 169, - 104, - 32, - 218, - 81, - 11 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "config", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "operator_registry", - "writable": true - }, - { - "name": "inbound_envelopes", - "writable": true - }, - { - "name": "outbound_envelopes", - "writable": true - }, - { - "name": "latest_outbound_envelope", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "chain_code", - "type": "u64" - } - ] - }, - { - "name": "initialize_pay_rate_history", - "docs": [ - "Done///" - ], - "discriminator": [ - 157, - 190, - 74, - 135, - 91, - 232, - 250, - 122 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "pay_rate_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_payout_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 105, - 120, - 7, - 121, - 238, - 221, - 62, - 160 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "payout_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_pretoken_purchase_history", - "docs": [ - "Admin-only: initialize PretokenPurchaseHistory PDA for a pool" - ], - "discriminator": [ - 140, - 166, - 196, - 128, - 189, - 240, - 159, - 1 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "pool_pretoken_record", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_processing_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 228, - 202, - 164, - 194, - 29, - 134, - 125, - 242 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_reserve_pool", - "docs": [ - "Done///" - ], - "discriminator": [ - 4, - 7, - 171, - 131, - 156, - 172, - 150, - 220 - ], - "accounts": [ - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "controller_state", - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [] - }, - { - "name": "initialize_stake_allocation_state", - "discriminator": [ - 159, - 99, - 175, - 136, - 251, - 241, - 88, - 82 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "writable": true - }, - { - "name": "clock" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_stake_controller_state", - "docs": [ - "Done///" - ], - "discriminator": [ - 220, - 247, - 13, - 165, - 202, - 250, - 102, - 197 - ], - "accounts": [ - { - "name": "controller_state", - "writable": true - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "authority", - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_stake_metrics", - "docs": [ - "Done///" - ], - "discriminator": [ - 203, - 209, - 129, - 123, - 12, - 17, - 20, - 175 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_vault", - "docs": [ - "Done///" - ], - "discriminator": [ - 48, - 191, - 163, - 44, - 71, - 129, - 63, - 164 - ], - "accounts": [ - { - "name": "vault", - "writable": true - }, - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "controller_state", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "initialize_withdraw_global", - "discriminator": [ - 110, - 0, - 210, - 101, - 59, - 75, - 224, - 158 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "docs": [ - "liqSOL Token-2022 mint" - ] - }, - { - "name": "global", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [] - }, - { - "name": "initialize_withdraw_metadata", - "discriminator": [ - 0, - 170, - 135, - 3, - 35, - 58, - 213, - 75 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "metadata", - "writable": true - }, - { - "name": "global_config" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "args", - "type": { - "defined": { - "name": "MetadataArgs" - } - } - } - ] - }, - { - "name": "merge_activating_stakes", - "docs": [ - "V2: Merge activating transient stakes using PDA architecture", - "Returns the number of epochs successfully merged" - ], - "discriminator": [ - 181, - 183, - 76, - 92, - 57, - 11, - 212, - 189 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "treasury", - "docs": [ - "(treasury funded it at creation), closing the rent loop within the protocol." - ], - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validators list (zero-copy)" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validators list (zero-copy) - needed to check validators in cooldown" - ] - }, - { - "name": "validator_info", - "docs": [ - "Validator info PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "validator_transient", - "docs": [ - "Validator transient tracking PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - } - ], - "args": [ - { - "name": "vote_account", - "type": "pubkey" - } - ], - "returns": "u16" - }, - { - "name": "merge_deactivated_stakes", - "docs": [ - "V2: Merge fully deactivated stakes back to reserve" - ], - "discriminator": [ - 160, - 255, - 180, - 104, - 216, - 98, - 248, - 73 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "cranky", - "signer": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validators list (zero-copy)" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validators list (zero-copy) - needed to check validators in cooldown" - ] - }, - { - "name": "validator_info", - "docs": [ - "Validator info PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "validator_transient", - "docs": [ - "Validator transient tracking PDA for the validator being processed" - ], - "writable": true - }, - { - "name": "withdraw_global", - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "reserve_pool", - "docs": [ - "(principal stays). The merged-in rent is then withdrawn to treasury." - ], - "writable": true - }, - { - "name": "treasury", - "docs": [ - "back from reserve, closing the rent loop (treasury funded it at creation)." - ], - "writable": true - } - ], - "args": [ - { - "name": "vote_account", - "type": "pubkey" - } - ] - }, - { - "name": "migrate_batch_orchestrator", - "docs": [ - "One-shot migration: realloc BatchOrchestrator for the four per-op", - "`*_started_epoch: u16` fields + restored `_reserved` buffer.", - "Idempotent, ungated. `payer` covers the rent delta." - ], - "discriminator": [ - 130, - 240, - 40, - 175, - 53, - 209, - 232, - 11 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "batch_orchestrator", - "docs": [ - "is the only authorization needed; the op is idempotent." - ], - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "migrate_batch_orchestrator_v1_6", - "docs": [ - "One-shot migration: stamp BatchOrchestrator's v1.6.0 epoch pins", - "(unstake_started_epoch + cursors_epoch) to the current epoch so a", - "mid-epoch upgrade doesn't wipe live cursors. Admin-gated, idempotent", - "within an epoch; refuses re-runs after an epoch boundary (a late", - "re-stamp would bless dead cursors as live)." - ], - "discriminator": [ - 124, - 12, - 96, - 155, - 218, - 4, - 229, - 56 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "batch_orchestrator", - "writable": true - } - ], - "args": [] - }, - { - "name": "migrate_stake_allocation_state", - "docs": [ - "One-shot migration: explicitly zero StakeAllocationState.rebalance_started_epoch", - "(repurposed from the deprecated addition_target_rank slot). Admin-gated, idempotent." - ], - "discriminator": [ - 40, - 175, - 21, - 85, - 88, - 249, - 223, - 73 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_allocation_state", - "writable": true - } - ], - "args": [] - }, - { - "name": "migrate_stake_metrics", - "docs": [ - "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)" - ], - "discriminator": [ - 183, - 154, - 168, - 221, - 78, - 179, - 112, - 165 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "migrate_user_record", - "discriminator": [ - 6, - 118, - 249, - 178, - 209, - 106, - 197, - 25 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "user_ata" - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "migrate_validator_info_batch", - "docs": [ - "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)", - "Pass validator_info PDAs via remaining_accounts" - ], - "discriminator": [ - 250, - 77, - 53, - 116, - 38, - 22, - 12, - 100 - ], - "accounts": [ - { - "name": "global_config" - }, - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "process_graveyard_validators_batch", - "docs": [ - "Process graveyard validators batch: check transient resolution, queue main stake deactivation", - "Validators in graveyard with resolved transients will have their main stake queued for deactivation" - ], - "discriminator": [ - 141, - 178, - 8, - 118, - 133, - 183, - 86, - 233 - ], - "accounts": [ - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "clock" - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "process_pay_cycle", - "docs": [ - "Done///" - ], - "discriminator": [ - 98, - 183, - 240, - 247, - 39, - 248, - 198, - 224 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "payout_state", - "writable": true - }, - { - "name": "pay_rate_history", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "stake_controller_authority", - "writable": true - }, - { - "name": "mint_authority" - }, - { - "name": "liqsol_program" - }, - { - "name": "token_program" - }, - { - "name": "instructions" - }, - { - "name": "global_config", - "docs": [ - "Global config for process_pay_cycle_enabled check" - ] - } - ], - "args": [] - }, - { - "name": "process_stake_orders", - "docs": [ - "V2: Process stake orders using PDA architecture with pre-calculated allocations", - "Validators must be sent contiguously from the active list starting at validators_processed_this_epoch" - ], - "discriminator": [ - 92, - 161, - 223, - 219, - 54, - 232, - 40, - 16 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "treasury", - "docs": [ - "(system transfer, treasury signs). Falls back to admin only if treasury is dry." - ], - "writable": true - }, - { - "name": "vault" - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validator list - used to get total validator count" - ] - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - to verify allocations have been calculated for current epoch" - ], - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "system_program" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "stake_config" - }, - { - "name": "rent" - }, - { - "name": "global_config", - "docs": [ - "Global config for process_stake_orders_enabled check" - ] - } - ], - "args": [ - { - "name": "caller_funds_rent", - "type": "bool" - } - ] - }, - { - "name": "process_transfer_hook", - "discriminator": [ - 167, - 45, - 151, - 64, - 209, - 186, - 192, - 78 - ], - "accounts": [ - { - "name": "source_token" - }, - { - "name": "destination_token" - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_token_account" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "process_unstake_orders", - "docs": [ - "V2: Process unstake orders by splitting and deactivating stakes", - "Validators must be sent contiguously: first from active list, then graveyard list" - ], - "discriminator": [ - 44, - 122, - 251, - 185, - 253, - 193, - 250, - 191 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "vault", - "writable": true - }, - { - "name": "treasury", - "docs": [ - "here (system transfer, treasury signs). Falls back to admin only if dry.", - "Reserve no longer sources rent, so it's not needed by this instruction." - ], - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validator list - used to get total validator count" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validator list - allows unstaking from graveyard validators" - ] - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "stake_config" - }, - { - "name": "rent" - }, - { - "name": "system_program" - }, - { - "name": "stake_program" - }, - { - "name": "global_config", - "docs": [ - "Global config for process_unstake_orders_enabled check" - ] - } - ], - "args": [ - { - "name": "caller_funds_rent", - "type": "bool" - } - ] - }, - { - "name": "purchase", - "discriminator": [ - 21, - 93, - 113, - 154, - 193, - 160, - 242, - 168 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "buyer_ata", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "outpost_account", - "docs": [ - "User's pretoken deposit record" - ], - "writable": true - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "user_pretoken_record", - "writable": true - }, - { - "name": "chainlink_feed" - }, - { - "name": "chainlink_program" - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - }, - { - "name": "pretoken_purchase_history", - "writable": true - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "purchase_from_yield", - "discriminator": [ - 232, - 143, - 47, - 77, - 246, - 113, - 31, - 202 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "liqsol_mint" - }, - { - "name": "pool_authority", - "docs": [ - "Pool authority PDA" - ] - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "liqsol_pool_ata", - "docs": [ - "Pool's liqSOL ATA - deterministically derived from pool_authority + liqsol_mint" - ], - "writable": true - }, - { - "name": "liqsol_pool_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "token_program" - }, - { - "name": "system_program" - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "pool_pretoken_record", - "writable": true - }, - { - "name": "chainlink_feed" - }, - { - "name": "chainlink_program" - }, - { - "name": "pretoken_purchase_history", - "writable": true - } - ], - "args": [] - }, - { - "name": "record_price", - "discriminator": [ - 210, - 113, - 46, - 101, - 107, - 218, - 83, - 51 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "tranche_state" - }, - { - "name": "price_history", - "writable": true - }, - { - "name": "chainlink_program" - }, - { - "name": "chainlink_feed" - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "refresh_stake_metrics_post_late_epoch", - "docs": [ - "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)", - "Requires Distribution + UnstakeOrder as prerequisites", - "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch" - ], - "discriminator": [ - 11, - 226, - 87, - 114, - 47, - 159, - 99, - 157 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - } - ], - "args": [] - }, - { - "name": "refresh_stake_metrics_post_sync", - "docs": [ - "V2: Refresh stake metrics after removal selection + PDA setup", - "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites", - "Tracks completion in last_post_sync_stake_metrics_refresh_epoch" - ], - "discriminator": [ - 177, - 250, - 32, - 155, - 196, - 199, - 199, - 249 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "stake_metrics", - "writable": true - }, - { - "name": "epoch_state", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "active_list" - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - } - ], - "args": [] - }, - { - "name": "refund", - "discriminator": [ - 2, - 96, - 183, - 251, - 63, - 208, - 46, - 46 - ], - "accounts": [ - { - "name": "associated_token_program" - }, - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "outpost_account", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "refund_liqsol_ata", - "writable": true - }, - { - "name": "liqsol_pool_user_record", - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_mint" - }, - { - "name": "token_program" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "register_system_pda", - "discriminator": [ - 110, - 93, - 36, - 156, - 179, - 69, - 54, - 210 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "pda_owner", - "docs": [ - "The PDA whose user record we're creating — must be system-owned (no program data)." - ] - }, - { - "name": "pda_ata" - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account holding liqSOL (for index sync)" - ], - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "register_user", - "discriminator": [ - 2, - 241, - 150, - 223, - 99, - 214, - 116, - 97 - ], - "accounts": [ - { - "name": "payer", - "writable": true, - "signer": true - }, - { - "name": "user_ata" - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account holding liqSOL (for index sync)" - ], - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [] - }, - { - "name": "remove_low_performers_batch", - "docs": [ - "Process batch of validators for removal (below exit threshold)" - ], - "discriminator": [ - 91, - 142, - 166, - 98, - 245, - 245, - 159, - 44 - ], - "accounts": [ - { - "name": "active_list", - "writable": true - }, - { - "name": "graveyard_list", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "allocation_state" - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "request_swap", - "discriminator": [ - 170, - 167, - 97, - 14, - 88, - 175, - 39, - 108 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "source_token_code", - "type": "u64" - }, - { - "name": "source_reserve_code", - "type": "u64" - }, - { - "name": "source_amount", - "type": "u64" - }, - { - "name": "target_chain_code", - "type": "u64" - }, - { - "name": "target_token_code", - "type": "u64" - }, - { - "name": "target_reserve_code", - "type": "u64" - }, - { - "name": "target_recipient", - "type": "bytes" - }, - { - "name": "target_amount", - "type": "u64" - }, - { - "name": "target_tolerance_bps", - "type": "u32" - } - ] - }, - { - "name": "request_swap_spl", - "discriminator": [ - 119, - 83, - 153, - 185, - 164, - 202, - 45, - 38 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "config" - }, - { - "name": "reserve", - "writable": true - }, - { - "name": "reserve_vault", - "writable": true - }, - { - "name": "mint" - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "outbound_message_buffer", - "writable": true - }, - { - "name": "token_program" - } - ], - "args": [ - { - "name": "source_token_code", - "type": "u64" - }, - { - "name": "source_reserve_code", - "type": "u64" - }, - { - "name": "source_amount", - "type": "u64" - }, - { - "name": "target_chain_code", - "type": "u64" - }, - { - "name": "target_token_code", - "type": "u64" - }, - { - "name": "target_reserve_code", - "type": "u64" - }, - { - "name": "target_recipient", - "type": "bytes" - }, - { - "name": "target_amount", - "type": "u64" - }, - { - "name": "target_tolerance_bps", - "type": "u32" - } - ] - }, - { - "name": "request_unbond_role", - "discriminator": [ - 223, - 225, - 84, - 83, - 115, - 183, - 80, - 33 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "global_state" - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - } - ] - }, - { - "name": "request_withdraw", - "discriminator": [ - 137, - 95, - 187, - 96, - 250, - 138, - 31, - 182 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "owner", - "docs": [ - "Recipient of the NFT receipt (can be user)" - ], - "writable": true - }, - { - "name": "global", - "docs": [ - "Global operator state" - ], - "writable": true - }, - { - "name": "liqsol_mint", - "docs": [ - "liqSOL mint reference (must match Global.liqsol_mint so we can read decimals)" - ], - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "docs": [ - "Distribution state for index tracking" - ], - "writable": true - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's token account holding liqSOL (for sync_index balance)" - ], - "writable": true - }, - { - "name": "reserve_pool", - "docs": [ - "Reserve pool - to check available balance for instant withdrawals" - ], - "writable": true - }, - { - "name": "stake_allocation_state", - "docs": [ - "Stake allocation state - for accumulate_unstake_request" - ], - "writable": true - }, - { - "name": "stake_metrics", - "docs": [ - "Stake metrics - for accumulate_unstake_request" - ] - }, - { - "name": "maintenance_ledger", - "docs": [ - "Maintenance ledger - for accumulate_unstake_request" - ] - }, - { - "name": "global_config", - "docs": [ - "Global config for min_unstake_request setting" - ] - }, - { - "name": "clock" - }, - { - "name": "mint_authority" - }, - { - "name": "receipt_data", - "writable": true - }, - { - "name": "metadata", - "writable": true - }, - { - "name": "nft_mint", - "docs": [ - "Uses global.next_receipt_id for deterministic, collision-free address generation" - ], - "writable": true - }, - { - "name": "nft_ata", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "token_interface" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "set_admin", - "discriminator": [ - 251, - 163, - 0, - 52, - 91, - 194, - 187, - 92 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - }, - { - "name": "new_authority" - } - ], - "args": [] - }, - { - "name": "set_cranky", - "discriminator": [ - 232, - 48, - 178, - 74, - 194, - 60, - 143, - 164 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - }, - { - "name": "new_authority" - } - ], - "args": [] - }, - { - "name": "set_paused", - "discriminator": [ - 91, - 60, - 125, - 192, - 176, - 225, - 166, - 218 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "paused", - "type": "bool" - } - ] - }, - { - "name": "set_retention_config", - "discriminator": [ - 224, - 115, - 230, - 164, - 16, - 100, - 30, - 234 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config", - "writable": true - } - ], - "args": [ - { - "name": "retention_epochs", - "type": "u32" - } - ] - }, - { - "name": "set_role_principal", - "discriminator": [ - 33, - 199, - 203, - 50, - 60, - 167, - 90, - 92 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "role", - "type": { - "defined": { - "name": "Role" - } - } - }, - { - "name": "principal", - "type": "u64" - } - ] - }, - { - "name": "set_role_warmup_duration", - "discriminator": [ - 229, - 188, - 179, - 162, - 56, - 173, - 228, - 68 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "duration_seconds", - "type": "i64" - } - ] - }, - { - "name": "set_token_address", - "discriminator": [ - 231, - 130, - 7, - 149, - 155, - 155, - 110, - 53 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config", - "writable": true - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "mint", - "type": "pubkey" - } - ] - }, - { - "name": "set_token_precision", - "discriminator": [ - 202, - 218, - 56, - 157, - 228, - 15, - 175, - 107 - ], - "accounts": [ - { - "name": "authority", - "signer": true - }, - { - "name": "config", - "writable": true - } - ], - "args": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "decimals", - "type": "u8" - } - ] - }, - { - "name": "set_wire_state", - "discriminator": [ - 62, - 194, - 254, - 126, - 251, - 69, - 35, - 228 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - } - ], - "args": [ - { - "name": "wire_state", - "type": { - "defined": { - "name": "WireState" - } - } - } - ] - }, - { - "name": "setup_validator_pdas_batch", - "discriminator": [ - 115, - 37, - 9, - 246, - 144, - 224, - 178, - 79 - ], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "active_list", - "writable": true - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "allocation_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "system_program", - "docs": [ - "Needed for manual PDA creation" - ] - } - ], - "args": [] - }, - { - "name": "slash_bond", - "discriminator": [ - 143, - 246, - 51, - 243, - 88, - 198, - 217, - 48 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "user", - "docs": [ - "The user being slashed" - ] - }, - { - "name": "outpost_account", - "writable": true - } - ], - "args": [] - }, - { - "name": "sol_to_liqsol", - "discriminator": [ - 250, - 110, - 1, - 100, - 71, - 3, - 235, - 113 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "deposit_authority", - "writable": true - }, - { - "name": "system_program" - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "liqsol_program" - }, - { - "name": "pay_rate_history" - }, - { - "name": "stake_program" - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "liqsol_mint_authority" - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "vault" - }, - { - "name": "ephemeral_stake", - "writable": true - }, - { - "name": "controller_state", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for deposit settings" - ] - }, - { - "name": "payout_state", - "writable": true - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "docs": [ - "The bucket's associated token account" - ], - "writable": true - }, - { - "name": "user_record", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "instructions_sysvar" - }, - { - "name": "clock" - }, - { - "name": "stake_history" - }, - { - "name": "rent" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - }, - { - "name": "seed", - "type": "u32" - } - ] - }, - { - "name": "sync_active_scores", - "discriminator": [ - 38, - 188, - 30, - 93, - 139, - 1, - 140, - 168 - ], - "accounts": [ - { - "name": "active_list", - "writable": true - }, - { - "name": "leaderboard_state" - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for late epoch slot gate" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "sync_leaderboard_scores_batch", - "docs": [ - "region: Validator Leaderboard Syncing" - ], - "discriminator": [ - 52, - 11, - 210, - 173, - 90, - 5, - 48, - 50 - ], - "accounts": [ - { - "name": "leaderboard_state" - }, - { - "name": "processing_state", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "sync_main_stake_accounts", - "docs": [ - "V2: Sync main stake accounts using PDA architecture (batched)", - "Processes validators in batches via remaining_accounts (batch size is enforced client-side)", - "Note: Only syncs primary delegated stakes, not transient stakes" - ], - "discriminator": [ - 159, - 17, - 201, - 39, - 89, - 62, - 65, - 135 - ], - "accounts": [ - { - "name": "admin", - "signer": true - }, - { - "name": "processing_state", - "docs": [ - "Processing state for tracking batch progress" - ], - "writable": true - }, - { - "name": "epoch_state", - "docs": [ - "Epoch state to mark completion" - ], - "writable": true - }, - { - "name": "active_list", - "docs": [ - "Active validator list - to check validator counts and membership" - ] - }, - { - "name": "graveyard_list", - "docs": [ - "Graveyard validator list - graveyard validators also need syncing for merge operations" - ] - }, - { - "name": "stake_history" - }, - { - "name": "vault", - "writable": true - }, - { - "name": "reserve_pool", - "writable": true - }, - { - "name": "stake_program" - }, - { - "name": "clock" - } - ], - "args": [] - }, - { - "name": "sync_validator_selection_thresholds", - "docs": [ - "Calculate and store entry/exit thresholds from validator leaderboard" - ], - "discriminator": [ - 102, - 171, - 32, - 136, - 205, - 105, - 208, - 225 - ], - "accounts": [ - { - "name": "leaderboard_state" - }, - { - "name": "allocation_state", - "writable": true - }, - { - "name": "maintenance_ledger", - "writable": true - }, - { - "name": "global_config", - "docs": [ - "Global config for min_vpp_entry and min_vpp_exit" - ] - }, - { - "name": "authority", - "signer": true - } - ], - "args": [] - }, - { - "name": "synd", - "discriminator": [ - 153, - 175, - 231, - 40, - 44, - 65, - 175, - 172 - ], - "accounts": [ - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "liqsol_mint", - "writable": true - }, - { - "name": "global_state", - "writable": true - }, - { - "name": "distribution_state", - "writable": true - }, - { - "name": "user_ata", - "writable": true - }, - { - "name": "pool_authority" - }, - { - "name": "bucket_authority" - }, - { - "name": "bucket_token_account", - "writable": true - }, - { - "name": "bucket_user_record", - "writable": true - }, - { - "name": "sender_user_record", - "writable": true - }, - { - "name": "receiver_user_record", - "writable": true - }, - { - "name": "extra_account_meta_list" - }, - { - "name": "liqsol_core_program" - }, - { - "name": "transfer_hook_program" - }, - { - "name": "liqsol_pool_ata", - "writable": true - }, - { - "name": "outpost_account", - "docs": [ - "User's pretoken deposit record" - ], - "writable": true - }, - { - "name": "pretoken_purchase_history", - "writable": true - }, - { - "name": "token_program" - }, - { - "name": "associated_token_program" - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "amount", - "type": "u64" - } - ] - }, - { - "name": "update_config_bool", - "discriminator": [ - 79, - 36, - 65, - 239, - 188, - 35, - 13, - 160 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyBool" - } - } - }, - { - "name": "value", - "type": "bool" - } - ] - }, - { - "name": "update_config_u16", - "discriminator": [ - 149, - 9, - 244, - 25, - 46, - 136, - 59, - 173 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyU16" - } - } - }, - { - "name": "value", - "type": "u16" - } - ] - }, - { - "name": "update_config_u64", - "discriminator": [ - 120, - 43, - 124, - 106, - 97, - 80, - 208, - 123 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyU64" - } - } - }, - { - "name": "value", - "type": "u64" - } - ] - }, - { - "name": "update_config_u8", - "discriminator": [ - 17, - 160, - 31, - 134, - 222, - 250, - 229, - 253 - ], - "accounts": [ - { - "name": "global_config", - "writable": true - }, - { - "name": "admin", - "signer": true - } - ], - "args": [ - { - "name": "key", - "type": { - "defined": { - "name": "ConfigKeyU8" - } - } - }, - { - "name": "value", - "type": "u8" - } - ] - }, - { - "name": "update_growth_parameters", - "discriminator": [ - 172, - 187, - 237, - 233, - 250, - 160, - 115, - 239 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "price_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "supply_growth_bps", - "type": "u16" - }, - { - "name": "price_growth_cents", - "type": "u16" - } - ] - }, - { - "name": "update_price_bounds", - "discriminator": [ - 241, - 116, - 141, - 65, - 61, - 95, - 232, - 28 - ], - "accounts": [ - { - "name": "admin", - "writable": true, - "signer": true - }, - { - "name": "global_config" - }, - { - "name": "tranche_state", - "writable": true - }, - { - "name": "price_history", - "writable": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "min_price_usd", - "type": "u64" - }, - { - "name": "max_price_usd", - "type": "u64" - }, - { - "name": "max_staleness_seconds", - "type": "i64" - } - ] - } - ], - "accounts": [ - { - "name": "BatchOrchestrator", - "discriminator": [ - 70, - 163, - 206, - 225, - 7, - 189, - 73, - 94 - ] - }, - { - "name": "DistributionState", - "discriminator": [ - 7, - 25, - 94, - 15, - 208, - 170, - 4, - 103 - ] - }, - { - "name": "EnvelopeChunks", - "discriminator": [ - 51, - 126, - 62, - 161, - 85, - 175, - 66, - 63 - ] - }, - { - "name": "EnvelopeLog", - "discriminator": [ - 73, - 107, - 128, - 29, - 76, - 210, - 155, - 113 - ] - }, - { - "name": "EpochDeliveries", - "discriminator": [ - 134, - 83, - 77, - 28, - 26, - 189, - 174, - 190 - ] - }, - { - "name": "Global", - "discriminator": [ - 167, - 232, - 232, - 177, - 200, - 108, - 114, - 127 - ] - }, - { - "name": "GlobalConfig", - "discriminator": [ - 149, - 8, - 156, - 202, - 160, - 252, - 176, - 217 - ] - }, - { - "name": "GlobalState", - "discriminator": [ - 163, - 46, - 74, - 168, - 216, - 123, - 133, - 98 - ] - }, - { - "name": "LatestOutboundEnvelope", - "discriminator": [ - 74, - 80, - 163, - 159, - 178, - 236, - 249, - 15 - ] - }, - { - "name": "LeaderboardState", - "discriminator": [ - 211, - 181, - 29, - 120, - 189, - 4, - 106, - 111 - ] - }, - { - "name": "LiqReceiptData", - "discriminator": [ - 75, - 119, - 90, - 79, - 25, - 200, - 9, - 46 - ] - }, - { - "name": "MaintenanceLedger", - "discriminator": [ - 140, - 250, - 92, - 173, - 147, - 65, - 26, - 39 - ] - }, - { - "name": "OperatorRegistry", - "discriminator": [ - 194, - 188, - 172, - 240, - 220, - 209, - 36, - 100 - ] - }, - { - "name": "OutboundMessageBuffer", - "discriminator": [ - 133, - 145, - 100, - 61, - 28, - 106, - 209, - 197 - ] - }, - { - "name": "OutpostAccount", - "discriminator": [ - 87, - 205, - 242, - 192, - 212, - 51, - 26, - 93 - ] - }, - { - "name": "OutpostConfig", - "discriminator": [ - 211, - 233, - 11, - 174, - 26, - 119, - 188, - 182 - ] - }, - { - "name": "PayRateHistory", - "discriminator": [ - 139, - 8, - 65, - 111, - 71, - 41, - 187, - 218 - ] - }, - { - "name": "PayoutState", - "discriminator": [ - 106, - 54, - 13, - 167, - 203, - 44, - 168, - 150 - ] - }, - { - "name": "PretokenPurchaseHistory", - "discriminator": [ - 33, - 71, - 113, - 206, - 33, - 180, - 236, - 131 - ] - }, - { - "name": "PriceHistory", - "discriminator": [ - 38, - 241, - 40, - 19, - 42, - 228, - 93, - 152 - ] - }, - { - "name": "Reserve", - "discriminator": [ - 43, - 242, - 204, - 202, - 26, - 247, - 59, - 127 - ] - }, - { - "name": "ReserveAggregate", - "discriminator": [ - 46, - 66, - 28, - 2, - 223, - 209, - 19, - 45 - ] - }, - { - "name": "StakeAllocationState", - "discriminator": [ - 23, - 238, - 120, - 198, - 156, - 165, - 151, - 119 - ] - }, - { - "name": "StakeControllerState", - "discriminator": [ - 218, - 168, - 114, - 136, - 80, - 186, - 29, - 218 - ] - }, - { - "name": "StakeMetrics", - "discriminator": [ - 91, - 84, - 217, - 97, - 98, - 38, - 18, - 143 - ] - }, - { - "name": "TokenMetadata", - "discriminator": [ - 237, - 215, - 132, - 182, - 24, - 127, - 175, - 173 - ] - }, - { - "name": "TrancheState", - "discriminator": [ - 212, - 231, - 254, - 24, - 238, - 63, - 92, - 105 - ] - }, - { - "name": "UserPretokenRecord", - "discriminator": [ - 117, - 99, - 159, - 251, - 98, - 253, - 6, - 238 - ] - }, - { - "name": "UserRecord", - "discriminator": [ - 210, - 252, - 132, - 218, - 191, - 85, - 173, - 167 - ] - }, - { - "name": "ValidatorInfoAccount", - "discriminator": [ - 195, - 243, - 81, - 187, - 172, - 232, - 57, - 59 - ] - }, - { - "name": "ValidatorList", - "discriminator": [ - 131, - 181, - 125, - 127, - 46, - 36, - 40, - 167 - ] - }, - { - "name": "ValidatorTransientAccount", - "discriminator": [ - 97, - 207, - 155, - 142, - 86, - 170, - 118, - 161 - ] - } - ], - "events": [ - { - "name": "EpochResolved", - "discriminator": [ - 62, - 81, - 212, - 223, - 209, - 104, - 51, - 65 - ] - }, - { - "name": "GraveyardDeactivationQueuedEvent", - "discriminator": [ - 131, - 241, - 122, - 229, - 108, - 21, - 67, - 37 - ] - }, - { - "name": "GraveyardValidatorCleanedEvent", - "discriminator": [ - 3, - 252, - 58, - 228, - 135, - 135, - 104, - 34 - ] - }, - { - "name": "PretokenPurchased", - "discriminator": [ - 39, - 1, - 143, - 191, - 8, - 14, - 80, - 41 - ] - }, - { - "name": "StakesMerged", - "discriminator": [ - 3, - 16, - 51, - 153, - 152, - 186, - 19, - 97 - ] - }, - { - "name": "ValidatorAddedEvent", - "discriminator": [ - 71, - 123, - 103, - 213, - 174, - 178, - 82, - 130 - ] - }, - { - "name": "ValidatorRemovedEvent", - "discriminator": [ - 49, - 23, - 179, - 208, - 124, - 3, - 231, - 59 - ] - }, - { - "name": "ValidatorSwappedEvent", - "discriminator": [ - 33, - 50, - 10, - 35, - 69, - 113, - 96, - 180 - ] - }, - { - "name": "ValidatorsSyncedEvent", - "discriminator": [ - 119, - 121, - 49, - 120, - 230, - 132, - 109, - 214 - ] - }, - { - "name": "WithdrawClaimed", - "discriminator": [ - 77, - 130, - 89, - 38, - 239, - 172, - 174, - 85 - ] - }, - { - "name": "WithdrawRequested", - "discriminator": [ - 114, - 16, - 240, - 206, - 93, - 128, - 151, - 39 - ] - } - ], - "errors": [ - { - "code": 6000, - "name": "EnvelopeDecodeFailed", - "msg": "Envelope protobuf decode failed" - }, - { - "code": 6001, - "name": "AttestationDecodeFailed", - "msg": "Attestation protobuf decode failed" - }, - { - "code": 6002, - "name": "NonSequentialEpoch", - "msg": "Non-sequential epoch index" - }, - { - "code": 6003, - "name": "EpochHashMismatch", - "msg": "Previous envelope hash mismatch" - }, - { - "code": 6004, - "name": "OperatorAlreadyDelivered", - "msg": "Operator already delivered this epoch" - }, - { - "code": 6005, - "name": "NotActiveOperator", - "msg": "Caller is not an active batch operator" - }, - { - "code": 6006, - "name": "EmptyOperatorGroups", - "msg": "Operator group list cannot be empty while roster is initialized" - }, - { - "code": 6007, - "name": "OutboundMessageBufferOverflow", - "msg": "Outbound message buffer capacity exceeded" - }, - { - "code": 6008, - "name": "Unauthorized", - "msg": "Unauthorized caller for attestation" - }, - { - "code": 6009, - "name": "OperatorRegistryFull", - "msg": "Operator registry is full; cannot add another operator" - }, - { - "code": 6010, - "name": "OperatorGroupListFull", - "msg": "Operator group count exceeds configured maximum" - }, - { - "code": 6011, - "name": "OperatorGroupFull", - "msg": "Operator group member count exceeds configured maximum" - }, - { - "code": 6012, - "name": "InvalidSolanaAddressLength", - "msg": "Solana address in Operators entry is not 32 bytes" - }, - { - "code": 6013, - "name": "EpochDeliveryListFull", - "msg": "Epoch delivery count exceeds configured maximum" - }, - { - "code": 6014, - "name": "UnsupportedAttestationType", - "msg": "Attestation type not supported by this outpost" - }, - { - "code": 6015, - "name": "ZeroAmount", - "msg": "Amount must be greater than zero" - }, - { - "code": 6016, - "name": "InvalidOperatorType", - "msg": "Invalid OperatorType for Solana outpost" - }, - { - "code": 6017, - "name": "InvalidTokenKind", - "msg": "Invalid TokenKind for deposit" - }, - { - "code": 6018, - "name": "InvalidWireNameLength", - "msg": "WIRE account name exceeds 13 characters" - }, - { - "code": 6019, - "name": "EnvelopeTooLarge", - "msg": "Envelope data exceeds MAX_ENVELOPE_BYTES" - }, - { - "code": 6020, - "name": "InvalidRetentionConfig", - "msg": "Retention config invalid: full_retention_seconds < data_retention_epochs * epoch_duration_seconds" - }, - { - "code": 6021, - "name": "InvalidEpochDuration", - "msg": "Epoch duration must be non-zero" - }, - { - "code": 6022, - "name": "EnvelopeKindMismatch", - "msg": "Envelope kind does not match account type" - }, - { - "code": 6023, - "name": "EnvelopeStillInRetention", - "msg": "Envelope pruning attempted on record still inside retention window" - }, - { - "code": 6024, - "name": "InvalidChunkCount", - "msg": "Chunk count must be in 1..=MAX_CHUNKS" - }, - { - "code": 6025, - "name": "ChunkIndexOutOfRange", - "msg": "Chunk index out of range for declared total_chunks" - }, - { - "code": 6026, - "name": "ChunkTooLarge", - "msg": "Chunk payload exceeds MAX_CHUNK_BYTES" - }, - { - "code": 6027, - "name": "ChunkSizeMismatch", - "msg": "Chunk size does not match the declared envelope shape" - }, - { - "code": 6028, - "name": "ChunkOutOfOrder", - "msg": "Chunk arrived out of order; chunks must be submitted sequentially" - }, - { - "code": 6029, - "name": "ChunkBufferEpochMismatch", - "msg": "Chunk buffer header locked to a different epoch" - }, - { - "code": 6030, - "name": "ChunkBufferShapeMismatch", - "msg": "Chunk buffer header locked to a different total_chunks/total_bytes" - }, - { - "code": 6031, - "name": "ChunkBufferOperatorMismatch", - "msg": "Chunk buffer was opened by a different operator" - }, - { - "code": 6032, - "name": "ChunkCleanupNotYetEligible", - "msg": "Chunk cleanup is not eligible until the epoch has advanced" - }, - { - "code": 6033, - "name": "OversizedQueuedMessage", - "msg": "A single queued outbound message exceeds MAX_ENVELOPE_BYTES; cannot pack into an envelope" - }, - { - "code": 6034, - "name": "CollateralLedgerOverflow", - "msg": "Collateral ledger has reached MAX_COLLATERAL_ENTRIES capacity" - }, - { - "code": 6035, - "name": "CallerNotRegistered", - "msg": "Caller is not present in the operator registry" - }, - { - "code": 6036, - "name": "WrongOperatorType", - "msg": "Caller's operator role does not match the action's required role" - }, - { - "code": 6037, - "name": "OperatorNotActive", - "msg": "Caller's operator status is not ACTIVE" - }, - { - "code": 6038, - "name": "ReserveNotFound", - "msg": "Reserve PDA not found for the supplied (token_code, reserve_code)" - }, - { - "code": 6039, - "name": "ReserveWrongStatus", - "msg": "Reserve is not in the status required by the action" - }, - { - "code": 6040, - "name": "ReserveNotCreator", - "msg": "Caller does not match the reserve's creator" - }, - { - "code": 6041, - "name": "TokenCodeNotConfigured", - "msg": "Token code is not configured in outpost_config.token_addresses_by_code" - }, - { - "code": 6042, - "name": "BadConnectorWeight", - "msg": "Connector weight must be in 1..=10_000 basis points" - }, - { - "code": 6043, - "name": "ReserveNameTooLong", - "msg": "Reserve name exceeds RESERVE_NAME_MAX_BYTES" - }, - { - "code": 6044, - "name": "ReserveDescriptionTooLong", - "msg": "Reserve description exceeds RESERVE_DESCRIPTION_MAX_BYTES" - }, - { - "code": 6045, - "name": "TokenAddressesFull", - "msg": "Token addresses table is full; cannot register another entry" - }, - { - "code": 6046, - "name": "ZeroReserveAmount", - "msg": "Reserve external_token_amount must be greater than zero" - }, - { - "code": 6047, - "name": "SwapUnknownSlugName", - "msg": "requestSwap: slug_name parameter is UNKNOWN (zero)" - }, - { - "code": 6048, - "name": "SwapEmptyRecipient", - "msg": "requestSwap: target_recipient is empty" - }, - { - "code": 6049, - "name": "SwapZeroSourceAmount", - "msg": "requestSwap: source_amount must be > 0" - }, - { - "code": 6050, - "name": "SwapSourceNotNative", - "msg": "requestSwap: source token must be native (this pass)" - }, - { - "code": 6051, - "name": "SwapSourceReserveUnavailable", - "msg": "requestSwap: source reserve unavailable" - }, - { - "code": 6052, - "name": "ArithmeticOverflow", - "msg": "arithmetic overflow during reserve accounting" - }, - { - "code": 6053, - "name": "SwapSourceIsNative", - "msg": "requestSwapSpl: source token must be SPL, not native" - }, - { - "code": 6054, - "name": "SwapSplMintMismatch", - "msg": "SPL mint does not match outpost_config binding for this token_code" - }, - { - "code": 6055, - "name": "PrecisionUnconfigured", - "msg": "token precision not configured — call set_token_precision first" - }, - { - "code": 6056, - "name": "RecipientAtaCreationFailed", - "msg": "handle_swap_remit: recipient ATA creation failed on-chain" - }, - { - "code": 6057, - "name": "TerminalChunkNotEmpty", - "msg": "epoch_in: the terminal finalize call must carry no chunk data" - }, - { - "code": 6058, - "name": "TerminalChunkBeforeDataComplete", - "msg": "epoch_in: terminal finalize before every data chunk was uploaded" - }, - { - "code": 6059, - "name": "EnvelopeEpochMismatch", - "msg": "Decoded envelope epoch does not match the epoch_in instruction epoch" - }, - { - "code": 6060, - "name": "NonCanonicalPreviousEnvelopeHash", - "msg": "previous_envelope_hash is not in canonical form" - }, - { - "code": 6061, - "name": "ReserveCreatorAtaNotCanonical", - "msg": "createReserve: creator ATA is not the canonical account for this mint" - }, - { - "code": 6062, - "name": "EmitBeforeEpochAccepted", - "msg": "Outbound emit for an epoch the inbound cursor has not accepted" - }, - { - "code": 6063, - "name": "EnvelopeWrongDestination", - "msg": "envelope destination is not an SVM chain" - }, - { - "code": 7000, - "name": "DestinationAccountDoesNotExist", - "msg": "Destination stake account does not exist" - }, - { - "code": 7001, - "name": "SourceAccountDoesNotExist", - "msg": "Source stake account does not exist" - }, - { - "code": 7002, - "name": "InvalidDestinationOwner", - "msg": "Destination account not owned by stake program" - }, - { - "code": 7003, - "name": "InvalidSourceOwner", - "msg": "Source account not owned by stake program" - }, - { - "code": 7004, - "name": "ClockBorrowFailed", - "msg": "Failed to borrow clock data" - }, - { - "code": 7005, - "name": "ClockDeserializeFailed", - "msg": "Failed to deserialize clock" - }, - { - "code": 7006, - "name": "DestinationAnalysisFailed", - "msg": "Failed to analyze destination stake account" - }, - { - "code": 7007, - "name": "SourceAnalysisFailed", - "msg": "Failed to analyze source stake account" - }, - { - "code": 7008, - "name": "DestinationStillActivating", - "msg": "Destination stake is still activating" - }, - { - "code": 7009, - "name": "DestinationDeactivating", - "msg": "Destination stake is deactivating" - }, - { - "code": 7010, - "name": "SourceStillActivating", - "msg": "Source stake is still activating" - }, - { - "code": 7011, - "name": "SourceDeactivating", - "msg": "Source stake is deactivating" - }, - { - "code": 7012, - "name": "DestinationBorrowFailed", - "msg": "Failed to borrow destination account data" - }, - { - "code": 7013, - "name": "DestinationParseFailed", - "msg": "Failed to parse destination stake state" - }, - { - "code": 7014, - "name": "SourceBorrowFailed", - "msg": "Failed to borrow source account data" - }, - { - "code": 7015, - "name": "SourceParseFailed", - "msg": "Failed to parse source stake state" - }, - { - "code": 7016, - "name": "DifferentValidators", - "msg": "Stakes are delegated to different validators" - }, - { - "code": 7017, - "name": "DifferentStakers", - "msg": "Stakes have different staker authorities" - }, - { - "code": 7018, - "name": "DifferentWithdrawers", - "msg": "Stakes have different withdrawer authorities" - }, - { - "code": 7019, - "name": "AuthoritiesNotFound", - "msg": "Could not extract authorities from accounts" - }, - { - "code": 7020, - "name": "MergeInstructionFailed", - "msg": "Merge instruction failed" - }, - { - "code": 7021, - "name": "EpochRewardsActive", - "msg": "Epoch rewards distribution is active - stake operations blocked" - }, - { - "code": 7022, - "name": "DifferentCreditsObserved", - "msg": "Stakes have different credits_observed - cannot merge until both earn same rewards" - }, - { - "code": 7100, - "name": "AccountBorrowFailed", - "msg": "Util Acc borrow Failed" - }, - { - "code": 7200, - "name": "InvalidAuthority", - "msg": "Only the configured admin may perform this action" - }, - { - "code": 7201, - "name": "InvalidAccountOwner", - "msg": "OutpostAccount does not belong to the signer" - }, - { - "code": 7202, - "name": "RoleNotEnabled", - "msg": "Role is not enabled (principal is 0)" - }, - { - "code": 7203, - "name": "AlreadyBondedForRole", - "msg": "Already bonded for this role" - }, - { - "code": 7204, - "name": "NotBondedForRole", - "msg": "Not bonded for this role" - }, - { - "code": 7205, - "name": "InsufficientStakedLiqsol", - "msg": "Insufficient staked liqSOL for bonding" - }, - { - "code": 7206, - "name": "BondStillInWarmup", - "msg": "Bond still in warmup period" - }, - { - "code": 7207, - "name": "AlreadyUnbonding", - "msg": "Unbond already requested for this role" - }, - { - "code": 7208, - "name": "NotUnbonding", - "msg": "Unbond not requested for this role" - }, - { - "code": 7209, - "name": "NotBonded", - "msg": "User has no active bonds" - }, - { - "code": 7210, - "name": "MissingRole", - "msg": "Actor does not have required role" - }, - { - "code": 7211, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7212, - "name": "Underflow", - "msg": "Arithmetic underflow" - }, - { - "code": 7213, - "name": "InvalidWarmupDuration", - "msg": "Invalid warmup duration" - }, - { - "code": 7300, - "name": "DepositTooSmall", - "msg": "Deposit amount is below minimum required" - }, - { - "code": 7301, - "name": "NotInitialized", - "msg": "Deposit Router not initialized" - }, - { - "code": 7302, - "name": "InvalidAuthority", - "msg": "Invalid authority" - }, - { - "code": 7303, - "name": "InsufficientFunds", - "msg": "Insufficient funds" - }, - { - "code": 7304, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7305, - "name": "CalculationFailure", - "msg": "Calculation failure" - }, - { - "code": 7306, - "name": "NothingToMint", - "msg": "Cannot mint zero tokens" - }, - { - "code": 7307, - "name": "InvalidAccount", - "msg": "Invalid account provided" - }, - { - "code": 7308, - "name": "InsufficientFundsForStake", - "msg": "Insufficient funds remaining after reserving fees to proceed with staking" - }, - { - "code": 7309, - "name": "UnauthorizedProgram", - "msg": "Unauthorized program attempting to call this instruction" - }, - { - "code": 7310, - "name": "DepositsDisabled", - "msg": "Deposits are currently disabled" - }, - { - "code": 7400, - "name": "NoRewardsToClaim", - "msg": "No rewards to claim" - }, - { - "code": 7401, - "name": "InsufficientBalance", - "msg": "Insufficient balance" - }, - { - "code": 7402, - "name": "InsufficientFunds", - "msg": "Insufficient funds" - }, - { - "code": 7403, - "name": "Unauthorized", - "msg": "Unauthorized - caller is not the distribution authority" - }, - { - "code": 7404, - "name": "InvalidMint", - "msg": "Invalid mint" - }, - { - "code": 7405, - "name": "InvalidOwner", - "msg": "Invalid owner" - }, - { - "code": 7406, - "name": "InvalidBucketAccount", - "msg": "Invalid bucket token account" - }, - { - "code": 7407, - "name": "InvalidUserRecord", - "msg": "Invalid user record" - }, - { - "code": 7408, - "name": "InvalidWithdrawal", - "msg": "Invalid withdrawal - balance increased instead of decreased" - }, - { - "code": 7409, - "name": "InvalidWithdrawalAmount", - "msg": "Invalid withdrawal - request must be greater than 0" - }, - { - "code": 7410, - "name": "InvalidProgramId", - "msg": "Invalid program ID" - }, - { - "code": 7411, - "name": "InstructionIntrospectionFailed", - "msg": "Instruction introspection failed" - }, - { - "code": 7412, - "name": "TransferNotInProgress", - "msg": "Transfer hook not active for this token account" - }, - { - "code": 7413, - "name": "ShareZeroTransfer", - "msg": "Amount too small resulting in zero share transfer" - }, - { - "code": 7414, - "name": "ReceiptFulfilled", - "msg": "Receipt already fulfilled" - }, - { - "code": 7415, - "name": "InsufficientBucketBalance", - "msg": "Insufficient bucket balance to fulfill claim" - }, - { - "code": 7416, - "name": "ClaimCalculationError", - "msg": "Claim calculation error" - }, - { - "code": 7417, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7418, - "name": "Underflow", - "msg": "Arithmetic underflow" - }, - { - "code": 7419, - "name": "BalanceBelowTracked", - "msg": "Balance below tracked amount — possible token burn detected" - }, - { - "code": 7420, - "name": "LegacyUserRecordMigrationRequired", - "msg": "Legacy user record must be migrated via register_user or migrate_user_record before claiming or transfers" - }, - { - "code": 7421, - "name": "AmountExceedsEntitled", - "msg": "Requested amount exceeds share-backed entitlement — cap at max_withdrawable or use full-ATA withdraw" - }, - { - "code": 7500, - "name": "Unauthorized", - "msg": "Unauthorized: The authority does not match the controller state's authority." - }, - { - "code": 7501, - "name": "NoUpgradeAuthority", - "msg": "Program has no upgrade authority (immutable)." - }, - { - "code": 7502, - "name": "PercentOutOfRange", - "msg": "Percent config value must be in 0..=100" - }, - { - "code": 7503, - "name": "PercentInversion", - "msg": "Percent config would invert hysteresis: entry must be <= exit" - }, - { - "code": 7504, - "name": "UnstakeDeltaBelowSplitMinimum", - "msg": "min_rebalance_unstake_delta must be >= MIN_STAKE_DELEGATION (1 SOL)" - }, - { - "code": 7600, - "name": "InsufficientFunds", - "msg": "Insufficient funds" - }, - { - "code": 7601, - "name": "InvalidValidator", - "msg": "Invalid validator" - }, - { - "code": 7602, - "name": "NoSuitableValidator", - "msg": "No suitable validator found" - }, - { - "code": 7603, - "name": "TicketNotFound", - "msg": "Unstake ticket not found" - }, - { - "code": 7604, - "name": "TicketNotClaimable", - "msg": "Ticket not claimable yet" - }, - { - "code": 7605, - "name": "Unauthorized", - "msg": "Unauthorized" - }, - { - "code": 7606, - "name": "ArithmeticOverflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7607, - "name": "AccountAlreadyExists", - "msg": "Account already exists" - }, - { - "code": 7608, - "name": "InvalidStakeAccount", - "msg": "Invalid stake account" - }, - { - "code": 7609, - "name": "InvalidThreshold", - "msg": "Invalid threshold value" - }, - { - "code": 7610, - "name": "InvalidAccountData", - "msg": "Invalid account data" - }, - { - "code": 7611, - "name": "InvalidVoteAccount", - "msg": "Invalid vote account" - }, - { - "code": 7612, - "name": "StakesNotYetActive", - "msg": "Stakes not yet active" - }, - { - "code": 7613, - "name": "EpochDistributionAlreadyDone", - "msg": "Invalid epoch" - }, - { - "code": 7614, - "name": "EpochAlreadyResolved", - "msg": "Epoch already resolved" - }, - { - "code": 7615, - "name": "MergeFailed", - "msg": "Merge failed" - }, - { - "code": 7616, - "name": "ReservePoolNotInitialized", - "msg": "Reserve pool not initialized" - }, - { - "code": 7617, - "name": "InvalidEphemeralAccount", - "msg": "Invalid ephemeral account" - }, - { - "code": 7618, - "name": "InvalidStakeAccount0", - "msg": "Invalid stake account 0" - }, - { - "code": 7619, - "name": "EpochNotReadyForResolution", - "msg": "Epoch Table Not Ready To be resolved" - }, - { - "code": 7620, - "name": "InsufficientSlotsElapsed", - "msg": "Function called too soon in epoch, should be called close to epoch boundary" - }, - { - "code": 7621, - "name": "EpochRewardsActive", - "msg": "Epoch rewards distribution is active - stake operations blocked" - }, - { - "code": 7622, - "name": "ValidatorSyncRequired", - "msg": "Validator sync required - please call sync_validator_stakes first" - }, - { - "code": 7623, - "name": "TooSmallDeposit", - "msg": "Deposit amount too small" - }, - { - "code": 7624, - "name": "AllocationsNotCalculated", - "msg": "Allocations not calculated for current epoch - please run rebalance_validators first" - }, - { - "code": 7625, - "name": "InvalidAccountCount", - "msg": "Invalid account count - expected different number of accounts" - }, - { - "code": 7626, - "name": "InvalidValidatorInfo", - "msg": "Invalid ValidatorInfo account" - }, - { - "code": 7627, - "name": "UnstakeAllocationsNotCalculated", - "msg": "Unstake allocations must be calculated before validator allocations - please run calculate_unstake_allocations first" - }, - { - "code": 7628, - "name": "InvalidReservePoolAccount", - "msg": "Invalid reserve pool account" - }, - { - "code": 7629, - "name": "PreReqsUnmet", - "msg": "Some Pre Req Not Met, Look at Solana Logs for details" - }, - { - "code": 7630, - "name": "SystemBusy", - "msg": "System busy: stake metrics are stale from a recent unstake — please retry shortly" - }, - { - "code": 7631, - "name": "UpdateInProgress", - "msg": "Update in progress: stake metrics are being refreshed for this epoch — please retry shortly" - }, - { - "code": 7632, - "name": "MaintenanceMergeRequired", - "msg": "Maintenance Merge Transients Failed - please run merge_activating_stakes first" - }, - { - "code": 7633, - "name": "UnstakeTooSMall", - "msg": "Unstake Request Too Small" - }, - { - "code": 7634, - "name": "OperationInProgress", - "msg": "Operation already in progress" - }, - { - "code": 7635, - "name": "NoOperationInProgress", - "msg": "No operation currently in progress" - }, - { - "code": 7636, - "name": "InvalidSequence", - "msg": "Invalid sequence - expected different index or rank" - }, - { - "code": 7637, - "name": "ValidatorNotFound", - "msg": "Validator not found in leaderboard" - }, - { - "code": 7638, - "name": "InvalidRank", - "msg": "Invalid rank - exceeds validator count" - }, - { - "code": 7639, - "name": "NoValidatorsInLeaderboard", - "msg": "No validators in leaderboard" - }, - { - "code": 7640, - "name": "NoValidatorsFound", - "msg": "No validators found in active list" - }, - { - "code": 7641, - "name": "GraveyardFull", - "msg": "Graveyard list is full" - }, - { - "code": 7642, - "name": "ValidatorHasActiveStake", - "msg": "Validator still has active stake - cannot cleanup until stake is repatriated" - }, - { - "code": 7643, - "name": "ValidatorHasPendingDeactivations", - "msg": "Validator has pending deactivations - cannot cleanup until all deactivations complete" - }, - { - "code": 7644, - "name": "ValidatorNotUndelegated", - "msg": "Validator is not in NotDelegated state - stake must be fully deactivated before cleanup" - }, - { - "code": 7645, - "name": "BatchSizeTooLarge", - "msg": "Batch size exceeds maximum allowed" - }, - { - "code": 7646, - "name": "StakingDisabled", - "msg": "Staking is currently disabled" - }, - { - "code": 7647, - "name": "WithdrawalsDisabled", - "msg": "Withdrawals are currently disabled" - }, - { - "code": 7648, - "name": "EmergencyModeActive", - "msg": "Emergency mode is active" - }, - { - "code": 7649, - "name": "ProcessStakeOrdersDisabled", - "msg": "Process stake orders is currently disabled" - }, - { - "code": 7650, - "name": "ProcessUnstakeOrdersDisabled", - "msg": "Process unstake orders is currently disabled" - }, - { - "code": 7651, - "name": "ProcessPayCycleDisabled", - "msg": "Process pay cycle is currently disabled" - }, - { - "code": 7652, - "name": "ValidatorRecordNotUpdated", - "msg": "Validator record not updated for current epoch" - }, - { - "code": 7653, - "name": "LateEpochSlotGateNotMet", - "msg": "Late epoch operation called too early - minimum slots not yet elapsed" - }, - { - "code": 7654, - "name": "IndexOutOfBounds", - "msg": "Index out of bounds" - }, - { - "code": 7655, - "name": "AccountAlreadyMigrated", - "msg": "Account already at target size, migration not needed" - }, - { - "code": 7656, - "name": "TreasuryRentUnfunded", - "msg": "Treasury can't cover stake-account rent and caller opted out of fronting it" - }, - { - "code": 7700, - "name": "InvalidChainlinkProgram", - "msg": "Invalid Chainlink program account" - }, - { - "code": 7701, - "name": "InvalidChainlinkFeed", - "msg": "Invalid Chainlink feed account" - }, - { - "code": 7702, - "name": "ArithmeticOverflow", - "msg": "Arithmetic overflow in calculation" - }, - { - "code": 7703, - "name": "InvalidCalculation", - "msg": "Invalid calculation result" - }, - { - "code": 7704, - "name": "DecimalPrecisionMismatch", - "msg": "Decimal precision mismatch" - }, - { - "code": 7705, - "name": "MissingNextTranche", - "msg": "Next tranche account required but not provided" - }, - { - "code": 7706, - "name": "InsufficientNextTrancheSupply", - "msg": "Insufficient pretokens in next tranche" - }, - { - "code": 7707, - "name": "TrancheExhausted", - "msg": "Current tranche exhausted" - }, - { - "code": 7708, - "name": "InvalidPretokenPrice", - "msg": "Invalid pretoken price" - }, - { - "code": 7709, - "name": "ChainlinkPriceFetchFailed", - "msg": "Failed to fetch SOL price from Chainlink" - }, - { - "code": 7710, - "name": "StalePrice", - "msg": "Chainlink price data is stale" - }, - { - "code": 7711, - "name": "PriceOutOfBounds", - "msg": "Price out of valid bounds" - }, - { - "code": 7712, - "name": "InvalidGrowthBps", - "msg": "Invalid growth BPS value (must be <= 10000)" - }, - { - "code": 7713, - "name": "Unauthorized", - "msg": "Unauthorized: caller is not admin" - }, - { - "code": 7714, - "name": "EmptyPriceHistory", - "msg": "Price history is empty" - }, - { - "code": 7715, - "name": "InsufficientFunds", - "msg": "Insufficient funds for pretoken purchase" - }, - { - "code": 7716, - "name": "ExceededTrancheLimit", - "msg": "Exceeded tranche limit, split purchase into multiple transactions" - }, - { - "code": 7717, - "name": "ZeroPretokensPurchased", - "msg": "Deposit too small to purchase any pretokens at current tranche price" - }, - { - "code": 7718, - "name": "InvalidRoundData", - "msg": "Invalid round data from Chainlink feed" - }, - { - "code": 7719, - "name": "InvalidStaleness", - "msg": "max_staleness_seconds must be > 0 - any non-positive value would brick price reads" - }, - { - "code": 7800, - "name": "Unauthorized", - "msg": "Unauthorized access" - }, - { - "code": 7801, - "name": "MaxValidatorsReached", - "msg": "Maximum validators reached" - }, - { - "code": 7802, - "name": "ValidatorAlreadyExists", - "msg": "Validator already exists" - }, - { - "code": 7803, - "name": "ValidatorNotFound", - "msg": "Validator not found" - }, - { - "code": 7804, - "name": "InvalidStakeUpdateType", - "msg": "Invalid stake update type" - }, - { - "code": 7805, - "name": "InvalidVoteAccount", - "msg": "Invalid vote account provided" - }, - { - "code": 7806, - "name": "InvalidInputLength", - "msg": "Invalid input length - all vectors must have same length" - }, - { - "code": 7807, - "name": "InvalidStakeAccount", - "msg": "Invalid Stake Account" - }, - { - "code": 7808, - "name": "ArithmeticOverflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7809, - "name": "InsufficientTransientStake", - "msg": "Insufficient transient stake" - }, - { - "code": 7810, - "name": "TransientTrackingFull", - "msg": "Transient tracking is full (100 entries max)" - }, - { - "code": 7811, - "name": "ValidatorStillInCooldown", - "msg": "Validator is still in cooldown period" - }, - { - "code": 7812, - "name": "InvalidVppScore", - "msg": "VPP score must be between 0 and 100" - }, - { - "code": 7900, - "name": "Unauthorized", - "msg": "Unauthorized admin attempting to call this instruction" - }, - { - "code": 7901, - "name": "InvalidAmount", - "msg": "Invalid amount" - }, - { - "code": 7902, - "name": "DDayNotSet", - "msg": "D-Day is not set" - }, - { - "code": 7903, - "name": "DDayActive", - "msg": "D-Day is active - stakes not allowed" - }, - { - "code": 7904, - "name": "InvalidLiqsolMint", - "msg": "Invalid liqSOL mint address" - }, - { - "code": 7905, - "name": "InsufficientFunds", - "msg": "Insufficient funds in user account" - }, - { - "code": 7906, - "name": "InsufficientStake", - "msg": "Insufficient staked amount for withdrawal" - }, - { - "code": 7907, - "name": "InsufficientShares", - "msg": "Insufficient shares for withdrawal" - }, - { - "code": 7908, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 7909, - "name": "Underflow", - "msg": "Arithmetic underflow" - }, - { - "code": 7910, - "name": "EmptyLiqsolPool", - "msg": "No liqSOL deposits registered in the pool" - }, - { - "code": 7911, - "name": "NoLiqsolPosition", - "msg": "No liqSOL position recorded for this user" - }, - { - "code": 7912, - "name": "NoStakeDeposit", - "msg": "No stake deposit found (only pretoken purchases exist)" - }, - { - "code": 7913, - "name": "RawSolBucketUnimplemented", - "msg": "Raw SOL bucket handling is not implemented yet" - }, - { - "code": 7914, - "name": "NoAccumulatedYield", - "msg": "No accumulated yield available to consume" - }, - { - "code": 7915, - "name": "RefundsNotActive", - "msg": "Refunds are not active" - }, - { - "code": 7916, - "name": "NoRefundablePosition", - "msg": "No refundable position found for this user" - }, - { - "code": 7917, - "name": "SystemPaused", - "msg": "System is currently paused" - }, - { - "code": 7918, - "name": "RefundsActive", - "msg": "Refunds are active - operation not allowed" - }, - { - "code": 7919, - "name": "ReceiptLocked", - "msg": "OutpostAccount is locked by an active bond" - }, - { - "code": 7920, - "name": "InvalidWireState", - "msg": "Invalid wire state for this operation" - }, - { - "code": 8000, - "name": "InvalidUserRecord", - "msg": "Invalid user record" - }, - { - "code": 8001, - "name": "InsufficientBalance", - "msg": "Insufficient balance" - }, - { - "code": 8002, - "name": "Overflow", - "msg": "Arithmetic overflow" - }, - { - "code": 8003, - "name": "ArithmeticUnderflow", - "msg": "Arithmetic underflow" - }, - { - "code": 8004, - "name": "AlreadyFulfilled", - "msg": "Receipt already fulfilled" - }, - { - "code": 8005, - "name": "NotYetServiceable", - "msg": "Receipt not yet serviceable" - }, - { - "code": 8006, - "name": "BadFrontierOrder", - "msg": "Frontier receipts out of order or unexpected id" - }, - { - "code": 8007, - "name": "MissingNftToken", - "msg": "User does not hold the NFT receipt token" - }, - { - "code": 8008, - "name": "WithdrawalsDisabled", - "msg": "Withdrawals are currently disabled" - }, - { - "code": 8009, - "name": "ClaimWithdrawalsDisabled", - "msg": "Claim withdrawals are currently disabled" - } - ], - "types": [ - { - "name": "AttestationData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "attestation_type", - "type": "i32" - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "BatchOrchestrator", - "docs": [ - "Holds resume positions for batched ops - cursors only, no value.", - "", - "Rule of thumb for what lives here vs StakeAllocationState: this account is", - "for WIPEABLE positions. Completion truth is in MaintenanceLedger, so a stale", - "cursor's staleness response is just \"zero it\" (sweep_stale_cursors does that", - "blanket at every epoch boundary). Anything that carries money/accounting and", - "needs abort/recover on staleness belongs on StakeAllocationState next to its", - "cycle, not here. The aggregation temps are the one grandfathered exception -", - "they carry value, so they sit outside the sweep behind their own mode-tag +", - "started_epoch guard.", - "", - "On liveness: ops here have no in_progress bools - a nonzero cursor/mode-tag", - "IS the liveness signal (see graveyard_locked, WIN-60). That inference works", - "because zero is out-of-band by construction for these fields: cursor at 0 =", - "no progress = idle, same state. Don't copy this pattern to fields where zero", - "is a real value (epochs, amounts) - those need an explicit bool." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "validators_processed_this_epoch", - "type": "u8" - }, - { - "name": "validators_merge_processed_this_epoch", - "type": "u16" - }, - { - "name": "validators_deactivating_merge_processed", - "type": "u16" - }, - { - "name": "validators_sync_processed_this_epoch", - "type": "u16" - }, - { - "name": "validators_unstake_processed_this_epoch", - "type": "u16" - }, - { - "name": "validators_aggregate_processed_this_epoch", - "type": "u16" - }, - { - "name": "temp_total_active_stake", - "type": "u64" - }, - { - "name": "temp_total_transient_stake", - "type": "u64" - }, - { - "name": "temp_total_reward", - "type": "u64" - }, - { - "name": "temp_total_unstakeable_stake", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "infra_next_index", - "docs": [ - "Next active_list index to process for PDA setup" - ], - "type": "u16" - }, - { - "name": "infos_next_index", - "docs": [ - "Next active_list index to process for infos sync" - ], - "type": "u16" - }, - { - "name": "leaderboard_scores_next_index", - "docs": [ - "Next leaderboard registry index to process for score sync" - ], - "type": "u16" - }, - { - "name": "removal_next_index", - "docs": [ - "Next index in active list to check for removal" - ], - "type": "u16" - }, - { - "name": "addition_next_rank", - "docs": [ - "Next rank in leaderboard to check for addition" - ], - "type": "u16" - }, - { - "name": "addition_target_rank", - "docs": [ - "Target (inclusive) leaderboard rank to process up to" - ], - "type": "u16" - }, - { - "name": "graveyard_next_index", - "docs": [ - "Next index in graveyard list to process" - ], - "type": "u16" - }, - { - "name": "graveyard_cleanup_next_index", - "docs": [ - "Next index in graveyard list to check for cleanup" - ], - "type": "u16" - }, - { - "name": "aggregate_mode_tag", - "docs": [ - "Tracks which aggregation mode currently owns the shared temp fields.", - "0 = idle,", - "1 = Normal,", - "2 = PostSync,", - "3 = PostLateEpoch.", - "Prevents cross-mode state contamination when modes share the same vars." - ], - "type": "u8" - }, - { - "name": "aggregation_started_epoch", - "docs": [ - "The epoch when the current aggregation batch started.", - "Prevents stale partial accumulators from being committed if an epoch boundary is crossed mid-aggregation." - ], - "type": "u64" - }, - { - "name": "mev_claims_next_index", - "docs": [ - "Next active_list index to process for MEV tip claims" - ], - "type": "u16" - }, - { - "name": "temp_total_mev_reward", - "docs": [ - "Temporary accumulator for MEV rewards across batches" - ], - "type": "u64" - }, - { - "name": "temp_total_outstanding_amount_to_unstake", - "docs": [ - "Temporary accumulator for sum of validators' amount_to_unstake across batches" - ], - "type": "u64" - }, - { - "name": "validators_sync_started_epoch", - "docs": [ - "Owns validators_sync_processed_this_epoch." - ], - "type": "u16" - }, - { - "name": "leaderboard_scores_started_epoch", - "docs": [ - "Owns leaderboard_scores_next_index." - ], - "type": "u16" - }, - { - "name": "graveyard_cleanup_started_epoch", - "docs": [ - "Owns graveyard_cleanup_next_index." - ], - "type": "u16" - }, - { - "name": "addition_started_epoch", - "docs": [ - "Owns addition_next_rank + addition_target_rank." - ], - "type": "u16" - }, - { - "name": "unstake_started_epoch", - "docs": [ - "Owns validators_unstake_processed_this_epoch. A nonzero cursor from a", - "dead epoch is not a real lock — this pin lets consumers tell stale", - "leftovers apart from a live in-epoch traversal." - ], - "type": "u16" - }, - { - "name": "cursors_epoch", - "docs": [ - "Every cursor on this account is a per-epoch resume position — at an", - "epoch boundary any nonzero one is stale garbage. The first batch op to", - "touch this account in a new epoch wipes them all in one swing via", - "sweep_stale_cursors, so no op ever resumes against a list that", - "selection reshuffled since. Backstop for the per-op pins above." - ], - "type": "u16" - }, - { - "name": "_reserved", - "type": { - "array": [ - "u8", - 60 - ] - } - } - ] - } - }, - { - "name": "CollateralEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "depositor", - "type": "pubkey" - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "ConfigKeyBool", - "docs": [ - "Keys for bool config values (feature flags) - stored as bits in a u16", - "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,", - "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "DepositsEnabled" - }, - { - "name": "WithdrawalsEnabled" - }, - { - "name": "ClaimWithdrawalsEnabled" - }, - { - "name": "ProcessStakeOrdersEnabled" - }, - { - "name": "ProcessUnstakeOrdersEnabled" - }, - { - "name": "ProcessPayCycleEnabled" - }, - { - "name": "RebalancingEnabled" - } - ] - } - }, - { - "name": "ConfigKeyU16", - "docs": [ - "Keys for u16 config values (small counts, thresholds, ranks)" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "CooldownEpochs" - }, - { - "name": "DepositFeeEpochsMultiplier" - }, - { - "name": "MinVppEntry" - }, - { - "name": "MinVppExit" - }, - { - "name": "TinyNetworkThreshold" - }, - { - "name": "SmallNetworkThreshold" - }, - { - "name": "MediumNetworkThreshold" - }, - { - "name": "LargeNetworkEntryRank" - }, - { - "name": "LargeNetworkExitRank" - } - ] - } - }, - { - "name": "ConfigKeyU64", - "docs": [ - "Keys for u64 config values (large amounts, rates)" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "MinUserDeposit" - }, - { - "name": "MinUnstakeRequest" - }, - { - "name": "MinRebalanceStakeDelta" - }, - { - "name": "MinRebalanceUnstakeDelta" - }, - { - "name": "TransientThreshold" - }, - { - "name": "MinLateEpochSlotGate" - } - ] - } - }, - { - "name": "ConfigKeyU8", - "docs": [ - "Keys for u8 config values (percentages 0-100)" - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "SmallNetworkEntryPercent" - }, - { - "name": "SmallNetworkExitPercent" - }, - { - "name": "MediumNetworkEntryPercent" - }, - { - "name": "MediumNetworkExitPercent" - } - ] - } - }, - { - "name": "DistributionState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "liqsol_mint", - "type": "pubkey" - }, - { - "name": "current_index", - "type": "u64" - }, - { - "name": "total_shares", - "docs": [ - "Sum of all user shares across the system" - ], - "type": "u64" - }, - { - "name": "last_bucket_balance", - "docs": [ - "Last observed bucket balance used for incremental index updates" - ], - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "bucket_bump", - "docs": [ - "Cached bucket authority bump to avoid repeated find_program_address calls" - ], - "type": "u8" - }, - { - "name": "pool_bump", - "docs": [ - "Cached pool authority bump to avoid repeated find_program_address calls" - ], - "type": "u8" - }, - { - "name": "bucket_authority", - "docs": [ - "Cached bucket authority pubkey for transfer-hook optimization" - ], - "type": "pubkey" - }, - { - "name": "pool_authority", - "docs": [ - "Cached pool authority pubkey for transfer-hook optimization" - ], - "type": "pubkey" - } - ] - } - }, - { - "name": "EnvelopeChunks", - "type": { - "kind": "struct", - "fields": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "operator", - "type": "pubkey" - }, - { - "name": "total_chunks", - "type": "u16" - }, - { - "name": "total_bytes", - "type": "u32" - }, - { - "name": "received_chunks", - "type": "u16" - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "EnvelopeLog", - "type": { - "kind": "struct", - "fields": [ - { - "name": "envelopes", - "type": { - "vec": { - "defined": { - "name": "EnvelopeRecord" - } - } - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "EnvelopeRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "emitted_at", - "type": "u64" - }, - { - "name": "checksum", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "EpochDeliveries", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "deliveries", - "type": { - "vec": { - "defined": { - "name": "OperatorDelivery" - } - } - } - }, - { - "name": "consensus_reached", - "type": "bool" - }, - { - "name": "consensus_hash", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "EpochResolved", - "type": { - "kind": "struct", - "fields": [ - { - "name": "validator", - "type": "pubkey" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "total_stake_amount", - "type": "u64" - }, - { - "name": "max_index", - "type": "u32" - } - ] - } - }, - { - "name": "FailedSwapRemit", - "type": { - "kind": "struct", - "fields": [ - { - "name": "original_swap_remit_id", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "recipient_address", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "token_code", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "reason_len", - "type": "u8" - }, - { - "name": "reason", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "Global", - "docs": [ - "Global operator state. Epoch-based model: receipts are serviceable", - "when `epoch <= serviceable_epoch` as reported by an external runtime." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "authority", - "docs": [ - "DEPRECATED: Originally intended as authority for serviceable_epoch updates,", - "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.", - "Retained to preserve account layout." - ], - "type": "pubkey" - }, - { - "name": "liqsol_mint", - "docs": [ - "Token-2022 liqSOL mint burned on withdraw." - ], - "type": "pubkey" - }, - { - "name": "serviceable_epoch", - "docs": [ - "Highest epoch that is currently claimable." - ], - "type": "u64" - }, - { - "name": "total_encumbered_funds", - "docs": [ - "Total SOL encumbered for pending withdrawal requests.", - "This amount is reserved from the reserve pool and will be paid out when receipts are claimed." - ], - "type": "u64" - }, - { - "name": "next_receipt_id", - "docs": [ - "Monotonic counter for generating unique receipt IDs" - ], - "type": "u64" - } - ] - } - }, - { - "name": "GlobalConfig", - "docs": [ - "Zero-copy global config PDA" - ], - "serialization": "bytemuckunsafe", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "_padding", - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "admin", - "type": "pubkey" - }, - { - "name": "cranky", - "type": "pubkey" - }, - { - "name": "_reserved_pubkey", - "type": { - "array": [ - "pubkey", - 1 - ] - } - }, - { - "name": "min_user_deposit", - "docs": [ - "Minimum SOL amount a user can deposit" - ], - "type": "u64" - }, - { - "name": "min_unstake_request", - "docs": [ - "Minimum SOL amount for an unstake/withdrawal request" - ], - "type": "u64" - }, - { - "name": "min_rebalance_stake_delta", - "docs": [ - "Minimum stake delta to trigger a stake rebalance order" - ], - "type": "u64" - }, - { - "name": "min_rebalance_unstake_delta", - "docs": [ - "Minimum unstake delta to trigger an unstake rebalance order" - ], - "type": "u64" - }, - { - "name": "transient_threshold", - "docs": [ - "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.", - "Rebalance now counts all transient stake on both sides of the delta equation,", - "so the per-validator threshold gate was removed." - ], - "type": "u64" - }, - { - "name": "min_late_epoch_slot_gate", - "docs": [ - "Minimum slots that must have elapsed in the epoch before late epoch operations can execute" - ], - "type": "u64" - }, - { - "name": "_reserved_u64", - "type": { - "array": [ - "u64", - 2 - ] - } - }, - { - "name": "cooldown_epochs", - "docs": [ - "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change" - ], - "type": "u16" - }, - { - "name": "deposit_fee_multiplier", - "docs": [ - "Multiplier for deposit fee calculation, this would be average \"pay rate x number of epochs we expect the stake to warm up\"" - ], - "type": "u16" - }, - { - "name": "min_vpp_entry", - "docs": [ - "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small" - ], - "type": "u16" - }, - { - "name": "min_vpp_exit", - "docs": [ - "VPP score threshold below which a validator is removed from active set, again a fall back" - ], - "type": "u16" - }, - { - "name": "tiny_network_threshold", - "docs": [ - "Max validators for \"tiny\" network band (uses fixed VPP thresholds) as above" - ], - "type": "u16" - }, - { - "name": "small_network_threshold", - "docs": [ - "Max validators for \"small\" network band (uses percentile-based selection)" - ], - "type": "u16" - }, - { - "name": "medium_network_threshold", - "docs": [ - "Max validators for \"medium\" network band (uses percentile-based selection)" - ], - "type": "u16" - }, - { - "name": "large_network_entry_rank", - "docs": [ - "Fixed rank threshold to enter active set in large networks (0-indexed)" - ], - "type": "u16" - }, - { - "name": "large_network_exit_rank", - "docs": [ - "Fixed rank threshold to exit active set in large networks (0-indexed)" - ], - "type": "u16" - }, - { - "name": "_reserved_u16", - "type": { - "array": [ - "u16", - 3 - ] - } - }, - { - "name": "small_network_entry_percent", - "docs": [ - "Percentile rank required to enter active set in small networks" - ], - "type": "u8" - }, - { - "name": "small_network_exit_percent", - "docs": [ - "Percentile rank below which validators exit in small networks" - ], - "type": "u8" - }, - { - "name": "medium_network_entry_percent", - "docs": [ - "Percentile rank required to enter active set in medium networks" - ], - "type": "u8" - }, - { - "name": "medium_network_exit_percent", - "docs": [ - "Percentile rank below which validators exit in medium networks" - ], - "type": "u8" - }, - { - "name": "_reserved_u8", - "type": { - "array": [ - "u8", - 2 - ] - } - }, - { - "name": "feature_flags", - "docs": [ - "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,", - "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,", - "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved" - ], - "type": "u16" - }, - { - "name": "_reserved_flags", - "type": { - "array": [ - "u16", - 1 - ] - } - }, - { - "name": "_reserved_trailing", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "GlobalState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "deployed_at", - "docs": [ - "Legacy refund timer fields retained to preserve account layout.", - "Refund activation is controlled exclusively through `wire_state`." - ], - "type": "i64" - }, - { - "name": "refund_delay_seconds", - "type": "i64" - }, - { - "name": "paused", - "docs": [ - "Global pause flag - when true, all operations except refunds are disabled" - ], - "type": "bool" - }, - { - "name": "total_staked_liqsol", - "docs": [ - "Aggregate liqSOL staked through pretokens (maps to distribution tracked balance)" - ], - "type": "u64" - }, - { - "name": "total_purchased_liqsol", - "docs": [ - "Aggregate liqSOL pretoken purchases (part of distribution tracked balance)" - ], - "type": "u64" - }, - { - "name": "total_shares", - "docs": [ - "Total shares issued to all users (for share/index yield isolation)" - ], - "type": "u64" - }, - { - "name": "protocol_shares", - "docs": [ - "Total shares issued to protocol (for share/index yield isolation)" - ], - "type": "u64" - }, - { - "name": "current_index", - "docs": [ - "Current share-to-token exchange rate (scaled by INDEX_SCALE = 1e12)", - "Starts at INDEX_SCALE (1.0) and grows as yield accrues" - ], - "type": "u64" - }, - { - "name": "expected_pool_balance", - "docs": [ - "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).", - "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield." - ], - "type": "u64" - }, - { - "name": "yield_accumulated_liqsol", - "docs": [ - "Accumulated liqSOL yield available for protocol pretoken purchases" - ], - "type": "u64" - }, - { - "name": "role_principals", - "docs": [ - "Required principal (liqSOL) per role [YieldOp, BatchOp, Underwriter, PoolOp]" - ], - "type": { - "array": [ - "u64", - 4 - ] - } - }, - { - "name": "role_warmup_duration", - "docs": [ - "Warmup duration in seconds (applies when ANY new role is bonded)" - ], - "type": "i64" - }, - { - "name": "wire_state", - "type": { - "defined": { - "name": "WireState" - } - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "GraveyardDeactivationQueuedEvent", - "docs": [ - "Event emitted when a graveyard validator's main stake deactivation is queued" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "amount_to_unstake", - "type": "u64" - } - ] - } - }, - { - "name": "GraveyardValidatorCleanedEvent", - "docs": [ - "Event emitted when a graveyard validator is cleaned up" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "epochs_since_state_change", - "type": "u16" - } - ] - } - }, - { - "name": "LatestOutboundEnvelope", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch_index", - "type": "u32" - }, - { - "name": "checksum", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "data", - "type": "bytes" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "LeaderboardState", - "docs": [ - "Central leaderboard state using parallel arrays for efficient ranking and CPI access", - "Stores VPP scores and sorted rankings for up to 1024 validators", - "Uses zero-copy for efficient access from other programs via CPI" - ], - "serialization": "bytemuck", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "scores", - "docs": [ - "VPP scores indexed by registry_index (0-100 range)", - "registry_index is assigned on first validator registration and never changes" - ], - "type": { - "array": [ - "u8", - 1024 - ] - } - }, - { - "name": "sorted_indices", - "docs": [ - "Validator indices sorted by VPP score descending", - "sorted_indices[0] = registry_index of highest VPP validator", - "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc." - ], - "type": { - "array": [ - "u16", - 1024 - ] - } - }, - { - "name": "vote_accounts", - "docs": [ - "Vote account pubkeys indexed by registry_index", - "Allows CPI callers to get vote accounts for top N validators" - ], - "type": { - "array": [ - { - "defined": { - "name": "PubkeyBytes" - } - }, - 1024 - ] - } - }, - { - "name": "num_validators", - "docs": [ - "Number of active validators currently in the leaderboard" - ], - "type": "u16" - }, - { - "name": "bump", - "docs": [ - "PDA bump seed" - ], - "type": "u8" - }, - { - "name": "_align", - "docs": [ - "Alignment byte (keeps u16 fields below properly aligned)" - ], - "type": "u8" - }, - { - "name": "crank_next_index", - "docs": [ - "Next validator index to process during crank_update_scores" - ], - "type": "u16" - }, - { - "name": "last_crank_epoch", - "docs": [ - "Last epoch when crank_update_scores completed all validators" - ], - "type": "u16" - }, - { - "name": "crank_started_epoch", - "docs": [ - "Epoch when start_crank was called (signals an active crank cycle)" - ], - "type": "u16" - } - ] - } - }, - { - "name": "LiqReceiptData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "receipt_id", - "type": "u64" - }, - { - "name": "liqports", - "type": "u64" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "fulfilled", - "type": "bool" - } - ] - } - }, - { - "name": "MaintenanceLedger", - "type": { - "kind": "struct", - "fields": [ - { - "name": "last_sync_epoch", - "type": "u16" - }, - { - "name": "last_validator_score_sync_epoch", - "type": "u16" - }, - { - "name": "last_leaderboard_scores_sync_epoch", - "type": "u16" - }, - { - "name": "last_active_infos_synced_epoch", - "docs": [ - "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout." - ], - "type": "u16" - }, - { - "name": "last_updated_stake_metrics_epoch", - "type": "u64" - }, - { - "name": "last_distribution_epoch", - "type": { - "option": "u64" - } - }, - { - "name": "last_distribution_slot", - "docs": [ - "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout." - ], - "type": { - "option": "u64" - } - }, - { - "name": "last_merge_deactivating_transients_epoch", - "type": "u64" - }, - { - "name": "last_rebalance_allocation_epoch", - "type": "u64" - }, - { - "name": "last_merge_activating_transients_epoch", - "type": "u64" - }, - { - "name": "last_unstake_epoch", - "type": { - "option": "u64" - } - }, - { - "name": "last_unstake_allocation_epoch", - "type": "u64" - }, - { - "name": "min_max_resolved_epoch_deactivations", - "type": "u16" - }, - { - "name": "last_threshold_sync_epoch", - "type": "u16" - }, - { - "name": "last_validator_removal_selection_epoch", - "type": "u16" - }, - { - "name": "last_validator_addition_selection_epoch", - "type": "u16" - }, - { - "name": "last_validator_pda_setup_epoch", - "type": "u16" - }, - { - "name": "last_graveyard_processing_epoch", - "type": "u16" - }, - { - "name": "last_post_sync_stake_metrics_refresh_epoch", - "type": "u16" - }, - { - "name": "last_graveyard_cleanup_epoch", - "type": "u16" - }, - { - "name": "last_post_late_epoch_stake_metrics_refresh_epoch", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "MetadataArgs", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - }, - { - "name": "symbol", - "type": "string" - }, - { - "name": "uri", - "type": "string" - } - ] - } - }, - { - "name": "OperatorDelivery", - "type": { - "kind": "struct", - "fields": [ - { - "name": "operator", - "type": "pubkey" - }, - { - "name": "envelope_hash", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "OperatorGroup", - "type": { - "kind": "struct", - "fields": [ - { - "name": "members", - "type": { - "vec": "pubkey" - } - } - ] - } - }, - { - "name": "OperatorMapping", - "type": { - "kind": "struct", - "fields": [ - { - "name": "wire_name", - "type": "u64" - }, - { - "name": "sol_address", - "type": "pubkey" - }, - { - "name": "role", - "type": "u32" - }, - { - "name": "status", - "type": "u32" - }, - { - "name": "slashed_at", - "type": "i64" - }, - { - "name": "terminated_at", - "type": "i64" - } - ] - } - }, - { - "name": "OperatorRegistry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "active_group_index", - "type": "u32" - }, - { - "name": "groups", - "type": { - "vec": { - "defined": { - "name": "OperatorGroup" - } - } - } - }, - { - "name": "operators", - "type": { - "vec": { - "defined": { - "name": "OperatorMapping" - } - } - } - }, - { - "name": "collateral_by_code", - "type": { - "vec": { - "defined": { - "name": "CollateralEntry" - } - } - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "OutboundMessageBuffer", - "type": { - "kind": "struct", - "fields": [ - { - "name": "attestation_count", - "type": "u16" - }, - { - "name": "used_data_bytes", - "type": "u32" - }, - { - "name": "entries", - "type": { - "vec": { - "defined": { - "name": "AttestationData" - } - } - } - }, - { - "name": "next_swap_id", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "OutpostAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "user", - "type": "pubkey" - }, - { - "name": "staked_liqsol", - "docs": [ - "STAKE deposits (withdrawable pre-D-Day)", - "Principal amount staked (for display/tracking)" - ], - "type": "u64" - }, - { - "name": "staked_shares", - "docs": [ - "Shares from staking (actual accounting for yield isolation)" - ], - "type": "u64" - }, - { - "name": "purchased_liqsol", - "docs": [ - "WARRANT_PURCHASE deposits with liqSOL (permanent)", - "Principal amount spent on pretokens (for display/tracking)" - ], - "type": "u64" - }, - { - "name": "purchased_shares", - "docs": [ - "Shares from liqSOL pretoken purchases (actual accounting for yield isolation)" - ], - "type": "u64" - }, - { - "name": "bonded_principals", - "docs": [ - "LiqSOL locked by bonds per role" - ], - "type": { - "array": [ - "u64", - 4 - ] - } - }, - { - "name": "bonded_roles", - "docs": [ - "Bitmap of bonded roles (bits 0-3 for YieldOp, BatchOp, Underwriter, PoolOp)" - ], - "type": "u8" - }, - { - "name": "unbond_requested", - "docs": [ - "Bitmap of roles with pending unbond requests (bits 0-3)" - ], - "type": "u8" - }, - { - "name": "warmup_ends_at", - "docs": [ - "Warmup end timestamp - has_role returns false until this time" - ], - "type": "i64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "accumulated_pretoken_yield", - "type": { - "option": "u64" - } - }, - { - "name": "last_epoch_synd_liqsol", - "type": { - "option": "u64" - } - }, - { - "name": "last_synd_epoch", - "type": { - "option": "u64" - } - } - ] - } - }, - { - "name": "OutpostConfig", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "pubkey" - }, - { - "name": "chain_code", - "type": "u64" - }, - { - "name": "next_epoch_index", - "type": "u32" - }, - { - "name": "previous_epoch_hash", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "previous_outbound_epoch_hash", - "docs": [ - "Chain tip for the OUTBOUND (outpost → depot) stream: the canonical", - "epoch digest (`keccak256(encoded envelope)`, `envelope_hash` empty) of", - "this outpost's own previous emit. Stamped into each outbound", - "envelope's `previous_envelope_hash` and advanced after every emit —", - "SEC-114 per-stream chaining; the depot's inbound verification drops a", - "cross-stream link (the inbound tip `previous_epoch_hash`) as a chain", - "break. All-zero = genesis (no emit on this stream yet)." - ], - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "epoch_duration_sec", - "type": "u32" - }, - { - "name": "current_epoch_started_at", - "type": "i64" - }, - { - "name": "registry_initialized", - "type": "bool" - }, - { - "name": "last_message_id", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "last_message_timestamp", - "type": "u64" - }, - { - "name": "envelope_retention_epochs", - "type": "u32" - }, - { - "name": "token_addresses_by_code", - "type": { - "vec": { - "defined": { - "name": "TokenAddressEntry" - } - } - } - }, - { - "name": "precision_by_token_code", - "type": { - "vec": { - "defined": { - "name": "TokenPrecisionEntry" - } - } - } - }, - { - "name": "config_version", - "type": "u8" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PayRateEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "scaled_rate", - "type": "u64" - } - ] - } - }, - { - "name": "PayRateHistory", - "type": { - "kind": "struct", - "fields": [ - { - "name": "current_index", - "type": "u16" - }, - { - "name": "total_entries_added", - "type": "u64" - }, - { - "name": "entries", - "type": { - "vec": { - "defined": { - "name": "PayRateEntry" - } - } - } - }, - { - "name": "max_entries", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PayoutState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "total_yield_paid_out_epoch", - "type": "u64" - }, - { - "name": "fees_remaining_to_distribute", - "type": "u64" - }, - { - "name": "total_fees_deposited", - "type": "u64" - }, - { - "name": "total_cumulative_payout_alltime", - "type": "u128" - }, - { - "name": "total_cumulative_payout_epoch", - "type": "u64" - }, - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "epoch", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PretokenPurchaseHistory", - "serialization": "bytemuck", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "starting_epoch", - "type": "u64" - }, - { - "name": "latest_epoch", - "type": "u64" - }, - { - "name": "purchased_per_epoch", - "type": { - "array": [ - "u64", - 100 - ] - } - }, - { - "name": "synd_per_epoch", - "type": { - "array": [ - "u64", - 100 - ] - } - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "_padding", - "type": { - "array": [ - "u8", - 7 - ] - } - } - ] - } - }, - { - "name": "PretokenPurchased", - "type": { - "kind": "struct", - "fields": [ - { - "name": "user", - "type": "pubkey" - }, - { - "name": "tranche_number", - "type": "u64" - }, - { - "name": "pretokens_purchased", - "type": "u64" - } - ] - } - }, - { - "name": "PriceHistory", - "docs": [ - "Price history for windowed moving average calculations", - "All prices stored in 8-decimal precision" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "window_size", - "docs": [ - "Number of prices to keep in the moving average window" - ], - "type": "u8" - }, - { - "name": "prices", - "docs": [ - "Circular buffer of recent prices (fixed size, 8-dec each)" - ], - "type": { - "array": [ - "u64", - 10 - ] - } - }, - { - "name": "count", - "docs": [ - "Number of valid entries in the prices array (0-10)" - ], - "type": "u8" - }, - { - "name": "next_index", - "type": "u8" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "PubkeyBytes", - "docs": [ - "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.", - "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`." - ], - "serialization": "bytemuck", - "repr": { - "kind": "transparent" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "bytes", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "Reserve", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "reserve_code", - "type": "u64" - }, - { - "name": "external_token_amount", - "type": "u64" - }, - { - "name": "requested_wire_amount", - "type": "u64" - }, - { - "name": "connector_weight_bps", - "type": "u32" - }, - { - "name": "status", - "type": { - "defined": { - "name": "ReserveStatus" - } - } - }, - { - "name": "creator", - "type": "pubkey" - }, - { - "name": "custody_mint", - "docs": [ - "Mint/native mode pinned at reserve creation. `NATIVE_TOKEN_MARKER`", - "means the reserve custodies lamports; any other pubkey is the SPL mint", - "held by the `reserve_vault`. Terminal handlers (SwapRemit, SwapRevert,", - "ReserveCreateCancelled) read this instead of the mutable", - "`OutpostConfig.token_addresses_by_code`, so an admin re-point of a", - "token_code between creation and dispatch cannot change how an", - "already-created reserve settles." - ], - "type": "pubkey" - }, - { - "name": "custody_decimals", - "docs": [ - "Chain-side decimals pinned at reserve creation. Native reserves use", - "`DEPOT_PRECISION_DECIMALS`; SPL reserves use the source mint's", - "`decimals` at creation time." - ], - "type": "u8" - }, - { - "name": "name_len", - "type": "u8" - }, - { - "name": "name_bytes", - "type": { - "array": [ - "u8", - 64 - ] - } - }, - { - "name": "description_len", - "type": "u16" - }, - { - "name": "description_bytes", - "type": { - "array": [ - "u8", - 256 - ] - } - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "ReserveAggregate", - "type": { - "kind": "struct", - "fields": [ - { - "name": "failed_remits", - "type": { - "array": [ - { - "defined": { - "name": "FailedSwapRemit" - } - }, - 8 - ] - } - }, - { - "name": "failed_remits_head", - "type": "u8" - }, - { - "name": "failed_remits_total", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "ReserveStatus", - "docs": [ - "Local Borsh enum (NOT the proto enum): tags Pending=0, Active=1, Cancelled=2." - ], - "type": { - "kind": "enum", - "variants": [ - { - "name": "Pending" - }, - { - "name": "Active" - }, - { - "name": "Cancelled" - } - ] - } - }, - { - "name": "Role", - "repr": { - "kind": "rust" - }, - "type": { - "kind": "enum", - "variants": [ - { - "name": "YieldOperator" - }, - { - "name": "BatchOperator" - }, - { - "name": "Underwriter" - }, - { - "name": "PoolOperator" - } - ] - } - }, - { - "name": "StakeAllocationState", - "docs": [ - "Stake allocation state tracking for validator stake distribution and unstake orders", - "Tracks both staking allocations (VPP-based) and unstake order batching", - "", - "Rule of thumb for what lives here vs BatchOrchestrator: this account holds", - "CONSERVED-VALUE cycles (frozen amounts, distributed totals, snapshots) - you", - "can never blanket-zero these, a stale cycle gets aborted/recovered instead", - "(see start_unstake_allocation's remainder recovery and abort_rebalance).", - "That's also why the *_started_epoch pins live here and not on BO: the pin is", - "part of its cycle record and must be stamped/cleared atomically with it by", - "the cycle's own start/abort methods, so pin and cycle can't desync. Pure", - "resume cursors with no value attached belong on BatchOrchestrator, where the", - "epoch sweep can wipe them for free.", - "", - "The in_progress bools here are deliberately explicit, NOT inferred like BO", - "does with its cursors. Inference needs a signal whose zero is out-of-band,", - "and every candidate here has a meaningful zero: epoch 0 is real (localnet),", - "an unstake-only rebalance legitimately distributes 0, and the processed", - "counter being nonzero-while-open is an accident of call sites, not a", - "guarantee. Plus these cycles have a state BO ops don't: open-but-stale with", - "recoverable frozen value - stale here means recover, not wipe, so it must", - "stay distinguishable from idle." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "total_active_vpp", - "docs": [ - "Sum of all VPP scores (0-100 each) for Trusted validators in the active list.", - "Max with 200 validators at 100 each = 20,000, fits in u32.", - "", - "Authoritatively recomputed by `conclude_addition_selection` from the active", - "list's `vpp` fields at the end of every addition-selection cycle, so any", - "intra-cycle drift from removals/score updates is wiped before allocation", - "uses this as a denominator. Do not maintain incrementally." - ], - "type": "u32" - }, - { - "name": "bump", - "docs": [ - "Bump seed for PDA" - ], - "type": "u8" - }, - { - "name": "initial_reserve_balance", - "docs": [ - "Initial reserve balance when distribution cycle started (for batched distribution)" - ], - "type": "u64" - }, - { - "name": "pending_unstake_amount_this_epoch", - "docs": [ - "Accumulates unstake requests during the epoch (before allocation starts)", - "Resets to 0 when allocation cycle begins" - ], - "type": "u64" - }, - { - "name": "unstake_allocation_in_progress", - "docs": [ - "Whether unstake allocation is currently in progress (batched processing)" - ], - "type": "bool" - }, - { - "name": "validators_processed_this_unstake_allocation", - "docs": [ - "Number of validators processed in the current unstake allocation batch" - ], - "type": "u16" - }, - { - "name": "processing_unstake_amount_this_allocation", - "docs": [ - "FROZEN amount being allocated across all batches this cycle", - "Set at start of allocation, prevents race conditions with new requests" - ], - "type": "u64" - }, - { - "name": "amount_distributed_this_unstake_allocation", - "docs": [ - "Tracks cumulative amount distributed across all batches in current unstake allocation cycle" - ], - "type": "u64" - }, - { - "name": "rebalance_in_progress", - "docs": [ - "Whether rebalancing is currently in progress (batched processing)" - ], - "type": "bool" - }, - { - "name": "validators_processed_this_rebalance", - "docs": [ - "Number of validators processed in the current rebalance cycle" - ], - "type": "u16" - }, - { - "name": "total_amount_to_distribute_this_rebalance", - "docs": [ - "Total amount to distribute for this rebalance cycle (after subtracting encumbered funds and buffer)", - "Saved at the start to ensure consistency across all batches" - ], - "type": "u64" - }, - { - "name": "cumulative_stake_requested_this_rebalance", - "docs": [ - "Tracks cumulative stake requested (sum of positive deltas) across all batches in current rebalance cycle" - ], - "type": "u64" - }, - { - "name": "rebalance_stake_scale_factor", - "docs": [ - "Scale factor to apply during process_stake_orders (uses PAY_RATE_SCALE_FACTOR precision)", - "Set to PAY_RATE_SCALE_FACTOR (1.0) if no scaling needed, or lower if cumulative > available" - ], - "type": "u64" - }, - { - "name": "is_small_distribution_mode", - "docs": [ - "Whether we're in small distribution mode (not enough for VPP-based distribution)", - "In this mode, we distribute evenly to first N validators instead of using VPP ratios" - ], - "type": "bool" - }, - { - "name": "validators_to_fund_this_rebalance", - "docs": [ - "Number of validators to fund in small distribution mode", - "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)" - ], - "type": "u16" - }, - { - "name": "amount_per_validator_this_rebalance", - "docs": [ - "Amount each validator gets in small distribution mode", - "Calculated as total_to_distribute / validators_to_fund" - ], - "type": "u64" - }, - { - "name": "selection_entry_threshold_vpp", - "docs": [ - "Entry threshold VPP from leaderboard (validators must meet this to be added, 0-100)" - ], - "type": "u8" - }, - { - "name": "selection_exit_threshold_vpp", - "docs": [ - "Exit threshold VPP from leaderboard (validators below this are removed, 0-100)" - ], - "type": "u8" - }, - { - "name": "addition_in_progress", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always false." - ], - "type": "bool" - }, - { - "name": "unstake_allocation_started_epoch", - "docs": [ - "Epoch in which the current unstake allocation cycle was started.", - "Used to detect stale cycles that span epoch boundaries — if the epoch", - "has advanced, the cycle is reset and restarted to avoid resuming", - "against a mutated validator active list.", - "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)" - ], - "type": "u16" - }, - { - "name": "rebalance_started_epoch", - "docs": [ - "Epoch in which the current rebalance cycle was started. Same job as", - "unstake_allocation_started_epoch above — a cycle whose epoch no longer", - "matches is stale (active list may have been reshuffled by selection)", - "and gets aborted + restarted instead of resumed.", - "(Repurposed from the deprecated addition_target_rank field — always 0 on mainnet.)" - ], - "type": "u16" - }, - { - "name": "validators_added_this_selection", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always 0." - ], - "type": "u16" - }, - { - "name": "removal_in_progress", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always false." - ], - "type": "bool" - }, - { - "name": "removal_next_index", - "docs": [ - "DEPRECATED — see BatchOrchestrator.removal_next_index. Always 0." - ], - "type": "u16" - }, - { - "name": "removal_active_list_snapshot", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always 0." - ], - "type": "u16" - }, - { - "name": "validators_removed_this_selection", - "docs": [ - "DEPRECATED — see BatchOrchestrator. Always 0." - ], - "type": "u16" - } - ] - } - }, - { - "name": "StakeControllerState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "pubkey" - }, - { - "name": "vault_initialized", - "type": "bool" - }, - { - "name": "reserve_pool_initialized", - "type": "bool" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "StakeMetrics", - "type": { - "kind": "struct", - "fields": [ - { - "name": "current_active_stake", - "type": "u64" - }, - { - "name": "transient_active_stake", - "type": "u64" - }, - { - "name": "actual_system_yield_received", - "type": "u64" - }, - { - "name": "sol_system_pay_rate", - "type": "u64" - }, - { - "name": "unstakeable_stake", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "mev_reward", - "docs": [ - "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)" - ], - "type": "u64" - }, - { - "name": "total_outstanding_amount_to_unstake", - "docs": [ - "WNS-16: total amount_to_unstake across all validators at last metrics refresh.", - "Represents allocated-but-not-yet-deactivated unstake obligations.", - "Subtracted from unstakeable_stake in admission control to prevent double-promising." - ], - "type": "u64" - }, - { - "name": "_reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 24 - ] - } - } - ] - } - }, - { - "name": "StakesMerged", - "type": { - "kind": "struct", - "fields": [ - { - "name": "validator", - "type": "pubkey" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "count", - "type": "u32" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "TokenAddressEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "mint", - "type": "pubkey" - } - ] - } - }, - { - "name": "TokenMetadata", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - }, - { - "name": "symbol", - "type": "string" - }, - { - "name": "uri", - "type": "string" - } - ] - } - }, - { - "name": "TokenPrecisionEntry", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token_code", - "type": "u64" - }, - { - "name": "decimals", - "type": "u8" - } - ] - } - }, - { - "name": "TrancheState", - "docs": [ - "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)", - "Example: $193.32 is stored as 19332000000" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "current_tranche_number", - "type": "u64" - }, - { - "name": "current_tranche_supply", - "type": "u64" - }, - { - "name": "current_tranche_price_usd", - "type": "u64" - }, - { - "name": "total_pretokens_sold", - "type": "u64" - }, - { - "name": "initial_tranche_supply", - "type": "u64" - }, - { - "name": "supply_growth_bps", - "docs": [ - "Supply growth in basis points (e.g., 100 = 1%, max 10000)" - ], - "type": "u16" - }, - { - "name": "price_growth_cents", - "docs": [ - "Price growth in cents per tranche (0.01 USD units)" - ], - "type": "u16" - }, - { - "name": "min_price_usd", - "docs": [ - "Minimum valid SOL/USD price for validation (8-dec)" - ], - "type": "u64" - }, - { - "name": "max_price_usd", - "docs": [ - "Maximum valid SOL/USD price for validation (8-dec)" - ], - "type": "u64" - }, - { - "name": "max_staleness_seconds", - "docs": [ - "Maximum staleness in seconds for Chainlink data" - ], - "type": "i64" - }, - { - "name": "chainlink_program", - "docs": [ - "Chainlink program address" - ], - "type": "pubkey" - }, - { - "name": "chainlink_feed", - "docs": [ - "Chainlink price feed PDA" - ], - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "UserPretokenRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "user", - "type": "pubkey" - }, - { - "name": "total_sol_deposited", - "type": "u64" - }, - { - "name": "total_pretokens_purchased", - "type": "u64" - }, - { - "name": "last_tranche_number", - "type": "u64" - }, - { - "name": "last_tranche_price_usd", - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, - { - "name": "UserRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "shares", - "docs": [ - "User's share of the distribution pool", - "entitled_balance = shares * current_index / INDEX_SCALE" - ], - "type": "u64" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "tracked_balance", - "docs": [ - "Last reconciled liqSOL token balance for this user ATA" - ], - "type": "u64" - } - ] - } - }, - { - "name": "ValidatorAddedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "vpp", - "type": "u8" - } - ] - } - }, - { - "name": "ValidatorInfoAccount", - "docs": [ - "Per-validator information account", - "Seed: [\"validator_info\", vote_account]" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "docs": [ - "Vote account this info belongs to" - ], - "type": "pubkey" - }, - { - "name": "vpp", - "docs": [ - "Validator Performance Points (0-100 score)" - ], - "type": "u8" - }, - { - "name": "bump", - "docs": [ - "Bump seed for PDA" - ], - "type": "u8" - }, - { - "name": "current_active_stake", - "docs": [ - "Fully active stake earning rewards" - ], - "type": "u64" - }, - { - "name": "epoch_reward", - "docs": [ - "Rewards earned in the last epoch", - "This is update in the function: sync_validator_stakes_v2 and is a simple subtraction of current - previous active stake. This does cater for deactivations etc. so", - "no worries" - ], - "type": "u64" - }, - { - "name": "transient_active_stake", - "docs": [ - "Stake warming up (activating), not fully active yet" - ], - "type": "u64" - }, - { - "name": "transient_deactivating_stake", - "docs": [ - "Stake cooling down (deactivating), no longer earning rewards" - ], - "type": "u64" - }, - { - "name": "last_chain_sync_epoch", - "docs": [ - "When was this entry last updated from the chain?", - "This is update in the function: sync_validator_stakes_v2" - ], - "type": "u16" - }, - { - "name": "last_score_sync_epoch", - "docs": [ - "When was this VPP score last updated from our Validator Leaderboard program?" - ], - "type": "u16" - }, - { - "name": "last_state_change_epoch", - "docs": [ - "When was the validator state last changed? (helps determine cooldowns)" - ], - "type": "u16" - }, - { - "name": "amount_to_stake", - "docs": [ - "The amount of stake to stake" - ], - "type": "u64" - }, - { - "name": "amount_to_unstake", - "docs": [ - "The amount of stake to unstake" - ], - "type": "u64" - }, - { - "name": "validator_repute", - "docs": [ - "State of the validator" - ], - "type": { - "defined": { - "name": "ValidatorReputation" - } - } - }, - { - "name": "validator_state", - "type": { - "defined": { - "name": "ValidatorState" - } - } - }, - { - "name": "state_transition_trigger_stake_amount", - "type": "u64" - }, - { - "name": "mev_earned", - "docs": [ - "MEV reward swept for this validator in the current epoch" - ], - "type": "u64" - }, - { - "name": "rebalance_unstake_pending", - "docs": [ - "The share of amount_to_unstake that came from rebalance this epoch.", - "amount_to_unstake mixes two things with different rules: user-withdrawal", - "shares are DEBT (back receipts, never resettable) while the rebalance", - "share is INTENT (recomputed from target-vs-effective every cycle,", - "replaceable). This field makes the intent part separable so a new", - "rebalance cycle can drop a dead cycle's contribution instead of adding", - "on top of it, without ever touching user debt.", - "(Carved from _reserved - those bytes are structurally zero: introduced", - "via realloc(len, true) in migrate_validator_info_batch and zeroed by", - "initialize() on fresh PDAs, never written since. Zero = \"all existing", - "amount_to_unstake is debt\", which is exactly today's safe behavior.)" - ], - "type": "u64" - }, - { - "name": "rebalance_unstake_epoch", - "docs": [ - "Epoch the rebalance component was stamped. A mismatch with the current", - "epoch means the component is a dead cycle's intent - subtract and re-add." - ], - "type": "u16" - }, - { - "name": "_reserved", - "docs": [ - "Reserved space for future use" - ], - "type": { - "array": [ - "u8", - 14 - ] - } - } - ] - } - }, - { - "name": "ValidatorList", - "docs": [ - "Zero-copy validator list account", - "Stores a fixed-capacity array of validator vote account pubkeys" - ], - "serialization": "bytemuckunsafe", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "count", - "docs": [ - "Current number of validators in the list" - ], - "type": "u32" - }, - { - "name": "capacity", - "docs": [ - "Maximum capacity of the list" - ], - "type": "u32" - }, - { - "name": "bump", - "docs": [ - "PDA bump seed" - ], - "type": "u8" - }, - { - "name": "_padding", - "docs": [ - "Padding for alignment" - ], - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "validators", - "docs": [ - "Fixed array of validator vote account pubkeys", - "Using Option to allow for empty slots (None = empty)" - ], - "type": { - "array": [ - { - "defined": { - "name": "ValidatorListEntry" - } - }, - 200 - ] - } - } - ] - } - }, - { - "name": "ValidatorListEntry", - "serialization": "bytemuckunsafe", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "docs": [ - "Vote account pubkey (all zeros = empty slot)" - ], - "type": "pubkey" - }, - { - "name": "registry_index", - "docs": [ - "Immutable index into the validator leaderboard arrays (u16::MAX = unknown)" - ], - "type": "u16" - }, - { - "name": "pdas_initialized", - "docs": [ - "Whether per-validator PDAs (info/transient) are initialized" - ], - "type": "bool" - }, - { - "name": "vpp", - "docs": [ - "Cached VPP score (0-100) refreshed at the start of a maintenance run" - ], - "type": "u8" - }, - { - "name": "_pad", - "docs": [ - "Padding to keep 8-byte alignment (32 + 2 + 1 + 1 + 4 = 40 bytes)" - ], - "type": { - "array": [ - "u8", - 4 - ] - } - } - ] - } - }, - { - "name": "ValidatorRemovedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "type": "pubkey" - }, - { - "name": "vpp", - "type": "u8" - } - ] - } - }, - { - "name": "ValidatorReputation", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Trusted" - }, - { - "name": "Blacklisted" - }, - { - "name": "UnderPerforming" - } - ] - } - }, - { - "name": "ValidatorState", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Warming" - }, - { - "name": "NotDelegated" - }, - { - "name": "Cooling" - }, - { - "name": "Warm" - }, - { - "name": "ReadyToCool" - } - ] - } - }, - { - "name": "ValidatorSwappedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "removed_vote", - "type": "pubkey" - }, - { - "name": "removed_vpp", - "type": "u8" - }, - { - "name": "added_vote", - "type": "pubkey" - }, - { - "name": "added_vpp", - "type": "u8" - } - ] - } - }, - { - "name": "ValidatorTransientAccount", - "docs": [ - "Per-validator transient stake tracking account", - "Seed: [\"validator_transient\", vote_account]", - "", - "This account tracks the resolution status of transient stake accounts", - "(both activating and deactivating) for a specific validator." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "vote_account", - "docs": [ - "Vote account this transient tracking belongs to" - ], - "type": "pubkey" - }, - { - "name": "bump", - "docs": [ - "Bump seed for PDA" - ], - "type": "u8" - }, - { - "name": "_padding", - "docs": [ - "Padding for alignment" - ], - "type": { - "array": [ - "u8", - 7 - ] - } - }, - { - "name": "max_resolved_epoch_deactivations", - "docs": [ - "The epoch number for which we have resolved the deactivating stakes", - "(resolved = deactivated and merged into the stake pool reserve)" - ], - "type": "u16" - }, - { - "name": "max_resolved_activating_stake", - "docs": [ - "The epoch number for which we have resolved the activating stakes", - "(resolved = fully activated and merged into the main stake account)" - ], - "type": "u16" - }, - { - "name": "last_updated_epoch_activations", - "docs": [ - "When did we last check if there are pending activated transient stakes that need to be merged in" - ], - "type": "u16" - }, - { - "name": "last_updated_epoch_deactivations", - "docs": [ - "When did we last check if there were pending deactivated stakes that need to be merged into the reserve pool" - ], - "type": "u16" - } - ] - } - }, - { - "name": "ValidatorsSyncedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "updated_count", - "type": "u32" - }, - { - "name": "not_found_count", - "type": "u32" - }, - { - "name": "epoch", - "type": "u64" - } - ] - } - }, - { - "name": "WireState", - "type": { - "kind": "enum", - "variants": [ - { - "name": "PreLaunch" - }, - { - "name": "PostLaunch" - }, - { - "name": "Refund" - } - ] - } - }, - { - "name": "WithdrawClaimed", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "user", - "type": "pubkey" - } - ] - } - }, - { - "name": "WithdrawRequested", - "type": { - "kind": "struct", - "fields": [ - { - "name": "epoch", - "type": "u64" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "user", - "type": "pubkey" - }, - { - "name": "receipt_id", - "type": "u64" - } - ] - } - } - ] -} diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 918518a..d5757be 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -1,13 +1,17 @@ import { providers, Signer } from "ethers" import { match } from "ts-pattern" +import { assertOutpostArtifactCompatibility } from "../../artifacts/index.js" import { OPPInbound__factory, OPP__factory, OperatorRegistry__factory, ReserveManager__factory } from "../../contracts/ethereum/index.js" -import { EthereumContractName } from "../../deployments/index.js" +import { + EthereumContractName, + OutpostChainFamily +} from "../../deployments/index.js" import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" function resolveProvider( @@ -32,6 +36,8 @@ export class EthereumOutpostClient { provider = resolveProvider(connection), network = await provider.getNetwork() + assertOutpostArtifactCompatibility(deployment, OutpostChainFamily.ethereum) + if (network.chainId !== deployment.ethereum.chainId) { throw new Error( `Ethereum chain mismatch: expected ${deployment.ethereum.chainId}, received ${network.chainId}` diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 631fcf4..a96648a 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -2,7 +2,11 @@ import { Program } from "@coral-xyz/anchor" import { PublicKey } from "@solana/web3.js" import { match } from "ts-pattern" -import { SolanaProgramName } from "../../deployments/index.js" +import { assertOutpostArtifactCompatibility } from "../../artifacts/index.js" +import { + OutpostChainFamily, + SolanaProgramName +} from "../../deployments/index.js" import { LiqsolCore, liqsolCoreIdl } from "../../programs/solana/index.js" import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" @@ -15,6 +19,8 @@ export class SolanaOutpostClient { const { deployment, provider } = options, genesisHash = await provider.connection.getGenesisHash() + assertOutpostArtifactCompatibility(deployment, OutpostChainFamily.solana) + if (genesisHash !== deployment.solana.genesisHash) { throw new Error( `Solana genesis mismatch: expected ${deployment.solana.genesisHash}, received ${genesisHash}` @@ -41,7 +47,13 @@ export class SolanaOutpostClient { private readonly liqsolCore: Program private constructor(private readonly options: SolanaOutpostClientOptions) { - this.liqsolCore = new Program(liqsolCoreIdl, options.provider) + const address = + options.deployment.solana.programs[SolanaProgramName.liqsolCore].address + + this.liqsolCore = new Program( + { ...liqsolCoreIdl, address }, + options.provider + ) } /** Provider verified against the configured Solana cluster. */ diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts deleted file mode 100644 index ce639bd..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/OPP.ts +++ /dev/null @@ -1,1084 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from "ethers"; -import type { - FunctionFragment, - Result, - EventFragment, -} from "@ethersproject/abi"; -import type { Listener, Provider } from "@ethersproject/providers"; -import type { - TypedEventFilter, - TypedEvent, - TypedListener, - OnEvent, -} from "./common.js"; - -export type ChainIdStruct = { kind: BigNumberish; id: BigNumberish }; - -export type ChainIdStructOutput = [number, number] & { - kind: number; - id: number; -}; - -export type EndpointsStruct = { start: ChainIdStruct; end: ChainIdStruct }; - -export type EndpointsStructOutput = [ - ChainIdStructOutput, - ChainIdStructOutput -] & { start: ChainIdStructOutput; end: ChainIdStructOutput }; - -export type MessageHeaderStruct = { - endpoints: EndpointsStruct; - messageId: BytesLike; - previousMessageId: BytesLike; - payloadSize: BigNumberish; - payloadChecksum: BytesLike; - timestamp: BigNumberish; - headerChecksum: BytesLike; -}; - -export type MessageHeaderStructOutput = [ - EndpointsStructOutput, - string, - string, - number, - string, - BigNumber, - string -] & { - endpoints: EndpointsStructOutput; - messageId: string; - previousMessageId: string; - payloadSize: number; - payloadChecksum: string; - timestamp: BigNumber; - headerChecksum: string; -}; - -export type AttestationEntryStruct = { - type_: BigNumberish; - dataSize: BigNumberish; - data: BytesLike; -}; - -export type AttestationEntryStructOutput = [number, number, string] & { - type_: number; - dataSize: number; - data: string; -}; - -export type MessagePayloadStruct = { - version: BigNumberish; - attestations: AttestationEntryStruct[]; -}; - -export type MessagePayloadStructOutput = [ - number, - AttestationEntryStructOutput[] -] & { version: number; attestations: AttestationEntryStructOutput[] }; - -export declare namespace OPPEnvelopeRetention { - export type EnvelopeRecordStruct = { - epochIndex: BigNumberish; - emittedAt: BigNumberish; - checksum: BytesLike; - }; - - export type EnvelopeRecordStructOutput = [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - }; -} - -export interface OPPInterface extends utils.Interface { - functions: { - "MAX_ENVELOPE_BYTES()": FunctionFragment; - "UPGRADE_INTERFACE_VERSION()": FunctionFragment; - "addAttestation(uint16,bytes)": FunctionFragment; - "allAuthorizedSenders(uint256)": FunctionFragment; - "authority()": FunctionFragment; - "authorizedSenders(bytes32)": FunctionFragment; - "emitOutboundEnvelope(uint32)": FunctionFragment; - "enterSendMode(uint256)": FunctionFragment; - "exitSendMode(uint256)": FunctionFragment; - "getLatestOutboundEnvelope()": FunctionFragment; - "getOutboundEnvelope(uint32)": FunctionFragment; - "inSendMode()": FunctionFragment; - "initialize(address)": FunctionFragment; - "isConsumingScheduledOp()": FunctionFragment; - "lastMessageID()": FunctionFragment; - "lastMessageTimestamp()": FunctionFragment; - "latestOutboundEnvelope()": FunctionFragment; - "latestOutboundEpoch()": FunctionFragment; - "outboundEnvelopes(uint32)": FunctionFragment; - "outboundRetentionConfig()": FunctionFragment; - "pendingAttestationCount()": FunctionFragment; - "proxiableUUID()": FunctionFragment; - "pruneOutboundEnvelope(uint32)": FunctionFragment; - "queuedMessageCount()": FunctionFragment; - "sendModeTag()": FunctionFragment; - "serializeMessage((((uint8,uint32),(uint8,uint32)),bytes,bytes,uint32,bytes,uint64,bytes),(uint32,(uint16,uint32,bytes)[]))": FunctionFragment; - "setAuthority(address)": FunctionFragment; - "setEnvelopeRetentionConfig(uint32)": FunctionFragment; - "upgradeToAndCall(address,bytes)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "MAX_ENVELOPE_BYTES" - | "UPGRADE_INTERFACE_VERSION" - | "addAttestation" - | "allAuthorizedSenders" - | "authority" - | "authorizedSenders" - | "emitOutboundEnvelope" - | "enterSendMode" - | "exitSendMode" - | "getLatestOutboundEnvelope" - | "getOutboundEnvelope" - | "inSendMode" - | "initialize" - | "isConsumingScheduledOp" - | "lastMessageID" - | "lastMessageTimestamp" - | "latestOutboundEnvelope" - | "latestOutboundEpoch" - | "outboundEnvelopes" - | "outboundRetentionConfig" - | "pendingAttestationCount" - | "proxiableUUID" - | "pruneOutboundEnvelope" - | "queuedMessageCount" - | "sendModeTag" - | "serializeMessage" - | "setAuthority" - | "setEnvelopeRetentionConfig" - | "upgradeToAndCall" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "MAX_ENVELOPE_BYTES", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "UPGRADE_INTERFACE_VERSION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "addAttestation", - values: [BigNumberish, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "allAuthorizedSenders", - values: [BigNumberish] - ): string; - encodeFunctionData(functionFragment: "authority", values?: undefined): string; - encodeFunctionData( - functionFragment: "authorizedSenders", - values: [BytesLike] - ): string; - encodeFunctionData( - functionFragment: "emitOutboundEnvelope", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "enterSendMode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "exitSendMode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "getLatestOutboundEnvelope", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getOutboundEnvelope", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "inSendMode", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "initialize", values: [string]): string; - encodeFunctionData( - functionFragment: "isConsumingScheduledOp", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastMessageID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastMessageTimestamp", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "latestOutboundEnvelope", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "latestOutboundEpoch", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "outboundEnvelopes", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "outboundRetentionConfig", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pendingAttestationCount", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "proxiableUUID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pruneOutboundEnvelope", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "queuedMessageCount", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "sendModeTag", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "serializeMessage", - values: [MessageHeaderStruct, MessagePayloadStruct] - ): string; - encodeFunctionData( - functionFragment: "setAuthority", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "setEnvelopeRetentionConfig", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "upgradeToAndCall", - values: [string, BytesLike] - ): string; - - decodeFunctionResult( - functionFragment: "MAX_ENVELOPE_BYTES", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "UPGRADE_INTERFACE_VERSION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "addAttestation", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "allAuthorizedSenders", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "authorizedSenders", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "emitOutboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "enterSendMode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "exitSendMode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getLatestOutboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getOutboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "inSendMode", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "isConsumingScheduledOp", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastMessageID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastMessageTimestamp", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "latestOutboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "latestOutboundEpoch", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "outboundEnvelopes", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "outboundRetentionConfig", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pendingAttestationCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "proxiableUUID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pruneOutboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "queuedMessageCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "sendModeTag", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "serializeMessage", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setAuthority", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setEnvelopeRetentionConfig", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "upgradeToAndCall", - data: BytesLike - ): Result; - - events: { - "AuthorityUpdated(address)": EventFragment; - "EnvelopeRetentionCatchUpPruned(uint32)": EventFragment; - "EnvelopeRetentionConfigUpdated(uint32,uint32)": EventFragment; - "Initialized(uint64)": EventFragment; - "OPPEnvelope(bytes)": EventFragment; - "Upgraded(address)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; - getEvent( - nameOrSignatureOrTopic: "EnvelopeRetentionCatchUpPruned" - ): EventFragment; - getEvent( - nameOrSignatureOrTopic: "EnvelopeRetentionConfigUpdated" - ): EventFragment; - getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OPPEnvelope"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; -} - -export interface AuthorityUpdatedEventObject { - authority: string; -} -export type AuthorityUpdatedEvent = TypedEvent< - [string], - AuthorityUpdatedEventObject ->; - -export type AuthorityUpdatedEventFilter = - TypedEventFilter; - -export interface EnvelopeRetentionCatchUpPrunedEventObject { - epochIndex: number; -} -export type EnvelopeRetentionCatchUpPrunedEvent = TypedEvent< - [number], - EnvelopeRetentionCatchUpPrunedEventObject ->; - -export type EnvelopeRetentionCatchUpPrunedEventFilter = - TypedEventFilter; - -export interface EnvelopeRetentionConfigUpdatedEventObject { - previousRetentionEpochs: number; - retentionEpochs: number; -} -export type EnvelopeRetentionConfigUpdatedEvent = TypedEvent< - [number, number], - EnvelopeRetentionConfigUpdatedEventObject ->; - -export type EnvelopeRetentionConfigUpdatedEventFilter = - TypedEventFilter; - -export interface InitializedEventObject { - version: BigNumber; -} -export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; - -export type InitializedEventFilter = TypedEventFilter; - -export interface OPPEnvelopeEventObject { - data: string; -} -export type OPPEnvelopeEvent = TypedEvent<[string], OPPEnvelopeEventObject>; - -export type OPPEnvelopeEventFilter = TypedEventFilter; - -export interface UpgradedEventObject { - implementation: string; -} -export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; - -export type UpgradedEventFilter = TypedEventFilter; - -export interface OPP extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: OPPInterface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>; - - listeners( - eventFilter?: TypedEventFilter - ): Array>; - listeners(eventName?: string): Array; - removeAllListeners( - eventFilter: TypedEventFilter - ): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; - - addAttestation( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - allAuthorizedSenders( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[string]>; - - authority(overrides?: CallOverrides): Promise<[string]>; - - authorizedSenders( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise<[boolean]>; - - emitOutboundEnvelope( - wireEpochIndex: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - enterSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - exitSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - getLatestOutboundEnvelope( - overrides?: CallOverrides - ): Promise<[number, string] & { epoch_: number; data_: string }>; - - getOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise<[OPPEnvelopeRetention.EnvelopeRecordStructOutput]>; - - inSendMode(overrides?: CallOverrides): Promise<[boolean]>; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; - - lastMessageID(overrides?: CallOverrides): Promise<[string]>; - - lastMessageTimestamp(overrides?: CallOverrides): Promise<[BigNumber]>; - - latestOutboundEnvelope(overrides?: CallOverrides): Promise<[string]>; - - latestOutboundEpoch(overrides?: CallOverrides): Promise<[number]>; - - outboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - } - >; - - outboundRetentionConfig( - overrides?: CallOverrides - ): Promise<[number] & { retentionEpochs: number }>; - - pendingAttestationCount(overrides?: CallOverrides): Promise<[BigNumber]>; - - proxiableUUID(overrides?: CallOverrides): Promise<[string]>; - - pruneOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - queuedMessageCount(overrides?: CallOverrides): Promise<[BigNumber]>; - - sendModeTag(overrides?: CallOverrides): Promise<[BigNumber]>; - - serializeMessage( - header: MessageHeaderStruct, - payload: MessagePayloadStruct, - overrides?: CallOverrides - ): Promise<[MessageHeaderStructOutput]>; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - }; - - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - addAttestation( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - allAuthorizedSenders( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - authorizedSenders( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - emitOutboundEnvelope( - wireEpochIndex: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - enterSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - exitSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - getLatestOutboundEnvelope( - overrides?: CallOverrides - ): Promise<[number, string] & { epoch_: number; data_: string }>; - - getOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inSendMode(overrides?: CallOverrides): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - lastMessageTimestamp(overrides?: CallOverrides): Promise; - - latestOutboundEnvelope(overrides?: CallOverrides): Promise; - - latestOutboundEpoch(overrides?: CallOverrides): Promise; - - outboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - } - >; - - outboundRetentionConfig(overrides?: CallOverrides): Promise; - - pendingAttestationCount(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - queuedMessageCount(overrides?: CallOverrides): Promise; - - sendModeTag(overrides?: CallOverrides): Promise; - - serializeMessage( - header: MessageHeaderStruct, - payload: MessagePayloadStruct, - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - callStatic: { - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - addAttestation( - attestationType: BigNumberish, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - - allAuthorizedSenders( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - authorizedSenders( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - emitOutboundEnvelope( - wireEpochIndex: BigNumberish, - overrides?: CallOverrides - ): Promise; - - enterSendMode(tag: BigNumberish, overrides?: CallOverrides): Promise; - - exitSendMode(tag: BigNumberish, overrides?: CallOverrides): Promise; - - getLatestOutboundEnvelope( - overrides?: CallOverrides - ): Promise<[number, string] & { epoch_: number; data_: string }>; - - getOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inSendMode(overrides?: CallOverrides): Promise; - - initialize(_authority: string, overrides?: CallOverrides): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - lastMessageTimestamp(overrides?: CallOverrides): Promise; - - latestOutboundEnvelope(overrides?: CallOverrides): Promise; - - latestOutboundEpoch(overrides?: CallOverrides): Promise; - - outboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - } - >; - - outboundRetentionConfig(overrides?: CallOverrides): Promise; - - pendingAttestationCount(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - queuedMessageCount(overrides?: CallOverrides): Promise; - - sendModeTag(overrides?: CallOverrides): Promise; - - serializeMessage( - header: MessageHeaderStruct, - payload: MessagePayloadStruct, - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: CallOverrides - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: CallOverrides - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; - AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; - - "EnvelopeRetentionCatchUpPruned(uint32)"( - epochIndex?: BigNumberish | null - ): EnvelopeRetentionCatchUpPrunedEventFilter; - EnvelopeRetentionCatchUpPruned( - epochIndex?: BigNumberish | null - ): EnvelopeRetentionCatchUpPrunedEventFilter; - - "EnvelopeRetentionConfigUpdated(uint32,uint32)"( - previousRetentionEpochs?: null, - retentionEpochs?: null - ): EnvelopeRetentionConfigUpdatedEventFilter; - EnvelopeRetentionConfigUpdated( - previousRetentionEpochs?: null, - retentionEpochs?: null - ): EnvelopeRetentionConfigUpdatedEventFilter; - - "Initialized(uint64)"(version?: null): InitializedEventFilter; - Initialized(version?: null): InitializedEventFilter; - - "OPPEnvelope(bytes)"(data?: null): OPPEnvelopeEventFilter; - OPPEnvelope(data?: null): OPPEnvelopeEventFilter; - - "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; - Upgraded(implementation?: string | null): UpgradedEventFilter; - }; - - estimateGas: { - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - addAttestation( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - allAuthorizedSenders( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - authorizedSenders( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - emitOutboundEnvelope( - wireEpochIndex: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - enterSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - exitSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - getLatestOutboundEnvelope(overrides?: CallOverrides): Promise; - - getOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inSendMode(overrides?: CallOverrides): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - lastMessageTimestamp(overrides?: CallOverrides): Promise; - - latestOutboundEnvelope(overrides?: CallOverrides): Promise; - - latestOutboundEpoch(overrides?: CallOverrides): Promise; - - outboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - outboundRetentionConfig(overrides?: CallOverrides): Promise; - - pendingAttestationCount(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - queuedMessageCount(overrides?: CallOverrides): Promise; - - sendModeTag(overrides?: CallOverrides): Promise; - - serializeMessage( - header: MessageHeaderStruct, - payload: MessagePayloadStruct, - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - }; - - populateTransaction: { - MAX_ENVELOPE_BYTES( - overrides?: CallOverrides - ): Promise; - - UPGRADE_INTERFACE_VERSION( - overrides?: CallOverrides - ): Promise; - - addAttestation( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - allAuthorizedSenders( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - authorizedSenders( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - emitOutboundEnvelope( - wireEpochIndex: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - enterSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - exitSendMode( - tag: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - getLatestOutboundEnvelope( - overrides?: CallOverrides - ): Promise; - - getOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inSendMode(overrides?: CallOverrides): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp( - overrides?: CallOverrides - ): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - lastMessageTimestamp( - overrides?: CallOverrides - ): Promise; - - latestOutboundEnvelope( - overrides?: CallOverrides - ): Promise; - - latestOutboundEpoch( - overrides?: CallOverrides - ): Promise; - - outboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - outboundRetentionConfig( - overrides?: CallOverrides - ): Promise; - - pendingAttestationCount( - overrides?: CallOverrides - ): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneOutboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - queuedMessageCount( - overrides?: CallOverrides - ): Promise; - - sendModeTag(overrides?: CallOverrides): Promise; - - serializeMessage( - header: MessageHeaderStruct, - payload: MessagePayloadStruct, - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - }; -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts deleted file mode 100644 index 761db9a..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/OPPInbound.ts +++ /dev/null @@ -1,1660 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from "ethers"; -import type { - FunctionFragment, - Result, - EventFragment, -} from "@ethersproject/abi"; -import type { Listener, Provider } from "@ethersproject/providers"; -import type { - TypedEventFilter, - TypedEvent, - TypedListener, - OnEvent, -} from "./common.js"; - -export type ChainIdStruct = { kind: BigNumberish; id: BigNumberish }; - -export type ChainIdStructOutput = [number, number] & { - kind: number; - id: number; -}; - -export type EndpointsStruct = { start: ChainIdStruct; end: ChainIdStruct }; - -export type EndpointsStructOutput = [ - ChainIdStructOutput, - ChainIdStructOutput -] & { start: ChainIdStructOutput; end: ChainIdStructOutput }; - -export declare namespace OPPEnvelopeRetention { - export type EnvelopeRecordStruct = { - epochIndex: BigNumberish; - emittedAt: BigNumberish; - checksum: BytesLike; - }; - - export type EnvelopeRecordStructOutput = [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - }; -} - -export interface OPPInboundInterface extends utils.Interface { - functions: { - "MAX_ENVELOPE_BYTES()": FunctionFragment; - "MIN_SIG_WEIGHT()": FunctionFragment; - "UPGRADE_INTERFACE_VERSION()": FunctionFragment; - "activeGroupIndex()": FunctionFragment; - "attestationHandlers(uint16)": FunctionFragment; - "authority()": FunctionFragment; - "batchOpGroups(uint256,uint256)": FunctionFragment; - "consensusReached()": FunctionFragment; - "currentEpochStartedAt()": FunctionFragment; - "epochDeliveries(uint32,address)": FunctionFragment; - "epochDeliveryCount(uint32)": FunctionFragment; - "epochDigestCount(uint32,bytes32)": FunctionFragment; - "epochDurationSec()": FunctionFragment; - "epochIn(bytes)": FunctionFragment; - "getInboundEnvelope(uint32)": FunctionFragment; - "inboundEnvelopes(uint32)": FunctionFragment; - "inboundRetentionConfig()": FunctionFragment; - "initialize(address)": FunctionFragment; - "isActiveOperator(address)": FunctionFragment; - "isConsumingScheduledOp()": FunctionFragment; - "lastMessageID()": FunctionFragment; - "nextEpochIndex()": FunctionFragment; - "operatorEthAddress(bytes32)": FunctionFragment; - "oppContract()": FunctionFragment; - "pendingConsensus()": FunctionFragment; - "pendingConsensusForDigest(bytes32)": FunctionFragment; - "pendingEpoch()": FunctionFragment; - "pendingEpochHash()": FunctionFragment; - "pendingMessageCount()": FunctionFragment; - "previousEpochHash()": FunctionFragment; - "proxiableUUID()": FunctionFragment; - "pruneInboundEnvelope(uint32)": FunctionFragment; - "pubkeyAddressCache(bytes32)": FunctionFragment; - "reserveManagerAddress()": FunctionFragment; - "rosterInitialized()": FunctionFragment; - "setAttestationHandler(uint16,address)": FunctionFragment; - "setAuthority(address)": FunctionFragment; - "setEnvelopeRetentionConfig(uint32)": FunctionFragment; - "setEpochDurationSec(uint32)": FunctionFragment; - "setOPPContract(address)": FunctionFragment; - "setReserveManagerAddress(address)": FunctionFragment; - "upgradeToAndCall(address,bytes)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "MAX_ENVELOPE_BYTES" - | "MIN_SIG_WEIGHT" - | "UPGRADE_INTERFACE_VERSION" - | "activeGroupIndex" - | "attestationHandlers" - | "authority" - | "batchOpGroups" - | "consensusReached" - | "currentEpochStartedAt" - | "epochDeliveries" - | "epochDeliveryCount" - | "epochDigestCount" - | "epochDurationSec" - | "epochIn" - | "getInboundEnvelope" - | "inboundEnvelopes" - | "inboundRetentionConfig" - | "initialize" - | "isActiveOperator" - | "isConsumingScheduledOp" - | "lastMessageID" - | "nextEpochIndex" - | "operatorEthAddress" - | "oppContract" - | "pendingConsensus" - | "pendingConsensusForDigest" - | "pendingEpoch" - | "pendingEpochHash" - | "pendingMessageCount" - | "previousEpochHash" - | "proxiableUUID" - | "pruneInboundEnvelope" - | "pubkeyAddressCache" - | "reserveManagerAddress" - | "rosterInitialized" - | "setAttestationHandler" - | "setAuthority" - | "setEnvelopeRetentionConfig" - | "setEpochDurationSec" - | "setOPPContract" - | "setReserveManagerAddress" - | "upgradeToAndCall" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "MAX_ENVELOPE_BYTES", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "MIN_SIG_WEIGHT", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "UPGRADE_INTERFACE_VERSION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "activeGroupIndex", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "attestationHandlers", - values: [BigNumberish] - ): string; - encodeFunctionData(functionFragment: "authority", values?: undefined): string; - encodeFunctionData( - functionFragment: "batchOpGroups", - values: [BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "consensusReached", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "currentEpochStartedAt", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "epochDeliveries", - values: [BigNumberish, string] - ): string; - encodeFunctionData( - functionFragment: "epochDeliveryCount", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "epochDigestCount", - values: [BigNumberish, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "epochDurationSec", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "epochIn", values: [BytesLike]): string; - encodeFunctionData( - functionFragment: "getInboundEnvelope", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "inboundEnvelopes", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "inboundRetentionConfig", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "initialize", values: [string]): string; - encodeFunctionData( - functionFragment: "isActiveOperator", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "isConsumingScheduledOp", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "lastMessageID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "nextEpochIndex", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "operatorEthAddress", - values: [BytesLike] - ): string; - encodeFunctionData( - functionFragment: "oppContract", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pendingConsensus", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pendingConsensusForDigest", - values: [BytesLike] - ): string; - encodeFunctionData( - functionFragment: "pendingEpoch", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pendingEpochHash", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pendingMessageCount", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "previousEpochHash", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "proxiableUUID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "pruneInboundEnvelope", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "pubkeyAddressCache", - values: [BytesLike] - ): string; - encodeFunctionData( - functionFragment: "reserveManagerAddress", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "rosterInitialized", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "setAttestationHandler", - values: [BigNumberish, string] - ): string; - encodeFunctionData( - functionFragment: "setAuthority", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "setEnvelopeRetentionConfig", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setEpochDurationSec", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setOPPContract", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "setReserveManagerAddress", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "upgradeToAndCall", - values: [string, BytesLike] - ): string; - - decodeFunctionResult( - functionFragment: "MAX_ENVELOPE_BYTES", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "MIN_SIG_WEIGHT", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "UPGRADE_INTERFACE_VERSION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "activeGroupIndex", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "attestationHandlers", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "batchOpGroups", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "consensusReached", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "currentEpochStartedAt", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "epochDeliveries", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "epochDeliveryCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "epochDigestCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "epochDurationSec", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "epochIn", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "getInboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "inboundEnvelopes", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "inboundRetentionConfig", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "isActiveOperator", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "isConsumingScheduledOp", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "lastMessageID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nextEpochIndex", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "operatorEthAddress", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "oppContract", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pendingConsensus", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pendingConsensusForDigest", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pendingEpoch", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pendingEpochHash", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pendingMessageCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "previousEpochHash", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "proxiableUUID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pruneInboundEnvelope", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "pubkeyAddressCache", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "reserveManagerAddress", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "rosterInitialized", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setAttestationHandler", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setAuthority", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setEnvelopeRetentionConfig", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setEpochDurationSec", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setOPPContract", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setReserveManagerAddress", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "upgradeToAndCall", - data: BytesLike - ): Result; - - events: { - "AttestationBlackholed(bytes,uint16,uint64)": EventFragment; - "AttestationDelivered(address,bytes,uint16,uint64)": EventFragment; - "AttestationHandlerSet(uint16,address,address)": EventFragment; - "AuthorityUpdated(address)": EventFragment; - "EnvelopeRetentionCatchUpPruned(uint32)": EventFragment; - "EnvelopeRetentionConfigUpdated(uint32,uint32)": EventFragment; - "EpochComplete(uint32)": EventFragment; - "EpochConsensus(uint32,bytes32,uint32)": EventFragment; - "EpochDelivery(uint32,address,bytes32)": EventFragment; - "EpochReceived(uint32,bytes32,uint256)": EventFragment; - "Initialized(uint64)": EventFragment; - "ReserveManagerAddressSet(address,address)": EventFragment; - "Upgraded(address)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "AttestationBlackholed"): EventFragment; - getEvent(nameOrSignatureOrTopic: "AttestationDelivered"): EventFragment; - getEvent(nameOrSignatureOrTopic: "AttestationHandlerSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; - getEvent( - nameOrSignatureOrTopic: "EnvelopeRetentionCatchUpPruned" - ): EventFragment; - getEvent( - nameOrSignatureOrTopic: "EnvelopeRetentionConfigUpdated" - ): EventFragment; - getEvent(nameOrSignatureOrTopic: "EpochComplete"): EventFragment; - getEvent(nameOrSignatureOrTopic: "EpochConsensus"): EventFragment; - getEvent(nameOrSignatureOrTopic: "EpochDelivery"): EventFragment; - getEvent(nameOrSignatureOrTopic: "EpochReceived"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ReserveManagerAddressSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; -} - -export interface AttestationBlackholedEventObject { - messageID: string; - attestationType: number; - sequenceNumber: BigNumber; -} -export type AttestationBlackholedEvent = TypedEvent< - [string, number, BigNumber], - AttestationBlackholedEventObject ->; - -export type AttestationBlackholedEventFilter = - TypedEventFilter; - -export interface AttestationDeliveredEventObject { - handler: string; - messageID: string; - attestationType: number; - sequenceNumber: BigNumber; -} -export type AttestationDeliveredEvent = TypedEvent< - [string, string, number, BigNumber], - AttestationDeliveredEventObject ->; - -export type AttestationDeliveredEventFilter = - TypedEventFilter; - -export interface AttestationHandlerSetEventObject { - attestationType: number; - handler: string; - oldHandler: string; -} -export type AttestationHandlerSetEvent = TypedEvent< - [number, string, string], - AttestationHandlerSetEventObject ->; - -export type AttestationHandlerSetEventFilter = - TypedEventFilter; - -export interface AuthorityUpdatedEventObject { - authority: string; -} -export type AuthorityUpdatedEvent = TypedEvent< - [string], - AuthorityUpdatedEventObject ->; - -export type AuthorityUpdatedEventFilter = - TypedEventFilter; - -export interface EnvelopeRetentionCatchUpPrunedEventObject { - epochIndex: number; -} -export type EnvelopeRetentionCatchUpPrunedEvent = TypedEvent< - [number], - EnvelopeRetentionCatchUpPrunedEventObject ->; - -export type EnvelopeRetentionCatchUpPrunedEventFilter = - TypedEventFilter; - -export interface EnvelopeRetentionConfigUpdatedEventObject { - previousRetentionEpochs: number; - retentionEpochs: number; -} -export type EnvelopeRetentionConfigUpdatedEvent = TypedEvent< - [number, number], - EnvelopeRetentionConfigUpdatedEventObject ->; - -export type EnvelopeRetentionConfigUpdatedEventFilter = - TypedEventFilter; - -export interface EpochCompleteEventObject { - epochIndex: number; -} -export type EpochCompleteEvent = TypedEvent<[number], EpochCompleteEventObject>; - -export type EpochCompleteEventFilter = TypedEventFilter; - -export interface EpochConsensusEventObject { - epochIndex: number; - epochHash: string; - deliveryCount: number; -} -export type EpochConsensusEvent = TypedEvent< - [number, string, number], - EpochConsensusEventObject ->; - -export type EpochConsensusEventFilter = TypedEventFilter; - -export interface EpochDeliveryEventObject { - epochIndex: number; - operator_: string; - epochHash: string; -} -export type EpochDeliveryEvent = TypedEvent< - [number, string, string], - EpochDeliveryEventObject ->; - -export type EpochDeliveryEventFilter = TypedEventFilter; - -export interface EpochReceivedEventObject { - epochIndex: number; - epochHash: string; - messageCount: BigNumber; -} -export type EpochReceivedEvent = TypedEvent< - [number, string, BigNumber], - EpochReceivedEventObject ->; - -export type EpochReceivedEventFilter = TypedEventFilter; - -export interface InitializedEventObject { - version: BigNumber; -} -export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; - -export type InitializedEventFilter = TypedEventFilter; - -export interface ReserveManagerAddressSetEventObject { - newReserveManager: string; - oldReserveManager: string; -} -export type ReserveManagerAddressSetEvent = TypedEvent< - [string, string], - ReserveManagerAddressSetEventObject ->; - -export type ReserveManagerAddressSetEventFilter = - TypedEventFilter; - -export interface UpgradedEventObject { - implementation: string; -} -export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; - -export type UpgradedEventFilter = TypedEventFilter; - -export interface OPPInbound extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: OPPInboundInterface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>; - - listeners( - eventFilter?: TypedEventFilter - ): Array>; - listeners(eventName?: string): Array; - removeAllListeners( - eventFilter: TypedEventFilter - ): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>; - - MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise<[BigNumber]>; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; - - activeGroupIndex(overrides?: CallOverrides): Promise<[number]>; - - attestationHandlers( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[string]>; - - authority(overrides?: CallOverrides): Promise<[string]>; - - batchOpGroups( - arg0: BigNumberish, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise<[string]>; - - consensusReached(overrides?: CallOverrides): Promise<[boolean]>; - - currentEpochStartedAt(overrides?: CallOverrides): Promise<[BigNumber]>; - - epochDeliveries( - arg0: BigNumberish, - arg1: string, - overrides?: CallOverrides - ): Promise<[string]>; - - epochDeliveryCount( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[number]>; - - epochDigestCount( - arg0: BigNumberish, - arg1: BytesLike, - overrides?: CallOverrides - ): Promise<[number]>; - - epochDurationSec(overrides?: CallOverrides): Promise<[number]>; - - epochIn( - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - getInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise<[OPPEnvelopeRetention.EnvelopeRecordStructOutput]>; - - inboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - } - >; - - inboundRetentionConfig( - overrides?: CallOverrides - ): Promise<[number] & { retentionEpochs: number }>; - - initialize( - oppManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isActiveOperator( - operator_: string, - overrides?: CallOverrides - ): Promise<[boolean]>; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; - - lastMessageID(overrides?: CallOverrides): Promise<[string]>; - - nextEpochIndex(overrides?: CallOverrides): Promise<[number]>; - - operatorEthAddress( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise<[string]>; - - oppContract(overrides?: CallOverrides): Promise<[string]>; - - pendingConsensus( - overrides?: CallOverrides - ): Promise< - [number, number, number, BigNumber, number] & { - nextEpoch: number; - deliveries: number; - groupSize: number; - currentEpochStartedAtTs: BigNumber; - epochDurationSec_: number; - } - >; - - pendingConsensusForDigest( - digest: BytesLike, - overrides?: CallOverrides - ): Promise< - [number, number, number, BigNumber, number] & { - nextEpoch: number; - agreeing: number; - groupSize: number; - currentEpochStartedAtTs: BigNumber; - epochDurationSec_: number; - } - >; - - pendingEpoch( - overrides?: CallOverrides - ): Promise< - [string, EndpointsStructOutput, BigNumber, number, number, string] & { - envelopeHash: string; - endpoints: EndpointsStructOutput; - epochTimestamp: BigNumber; - epochIndex: number; - epochEnvelopeIndex: number; - previousEnvelopeHash: string; - } - >; - - pendingEpochHash(overrides?: CallOverrides): Promise<[string]>; - - pendingMessageCount(overrides?: CallOverrides): Promise<[BigNumber]>; - - previousEpochHash(overrides?: CallOverrides): Promise<[string]>; - - proxiableUUID(overrides?: CallOverrides): Promise<[string]>; - - pruneInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - pubkeyAddressCache( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise<[string]>; - - reserveManagerAddress(overrides?: CallOverrides): Promise<[string]>; - - rosterInitialized(overrides?: CallOverrides): Promise<[boolean]>; - - setAttestationHandler( - attestationType: BigNumberish, - handler: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setEpochDurationSec( - durationSec: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPContract( - opp: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - newReserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - }; - - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; - - MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - activeGroupIndex(overrides?: CallOverrides): Promise; - - attestationHandlers( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - batchOpGroups( - arg0: BigNumberish, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - consensusReached(overrides?: CallOverrides): Promise; - - currentEpochStartedAt(overrides?: CallOverrides): Promise; - - epochDeliveries( - arg0: BigNumberish, - arg1: string, - overrides?: CallOverrides - ): Promise; - - epochDeliveryCount( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - epochDigestCount( - arg0: BigNumberish, - arg1: BytesLike, - overrides?: CallOverrides - ): Promise; - - epochDurationSec(overrides?: CallOverrides): Promise; - - epochIn( - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - getInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - } - >; - - inboundRetentionConfig(overrides?: CallOverrides): Promise; - - initialize( - oppManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isActiveOperator( - operator_: string, - overrides?: CallOverrides - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - nextEpochIndex(overrides?: CallOverrides): Promise; - - operatorEthAddress( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - oppContract(overrides?: CallOverrides): Promise; - - pendingConsensus( - overrides?: CallOverrides - ): Promise< - [number, number, number, BigNumber, number] & { - nextEpoch: number; - deliveries: number; - groupSize: number; - currentEpochStartedAtTs: BigNumber; - epochDurationSec_: number; - } - >; - - pendingConsensusForDigest( - digest: BytesLike, - overrides?: CallOverrides - ): Promise< - [number, number, number, BigNumber, number] & { - nextEpoch: number; - agreeing: number; - groupSize: number; - currentEpochStartedAtTs: BigNumber; - epochDurationSec_: number; - } - >; - - pendingEpoch( - overrides?: CallOverrides - ): Promise< - [string, EndpointsStructOutput, BigNumber, number, number, string] & { - envelopeHash: string; - endpoints: EndpointsStructOutput; - epochTimestamp: BigNumber; - epochIndex: number; - epochEnvelopeIndex: number; - previousEnvelopeHash: string; - } - >; - - pendingEpochHash(overrides?: CallOverrides): Promise; - - pendingMessageCount(overrides?: CallOverrides): Promise; - - previousEpochHash(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - pubkeyAddressCache( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - reserveManagerAddress(overrides?: CallOverrides): Promise; - - rosterInitialized(overrides?: CallOverrides): Promise; - - setAttestationHandler( - attestationType: BigNumberish, - handler: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setEpochDurationSec( - durationSec: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPContract( - opp: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - newReserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - callStatic: { - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; - - MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - activeGroupIndex(overrides?: CallOverrides): Promise; - - attestationHandlers( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - batchOpGroups( - arg0: BigNumberish, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - consensusReached(overrides?: CallOverrides): Promise; - - currentEpochStartedAt(overrides?: CallOverrides): Promise; - - epochDeliveries( - arg0: BigNumberish, - arg1: string, - overrides?: CallOverrides - ): Promise; - - epochDeliveryCount( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - epochDigestCount( - arg0: BigNumberish, - arg1: BytesLike, - overrides?: CallOverrides - ): Promise; - - epochDurationSec(overrides?: CallOverrides): Promise; - - epochIn(data: BytesLike, overrides?: CallOverrides): Promise; - - getInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise< - [number, BigNumber, string] & { - epochIndex: number; - emittedAt: BigNumber; - checksum: string; - } - >; - - inboundRetentionConfig(overrides?: CallOverrides): Promise; - - initialize(oppManager: string, overrides?: CallOverrides): Promise; - - isActiveOperator( - operator_: string, - overrides?: CallOverrides - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - nextEpochIndex(overrides?: CallOverrides): Promise; - - operatorEthAddress( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - oppContract(overrides?: CallOverrides): Promise; - - pendingConsensus( - overrides?: CallOverrides - ): Promise< - [number, number, number, BigNumber, number] & { - nextEpoch: number; - deliveries: number; - groupSize: number; - currentEpochStartedAtTs: BigNumber; - epochDurationSec_: number; - } - >; - - pendingConsensusForDigest( - digest: BytesLike, - overrides?: CallOverrides - ): Promise< - [number, number, number, BigNumber, number] & { - nextEpoch: number; - agreeing: number; - groupSize: number; - currentEpochStartedAtTs: BigNumber; - epochDurationSec_: number; - } - >; - - pendingEpoch( - overrides?: CallOverrides - ): Promise< - [string, EndpointsStructOutput, BigNumber, number, number, string] & { - envelopeHash: string; - endpoints: EndpointsStructOutput; - epochTimestamp: BigNumber; - epochIndex: number; - epochEnvelopeIndex: number; - previousEnvelopeHash: string; - } - >; - - pendingEpochHash(overrides?: CallOverrides): Promise; - - pendingMessageCount(overrides?: CallOverrides): Promise; - - previousEpochHash(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - pubkeyAddressCache( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - reserveManagerAddress(overrides?: CallOverrides): Promise; - - rosterInitialized(overrides?: CallOverrides): Promise; - - setAttestationHandler( - attestationType: BigNumberish, - handler: string, - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: CallOverrides - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setEpochDurationSec( - durationSec: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setOPPContract(opp: string, overrides?: CallOverrides): Promise; - - setReserveManagerAddress( - newReserveManager: string, - overrides?: CallOverrides - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "AttestationBlackholed(bytes,uint16,uint64)"( - messageID?: null, - attestationType?: null, - sequenceNumber?: null - ): AttestationBlackholedEventFilter; - AttestationBlackholed( - messageID?: null, - attestationType?: null, - sequenceNumber?: null - ): AttestationBlackholedEventFilter; - - "AttestationDelivered(address,bytes,uint16,uint64)"( - handler?: string | null, - messageID?: null, - attestationType?: null, - sequenceNumber?: null - ): AttestationDeliveredEventFilter; - AttestationDelivered( - handler?: string | null, - messageID?: null, - attestationType?: null, - sequenceNumber?: null - ): AttestationDeliveredEventFilter; - - "AttestationHandlerSet(uint16,address,address)"( - attestationType?: BigNumberish | null, - handler?: null, - oldHandler?: null - ): AttestationHandlerSetEventFilter; - AttestationHandlerSet( - attestationType?: BigNumberish | null, - handler?: null, - oldHandler?: null - ): AttestationHandlerSetEventFilter; - - "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; - AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; - - "EnvelopeRetentionCatchUpPruned(uint32)"( - epochIndex?: BigNumberish | null - ): EnvelopeRetentionCatchUpPrunedEventFilter; - EnvelopeRetentionCatchUpPruned( - epochIndex?: BigNumberish | null - ): EnvelopeRetentionCatchUpPrunedEventFilter; - - "EnvelopeRetentionConfigUpdated(uint32,uint32)"( - previousRetentionEpochs?: null, - retentionEpochs?: null - ): EnvelopeRetentionConfigUpdatedEventFilter; - EnvelopeRetentionConfigUpdated( - previousRetentionEpochs?: null, - retentionEpochs?: null - ): EnvelopeRetentionConfigUpdatedEventFilter; - - "EpochComplete(uint32)"(epochIndex?: null): EpochCompleteEventFilter; - EpochComplete(epochIndex?: null): EpochCompleteEventFilter; - - "EpochConsensus(uint32,bytes32,uint32)"( - epochIndex?: BigNumberish | null, - epochHash?: null, - deliveryCount?: null - ): EpochConsensusEventFilter; - EpochConsensus( - epochIndex?: BigNumberish | null, - epochHash?: null, - deliveryCount?: null - ): EpochConsensusEventFilter; - - "EpochDelivery(uint32,address,bytes32)"( - epochIndex?: BigNumberish | null, - operator_?: string | null, - epochHash?: null - ): EpochDeliveryEventFilter; - EpochDelivery( - epochIndex?: BigNumberish | null, - operator_?: string | null, - epochHash?: null - ): EpochDeliveryEventFilter; - - "EpochReceived(uint32,bytes32,uint256)"( - epochIndex?: null, - epochHash?: null, - messageCount?: null - ): EpochReceivedEventFilter; - EpochReceived( - epochIndex?: null, - epochHash?: null, - messageCount?: null - ): EpochReceivedEventFilter; - - "Initialized(uint64)"(version?: null): InitializedEventFilter; - Initialized(version?: null): InitializedEventFilter; - - "ReserveManagerAddressSet(address,address)"( - newReserveManager?: null, - oldReserveManager?: null - ): ReserveManagerAddressSetEventFilter; - ReserveManagerAddressSet( - newReserveManager?: null, - oldReserveManager?: null - ): ReserveManagerAddressSetEventFilter; - - "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; - Upgraded(implementation?: string | null): UpgradedEventFilter; - }; - - estimateGas: { - MAX_ENVELOPE_BYTES(overrides?: CallOverrides): Promise; - - MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - activeGroupIndex(overrides?: CallOverrides): Promise; - - attestationHandlers( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - batchOpGroups( - arg0: BigNumberish, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - consensusReached(overrides?: CallOverrides): Promise; - - currentEpochStartedAt(overrides?: CallOverrides): Promise; - - epochDeliveries( - arg0: BigNumberish, - arg1: string, - overrides?: CallOverrides - ): Promise; - - epochDeliveryCount( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - epochDigestCount( - arg0: BigNumberish, - arg1: BytesLike, - overrides?: CallOverrides - ): Promise; - - epochDurationSec(overrides?: CallOverrides): Promise; - - epochIn( - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - getInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inboundRetentionConfig(overrides?: CallOverrides): Promise; - - initialize( - oppManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isActiveOperator( - operator_: string, - overrides?: CallOverrides - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - nextEpochIndex(overrides?: CallOverrides): Promise; - - operatorEthAddress( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - oppContract(overrides?: CallOverrides): Promise; - - pendingConsensus(overrides?: CallOverrides): Promise; - - pendingConsensusForDigest( - digest: BytesLike, - overrides?: CallOverrides - ): Promise; - - pendingEpoch(overrides?: CallOverrides): Promise; - - pendingEpochHash(overrides?: CallOverrides): Promise; - - pendingMessageCount(overrides?: CallOverrides): Promise; - - previousEpochHash(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - pubkeyAddressCache( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - reserveManagerAddress(overrides?: CallOverrides): Promise; - - rosterInitialized(overrides?: CallOverrides): Promise; - - setAttestationHandler( - attestationType: BigNumberish, - handler: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setEpochDurationSec( - durationSec: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPContract( - opp: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - newReserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - }; - - populateTransaction: { - MAX_ENVELOPE_BYTES( - overrides?: CallOverrides - ): Promise; - - MIN_SIG_WEIGHT(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION( - overrides?: CallOverrides - ): Promise; - - activeGroupIndex(overrides?: CallOverrides): Promise; - - attestationHandlers( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - batchOpGroups( - arg0: BigNumberish, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - consensusReached(overrides?: CallOverrides): Promise; - - currentEpochStartedAt( - overrides?: CallOverrides - ): Promise; - - epochDeliveries( - arg0: BigNumberish, - arg1: string, - overrides?: CallOverrides - ): Promise; - - epochDeliveryCount( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - epochDigestCount( - arg0: BigNumberish, - arg1: BytesLike, - overrides?: CallOverrides - ): Promise; - - epochDurationSec(overrides?: CallOverrides): Promise; - - epochIn( - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - getInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inboundEnvelopes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - inboundRetentionConfig( - overrides?: CallOverrides - ): Promise; - - initialize( - oppManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isActiveOperator( - operator_: string, - overrides?: CallOverrides - ): Promise; - - isConsumingScheduledOp( - overrides?: CallOverrides - ): Promise; - - lastMessageID(overrides?: CallOverrides): Promise; - - nextEpochIndex(overrides?: CallOverrides): Promise; - - operatorEthAddress( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - oppContract(overrides?: CallOverrides): Promise; - - pendingConsensus(overrides?: CallOverrides): Promise; - - pendingConsensusForDigest( - digest: BytesLike, - overrides?: CallOverrides - ): Promise; - - pendingEpoch(overrides?: CallOverrides): Promise; - - pendingEpochHash(overrides?: CallOverrides): Promise; - - pendingMessageCount( - overrides?: CallOverrides - ): Promise; - - previousEpochHash(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - pruneInboundEnvelope( - epochIndex_: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - pubkeyAddressCache( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - reserveManagerAddress( - overrides?: CallOverrides - ): Promise; - - rosterInitialized(overrides?: CallOverrides): Promise; - - setAttestationHandler( - attestationType: BigNumberish, - handler: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setEnvelopeRetentionConfig( - retentionEpochs: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setEpochDurationSec( - durationSec: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPContract( - opp: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - newReserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - }; -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts deleted file mode 100644 index 73b8e5e..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/OperatorRegistry.ts +++ /dev/null @@ -1,1433 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from "ethers"; -import type { - FunctionFragment, - Result, - EventFragment, -} from "@ethersproject/abi"; -import type { Listener, Provider } from "@ethersproject/providers"; -import type { - TypedEventFilter, - TypedEvent, - TypedListener, - OnEvent, -} from "./common.js"; - -export type AttestationEntryStruct = { - type_: BigNumberish; - dataSize: BigNumberish; - data: BytesLike; -}; - -export type AttestationEntryStructOutput = [number, number, string] & { - type_: number; - dataSize: number; - data: string; -}; - -export interface OperatorRegistryInterface extends utils.Interface { - functions: { - "DEPOSIT_REVERT_ATTESTATION()": FunctionFragment; - "DEPOSIT_REVERT_GAS_MULTIPLIER()": FunctionFragment; - "OPERATOR_ACTION_ATTESTATION()": FunctionFragment; - "OPPAttestationIn(uint16,bytes)": FunctionFragment; - "UNDERWRITE_INTENT_COMMIT_ATTESTATION()": FunctionFragment; - "UPGRADE_INTERFACE_VERSION()": FunctionFragment; - "__OPPEndpointManaged_init(address)": FunctionFragment; - "authority()": FunctionFragment; - "commit(bytes)": FunctionFragment; - "deposit(uint8,bytes,uint64,uint256)": FunctionFragment; - "depositNonNative(uint64,uint64,uint64,uint8,bytes,uint256)": FunctionFragment; - "depositedByCode(address,uint64)": FunctionFragment; - "getSummaryAttestations()": FunctionFragment; - "initialize(address)": FunctionFragment; - "isConsumingScheduledOp()": FunctionFragment; - "liqToken()": FunctionFragment; - "liqTokenCode()": FunctionFragment; - "nativeTokenCode()": FunctionFragment; - "operators(address)": FunctionFragment; - "oppAddress()": FunctionFragment; - "oppInboundAddress()": FunctionFragment; - "outpostChainCode()": FunctionFragment; - "outpostId()": FunctionFragment; - "proxiableUUID()": FunctionFragment; - "reserveManagerAddress()": FunctionFragment; - "setAuthority(address)": FunctionFragment; - "setLiqToken(address)": FunctionFragment; - "setLiqTokenCode(uint64)": FunctionFragment; - "setNativeTokenCode(uint64)": FunctionFragment; - "setOPPAddresses(address,address)": FunctionFragment; - "setOutpostChainCode(uint64)": FunctionFragment; - "setOutpostId(uint64)": FunctionFragment; - "setReserveManagerAddress(address)": FunctionFragment; - "slash(address,uint64,uint64,string)": FunctionFragment; - "upgradeToAndCall(address,bytes)": FunctionFragment; - "withdraw(bytes,uint64,uint256)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "DEPOSIT_REVERT_ATTESTATION" - | "DEPOSIT_REVERT_GAS_MULTIPLIER" - | "OPERATOR_ACTION_ATTESTATION" - | "OPPAttestationIn" - | "UNDERWRITE_INTENT_COMMIT_ATTESTATION" - | "UPGRADE_INTERFACE_VERSION" - | "__OPPEndpointManaged_init" - | "authority" - | "commit" - | "deposit" - | "depositNonNative" - | "depositedByCode" - | "getSummaryAttestations" - | "initialize" - | "isConsumingScheduledOp" - | "liqToken" - | "liqTokenCode" - | "nativeTokenCode" - | "operators" - | "oppAddress" - | "oppInboundAddress" - | "outpostChainCode" - | "outpostId" - | "proxiableUUID" - | "reserveManagerAddress" - | "setAuthority" - | "setLiqToken" - | "setLiqTokenCode" - | "setNativeTokenCode" - | "setOPPAddresses" - | "setOutpostChainCode" - | "setOutpostId" - | "setReserveManagerAddress" - | "slash" - | "upgradeToAndCall" - | "withdraw" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "DEPOSIT_REVERT_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "DEPOSIT_REVERT_GAS_MULTIPLIER", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "OPERATOR_ACTION_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "OPPAttestationIn", - values: [BigNumberish, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "UNDERWRITE_INTENT_COMMIT_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "UPGRADE_INTERFACE_VERSION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "__OPPEndpointManaged_init", - values: [string] - ): string; - encodeFunctionData(functionFragment: "authority", values?: undefined): string; - encodeFunctionData(functionFragment: "commit", values: [BytesLike]): string; - encodeFunctionData( - functionFragment: "deposit", - values: [BigNumberish, BytesLike, BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "depositNonNative", - values: [ - BigNumberish, - BigNumberish, - BigNumberish, - BigNumberish, - BytesLike, - BigNumberish - ] - ): string; - encodeFunctionData( - functionFragment: "depositedByCode", - values: [string, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "getSummaryAttestations", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "initialize", values: [string]): string; - encodeFunctionData( - functionFragment: "isConsumingScheduledOp", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "liqToken", values?: undefined): string; - encodeFunctionData( - functionFragment: "liqTokenCode", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "nativeTokenCode", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "operators", values: [string]): string; - encodeFunctionData( - functionFragment: "oppAddress", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "oppInboundAddress", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "outpostChainCode", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "outpostId", values?: undefined): string; - encodeFunctionData( - functionFragment: "proxiableUUID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "reserveManagerAddress", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "setAuthority", - values: [string] - ): string; - encodeFunctionData(functionFragment: "setLiqToken", values: [string]): string; - encodeFunctionData( - functionFragment: "setLiqTokenCode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setNativeTokenCode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setOPPAddresses", - values: [string, string] - ): string; - encodeFunctionData( - functionFragment: "setOutpostChainCode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setOutpostId", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setReserveManagerAddress", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "slash", - values: [string, BigNumberish, BigNumberish, string] - ): string; - encodeFunctionData( - functionFragment: "upgradeToAndCall", - values: [string, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "withdraw", - values: [BytesLike, BigNumberish, BigNumberish] - ): string; - - decodeFunctionResult( - functionFragment: "DEPOSIT_REVERT_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "DEPOSIT_REVERT_GAS_MULTIPLIER", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "OPERATOR_ACTION_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "OPPAttestationIn", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "UNDERWRITE_INTENT_COMMIT_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "UPGRADE_INTERFACE_VERSION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "__OPPEndpointManaged_init", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "commit", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "depositNonNative", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "depositedByCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "getSummaryAttestations", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "isConsumingScheduledOp", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "liqToken", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "liqTokenCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nativeTokenCode", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "operators", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "oppAddress", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "oppInboundAddress", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "outpostChainCode", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "outpostId", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "proxiableUUID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "reserveManagerAddress", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setAuthority", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setLiqToken", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setLiqTokenCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setNativeTokenCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setOPPAddresses", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setOutpostChainCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setOutpostId", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setReserveManagerAddress", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "slash", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "upgradeToAndCall", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; - - events: { - "AuthorityUpdated(address)": EventFragment; - "DepositReverted(address,uint64,uint256,uint256,bytes,string)": EventFragment; - "Initialized(uint64)": EventFragment; - "LiqTokenCodeSet(uint64)": EventFragment; - "NativeTokenCodeSet(uint64)": EventFragment; - "OperatorDeposited(address,uint8,uint64,uint256)": EventFragment; - "OperatorSlashed(address,uint64,uint256,uint64,address,string)": EventFragment; - "OutpostChainCodeSet(uint64)": EventFragment; - "UnderwriteCommitRelayed(address,bytes)": EventFragment; - "Upgraded(address)": EventFragment; - "WithdrawRemitted(address,uint64,uint256,uint64)": EventFragment; - "WithdrawRequested(address,uint64,uint256,uint64)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "DepositReverted"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; - getEvent(nameOrSignatureOrTopic: "LiqTokenCodeSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "NativeTokenCodeSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OperatorDeposited"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OperatorSlashed"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OutpostChainCodeSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "UnderwriteCommitRelayed"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; - getEvent(nameOrSignatureOrTopic: "WithdrawRemitted"): EventFragment; - getEvent(nameOrSignatureOrTopic: "WithdrawRequested"): EventFragment; -} - -export interface AuthorityUpdatedEventObject { - authority: string; -} -export type AuthorityUpdatedEvent = TypedEvent< - [string], - AuthorityUpdatedEventObject ->; - -export type AuthorityUpdatedEventFilter = - TypedEventFilter; - -export interface DepositRevertedEventObject { - depositor: string; - tokenCode: BigNumber; - refundedToDepositor: BigNumber; - penaltyToReserve: BigNumber; - originalMessageId: string; - reason: string; -} -export type DepositRevertedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, string, string], - DepositRevertedEventObject ->; - -export type DepositRevertedEventFilter = TypedEventFilter; - -export interface InitializedEventObject { - version: BigNumber; -} -export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; - -export type InitializedEventFilter = TypedEventFilter; - -export interface LiqTokenCodeSetEventObject { - tokenCode: BigNumber; -} -export type LiqTokenCodeSetEvent = TypedEvent< - [BigNumber], - LiqTokenCodeSetEventObject ->; - -export type LiqTokenCodeSetEventFilter = TypedEventFilter; - -export interface NativeTokenCodeSetEventObject { - tokenCode: BigNumber; -} -export type NativeTokenCodeSetEvent = TypedEvent< - [BigNumber], - NativeTokenCodeSetEventObject ->; - -export type NativeTokenCodeSetEventFilter = - TypedEventFilter; - -export interface OperatorDepositedEventObject { - operator: string; - operatorType: number; - tokenCode: BigNumber; - amount: BigNumber; -} -export type OperatorDepositedEvent = TypedEvent< - [string, number, BigNumber, BigNumber], - OperatorDepositedEventObject ->; - -export type OperatorDepositedEventFilter = - TypedEventFilter; - -export interface OperatorSlashedEventObject { - operator: string; - tokenCode: BigNumber; - amount: BigNumber; - reserveCode: BigNumber; - reserveTarget: string; - reason: string; -} -export type OperatorSlashedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, string, string], - OperatorSlashedEventObject ->; - -export type OperatorSlashedEventFilter = TypedEventFilter; - -export interface OutpostChainCodeSetEventObject { - chainCode: BigNumber; -} -export type OutpostChainCodeSetEvent = TypedEvent< - [BigNumber], - OutpostChainCodeSetEventObject ->; - -export type OutpostChainCodeSetEventFilter = - TypedEventFilter; - -export interface UnderwriteCommitRelayedEventObject { - underwriter: string; - uicBytes: string; -} -export type UnderwriteCommitRelayedEvent = TypedEvent< - [string, string], - UnderwriteCommitRelayedEventObject ->; - -export type UnderwriteCommitRelayedEventFilter = - TypedEventFilter; - -export interface UpgradedEventObject { - implementation: string; -} -export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; - -export type UpgradedEventFilter = TypedEventFilter; - -export interface WithdrawRemittedEventObject { - operator: string; - tokenCode: BigNumber; - amount: BigNumber; - requestId: BigNumber; -} -export type WithdrawRemittedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber], - WithdrawRemittedEventObject ->; - -export type WithdrawRemittedEventFilter = - TypedEventFilter; - -export interface WithdrawRequestedEventObject { - operator: string; - tokenCode: BigNumber; - amount: BigNumber; - requestId: BigNumber; -} -export type WithdrawRequestedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber], - WithdrawRequestedEventObject ->; - -export type WithdrawRequestedEventFilter = - TypedEventFilter; - -export interface OperatorRegistry extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: OperatorRegistryInterface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>; - - listeners( - eventFilter?: TypedEventFilter - ): Array>; - listeners(eventName?: string): Array; - removeAllListeners( - eventFilter: TypedEventFilter - ): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; - - DEPOSIT_REVERT_GAS_MULTIPLIER( - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - UNDERWRITE_INTENT_COMMIT_ATTESTATION( - overrides?: CallOverrides - ): Promise<[number]>; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise<[string]>; - - commit( - uicBytes: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - deposit( - operatorType: BigNumberish, - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - depositNonNative( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - operatorType: BigNumberish, - compressedPubkey: BytesLike, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - depositedByCode( - arg0: string, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; - - liqToken(overrides?: CallOverrides): Promise<[string]>; - - liqTokenCode(overrides?: CallOverrides): Promise<[BigNumber]>; - - nativeTokenCode(overrides?: CallOverrides): Promise<[BigNumber]>; - - operators( - arg0: string, - overrides?: CallOverrides - ): Promise<[number, number] & { operatorType: number; status: number }>; - - oppAddress(overrides?: CallOverrides): Promise<[string]>; - - oppInboundAddress(overrides?: CallOverrides): Promise<[string]>; - - outpostChainCode(overrides?: CallOverrides): Promise<[BigNumber]>; - - outpostId(overrides?: CallOverrides): Promise<[BigNumber]>; - - proxiableUUID(overrides?: CallOverrides): Promise<[string]>; - - reserveManagerAddress(overrides?: CallOverrides): Promise<[string]>; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqToken( - _liqToken: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setNativeTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostId( - _outpostId: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - _reserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - slash( - operator: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - }; - - DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise; - - DEPOSIT_REVERT_GAS_MULTIPLIER(overrides?: CallOverrides): Promise; - - OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - UNDERWRITE_INTENT_COMMIT_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - commit( - uicBytes: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - deposit( - operatorType: BigNumberish, - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - depositNonNative( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - operatorType: BigNumberish, - compressedPubkey: BytesLike, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - depositedByCode( - arg0: string, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - liqToken(overrides?: CallOverrides): Promise; - - liqTokenCode(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - operators( - arg0: string, - overrides?: CallOverrides - ): Promise<[number, number] & { operatorType: number; status: number }>; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - outpostId(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - reserveManagerAddress(overrides?: CallOverrides): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqToken( - _liqToken: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setNativeTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostId( - _outpostId: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - _reserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - slash( - operator: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - callStatic: { - DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise; - - DEPOSIT_REVERT_GAS_MULTIPLIER( - overrides?: CallOverrides - ): Promise; - - OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - - UNDERWRITE_INTENT_COMMIT_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - commit(uicBytes: BytesLike, overrides?: CallOverrides): Promise; - - deposit( - operatorType: BigNumberish, - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - depositNonNative( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - operatorType: BigNumberish, - compressedPubkey: BytesLike, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - depositedByCode( - arg0: string, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: CallOverrides - ): Promise; - - initialize(_authority: string, overrides?: CallOverrides): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - liqToken(overrides?: CallOverrides): Promise; - - liqTokenCode(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - operators( - arg0: string, - overrides?: CallOverrides - ): Promise<[number, number] & { operatorType: number; status: number }>; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - outpostId(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - reserveManagerAddress(overrides?: CallOverrides): Promise; - - setAuthority( - newAuthority: string, - overrides?: CallOverrides - ): Promise; - - setLiqToken(_liqToken: string, overrides?: CallOverrides): Promise; - - setLiqTokenCode( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setNativeTokenCode( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: CallOverrides - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setOutpostId( - _outpostId: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setReserveManagerAddress( - _reserveManager: string, - overrides?: CallOverrides - ): Promise; - - slash( - operator: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - reason: string, - overrides?: CallOverrides - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - - withdraw( - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; - AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; - - "DepositReverted(address,uint64,uint256,uint256,bytes,string)"( - depositor?: string | null, - tokenCode?: null, - refundedToDepositor?: null, - penaltyToReserve?: null, - originalMessageId?: null, - reason?: null - ): DepositRevertedEventFilter; - DepositReverted( - depositor?: string | null, - tokenCode?: null, - refundedToDepositor?: null, - penaltyToReserve?: null, - originalMessageId?: null, - reason?: null - ): DepositRevertedEventFilter; - - "Initialized(uint64)"(version?: null): InitializedEventFilter; - Initialized(version?: null): InitializedEventFilter; - - "LiqTokenCodeSet(uint64)"(tokenCode?: null): LiqTokenCodeSetEventFilter; - LiqTokenCodeSet(tokenCode?: null): LiqTokenCodeSetEventFilter; - - "NativeTokenCodeSet(uint64)"( - tokenCode?: null - ): NativeTokenCodeSetEventFilter; - NativeTokenCodeSet(tokenCode?: null): NativeTokenCodeSetEventFilter; - - "OperatorDeposited(address,uint8,uint64,uint256)"( - operator?: string | null, - operatorType?: null, - tokenCode?: null, - amount?: null - ): OperatorDepositedEventFilter; - OperatorDeposited( - operator?: string | null, - operatorType?: null, - tokenCode?: null, - amount?: null - ): OperatorDepositedEventFilter; - - "OperatorSlashed(address,uint64,uint256,uint64,address,string)"( - operator?: string | null, - tokenCode?: null, - amount?: null, - reserveCode?: null, - reserveTarget?: null, - reason?: null - ): OperatorSlashedEventFilter; - OperatorSlashed( - operator?: string | null, - tokenCode?: null, - amount?: null, - reserveCode?: null, - reserveTarget?: null, - reason?: null - ): OperatorSlashedEventFilter; - - "OutpostChainCodeSet(uint64)"( - chainCode?: null - ): OutpostChainCodeSetEventFilter; - OutpostChainCodeSet(chainCode?: null): OutpostChainCodeSetEventFilter; - - "UnderwriteCommitRelayed(address,bytes)"( - underwriter?: string | null, - uicBytes?: null - ): UnderwriteCommitRelayedEventFilter; - UnderwriteCommitRelayed( - underwriter?: string | null, - uicBytes?: null - ): UnderwriteCommitRelayedEventFilter; - - "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; - Upgraded(implementation?: string | null): UpgradedEventFilter; - - "WithdrawRemitted(address,uint64,uint256,uint64)"( - operator?: string | null, - tokenCode?: null, - amount?: null, - requestId?: null - ): WithdrawRemittedEventFilter; - WithdrawRemitted( - operator?: string | null, - tokenCode?: null, - amount?: null, - requestId?: null - ): WithdrawRemittedEventFilter; - - "WithdrawRequested(address,uint64,uint256,uint64)"( - operator?: string | null, - tokenCode?: null, - amount?: null, - requestId?: null - ): WithdrawRequestedEventFilter; - WithdrawRequested( - operator?: string | null, - tokenCode?: null, - amount?: null, - requestId?: null - ): WithdrawRequestedEventFilter; - }; - - estimateGas: { - DEPOSIT_REVERT_ATTESTATION(overrides?: CallOverrides): Promise; - - DEPOSIT_REVERT_GAS_MULTIPLIER( - overrides?: CallOverrides - ): Promise; - - OPERATOR_ACTION_ATTESTATION(overrides?: CallOverrides): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - UNDERWRITE_INTENT_COMMIT_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - commit( - uicBytes: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - deposit( - operatorType: BigNumberish, - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - depositNonNative( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - operatorType: BigNumberish, - compressedPubkey: BytesLike, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - depositedByCode( - arg0: string, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - liqToken(overrides?: CallOverrides): Promise; - - liqTokenCode(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - operators(arg0: string, overrides?: CallOverrides): Promise; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - outpostId(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - reserveManagerAddress(overrides?: CallOverrides): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqToken( - _liqToken: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setNativeTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostId( - _outpostId: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - _reserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - slash( - operator: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - }; - - populateTransaction: { - DEPOSIT_REVERT_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - DEPOSIT_REVERT_GAS_MULTIPLIER( - overrides?: CallOverrides - ): Promise; - - OPERATOR_ACTION_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - UNDERWRITE_INTENT_COMMIT_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - UPGRADE_INTERFACE_VERSION( - overrides?: CallOverrides - ): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - commit( - uicBytes: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - deposit( - operatorType: BigNumberish, - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - depositNonNative( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - operatorType: BigNumberish, - compressedPubkey: BytesLike, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - depositedByCode( - arg0: string, - arg1: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp( - overrides?: CallOverrides - ): Promise; - - liqToken(overrides?: CallOverrides): Promise; - - liqTokenCode(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - operators( - arg0: string, - overrides?: CallOverrides - ): Promise; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - outpostId(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - reserveManagerAddress( - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqToken( - _liqToken: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setLiqTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setNativeTokenCode( - tokenCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostId( - _outpostId: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setReserveManagerAddress( - _reserveManager: string, - overrides?: Overrides & { from?: string } - ): Promise; - - slash( - operator: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - compressedPubkey: BytesLike, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - }; -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts deleted file mode 100644 index c8448d7..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/ReserveManager.ts +++ /dev/null @@ -1,2323 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumber, - BigNumberish, - BytesLike, - CallOverrides, - ContractTransaction, - Overrides, - PayableOverrides, - PopulatedTransaction, - Signer, - utils, -} from "ethers"; -import type { - FunctionFragment, - Result, - EventFragment, -} from "@ethersproject/abi"; -import type { Listener, Provider } from "@ethersproject/providers"; -import type { - TypedEventFilter, - TypedEvent, - TypedListener, - OnEvent, -} from "./common.js"; - -export type AttestationEntryStruct = { - type_: BigNumberish; - dataSize: BigNumberish; - data: BytesLike; -}; - -export type AttestationEntryStructOutput = [number, number, string] & { - type_: number; - dataSize: number; - data: string; -}; - -export declare namespace ReserveManager { - export type ReserveRecordStruct = { - tokenCode: BigNumberish; - reserveCode: BigNumberish; - externalTokenAmount: BigNumberish; - requestedWireAmount: BigNumberish; - connectorWeightBps: BigNumberish; - status: BigNumberish; - creator: string; - exists: boolean; - }; - - export type ReserveRecordStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - number, - number, - string, - boolean - ] & { - tokenCode: BigNumber; - reserveCode: BigNumber; - externalTokenAmount: BigNumber; - requestedWireAmount: BigNumber; - connectorWeightBps: number; - status: number; - creator: string; - exists: boolean; - }; - - export type TrackedCodeEntryStruct = { - tokenCode: BigNumberish; - reserveCode: BigNumberish; - tokenAddr: string; - precision: BigNumberish; - }; - - export type TrackedCodeEntryStructOutput = [ - BigNumber, - BigNumber, - string, - number - ] & { - tokenCode: BigNumber; - reserveCode: BigNumber; - tokenAddr: string; - precision: number; - }; -} - -export declare namespace ReserveManagerLib { - export type ReserveCreateArgsStruct = { - tokenCode: BigNumberish; - reserveCode: BigNumberish; - externalTokenAmount: BigNumberish; - requestedWireAmount: BigNumberish; - connectorWeightBps: BigNumberish; - name: string; - description: string; - isPrivate: boolean; - creatorPubKey: BytesLike; - }; - - export type ReserveCreateArgsStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - number, - string, - string, - boolean, - string - ] & { - tokenCode: BigNumber; - reserveCode: BigNumber; - externalTokenAmount: BigNumber; - requestedWireAmount: BigNumber; - connectorWeightBps: number; - name: string; - description: string; - isPrivate: boolean; - creatorPubKey: string; - }; - - export type PermitSigStruct = { - deadline: BigNumberish; - v: BigNumberish; - r: BytesLike; - s: BytesLike; - }; - - export type PermitSigStructOutput = [BigNumber, number, string, string] & { - deadline: BigNumber; - v: number; - r: string; - s: string; - }; - - export type SwapArgsStruct = { - sourceTokenCode: BigNumberish; - sourceReserveCode: BigNumberish; - sourceAmount: BigNumberish; - targetChainCode: BigNumberish; - targetTokenCode: BigNumberish; - targetReserveCode: BigNumberish; - targetRecipient: BytesLike; - targetAmount: BigNumberish; - targetToleranceBps: BigNumberish; - }; - - export type SwapArgsStructOutput = [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string, - BigNumber, - number - ] & { - sourceTokenCode: BigNumber; - sourceReserveCode: BigNumber; - sourceAmount: BigNumber; - targetChainCode: BigNumber; - targetTokenCode: BigNumber; - targetReserveCode: BigNumber; - targetRecipient: string; - targetAmount: BigNumber; - targetToleranceBps: number; - }; -} - -export interface ReserveManagerInterface extends utils.Interface { - functions: { - "BALANCE_SHEET_ATTESTATION()": FunctionFragment; - "OPPAttestationIn(uint16,bytes)": FunctionFragment; - "RESERVE_CREATE_ATTESTATION()": FunctionFragment; - "RESERVE_CREATE_CANCEL_ATTESTATION()": FunctionFragment; - "SWAP_REQUEST_ATTESTATION()": FunctionFragment; - "UPGRADE_INTERFACE_VERSION()": FunctionFragment; - "__OPPEndpointManaged_init(address)": FunctionFragment; - "_payRemit(address,uint64,uint256)": FunctionFragment; - "authority()": FunctionFragment; - "balanceOf(uint64)": FunctionFragment; - "cancel_create_reserve(uint64,uint64)": FunctionFragment; - "create_reserve(uint64,uint64,uint256,uint64,uint32,string,string,bool,bytes)": FunctionFragment; - "emitBalanceSheet()": FunctionFragment; - "getReserve(uint64,uint64)": FunctionFragment; - "getSummaryAttestations()": FunctionFragment; - "initialize(address)": FunctionFragment; - "isConsumingScheduledOp()": FunctionFragment; - "nativeTokenCode()": FunctionFragment; - "onReserveCreateCancelled(uint64,uint64,uint64)": FunctionFragment; - "onReserveReady(uint64,uint64,uint64)": FunctionFragment; - "onSwapRevert(address,uint64,uint64,uint64,bytes32,string)": FunctionFragment; - "oppAddress()": FunctionFragment; - "oppInboundAddress()": FunctionFragment; - "outpostChainCode()": FunctionFragment; - "pause()": FunctionFragment; - "paused()": FunctionFragment; - "proxiableUUID()": FunctionFragment; - "requestReserveCreateErc20WithApproval((uint64,uint64,uint256,uint64,uint32,string,string,bool,bytes))": FunctionFragment; - "requestReserveCreateErc20WithPermit((uint64,uint64,uint256,uint64,uint32,string,string,bool,bytes),(uint256,uint8,bytes32,bytes32))": FunctionFragment; - "requestSwap(uint64,uint64,uint64,uint64,uint64,bytes,uint64,uint32)": FunctionFragment; - "requestSwapErc20WithApproval((uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32))": FunctionFragment; - "requestSwapErc20WithPermit((uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32),(uint256,uint8,bytes32,bytes32))": FunctionFragment; - "reserves(bytes32)": FunctionFragment; - "setAuthority(address)": FunctionFragment; - "setOPPAddresses(address,address)": FunctionFragment; - "setOutpostChainCode(uint64)": FunctionFragment; - "setTrackedCodes((uint64,uint64,address,uint8)[])": FunctionFragment; - "swapDepositCounter()": FunctionFragment; - "tokenAddressesByCode(uint64)": FunctionFragment; - "tokenPrecisionByCode(uint64)": FunctionFragment; - "trackedCodesCount()": FunctionFragment; - "trackedReserveCodes(uint256)": FunctionFragment; - "trackedTokenCodes(uint256)": FunctionFragment; - "unpause()": FunctionFragment; - "upgradeToAndCall(address,bytes)": FunctionFragment; - "withdraw(uint64,uint64,uint256,address)": FunctionFragment; - }; - - getFunction( - nameOrSignatureOrTopic: - | "BALANCE_SHEET_ATTESTATION" - | "OPPAttestationIn" - | "RESERVE_CREATE_ATTESTATION" - | "RESERVE_CREATE_CANCEL_ATTESTATION" - | "SWAP_REQUEST_ATTESTATION" - | "UPGRADE_INTERFACE_VERSION" - | "__OPPEndpointManaged_init" - | "_payRemit" - | "authority" - | "balanceOf" - | "cancel_create_reserve" - | "create_reserve" - | "emitBalanceSheet" - | "getReserve" - | "getSummaryAttestations" - | "initialize" - | "isConsumingScheduledOp" - | "nativeTokenCode" - | "onReserveCreateCancelled" - | "onReserveReady" - | "onSwapRevert" - | "oppAddress" - | "oppInboundAddress" - | "outpostChainCode" - | "pause" - | "paused" - | "proxiableUUID" - | "requestReserveCreateErc20WithApproval" - | "requestReserveCreateErc20WithPermit" - | "requestSwap" - | "requestSwapErc20WithApproval" - | "requestSwapErc20WithPermit" - | "reserves" - | "setAuthority" - | "setOPPAddresses" - | "setOutpostChainCode" - | "setTrackedCodes" - | "swapDepositCounter" - | "tokenAddressesByCode" - | "tokenPrecisionByCode" - | "trackedCodesCount" - | "trackedReserveCodes" - | "trackedTokenCodes" - | "unpause" - | "upgradeToAndCall" - | "withdraw" - ): FunctionFragment; - - encodeFunctionData( - functionFragment: "BALANCE_SHEET_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "OPPAttestationIn", - values: [BigNumberish, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "RESERVE_CREATE_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "RESERVE_CREATE_CANCEL_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "SWAP_REQUEST_ATTESTATION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "UPGRADE_INTERFACE_VERSION", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "__OPPEndpointManaged_init", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "_payRemit", - values: [string, BigNumberish, BigNumberish] - ): string; - encodeFunctionData(functionFragment: "authority", values?: undefined): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "cancel_create_reserve", - values: [BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "create_reserve", - values: [ - BigNumberish, - BigNumberish, - BigNumberish, - BigNumberish, - BigNumberish, - string, - string, - boolean, - BytesLike - ] - ): string; - encodeFunctionData( - functionFragment: "emitBalanceSheet", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "getReserve", - values: [BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "getSummaryAttestations", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "initialize", values: [string]): string; - encodeFunctionData( - functionFragment: "isConsumingScheduledOp", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "nativeTokenCode", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "onReserveCreateCancelled", - values: [BigNumberish, BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "onReserveReady", - values: [BigNumberish, BigNumberish, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "onSwapRevert", - values: [ - string, - BigNumberish, - BigNumberish, - BigNumberish, - BytesLike, - string - ] - ): string; - encodeFunctionData( - functionFragment: "oppAddress", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "oppInboundAddress", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "outpostChainCode", - values?: undefined - ): string; - encodeFunctionData(functionFragment: "pause", values?: undefined): string; - encodeFunctionData(functionFragment: "paused", values?: undefined): string; - encodeFunctionData( - functionFragment: "proxiableUUID", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "requestReserveCreateErc20WithApproval", - values: [ReserveManagerLib.ReserveCreateArgsStruct] - ): string; - encodeFunctionData( - functionFragment: "requestReserveCreateErc20WithPermit", - values: [ - ReserveManagerLib.ReserveCreateArgsStruct, - ReserveManagerLib.PermitSigStruct - ] - ): string; - encodeFunctionData( - functionFragment: "requestSwap", - values: [ - BigNumberish, - BigNumberish, - BigNumberish, - BigNumberish, - BigNumberish, - BytesLike, - BigNumberish, - BigNumberish - ] - ): string; - encodeFunctionData( - functionFragment: "requestSwapErc20WithApproval", - values: [ReserveManagerLib.SwapArgsStruct] - ): string; - encodeFunctionData( - functionFragment: "requestSwapErc20WithPermit", - values: [ - ReserveManagerLib.SwapArgsStruct, - ReserveManagerLib.PermitSigStruct - ] - ): string; - encodeFunctionData(functionFragment: "reserves", values: [BytesLike]): string; - encodeFunctionData( - functionFragment: "setAuthority", - values: [string] - ): string; - encodeFunctionData( - functionFragment: "setOPPAddresses", - values: [string, string] - ): string; - encodeFunctionData( - functionFragment: "setOutpostChainCode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "setTrackedCodes", - values: [ReserveManager.TrackedCodeEntryStruct[]] - ): string; - encodeFunctionData( - functionFragment: "swapDepositCounter", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "tokenAddressesByCode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "tokenPrecisionByCode", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "trackedCodesCount", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "trackedReserveCodes", - values: [BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "trackedTokenCodes", - values: [BigNumberish] - ): string; - encodeFunctionData(functionFragment: "unpause", values?: undefined): string; - encodeFunctionData( - functionFragment: "upgradeToAndCall", - values: [string, BytesLike] - ): string; - encodeFunctionData( - functionFragment: "withdraw", - values: [BigNumberish, BigNumberish, BigNumberish, string] - ): string; - - decodeFunctionResult( - functionFragment: "BALANCE_SHEET_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "OPPAttestationIn", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "RESERVE_CREATE_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "RESERVE_CREATE_CANCEL_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "SWAP_REQUEST_ATTESTATION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "UPGRADE_INTERFACE_VERSION", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "__OPPEndpointManaged_init", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "_payRemit", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "authority", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "cancel_create_reserve", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "create_reserve", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "emitBalanceSheet", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "getReserve", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "getSummaryAttestations", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "isConsumingScheduledOp", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "nativeTokenCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "onReserveCreateCancelled", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "onReserveReady", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "onSwapRevert", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "oppAddress", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "oppInboundAddress", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "outpostChainCode", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "pause", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "proxiableUUID", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "requestReserveCreateErc20WithApproval", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "requestReserveCreateErc20WithPermit", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "requestSwap", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "requestSwapErc20WithApproval", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "requestSwapErc20WithPermit", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "reserves", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "setAuthority", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setOPPAddresses", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setOutpostChainCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setTrackedCodes", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "swapDepositCounter", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "tokenAddressesByCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "tokenPrecisionByCode", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "trackedCodesCount", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "trackedReserveCodes", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "trackedTokenCodes", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "unpause", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "upgradeToAndCall", - data: BytesLike - ): Result; - decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result; - - events: { - "AuthorityUpdated(address)": EventFragment; - "BalanceSheetEmitted()": EventFragment; - "Deposited(uint64,uint64,address,uint256)": EventFragment; - "Initialized(uint64)": EventFragment; - "OutpostChainCodeSet(uint64)": EventFragment; - "Paused(address)": EventFragment; - "ReserveActivated(uint64,uint64)": EventFragment; - "ReserveCancelRequested(uint64,uint64,address)": EventFragment; - "ReserveCancelled(uint64,uint64,address,uint256)": EventFragment; - "ReserveCreateRequested(uint64,uint64,address,uint256,uint64,uint32)": EventFragment; - "SwapDeposit(uint64,bytes32)": EventFragment; - "SwapRemitPaid(address,uint64,uint64,uint256,bytes32)": EventFragment; - "SwapRemitUnpayable(uint64,uint64,uint64,bytes32,string)": EventFragment; - "SwapRequested(address,uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32)": EventFragment; - "SwapRevertError(address,uint64,uint64,uint256,bytes32,bytes)": EventFragment; - "SwapReverted(address,uint64,uint64,uint256,bytes32,string)": EventFragment; - "TokenAddressSet(uint64,address)": EventFragment; - "TrackedCodesUpdated()": EventFragment; - "Unpaused(address)": EventFragment; - "Upgraded(address)": EventFragment; - "Withdrawn(uint64,uint64,address,uint256)": EventFragment; - }; - - getEvent(nameOrSignatureOrTopic: "AuthorityUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "BalanceSheetEmitted"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Deposited"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OutpostChainCodeSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ReserveActivated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ReserveCancelRequested"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ReserveCancelled"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ReserveCreateRequested"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SwapDeposit"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SwapRemitPaid"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SwapRemitUnpayable"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SwapRequested"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SwapRevertError"): EventFragment; - getEvent(nameOrSignatureOrTopic: "SwapReverted"): EventFragment; - getEvent(nameOrSignatureOrTopic: "TokenAddressSet"): EventFragment; - getEvent(nameOrSignatureOrTopic: "TrackedCodesUpdated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; - getEvent(nameOrSignatureOrTopic: "Withdrawn"): EventFragment; -} - -export interface AuthorityUpdatedEventObject { - authority: string; -} -export type AuthorityUpdatedEvent = TypedEvent< - [string], - AuthorityUpdatedEventObject ->; - -export type AuthorityUpdatedEventFilter = - TypedEventFilter; - -export interface BalanceSheetEmittedEventObject {} -export type BalanceSheetEmittedEvent = TypedEvent< - [], - BalanceSheetEmittedEventObject ->; - -export type BalanceSheetEmittedEventFilter = - TypedEventFilter; - -export interface DepositedEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; - from: string; - amount: BigNumber; -} -export type DepositedEvent = TypedEvent< - [BigNumber, BigNumber, string, BigNumber], - DepositedEventObject ->; - -export type DepositedEventFilter = TypedEventFilter; - -export interface InitializedEventObject { - version: BigNumber; -} -export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; - -export type InitializedEventFilter = TypedEventFilter; - -export interface OutpostChainCodeSetEventObject { - chainCode: BigNumber; -} -export type OutpostChainCodeSetEvent = TypedEvent< - [BigNumber], - OutpostChainCodeSetEventObject ->; - -export type OutpostChainCodeSetEventFilter = - TypedEventFilter; - -export interface PausedEventObject { - account: string; -} -export type PausedEvent = TypedEvent<[string], PausedEventObject>; - -export type PausedEventFilter = TypedEventFilter; - -export interface ReserveActivatedEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; -} -export type ReserveActivatedEvent = TypedEvent< - [BigNumber, BigNumber], - ReserveActivatedEventObject ->; - -export type ReserveActivatedEventFilter = - TypedEventFilter; - -export interface ReserveCancelRequestedEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; - creator: string; -} -export type ReserveCancelRequestedEvent = TypedEvent< - [BigNumber, BigNumber, string], - ReserveCancelRequestedEventObject ->; - -export type ReserveCancelRequestedEventFilter = - TypedEventFilter; - -export interface ReserveCancelledEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; - creator: string; - refundedAmount: BigNumber; -} -export type ReserveCancelledEvent = TypedEvent< - [BigNumber, BigNumber, string, BigNumber], - ReserveCancelledEventObject ->; - -export type ReserveCancelledEventFilter = - TypedEventFilter; - -export interface ReserveCreateRequestedEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; - creator: string; - externalTokenAmount: BigNumber; - requestedWireAmount: BigNumber; - connectorWeightBps: number; -} -export type ReserveCreateRequestedEvent = TypedEvent< - [BigNumber, BigNumber, string, BigNumber, BigNumber, number], - ReserveCreateRequestedEventObject ->; - -export type ReserveCreateRequestedEventFilter = - TypedEventFilter; - -export interface SwapDepositEventObject { - id: BigNumber; - hash: string; -} -export type SwapDepositEvent = TypedEvent< - [BigNumber, string], - SwapDepositEventObject ->; - -export type SwapDepositEventFilter = TypedEventFilter; - -export interface SwapRemitPaidEventObject { - recipient: string; - tokenCode: BigNumber; - reserveCode: BigNumber; - amount: BigNumber; - originalMessageId: string; -} -export type SwapRemitPaidEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, string], - SwapRemitPaidEventObject ->; - -export type SwapRemitPaidEventFilter = TypedEventFilter; - -export interface SwapRemitUnpayableEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; - depotAmount: BigNumber; - originalId: string; - reason: string; -} -export type SwapRemitUnpayableEvent = TypedEvent< - [BigNumber, BigNumber, BigNumber, string, string], - SwapRemitUnpayableEventObject ->; - -export type SwapRemitUnpayableEventFilter = - TypedEventFilter; - -export interface SwapRequestedEventObject { - user: string; - sourceTokenCode: BigNumber; - sourceReserveCode: BigNumber; - sourceAmount: BigNumber; - targetChainCode: BigNumber; - targetTokenCode: BigNumber; - targetReserveCode: BigNumber; - targetRecipient: string; - targetAmount: BigNumber; - targetToleranceBps: number; -} -export type SwapRequestedEvent = TypedEvent< - [ - string, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - BigNumber, - string, - BigNumber, - number - ], - SwapRequestedEventObject ->; - -export type SwapRequestedEventFilter = TypedEventFilter; - -export interface SwapRevertErrorEventObject { - depositor: string; - tokenCode: BigNumber; - reserveCode: BigNumber; - amount: BigNumber; - originalSwapMessageId: string; - errData: string; -} -export type SwapRevertErrorEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, string, string], - SwapRevertErrorEventObject ->; - -export type SwapRevertErrorEventFilter = TypedEventFilter; - -export interface SwapRevertedEventObject { - depositor: string; - tokenCode: BigNumber; - reserveCode: BigNumber; - amount: BigNumber; - originalSwapMessageId: string; - reason: string; -} -export type SwapRevertedEvent = TypedEvent< - [string, BigNumber, BigNumber, BigNumber, string, string], - SwapRevertedEventObject ->; - -export type SwapRevertedEventFilter = TypedEventFilter; - -export interface TokenAddressSetEventObject { - tokenCode: BigNumber; - addr: string; -} -export type TokenAddressSetEvent = TypedEvent< - [BigNumber, string], - TokenAddressSetEventObject ->; - -export type TokenAddressSetEventFilter = TypedEventFilter; - -export interface TrackedCodesUpdatedEventObject {} -export type TrackedCodesUpdatedEvent = TypedEvent< - [], - TrackedCodesUpdatedEventObject ->; - -export type TrackedCodesUpdatedEventFilter = - TypedEventFilter; - -export interface UnpausedEventObject { - account: string; -} -export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject>; - -export type UnpausedEventFilter = TypedEventFilter; - -export interface UpgradedEventObject { - implementation: string; -} -export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; - -export type UpgradedEventFilter = TypedEventFilter; - -export interface WithdrawnEventObject { - tokenCode: BigNumber; - reserveCode: BigNumber; - to: string; - amount: BigNumber; -} -export type WithdrawnEvent = TypedEvent< - [BigNumber, BigNumber, string, BigNumber], - WithdrawnEventObject ->; - -export type WithdrawnEventFilter = TypedEventFilter; - -export interface ReserveManager extends BaseContract { - connect(signerOrProvider: Signer | Provider | string): this; - attach(addressOrName: string): this; - deployed(): Promise; - - interface: ReserveManagerInterface; - - queryFilter( - event: TypedEventFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>; - - listeners( - eventFilter?: TypedEventFilter - ): Array>; - listeners(eventName?: string): Array; - removeAllListeners( - eventFilter: TypedEventFilter - ): this; - removeAllListeners(eventName?: string): this; - off: OnEvent; - on: OnEvent; - once: OnEvent; - removeListener: OnEvent; - - functions: { - BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; - - RESERVE_CREATE_CANCEL_ATTESTATION( - overrides?: CallOverrides - ): Promise<[number]>; - - SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise<[number]>; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - _payRemit( - to: string, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise<[string]>; - - balanceOf( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - cancel_create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - externalTokenAmount: BigNumberish, - requestedWireAmount: BigNumberish, - connectorWeightBps: BigNumberish, - name: string, - description: string, - isPrivate: boolean, - creatorPubKey: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - emitBalanceSheet( - overrides?: Overrides & { from?: string } - ): Promise; - - getReserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise<[ReserveManager.ReserveRecordStructOutput]>; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise<[string]>; - - nativeTokenCode(overrides?: CallOverrides): Promise<[BigNumber]>; - - onReserveCreateCancelled( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onReserveReady( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onSwapRevert( - depositor: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - depotAmount: BigNumberish, - originalSwapMessageId: BytesLike, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - oppAddress(overrides?: CallOverrides): Promise<[string]>; - - oppInboundAddress(overrides?: CallOverrides): Promise<[string]>; - - outpostChainCode(overrides?: CallOverrides): Promise<[BigNumber]>; - - pause( - overrides?: Overrides & { from?: string } - ): Promise; - - paused(overrides?: CallOverrides): Promise<[boolean]>; - - proxiableUUID(overrides?: CallOverrides): Promise<[string]>; - - requestReserveCreateErc20WithApproval( - args: ReserveManagerLib.ReserveCreateArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestReserveCreateErc20WithPermit( - args: ReserveManagerLib.ReserveCreateArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwap( - sourceTokenCode: BigNumberish, - sourceReserveCode: BigNumberish, - targetChainCode: BigNumberish, - targetTokenCode: BigNumberish, - targetReserveCode: BigNumberish, - targetRecipient: BytesLike, - targetAmount: BigNumberish, - targetToleranceBps: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - requestSwapErc20WithApproval( - args: ReserveManagerLib.SwapArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwapErc20WithPermit( - args: ReserveManagerLib.SwapArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - reserves( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise< - [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - number, - number, - string, - boolean - ] & { - tokenCode: BigNumber; - reserveCode: BigNumber; - externalTokenAmount: BigNumber; - requestedWireAmount: BigNumber; - connectorWeightBps: number; - status: number; - creator: string; - exists: boolean; - } - >; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setTrackedCodes( - entries: ReserveManager.TrackedCodeEntryStruct[], - overrides?: Overrides & { from?: string } - ): Promise; - - swapDepositCounter(overrides?: CallOverrides): Promise<[BigNumber]>; - - tokenAddressesByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[string]>; - - tokenPrecisionByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[number]>; - - trackedCodesCount(overrides?: CallOverrides): Promise<[BigNumber]>; - - trackedReserveCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - trackedTokenCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - - unpause( - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - amount: BigNumberish, - to: string, - overrides?: Overrides & { from?: string } - ): Promise; - }; - - BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise; - - RESERVE_CREATE_CANCEL_ATTESTATION(overrides?: CallOverrides): Promise; - - SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - _payRemit( - to: string, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - balanceOf( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - cancel_create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - externalTokenAmount: BigNumberish, - requestedWireAmount: BigNumberish, - connectorWeightBps: BigNumberish, - name: string, - description: string, - isPrivate: boolean, - creatorPubKey: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - emitBalanceSheet( - overrides?: Overrides & { from?: string } - ): Promise; - - getReserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - onReserveCreateCancelled( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onReserveReady( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onSwapRevert( - depositor: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - depotAmount: BigNumberish, - originalSwapMessageId: BytesLike, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - pause( - overrides?: Overrides & { from?: string } - ): Promise; - - paused(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - requestReserveCreateErc20WithApproval( - args: ReserveManagerLib.ReserveCreateArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestReserveCreateErc20WithPermit( - args: ReserveManagerLib.ReserveCreateArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwap( - sourceTokenCode: BigNumberish, - sourceReserveCode: BigNumberish, - targetChainCode: BigNumberish, - targetTokenCode: BigNumberish, - targetReserveCode: BigNumberish, - targetRecipient: BytesLike, - targetAmount: BigNumberish, - targetToleranceBps: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - requestSwapErc20WithApproval( - args: ReserveManagerLib.SwapArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwapErc20WithPermit( - args: ReserveManagerLib.SwapArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - reserves( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise< - [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - number, - number, - string, - boolean - ] & { - tokenCode: BigNumber; - reserveCode: BigNumber; - externalTokenAmount: BigNumber; - requestedWireAmount: BigNumber; - connectorWeightBps: number; - status: number; - creator: string; - exists: boolean; - } - >; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setTrackedCodes( - entries: ReserveManager.TrackedCodeEntryStruct[], - overrides?: Overrides & { from?: string } - ): Promise; - - swapDepositCounter(overrides?: CallOverrides): Promise; - - tokenAddressesByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - tokenPrecisionByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedCodesCount(overrides?: CallOverrides): Promise; - - trackedReserveCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedTokenCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - unpause( - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - amount: BigNumberish, - to: string, - overrides?: Overrides & { from?: string } - ): Promise; - - callStatic: { - BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - - RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise; - - RESERVE_CREATE_CANCEL_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: CallOverrides - ): Promise; - - _payRemit( - to: string, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: CallOverrides - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - balanceOf( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - cancel_create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - externalTokenAmount: BigNumberish, - requestedWireAmount: BigNumberish, - connectorWeightBps: BigNumberish, - name: string, - description: string, - isPrivate: boolean, - creatorPubKey: BytesLike, - overrides?: CallOverrides - ): Promise; - - emitBalanceSheet(overrides?: CallOverrides): Promise; - - getReserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: CallOverrides - ): Promise; - - initialize(_authority: string, overrides?: CallOverrides): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - onReserveCreateCancelled( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - onReserveReady( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - onSwapRevert( - depositor: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - depotAmount: BigNumberish, - originalSwapMessageId: BytesLike, - reason: string, - overrides?: CallOverrides - ): Promise; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - pause(overrides?: CallOverrides): Promise; - - paused(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - requestReserveCreateErc20WithApproval( - args: ReserveManagerLib.ReserveCreateArgsStruct, - overrides?: CallOverrides - ): Promise; - - requestReserveCreateErc20WithPermit( - args: ReserveManagerLib.ReserveCreateArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: CallOverrides - ): Promise; - - requestSwap( - sourceTokenCode: BigNumberish, - sourceReserveCode: BigNumberish, - targetChainCode: BigNumberish, - targetTokenCode: BigNumberish, - targetReserveCode: BigNumberish, - targetRecipient: BytesLike, - targetAmount: BigNumberish, - targetToleranceBps: BigNumberish, - overrides?: CallOverrides - ): Promise; - - requestSwapErc20WithApproval( - args: ReserveManagerLib.SwapArgsStruct, - overrides?: CallOverrides - ): Promise; - - requestSwapErc20WithPermit( - args: ReserveManagerLib.SwapArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: CallOverrides - ): Promise; - - reserves( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise< - [ - BigNumber, - BigNumber, - BigNumber, - BigNumber, - number, - number, - string, - boolean - ] & { - tokenCode: BigNumber; - reserveCode: BigNumber; - externalTokenAmount: BigNumber; - requestedWireAmount: BigNumber; - connectorWeightBps: number; - status: number; - creator: string; - exists: boolean; - } - >; - - setAuthority( - newAuthority: string, - overrides?: CallOverrides - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: CallOverrides - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - setTrackedCodes( - entries: ReserveManager.TrackedCodeEntryStruct[], - overrides?: CallOverrides - ): Promise; - - swapDepositCounter(overrides?: CallOverrides): Promise; - - tokenAddressesByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - tokenPrecisionByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedCodesCount(overrides?: CallOverrides): Promise; - - trackedReserveCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedTokenCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - unpause(overrides?: CallOverrides): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: CallOverrides - ): Promise; - - withdraw( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - amount: BigNumberish, - to: string, - overrides?: CallOverrides - ): Promise; - }; - - filters: { - "AuthorityUpdated(address)"(authority?: null): AuthorityUpdatedEventFilter; - AuthorityUpdated(authority?: null): AuthorityUpdatedEventFilter; - - "BalanceSheetEmitted()"(): BalanceSheetEmittedEventFilter; - BalanceSheetEmitted(): BalanceSheetEmittedEventFilter; - - "Deposited(uint64,uint64,address,uint256)"( - tokenCode?: null, - reserveCode?: null, - from?: string | null, - amount?: null - ): DepositedEventFilter; - Deposited( - tokenCode?: null, - reserveCode?: null, - from?: string | null, - amount?: null - ): DepositedEventFilter; - - "Initialized(uint64)"(version?: null): InitializedEventFilter; - Initialized(version?: null): InitializedEventFilter; - - "OutpostChainCodeSet(uint64)"( - chainCode?: null - ): OutpostChainCodeSetEventFilter; - OutpostChainCodeSet(chainCode?: null): OutpostChainCodeSetEventFilter; - - "Paused(address)"(account?: null): PausedEventFilter; - Paused(account?: null): PausedEventFilter; - - "ReserveActivated(uint64,uint64)"( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null - ): ReserveActivatedEventFilter; - ReserveActivated( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null - ): ReserveActivatedEventFilter; - - "ReserveCancelRequested(uint64,uint64,address)"( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null, - creator?: string | null - ): ReserveCancelRequestedEventFilter; - ReserveCancelRequested( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null, - creator?: string | null - ): ReserveCancelRequestedEventFilter; - - "ReserveCancelled(uint64,uint64,address,uint256)"( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null, - creator?: string | null, - refundedAmount?: null - ): ReserveCancelledEventFilter; - ReserveCancelled( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null, - creator?: string | null, - refundedAmount?: null - ): ReserveCancelledEventFilter; - - "ReserveCreateRequested(uint64,uint64,address,uint256,uint64,uint32)"( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null, - creator?: string | null, - externalTokenAmount?: null, - requestedWireAmount?: null, - connectorWeightBps?: null - ): ReserveCreateRequestedEventFilter; - ReserveCreateRequested( - tokenCode?: BigNumberish | null, - reserveCode?: BigNumberish | null, - creator?: string | null, - externalTokenAmount?: null, - requestedWireAmount?: null, - connectorWeightBps?: null - ): ReserveCreateRequestedEventFilter; - - "SwapDeposit(uint64,bytes32)"( - id?: BigNumberish | null, - hash?: null - ): SwapDepositEventFilter; - SwapDeposit(id?: BigNumberish | null, hash?: null): SwapDepositEventFilter; - - "SwapRemitPaid(address,uint64,uint64,uint256,bytes32)"( - recipient?: string | null, - tokenCode?: null, - reserveCode?: null, - amount?: null, - originalMessageId?: null - ): SwapRemitPaidEventFilter; - SwapRemitPaid( - recipient?: string | null, - tokenCode?: null, - reserveCode?: null, - amount?: null, - originalMessageId?: null - ): SwapRemitPaidEventFilter; - - "SwapRemitUnpayable(uint64,uint64,uint64,bytes32,string)"( - tokenCode?: null, - reserveCode?: null, - depotAmount?: null, - originalId?: null, - reason?: null - ): SwapRemitUnpayableEventFilter; - SwapRemitUnpayable( - tokenCode?: null, - reserveCode?: null, - depotAmount?: null, - originalId?: null, - reason?: null - ): SwapRemitUnpayableEventFilter; - - "SwapRequested(address,uint64,uint64,uint256,uint64,uint64,uint64,bytes,uint64,uint32)"( - user?: string | null, - sourceTokenCode?: null, - sourceReserveCode?: null, - sourceAmount?: null, - targetChainCode?: null, - targetTokenCode?: null, - targetReserveCode?: null, - targetRecipient?: null, - targetAmount?: null, - targetToleranceBps?: null - ): SwapRequestedEventFilter; - SwapRequested( - user?: string | null, - sourceTokenCode?: null, - sourceReserveCode?: null, - sourceAmount?: null, - targetChainCode?: null, - targetTokenCode?: null, - targetReserveCode?: null, - targetRecipient?: null, - targetAmount?: null, - targetToleranceBps?: null - ): SwapRequestedEventFilter; - - "SwapRevertError(address,uint64,uint64,uint256,bytes32,bytes)"( - depositor?: string | null, - tokenCode?: null, - reserveCode?: null, - amount?: null, - originalSwapMessageId?: null, - errData?: null - ): SwapRevertErrorEventFilter; - SwapRevertError( - depositor?: string | null, - tokenCode?: null, - reserveCode?: null, - amount?: null, - originalSwapMessageId?: null, - errData?: null - ): SwapRevertErrorEventFilter; - - "SwapReverted(address,uint64,uint64,uint256,bytes32,string)"( - depositor?: string | null, - tokenCode?: null, - reserveCode?: null, - amount?: null, - originalSwapMessageId?: null, - reason?: null - ): SwapRevertedEventFilter; - SwapReverted( - depositor?: string | null, - tokenCode?: null, - reserveCode?: null, - amount?: null, - originalSwapMessageId?: null, - reason?: null - ): SwapRevertedEventFilter; - - "TokenAddressSet(uint64,address)"( - tokenCode?: null, - addr?: null - ): TokenAddressSetEventFilter; - TokenAddressSet(tokenCode?: null, addr?: null): TokenAddressSetEventFilter; - - "TrackedCodesUpdated()"(): TrackedCodesUpdatedEventFilter; - TrackedCodesUpdated(): TrackedCodesUpdatedEventFilter; - - "Unpaused(address)"(account?: null): UnpausedEventFilter; - Unpaused(account?: null): UnpausedEventFilter; - - "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; - Upgraded(implementation?: string | null): UpgradedEventFilter; - - "Withdrawn(uint64,uint64,address,uint256)"( - tokenCode?: null, - reserveCode?: null, - to?: string | null, - amount?: null - ): WithdrawnEventFilter; - Withdrawn( - tokenCode?: null, - reserveCode?: null, - to?: string | null, - amount?: null - ): WithdrawnEventFilter; - }; - - estimateGas: { - BALANCE_SHEET_ATTESTATION(overrides?: CallOverrides): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - RESERVE_CREATE_ATTESTATION(overrides?: CallOverrides): Promise; - - RESERVE_CREATE_CANCEL_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - SWAP_REQUEST_ATTESTATION(overrides?: CallOverrides): Promise; - - UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - _payRemit( - to: string, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - balanceOf( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - cancel_create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - externalTokenAmount: BigNumberish, - requestedWireAmount: BigNumberish, - connectorWeightBps: BigNumberish, - name: string, - description: string, - isPrivate: boolean, - creatorPubKey: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - emitBalanceSheet( - overrides?: Overrides & { from?: string } - ): Promise; - - getReserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp(overrides?: CallOverrides): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - onReserveCreateCancelled( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onReserveReady( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onSwapRevert( - depositor: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - depotAmount: BigNumberish, - originalSwapMessageId: BytesLike, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - pause(overrides?: Overrides & { from?: string }): Promise; - - paused(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - requestReserveCreateErc20WithApproval( - args: ReserveManagerLib.ReserveCreateArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestReserveCreateErc20WithPermit( - args: ReserveManagerLib.ReserveCreateArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwap( - sourceTokenCode: BigNumberish, - sourceReserveCode: BigNumberish, - targetChainCode: BigNumberish, - targetTokenCode: BigNumberish, - targetReserveCode: BigNumberish, - targetRecipient: BytesLike, - targetAmount: BigNumberish, - targetToleranceBps: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - requestSwapErc20WithApproval( - args: ReserveManagerLib.SwapArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwapErc20WithPermit( - args: ReserveManagerLib.SwapArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - reserves(arg0: BytesLike, overrides?: CallOverrides): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setTrackedCodes( - entries: ReserveManager.TrackedCodeEntryStruct[], - overrides?: Overrides & { from?: string } - ): Promise; - - swapDepositCounter(overrides?: CallOverrides): Promise; - - tokenAddressesByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - tokenPrecisionByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedCodesCount(overrides?: CallOverrides): Promise; - - trackedReserveCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedTokenCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - unpause(overrides?: Overrides & { from?: string }): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - amount: BigNumberish, - to: string, - overrides?: Overrides & { from?: string } - ): Promise; - }; - - populateTransaction: { - BALANCE_SHEET_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - OPPAttestationIn( - attestationType: BigNumberish, - data: BytesLike, - overrides?: Overrides & { from?: string } - ): Promise; - - RESERVE_CREATE_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - RESERVE_CREATE_CANCEL_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - SWAP_REQUEST_ATTESTATION( - overrides?: CallOverrides - ): Promise; - - UPGRADE_INTERFACE_VERSION( - overrides?: CallOverrides - ): Promise; - - __OPPEndpointManaged_init( - owner: string, - overrides?: Overrides & { from?: string } - ): Promise; - - _payRemit( - to: string, - tokenCode: BigNumberish, - amount: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - authority(overrides?: CallOverrides): Promise; - - balanceOf( - tokenCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - cancel_create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - create_reserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - externalTokenAmount: BigNumberish, - requestedWireAmount: BigNumberish, - connectorWeightBps: BigNumberish, - name: string, - description: string, - isPrivate: boolean, - creatorPubKey: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - emitBalanceSheet( - overrides?: Overrides & { from?: string } - ): Promise; - - getReserve( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: CallOverrides - ): Promise; - - getSummaryAttestations( - overrides?: Overrides & { from?: string } - ): Promise; - - initialize( - _authority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - isConsumingScheduledOp( - overrides?: CallOverrides - ): Promise; - - nativeTokenCode(overrides?: CallOverrides): Promise; - - onReserveCreateCancelled( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onReserveReady( - chainCode: BigNumberish, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - onSwapRevert( - depositor: string, - tokenCode: BigNumberish, - reserveCode: BigNumberish, - depotAmount: BigNumberish, - originalSwapMessageId: BytesLike, - reason: string, - overrides?: Overrides & { from?: string } - ): Promise; - - oppAddress(overrides?: CallOverrides): Promise; - - oppInboundAddress(overrides?: CallOverrides): Promise; - - outpostChainCode(overrides?: CallOverrides): Promise; - - pause( - overrides?: Overrides & { from?: string } - ): Promise; - - paused(overrides?: CallOverrides): Promise; - - proxiableUUID(overrides?: CallOverrides): Promise; - - requestReserveCreateErc20WithApproval( - args: ReserveManagerLib.ReserveCreateArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestReserveCreateErc20WithPermit( - args: ReserveManagerLib.ReserveCreateArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwap( - sourceTokenCode: BigNumberish, - sourceReserveCode: BigNumberish, - targetChainCode: BigNumberish, - targetTokenCode: BigNumberish, - targetReserveCode: BigNumberish, - targetRecipient: BytesLike, - targetAmount: BigNumberish, - targetToleranceBps: BigNumberish, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - requestSwapErc20WithApproval( - args: ReserveManagerLib.SwapArgsStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - requestSwapErc20WithPermit( - args: ReserveManagerLib.SwapArgsStruct, - permitSig: ReserveManagerLib.PermitSigStruct, - overrides?: Overrides & { from?: string } - ): Promise; - - reserves( - arg0: BytesLike, - overrides?: CallOverrides - ): Promise; - - setAuthority( - newAuthority: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOPPAddresses( - _oppAddress: string, - _oppInboundAddress: string, - overrides?: Overrides & { from?: string } - ): Promise; - - setOutpostChainCode( - chainCode: BigNumberish, - overrides?: Overrides & { from?: string } - ): Promise; - - setTrackedCodes( - entries: ReserveManager.TrackedCodeEntryStruct[], - overrides?: Overrides & { from?: string } - ): Promise; - - swapDepositCounter( - overrides?: CallOverrides - ): Promise; - - tokenAddressesByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - tokenPrecisionByCode( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedCodesCount(overrides?: CallOverrides): Promise; - - trackedReserveCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - trackedTokenCodes( - arg0: BigNumberish, - overrides?: CallOverrides - ): Promise; - - unpause( - overrides?: Overrides & { from?: string } - ): Promise; - - upgradeToAndCall( - newImplementation: string, - data: BytesLike, - overrides?: PayableOverrides & { from?: string } - ): Promise; - - withdraw( - tokenCode: BigNumberish, - reserveCode: BigNumberish, - amount: BigNumberish, - to: string, - overrides?: Overrides & { from?: string } - ): Promise; - }; -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/common.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/common.ts deleted file mode 100644 index 2fc40c7..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/common.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { Listener } from "@ethersproject/providers"; -import type { Event, EventFilter } from "ethers"; - -export interface TypedEvent< - TArgsArray extends Array = any, - TArgsObject = any -> extends Event { - args: TArgsArray & TArgsObject; -} - -export interface TypedEventFilter<_TEvent extends TypedEvent> - extends EventFilter {} - -export interface TypedListener { - (...listenerArg: [...__TypechainArgsArray, TEvent]): void; -} - -type __TypechainArgsArray = T extends TypedEvent ? U : never; - -export interface OnEvent { - ( - eventFilter: TypedEventFilter, - listener: TypedListener - ): TRes; - (eventName: string, listener: Listener): TRes; -} - -export type MinEthersFactory = { - deploy(...a: ARGS[]): Promise; -}; - -export type GetContractTypeFromFactory = F extends MinEthersFactory< - infer C, - any -> - ? C - : never; - -export type GetARGsTypeFromFactory = F extends MinEthersFactory - ? Parameters - : never; diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts deleted file mode 100644 index 695cf95..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPPInbound__factory.ts +++ /dev/null @@ -1,1431 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { OPPInbound, OPPInboundInterface } from "../OPPInbound.js"; - -const _abi = [ - { - inputs: [ - { - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AccessManagedInvalidAuthority", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "uint32", - name: "delay", - type: "uint32", - }, - ], - name: "AccessManagedRequiredDelay", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "AccessManagedUnauthorized", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "target", - type: "address", - }, - ], - name: "AddressEmptyCode", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "ERC1967InvalidImplementation", - type: "error", - }, - { - inputs: [], - name: "ERC1967NonPayable", - type: "error", - }, - { - inputs: [], - name: "FailedCall", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "actualBytes", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxBytes", - type: "uint256", - }, - ], - name: "OPP_EnvelopeOverCap", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_EpochHashMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeRecordMissing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint32", - name: "evictBoundary", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeStillInRetention", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "required", - type: "uint256", - }, - { - internalType: "uint256", - name: "provided", - type: "uint256", - }, - ], - name: "OPP_InsufficientSignatureWeight", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "address", - name: "expected", - type: "address", - }, - ], - name: "OPP_InvalidOPPAddress", - type: "error", - }, - { - inputs: [], - name: "OPP_InvalidRetentionConfig", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "expected", - type: "bytes", - }, - { - internalType: "bytes", - name: "actual", - type: "bytes", - }, - ], - name: "OPP_MessageIDMismatch", - type: "error", - }, - { - inputs: [], - name: "OPP_NoAttestationsSent", - type: "error", - }, - { - inputs: [], - name: "OPP_NoPendingAttestations", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "previousEnvelopeHash", - type: "bytes", - }, - ], - name: "OPP_NonCanonicalPreviousEpochHash", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "expected", - type: "uint32", - }, - { - internalType: "uint32", - name: "actual", - type: "uint32", - }, - ], - name: "OPP_NonSequentialEpoch", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_NotActiveOperator", - type: "error", - }, - { - inputs: [], - name: "OPP_NotSending", - type: "error", - }, - { - inputs: [], - name: "OPP_OPPAddressNotSet", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_OperatorAlreadyDelivered", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_PayloadChecksumMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "stack", - type: "uint256", - }, - ], - name: "OPP_SendStackError", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnauthorizedAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnhandledAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "expectedChainId", - type: "uint256", - }, - { - internalType: "ChainKind", - name: "actualKind", - type: "uint8", - }, - { - internalType: "uint32", - name: "actualId", - type: "uint32", - }, - ], - name: "OPP_WrongDestinationChain", - type: "error", - }, - { - inputs: [], - name: "OPP_ZeroTag", - type: "error", - }, - { - inputs: [], - name: "UUPSUnauthorizedCallContext", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "slot", - type: "bytes32", - }, - ], - name: "UUPSUnsupportedProxiableUUID", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes", - name: "messageID", - type: "bytes", - }, - { - indexed: false, - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - indexed: false, - internalType: "uint64", - name: "sequenceNumber", - type: "uint64", - }, - ], - name: "AttestationBlackholed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "handler", - type: "address", - }, - { - indexed: false, - internalType: "bytes", - name: "messageID", - type: "bytes", - }, - { - indexed: false, - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - indexed: false, - internalType: "uint64", - name: "sequenceNumber", - type: "uint64", - }, - ], - name: "AttestationDelivered", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - indexed: false, - internalType: "address", - name: "handler", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "oldHandler", - type: "address", - }, - ], - name: "AttestationHandlerSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AuthorityUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "EnvelopeRetentionCatchUpPruned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint32", - name: "previousRetentionEpochs", - type: "uint32", - }, - { - indexed: false, - internalType: "uint32", - name: "retentionEpochs", - type: "uint32", - }, - ], - name: "EnvelopeRetentionConfigUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "EpochComplete", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - indexed: false, - internalType: "bytes32", - name: "epochHash", - type: "bytes32", - }, - { - indexed: false, - internalType: "uint32", - name: "deliveryCount", - type: "uint32", - }, - ], - name: "EpochConsensus", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - indexed: true, - internalType: "address", - name: "operator_", - type: "address", - }, - { - indexed: false, - internalType: "bytes32", - name: "epochHash", - type: "bytes32", - }, - ], - name: "EpochDelivery", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - indexed: false, - internalType: "bytes32", - name: "epochHash", - type: "bytes32", - }, - { - indexed: false, - internalType: "uint256", - name: "messageCount", - type: "uint256", - }, - ], - name: "EpochReceived", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "newReserveManager", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "oldReserveManager", - type: "address", - }, - ], - name: "ReserveManagerAddressSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { - inputs: [], - name: "MAX_ENVELOPE_BYTES", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "MIN_SIG_WEIGHT", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "UPGRADE_INTERFACE_VERSION", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "activeGroupIndex", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - name: "attestationHandlers", - outputs: [ - { - internalType: "contract IOPPReceiver", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "authority", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "batchOpGroups", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "consensusReached", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "currentEpochStartedAt", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "epochDeliveries", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - name: "epochDeliveryCount", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - name: "epochDigestCount", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "epochDurationSec", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "epochIn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex_", - type: "uint32", - }, - ], - name: "getInboundEnvelope", - outputs: [ - { - components: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint64", - name: "emittedAt", - type: "uint64", - }, - { - internalType: "bytes32", - name: "checksum", - type: "bytes32", - }, - ], - internalType: "struct OPPEnvelopeRetention.EnvelopeRecord", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - name: "inboundEnvelopes", - outputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint64", - name: "emittedAt", - type: "uint64", - }, - { - internalType: "bytes32", - name: "checksum", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "inboundRetentionConfig", - outputs: [ - { - internalType: "uint32", - name: "retentionEpochs", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "oppManager", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator_", - type: "address", - }, - ], - name: "isActiveOperator", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "isConsumingScheduledOp", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "lastMessageID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "nextEpochIndex", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - name: "operatorEthAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "oppContract", - outputs: [ - { - internalType: "contract IOPP", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingConsensus", - outputs: [ - { - internalType: "uint32", - name: "nextEpoch", - type: "uint32", - }, - { - internalType: "uint32", - name: "deliveries", - type: "uint32", - }, - { - internalType: "uint32", - name: "groupSize", - type: "uint32", - }, - { - internalType: "uint64", - name: "currentEpochStartedAtTs", - type: "uint64", - }, - { - internalType: "uint32", - name: "epochDurationSec_", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "digest", - type: "bytes32", - }, - ], - name: "pendingConsensusForDigest", - outputs: [ - { - internalType: "uint32", - name: "nextEpoch", - type: "uint32", - }, - { - internalType: "uint32", - name: "agreeing", - type: "uint32", - }, - { - internalType: "uint32", - name: "groupSize", - type: "uint32", - }, - { - internalType: "uint64", - name: "currentEpochStartedAtTs", - type: "uint64", - }, - { - internalType: "uint32", - name: "epochDurationSec_", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingEpoch", - outputs: [ - { - internalType: "bytes", - name: "envelopeHash", - type: "bytes", - }, - { - components: [ - { - components: [ - { - internalType: "ChainKind", - name: "kind", - type: "uint8", - }, - { - internalType: "uint32", - name: "id", - type: "uint32", - }, - ], - internalType: "struct ChainId", - name: "start", - type: "tuple", - }, - { - components: [ - { - internalType: "ChainKind", - name: "kind", - type: "uint8", - }, - { - internalType: "uint32", - name: "id", - type: "uint32", - }, - ], - internalType: "struct ChainId", - name: "end", - type: "tuple", - }, - ], - internalType: "struct Endpoints", - name: "endpoints", - type: "tuple", - }, - { - internalType: "uint64", - name: "epochTimestamp", - type: "uint64", - }, - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint32", - name: "epochEnvelopeIndex", - type: "uint32", - }, - { - internalType: "bytes", - name: "previousEnvelopeHash", - type: "bytes", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingEpochHash", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingMessageCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "previousEpochHash", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "proxiableUUID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex_", - type: "uint32", - }, - ], - name: "pruneInboundEnvelope", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - name: "pubkeyAddressCache", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "reserveManagerAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "rosterInitialized", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - internalType: "address", - name: "handler", - type: "address", - }, - ], - name: "setAttestationHandler", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newAuthority", - type: "address", - }, - ], - name: "setAuthority", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "retentionEpochs", - type: "uint32", - }, - ], - name: "setEnvelopeRetentionConfig", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "durationSec", - type: "uint32", - }, - ], - name: "setEpochDurationSec", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "opp", - type: "address", - }, - ], - name: "setOPPContract", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newReserveManager", - type: "address", - }, - ], - name: "setReserveManagerAddress", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, -] as const; - -export class OPPInbound__factory { - static readonly abi = _abi; - static createInterface(): OPPInboundInterface { - return new utils.Interface(_abi) as OPPInboundInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): OPPInbound { - return new Contract(address, _abi, signerOrProvider) as OPPInbound; - } -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts deleted file mode 100644 index 94b8d8f..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OPP__factory.ts +++ /dev/null @@ -1,1095 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { OPP, OPPInterface } from "../OPP.js"; - -const _abi = [ - { - inputs: [ - { - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AccessManagedInvalidAuthority", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "uint32", - name: "delay", - type: "uint32", - }, - ], - name: "AccessManagedRequiredDelay", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "AccessManagedUnauthorized", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "target", - type: "address", - }, - ], - name: "AddressEmptyCode", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "ERC1967InvalidImplementation", - type: "error", - }, - { - inputs: [], - name: "ERC1967NonPayable", - type: "error", - }, - { - inputs: [], - name: "FailedCall", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "actualBytes", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxBytes", - type: "uint256", - }, - ], - name: "OPP_EnvelopeOverCap", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_EpochHashMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeRecordMissing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint32", - name: "evictBoundary", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeStillInRetention", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "required", - type: "uint256", - }, - { - internalType: "uint256", - name: "provided", - type: "uint256", - }, - ], - name: "OPP_InsufficientSignatureWeight", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "address", - name: "expected", - type: "address", - }, - ], - name: "OPP_InvalidOPPAddress", - type: "error", - }, - { - inputs: [], - name: "OPP_InvalidRetentionConfig", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "expected", - type: "bytes", - }, - { - internalType: "bytes", - name: "actual", - type: "bytes", - }, - ], - name: "OPP_MessageIDMismatch", - type: "error", - }, - { - inputs: [], - name: "OPP_NoAttestationsSent", - type: "error", - }, - { - inputs: [], - name: "OPP_NoPendingAttestations", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "previousEnvelopeHash", - type: "bytes", - }, - ], - name: "OPP_NonCanonicalPreviousEpochHash", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "expected", - type: "uint32", - }, - { - internalType: "uint32", - name: "actual", - type: "uint32", - }, - ], - name: "OPP_NonSequentialEpoch", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_NotActiveOperator", - type: "error", - }, - { - inputs: [], - name: "OPP_NotSending", - type: "error", - }, - { - inputs: [], - name: "OPP_OPPAddressNotSet", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_OperatorAlreadyDelivered", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_PayloadChecksumMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "stack", - type: "uint256", - }, - ], - name: "OPP_SendStackError", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnauthorizedAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnhandledAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "expectedChainId", - type: "uint256", - }, - { - internalType: "ChainKind", - name: "actualKind", - type: "uint8", - }, - { - internalType: "uint32", - name: "actualId", - type: "uint32", - }, - ], - name: "OPP_WrongDestinationChain", - type: "error", - }, - { - inputs: [], - name: "OPP_ZeroTag", - type: "error", - }, - { - inputs: [], - name: "UUPSUnauthorizedCallContext", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "slot", - type: "bytes32", - }, - ], - name: "UUPSUnsupportedProxiableUUID", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AuthorityUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "EnvelopeRetentionCatchUpPruned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint32", - name: "previousRetentionEpochs", - type: "uint32", - }, - { - indexed: false, - internalType: "uint32", - name: "retentionEpochs", - type: "uint32", - }, - ], - name: "EnvelopeRetentionConfigUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "OPPEnvelope", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { - inputs: [], - name: "MAX_ENVELOPE_BYTES", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "UPGRADE_INTERFACE_VERSION", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "addAttestation", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "allAuthorizedSenders", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "authority", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - name: "authorizedSenders", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "wireEpochIndex", - type: "uint32", - }, - ], - name: "emitOutboundEnvelope", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tag", - type: "uint256", - }, - ], - name: "enterSendMode", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tag", - type: "uint256", - }, - ], - name: "exitSendMode", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "getLatestOutboundEnvelope", - outputs: [ - { - internalType: "uint32", - name: "epoch_", - type: "uint32", - }, - { - internalType: "bytes", - name: "data_", - type: "bytes", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex_", - type: "uint32", - }, - ], - name: "getOutboundEnvelope", - outputs: [ - { - components: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint64", - name: "emittedAt", - type: "uint64", - }, - { - internalType: "bytes32", - name: "checksum", - type: "bytes32", - }, - ], - internalType: "struct OPPEnvelopeRetention.EnvelopeRecord", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "inSendMode", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_authority", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "isConsumingScheduledOp", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "lastMessageID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "lastMessageTimestamp", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "latestOutboundEnvelope", - outputs: [ - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "latestOutboundEpoch", - outputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "", - type: "uint32", - }, - ], - name: "outboundEnvelopes", - outputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint64", - name: "emittedAt", - type: "uint64", - }, - { - internalType: "bytes32", - name: "checksum", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "outboundRetentionConfig", - outputs: [ - { - internalType: "uint32", - name: "retentionEpochs", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pendingAttestationCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "proxiableUUID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex_", - type: "uint32", - }, - ], - name: "pruneOutboundEnvelope", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "queuedMessageCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "sendModeTag", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { - components: [ - { - internalType: "ChainKind", - name: "kind", - type: "uint8", - }, - { - internalType: "uint32", - name: "id", - type: "uint32", - }, - ], - internalType: "struct ChainId", - name: "start", - type: "tuple", - }, - { - components: [ - { - internalType: "ChainKind", - name: "kind", - type: "uint8", - }, - { - internalType: "uint32", - name: "id", - type: "uint32", - }, - ], - internalType: "struct ChainId", - name: "end", - type: "tuple", - }, - ], - internalType: "struct Endpoints", - name: "endpoints", - type: "tuple", - }, - { - internalType: "bytes", - name: "messageId", - type: "bytes", - }, - { - internalType: "bytes", - name: "previousMessageId", - type: "bytes", - }, - { - internalType: "uint32", - name: "payloadSize", - type: "uint32", - }, - { - internalType: "bytes", - name: "payloadChecksum", - type: "bytes", - }, - { - internalType: "uint64", - name: "timestamp", - type: "uint64", - }, - { - internalType: "bytes", - name: "headerChecksum", - type: "bytes", - }, - ], - internalType: "struct MessageHeader", - name: "header", - type: "tuple", - }, - { - components: [ - { - internalType: "uint32", - name: "version", - type: "uint32", - }, - { - components: [ - { - internalType: "AttestationType", - name: "type_", - type: "uint16", - }, - { - internalType: "uint32", - name: "dataSize", - type: "uint32", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - internalType: "struct AttestationEntry[]", - name: "attestations", - type: "tuple[]", - }, - ], - internalType: "struct MessagePayload", - name: "payload", - type: "tuple", - }, - ], - name: "serializeMessage", - outputs: [ - { - components: [ - { - components: [ - { - components: [ - { - internalType: "ChainKind", - name: "kind", - type: "uint8", - }, - { - internalType: "uint32", - name: "id", - type: "uint32", - }, - ], - internalType: "struct ChainId", - name: "start", - type: "tuple", - }, - { - components: [ - { - internalType: "ChainKind", - name: "kind", - type: "uint8", - }, - { - internalType: "uint32", - name: "id", - type: "uint32", - }, - ], - internalType: "struct ChainId", - name: "end", - type: "tuple", - }, - ], - internalType: "struct Endpoints", - name: "endpoints", - type: "tuple", - }, - { - internalType: "bytes", - name: "messageId", - type: "bytes", - }, - { - internalType: "bytes", - name: "previousMessageId", - type: "bytes", - }, - { - internalType: "uint32", - name: "payloadSize", - type: "uint32", - }, - { - internalType: "bytes", - name: "payloadChecksum", - type: "bytes", - }, - { - internalType: "uint64", - name: "timestamp", - type: "uint64", - }, - { - internalType: "bytes", - name: "headerChecksum", - type: "bytes", - }, - ], - internalType: "struct MessageHeader", - name: "", - type: "tuple", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newAuthority", - type: "address", - }, - ], - name: "setAuthority", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint32", - name: "retentionEpochs", - type: "uint32", - }, - ], - name: "setEnvelopeRetentionConfig", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, -] as const; - -export class OPP__factory { - static readonly abi = _abi; - static createInterface(): OPPInterface { - return new utils.Interface(_abi) as OPPInterface; - } - static connect(address: string, signerOrProvider: Signer | Provider): OPP { - return new Contract(address, _abi, signerOrProvider) as OPP; - } -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts deleted file mode 100644 index 8b39e88..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/OperatorRegistry__factory.ts +++ /dev/null @@ -1,1784 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { - OperatorRegistry, - OperatorRegistryInterface, -} from "../OperatorRegistry.js"; - -const _abi = [ - { - inputs: [ - { - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AccessManagedInvalidAuthority", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "uint32", - name: "delay", - type: "uint32", - }, - ], - name: "AccessManagedRequiredDelay", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "AccessManagedUnauthorized", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "target", - type: "address", - }, - ], - name: "AddressEmptyCode", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "ERC1967InvalidImplementation", - type: "error", - }, - { - inputs: [], - name: "ERC1967NonPayable", - type: "error", - }, - { - inputs: [], - name: "FailedCall", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "actualBytes", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxBytes", - type: "uint256", - }, - ], - name: "OPP_EnvelopeOverCap", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_EpochHashMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeRecordMissing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint32", - name: "evictBoundary", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeStillInRetention", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "required", - type: "uint256", - }, - { - internalType: "uint256", - name: "provided", - type: "uint256", - }, - ], - name: "OPP_InsufficientSignatureWeight", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "address", - name: "expected", - type: "address", - }, - ], - name: "OPP_InvalidOPPAddress", - type: "error", - }, - { - inputs: [], - name: "OPP_InvalidRetentionConfig", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "expected", - type: "bytes", - }, - { - internalType: "bytes", - name: "actual", - type: "bytes", - }, - ], - name: "OPP_MessageIDMismatch", - type: "error", - }, - { - inputs: [], - name: "OPP_NoAttestationsSent", - type: "error", - }, - { - inputs: [], - name: "OPP_NoPendingAttestations", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "previousEnvelopeHash", - type: "bytes", - }, - ], - name: "OPP_NonCanonicalPreviousEpochHash", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "expected", - type: "uint32", - }, - { - internalType: "uint32", - name: "actual", - type: "uint32", - }, - ], - name: "OPP_NonSequentialEpoch", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_NotActiveOperator", - type: "error", - }, - { - inputs: [], - name: "OPP_NotSending", - type: "error", - }, - { - inputs: [], - name: "OPP_OPPAddressNotSet", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_OperatorAlreadyDelivered", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_PayloadChecksumMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "stack", - type: "uint256", - }, - ], - name: "OPP_SendStackError", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnauthorizedAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnhandledAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "expectedChainId", - type: "uint256", - }, - { - internalType: "ChainKind", - name: "actualKind", - type: "uint8", - }, - { - internalType: "uint32", - name: "actualId", - type: "uint32", - }, - ], - name: "OPP_WrongDestinationChain", - type: "error", - }, - { - inputs: [], - name: "OPP_ZeroTag", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "SafeERC20FailedOperation", - type: "error", - }, - { - inputs: [], - name: "UUPSUnauthorizedCallContext", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "slot", - type: "bytes32", - }, - ], - name: "UUPSUnsupportedProxiableUUID", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "address", - name: "provided", - type: "address", - }, - ], - name: "WIRE_BadContractAddress", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "bps", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxBps", - type: "uint256", - }, - ], - name: "WIRE_BasisPointsTooHigh", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "derived", - type: "address", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_DepositorKeyMismatch", - type: "error", - }, - { - inputs: [], - name: "WIRE_Erc20DepositValueNonZero", - type: "error", - }, - { - inputs: [], - name: "WIRE_Erc20TransferFailed", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "WIRE_EthSendFailed", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_FeeOnTransferUnsupported", - type: "error", - }, - { - inputs: [], - name: "WIRE_GoLiveInProgress", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "required", - type: "uint256", - }, - { - internalType: "uint256", - name: "available", - type: "uint256", - }, - ], - name: "WIRE_InsufficientEthBalance", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "length", - type: "uint256", - }, - ], - name: "WIRE_InvalidDepositorKey", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "WIRE_InvalidNodeTier", - type: "error", - }, - { - inputs: [], - name: "WIRE_InvalidPrice", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - ], - name: "WIRE_InvalidWireAccountName", - type: "error", - }, - { - inputs: [ - { - internalType: "WireKeyType", - name: "keyType", - type: "uint8", - }, - { - internalType: "uint256", - name: "keyLength", - type: "uint256", - }, - ], - name: "WIRE_InvalidWireKey", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "WIRE_LiqEthTransferFailed", - type: "error", - }, - { - inputs: [], - name: "WIRE_MultipleNativeTrackedCodes", - type: "error", - }, - { - inputs: [], - name: "WIRE_NativeDepositValueMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "actor", - type: "address", - }, - { - internalType: "OperatorType", - name: "operatorType", - type: "uint8", - }, - ], - name: "WIRE_NoBonds", - type: "error", - }, - { - inputs: [], - name: "WIRE_NoPricesRecorded", - type: "error", - }, - { - inputs: [], - name: "WIRE_NoYield", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "nftAddress", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_NodeTokenNotOwned", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "receiptId", - type: "uint256", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_NotReceiptOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_OnlyOPPInboundLib", - type: "error", - }, - { - inputs: [], - name: "WIRE_OppInboundCallerUnauthorized", - type: "error", - }, - { - inputs: [], - name: "WIRE_OutpostChainCodeUnset", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "innerRevert", - type: "bytes", - }, - ], - name: "WIRE_PermitFailed", - type: "error", - }, - { - inputs: [], - name: "WIRE_PrecisionOverflow", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_PrecisionUnsetForRefund", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - { - internalType: "uint256", - name: "minPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxPrice", - type: "uint256", - }, - ], - name: "WIRE_PriceOutOfBounds", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "receiptId", - type: "uint256", - }, - ], - name: "WIRE_ReceiptNotWithdrawable", - type: "error", - }, - { - inputs: [], - name: "WIRE_RefundingInProgress", - type: "error", - }, - { - inputs: [], - name: "WIRE_RefundingOnly", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveAlreadyExists", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveBadParam", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveCancelNotCreator", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveNotCancellable", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapEmptyRecipient", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapSourceNotNative", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapSourceReserveUnavailable", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_SwapSourceTokenNotRegistered", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapUnknownSlugName", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapZeroSourceAmount", - type: "error", - }, - { - inputs: [], - name: "WIRE_TokenAddressUnset", - type: "error", - }, - { - inputs: [ - { - internalType: "uint8", - name: "provided", - type: "uint8", - }, - ], - name: "WIRE_TokenPrecisionOutOfRange", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_TokenPrecisionUnset", - type: "error", - }, - { - inputs: [], - name: "WIRE_TrackedCodeZero", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "WIRE_UnexpectedError", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "WIRE_UnexpectedTokenDeposit", - type: "error", - }, - { - inputs: [], - name: "WIRE_WireNodesContractNotSet", - type: "error", - }, - { - inputs: [], - name: "WIRE_ZeroAmount", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AuthorityUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "depositor", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "refundedToDepositor", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "penaltyToReserve", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes", - name: "originalMessageId", - type: "bytes", - }, - { - indexed: false, - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "DepositReverted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "LiqTokenCodeSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "NativeTokenCodeSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "OperatorType", - name: "operatorType", - type: "uint8", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "OperatorDeposited", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "address", - name: "reserveTarget", - type: "address", - }, - { - indexed: false, - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "OperatorSlashed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - ], - name: "OutpostChainCodeSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "underwriter", - type: "address", - }, - { - indexed: false, - internalType: "bytes", - name: "uicBytes", - type: "bytes", - }, - ], - name: "UnderwriteCommitRelayed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint64", - name: "requestId", - type: "uint64", - }, - ], - name: "WithdrawRemitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint64", - name: "requestId", - type: "uint64", - }, - ], - name: "WithdrawRequested", - type: "event", - }, - { - inputs: [], - name: "DEPOSIT_REVERT_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DEPOSIT_REVERT_GAS_MULTIPLIER", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "OPERATOR_ACTION_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "OPPAttestationIn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "UNDERWRITE_INTENT_COMMIT_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "UPGRADE_INTERFACE_VERSION", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "__OPPEndpointManaged_init", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "authority", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes", - name: "uicBytes", - type: "bytes", - }, - ], - name: "commit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "OperatorType", - name: "operatorType", - type: "uint8", - }, - { - internalType: "bytes", - name: "compressedPubkey", - type: "bytes", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "deposit", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "OperatorType", - name: "operatorType", - type: "uint8", - }, - { - internalType: "bytes", - name: "compressedPubkey", - type: "bytes", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "depositNonNative", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - name: "depositedByCode", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getSummaryAttestations", - outputs: [ - { - components: [ - { - internalType: "AttestationType", - name: "type_", - type: "uint16", - }, - { - internalType: "uint32", - name: "dataSize", - type: "uint32", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - internalType: "struct AttestationEntry[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_authority", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "isConsumingScheduledOp", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "liqToken", - outputs: [ - { - internalType: "contract IERC20", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "liqTokenCode", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "nativeTokenCode", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "operators", - outputs: [ - { - internalType: "OperatorType", - name: "operatorType", - type: "uint8", - }, - { - internalType: "OperatorStatus", - name: "status", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "oppAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "oppInboundAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "outpostChainCode", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "outpostId", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "proxiableUUID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "reserveManagerAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newAuthority", - type: "address", - }, - ], - name: "setAuthority", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_liqToken", - type: "address", - }, - ], - name: "setLiqToken", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "setLiqTokenCode", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "setNativeTokenCode", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_oppAddress", - type: "address", - }, - { - internalType: "address", - name: "_oppInboundAddress", - type: "address", - }, - ], - name: "setOPPAddresses", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - ], - name: "setOutpostChainCode", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "_outpostId", - type: "uint64", - }, - ], - name: "setOutpostId", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_reserveManager", - type: "address", - }, - ], - name: "setReserveManagerAddress", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "slash", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes", - name: "compressedPubkey", - type: "bytes", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "withdraw", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, -] as const; - -export class OperatorRegistry__factory { - static readonly abi = _abi; - static createInterface(): OperatorRegistryInterface { - return new utils.Interface(_abi) as OperatorRegistryInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): OperatorRegistry { - return new Contract(address, _abi, signerOrProvider) as OperatorRegistry; - } -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts deleted file mode 100644 index f579d2f..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/ReserveManager__factory.ts +++ /dev/null @@ -1,2583 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Signer, utils } from "ethers"; -import type { Provider } from "@ethersproject/providers"; -import type { - ReserveManager, - ReserveManagerInterface, -} from "../ReserveManager.js"; - -const _abi = [ - { - inputs: [ - { - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AccessManagedInvalidAuthority", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "uint32", - name: "delay", - type: "uint32", - }, - ], - name: "AccessManagedRequiredDelay", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "AccessManagedUnauthorized", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "target", - type: "address", - }, - ], - name: "AddressEmptyCode", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "ERC1967InvalidImplementation", - type: "error", - }, - { - inputs: [], - name: "ERC1967NonPayable", - type: "error", - }, - { - inputs: [], - name: "EnforcedPause", - type: "error", - }, - { - inputs: [], - name: "ExpectedPause", - type: "error", - }, - { - inputs: [], - name: "FailedCall", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "raw", - type: "uint64", - }, - ], - name: "InvalidEnumValue", - type: "error", - }, - { - inputs: [], - name: "InvalidInitialization", - type: "error", - }, - { - inputs: [], - name: "NotInitializing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "actualBytes", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxBytes", - type: "uint256", - }, - ], - name: "OPP_EnvelopeOverCap", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_EpochHashMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeRecordMissing", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "uint32", - name: "evictBoundary", - type: "uint32", - }, - ], - name: "OPP_InboundEnvelopeStillInRetention", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "required", - type: "uint256", - }, - { - internalType: "uint256", - name: "provided", - type: "uint256", - }, - ], - name: "OPP_InsufficientSignatureWeight", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - { - internalType: "address", - name: "expected", - type: "address", - }, - ], - name: "OPP_InvalidOPPAddress", - type: "error", - }, - { - inputs: [], - name: "OPP_InvalidRetentionConfig", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "expected", - type: "bytes", - }, - { - internalType: "bytes", - name: "actual", - type: "bytes", - }, - ], - name: "OPP_MessageIDMismatch", - type: "error", - }, - { - inputs: [], - name: "OPP_NoAttestationsSent", - type: "error", - }, - { - inputs: [], - name: "OPP_NoPendingAttestations", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "previousEnvelopeHash", - type: "bytes", - }, - ], - name: "OPP_NonCanonicalPreviousEpochHash", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "expected", - type: "uint32", - }, - { - internalType: "uint32", - name: "actual", - type: "uint32", - }, - ], - name: "OPP_NonSequentialEpoch", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_NotActiveOperator", - type: "error", - }, - { - inputs: [], - name: "OPP_NotSending", - type: "error", - }, - { - inputs: [], - name: "OPP_OPPAddressNotSet", - type: "error", - }, - { - inputs: [ - { - internalType: "uint32", - name: "epochIndex", - type: "uint32", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "OPP_OperatorAlreadyDelivered", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "expected", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "actual", - type: "bytes32", - }, - ], - name: "OPP_PayloadChecksumMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "stack", - type: "uint256", - }, - ], - name: "OPP_SendStackError", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnauthorizedAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - ], - name: "OPP_UnhandledAttestationType", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "expectedChainId", - type: "uint256", - }, - { - internalType: "ChainKind", - name: "actualKind", - type: "uint8", - }, - { - internalType: "uint32", - name: "actualId", - type: "uint32", - }, - ], - name: "OPP_WrongDestinationChain", - type: "error", - }, - { - inputs: [], - name: "OPP_ZeroTag", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - ], - name: "SafeERC20FailedOperation", - type: "error", - }, - { - inputs: [], - name: "UUPSUnauthorizedCallContext", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "slot", - type: "bytes32", - }, - ], - name: "UUPSUnsupportedProxiableUUID", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "address", - name: "provided", - type: "address", - }, - ], - name: "WIRE_BadContractAddress", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "bps", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxBps", - type: "uint256", - }, - ], - name: "WIRE_BasisPointsTooHigh", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "derived", - type: "address", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_DepositorKeyMismatch", - type: "error", - }, - { - inputs: [], - name: "WIRE_Erc20DepositValueNonZero", - type: "error", - }, - { - inputs: [], - name: "WIRE_Erc20TransferFailed", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "WIRE_EthSendFailed", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_FeeOnTransferUnsupported", - type: "error", - }, - { - inputs: [], - name: "WIRE_GoLiveInProgress", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "required", - type: "uint256", - }, - { - internalType: "uint256", - name: "available", - type: "uint256", - }, - ], - name: "WIRE_InsufficientEthBalance", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "length", - type: "uint256", - }, - ], - name: "WIRE_InvalidDepositorKey", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "WIRE_InvalidNodeTier", - type: "error", - }, - { - inputs: [], - name: "WIRE_InvalidPrice", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "name", - type: "string", - }, - ], - name: "WIRE_InvalidWireAccountName", - type: "error", - }, - { - inputs: [ - { - internalType: "WireKeyType", - name: "keyType", - type: "uint8", - }, - { - internalType: "uint256", - name: "keyLength", - type: "uint256", - }, - ], - name: "WIRE_InvalidWireKey", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "WIRE_LiqEthTransferFailed", - type: "error", - }, - { - inputs: [], - name: "WIRE_MultipleNativeTrackedCodes", - type: "error", - }, - { - inputs: [], - name: "WIRE_NativeDepositValueMismatch", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "actor", - type: "address", - }, - { - internalType: "OperatorType", - name: "operatorType", - type: "uint8", - }, - ], - name: "WIRE_NoBonds", - type: "error", - }, - { - inputs: [], - name: "WIRE_NoPricesRecorded", - type: "error", - }, - { - inputs: [], - name: "WIRE_NoYield", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "nftAddress", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_NodeTokenNotOwned", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "receiptId", - type: "uint256", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_NotReceiptOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "caller", - type: "address", - }, - ], - name: "WIRE_OnlyOPPInboundLib", - type: "error", - }, - { - inputs: [], - name: "WIRE_OppInboundCallerUnauthorized", - type: "error", - }, - { - inputs: [], - name: "WIRE_OutpostChainCodeUnset", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes", - name: "innerRevert", - type: "bytes", - }, - ], - name: "WIRE_PermitFailed", - type: "error", - }, - { - inputs: [], - name: "WIRE_PrecisionOverflow", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_PrecisionUnsetForRefund", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - { - internalType: "uint256", - name: "minPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxPrice", - type: "uint256", - }, - ], - name: "WIRE_PriceOutOfBounds", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "receiptId", - type: "uint256", - }, - ], - name: "WIRE_ReceiptNotWithdrawable", - type: "error", - }, - { - inputs: [], - name: "WIRE_RefundingInProgress", - type: "error", - }, - { - inputs: [], - name: "WIRE_RefundingOnly", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveAlreadyExists", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveBadParam", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveCancelNotCreator", - type: "error", - }, - { - inputs: [], - name: "WIRE_ReserveNotCancellable", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapEmptyRecipient", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapSourceNotNative", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapSourceReserveUnavailable", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_SwapSourceTokenNotRegistered", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapUnknownSlugName", - type: "error", - }, - { - inputs: [], - name: "WIRE_SwapZeroSourceAmount", - type: "error", - }, - { - inputs: [], - name: "WIRE_TokenAddressUnset", - type: "error", - }, - { - inputs: [ - { - internalType: "uint8", - name: "provided", - type: "uint8", - }, - ], - name: "WIRE_TokenPrecisionOutOfRange", - type: "error", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "WIRE_TokenPrecisionUnset", - type: "error", - }, - { - inputs: [], - name: "WIRE_TrackedCodeZero", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "WIRE_UnexpectedError", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "WIRE_UnexpectedTokenDeposit", - type: "error", - }, - { - inputs: [], - name: "WIRE_WireNodesContractNotSet", - type: "error", - }, - { - inputs: [], - name: "WIRE_ZeroAmount", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "authority", - type: "address", - }, - ], - name: "AuthorityUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [], - name: "BalanceSheetEmitted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Deposited", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "version", - type: "uint64", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - ], - name: "OutpostChainCodeSet", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "Paused", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: true, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - ], - name: "ReserveActivated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: true, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: true, - internalType: "address", - name: "creator", - type: "address", - }, - ], - name: "ReserveCancelRequested", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: true, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: true, - internalType: "address", - name: "creator", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "refundedAmount", - type: "uint256", - }, - ], - name: "ReserveCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: true, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: true, - internalType: "address", - name: "creator", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "externalTokenAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint64", - name: "requestedWireAmount", - type: "uint64", - }, - { - indexed: false, - internalType: "uint32", - name: "connectorWeightBps", - type: "uint32", - }, - ], - name: "ReserveCreateRequested", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint64", - name: "id", - type: "uint64", - }, - { - indexed: false, - internalType: "bytes32", - name: "hash", - type: "bytes32", - }, - ], - name: "SwapDeposit", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "recipient", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes32", - name: "originalMessageId", - type: "bytes32", - }, - ], - name: "SwapRemitPaid", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "depotAmount", - type: "uint64", - }, - { - indexed: false, - internalType: "bytes32", - name: "originalId", - type: "bytes32", - }, - { - indexed: false, - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "SwapRemitUnpayable", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "user", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "sourceTokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "sourceReserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "sourceAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint64", - name: "targetChainCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "targetTokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "targetReserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "bytes", - name: "targetRecipient", - type: "bytes", - }, - { - indexed: false, - internalType: "uint64", - name: "targetAmount", - type: "uint64", - }, - { - indexed: false, - internalType: "uint32", - name: "targetToleranceBps", - type: "uint32", - }, - ], - name: "SwapRequested", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "depositor", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes32", - name: "originalSwapMessageId", - type: "bytes32", - }, - { - indexed: false, - internalType: "bytes", - name: "errData", - type: "bytes", - }, - ], - name: "SwapRevertError", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "depositor", - type: "address", - }, - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes32", - name: "originalSwapMessageId", - type: "bytes32", - }, - { - indexed: false, - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "SwapReverted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "address", - name: "addr", - type: "address", - }, - ], - name: "TokenAddressSet", - type: "event", - }, - { - anonymous: false, - inputs: [], - name: "TrackedCodesUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "Unpaused", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - indexed: false, - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "Withdrawn", - type: "event", - }, - { - inputs: [], - name: "BALANCE_SHEET_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "AttestationType", - name: "attestationType", - type: "uint16", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "OPPAttestationIn", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "RESERVE_CREATE_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "RESERVE_CREATE_CANCEL_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "SWAP_REQUEST_ATTESTATION", - outputs: [ - { - internalType: "AttestationType", - name: "", - type: "uint16", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "UPGRADE_INTERFACE_VERSION", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "__OPPEndpointManaged_init", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "_payRemit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "authority", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - ], - name: "cancel_create_reserve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "externalTokenAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "requestedWireAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "connectorWeightBps", - type: "uint32", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "description", - type: "string", - }, - { - internalType: "bool", - name: "isPrivate", - type: "bool", - }, - { - internalType: "bytes", - name: "creatorPubKey", - type: "bytes", - }, - ], - name: "create_reserve", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "emitBalanceSheet", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - ], - name: "getReserve", - outputs: [ - { - components: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "externalTokenAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "requestedWireAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "connectorWeightBps", - type: "uint32", - }, - { - internalType: "enum ReserveManager.LocalReserveStatus", - name: "status", - type: "uint8", - }, - { - internalType: "address", - name: "creator", - type: "address", - }, - { - internalType: "bool", - name: "exists", - type: "bool", - }, - ], - internalType: "struct ReserveManager.ReserveRecord", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getSummaryAttestations", - outputs: [ - { - components: [ - { - internalType: "AttestationType", - name: "type_", - type: "uint16", - }, - { - internalType: "uint32", - name: "dataSize", - type: "uint32", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - internalType: "struct AttestationEntry[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_authority", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "isConsumingScheduledOp", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "nativeTokenCode", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - ], - name: "onReserveCreateCancelled", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - ], - name: "onReserveReady", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "depositor", - type: "address", - }, - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "depotAmount", - type: "uint64", - }, - { - internalType: "bytes32", - name: "originalSwapMessageId", - type: "bytes32", - }, - { - internalType: "string", - name: "reason", - type: "string", - }, - ], - name: "onSwapRevert", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "oppAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "oppInboundAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "outpostChainCode", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pause", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "paused", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "proxiableUUID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "externalTokenAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "requestedWireAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "connectorWeightBps", - type: "uint32", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "description", - type: "string", - }, - { - internalType: "bool", - name: "isPrivate", - type: "bool", - }, - { - internalType: "bytes", - name: "creatorPubKey", - type: "bytes", - }, - ], - internalType: "struct ReserveManagerLib.ReserveCreateArgs", - name: "args", - type: "tuple", - }, - ], - name: "requestReserveCreateErc20WithApproval", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "externalTokenAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "requestedWireAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "connectorWeightBps", - type: "uint32", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "description", - type: "string", - }, - { - internalType: "bool", - name: "isPrivate", - type: "bool", - }, - { - internalType: "bytes", - name: "creatorPubKey", - type: "bytes", - }, - ], - internalType: "struct ReserveManagerLib.ReserveCreateArgs", - name: "args", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - internalType: "struct ReserveManagerLib.PermitSig", - name: "permitSig", - type: "tuple", - }, - ], - name: "requestReserveCreateErc20WithPermit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "sourceTokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "sourceReserveCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetChainCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetTokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetReserveCode", - type: "uint64", - }, - { - internalType: "bytes", - name: "targetRecipient", - type: "bytes", - }, - { - internalType: "uint64", - name: "targetAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "targetToleranceBps", - type: "uint32", - }, - ], - name: "requestSwap", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "uint64", - name: "sourceTokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "sourceReserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "sourceAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "targetChainCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetTokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetReserveCode", - type: "uint64", - }, - { - internalType: "bytes", - name: "targetRecipient", - type: "bytes", - }, - { - internalType: "uint64", - name: "targetAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "targetToleranceBps", - type: "uint32", - }, - ], - internalType: "struct ReserveManagerLib.SwapArgs", - name: "args", - type: "tuple", - }, - ], - name: "requestSwapErc20WithApproval", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "uint64", - name: "sourceTokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "sourceReserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "sourceAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "targetChainCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetTokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "targetReserveCode", - type: "uint64", - }, - { - internalType: "bytes", - name: "targetRecipient", - type: "bytes", - }, - { - internalType: "uint64", - name: "targetAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "targetToleranceBps", - type: "uint32", - }, - ], - internalType: "struct ReserveManagerLib.SwapArgs", - name: "args", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - internalType: "struct ReserveManagerLib.PermitSig", - name: "permitSig", - type: "tuple", - }, - ], - name: "requestSwapErc20WithPermit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - name: "reserves", - outputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "externalTokenAmount", - type: "uint256", - }, - { - internalType: "uint64", - name: "requestedWireAmount", - type: "uint64", - }, - { - internalType: "uint32", - name: "connectorWeightBps", - type: "uint32", - }, - { - internalType: "enum ReserveManager.LocalReserveStatus", - name: "status", - type: "uint8", - }, - { - internalType: "address", - name: "creator", - type: "address", - }, - { - internalType: "bool", - name: "exists", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newAuthority", - type: "address", - }, - ], - name: "setAuthority", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_oppAddress", - type: "address", - }, - { - internalType: "address", - name: "_oppInboundAddress", - type: "address", - }, - ], - name: "setOPPAddresses", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "chainCode", - type: "uint64", - }, - ], - name: "setOutpostChainCode", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "address", - name: "tokenAddr", - type: "address", - }, - { - internalType: "uint8", - name: "precision", - type: "uint8", - }, - ], - internalType: "struct ReserveManager.TrackedCodeEntry[]", - name: "entries", - type: "tuple[]", - }, - ], - name: "setTrackedCodes", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "swapDepositCounter", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - name: "tokenAddressesByCode", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - name: "tokenPrecisionByCode", - outputs: [ - { - internalType: "uint8", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "trackedCodesCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "trackedReserveCodes", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "trackedTokenCodes", - outputs: [ - { - internalType: "uint64", - name: "", - type: "uint64", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "unpause", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint64", - name: "tokenCode", - type: "uint64", - }, - { - internalType: "uint64", - name: "reserveCode", - type: "uint64", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "withdraw", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, -] as const; - -export class ReserveManager__factory { - static readonly abi = _abi; - static createInterface(): ReserveManagerInterface { - return new utils.Interface(_abi) as ReserveManagerInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): ReserveManager { - return new Contract(address, _abi, signerOrProvider) as ReserveManager; - } -} diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts deleted file mode 100644 index 158632f..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/factories/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -export { OPP__factory } from "./OPP__factory.js"; -export { OPPInbound__factory } from "./OPPInbound__factory.js"; -export { OperatorRegistry__factory } from "./OperatorRegistry__factory.js"; -export { ReserveManager__factory } from "./ReserveManager__factory.js"; diff --git a/packages/sdk-outpost/src/contracts/ethereum/generated/index.ts b/packages/sdk-outpost/src/contracts/ethereum/generated/index.ts deleted file mode 100644 index ea0a0af..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/generated/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -export type { OPP } from "./OPP.js"; -export type { OPPInbound } from "./OPPInbound.js"; -export type { OperatorRegistry } from "./OperatorRegistry.js"; -export type { ReserveManager } from "./ReserveManager.js"; -export * as factories from "./factories/index.js"; -export { OperatorRegistry__factory } from "./factories/OperatorRegistry__factory.js"; -export { OPP__factory } from "./factories/OPP__factory.js"; -export { OPPInbound__factory } from "./factories/OPPInbound__factory.js"; -export { ReserveManager__factory } from "./factories/ReserveManager__factory.js"; diff --git a/packages/sdk-outpost/src/deployments/Registry.ts b/packages/sdk-outpost/src/deployments/Registry.ts deleted file mode 100644 index d94b9cd..0000000 --- a/packages/sdk-outpost/src/deployments/Registry.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { - CurrentOutpostDeploymentId, - OutpostDeploymentDocuments -} from "./generated/Catalog.js" -import { OutpostDeployment, parseOutpostDeployment } from "./Schema.js" - -/** Deployment bundles available to SDK consumers. */ -export const OutpostDeployments: readonly OutpostDeployment[] = - OutpostDeploymentDocuments.map(parseOutpostDeployment) - -/** Resolve a deployment by its stable catalog id or throw. */ -export function getOutpostDeployment(id: string): OutpostDeployment { - const deployment = OutpostDeployments.find(candidate => candidate.id === id) - if (deployment == null) throw new Error(`No outpost deployment named ${id}`) - return deployment -} - -/** Deployment whose artifacts own the package's generated client types. */ -export const CurrentOutpostDeployment = getOutpostDeployment( - CurrentOutpostDeploymentId -) - -/** Structural identity implemented by sdk-core ChainId objects. */ -export interface WireChainIdLike { - readonly hexString: string -} - -/** Wire chain identity accepted from a hex string or sdk-core ChainId object. */ -export type WireChainIdInput = string | WireChainIdLike - -/** Resolve a deployment by its parent Wire chain identity or throw. */ -export function assertOutpostDeployment( - wireChainId: WireChainIdInput -): OutpostDeployment { - const chainId = - typeof wireChainId === "string" - ? wireChainId.toLowerCase() - : wireChainId.hexString.toLowerCase() - - if (!/^[0-9a-f]{64}$/.test(chainId)) { - throw new Error(`Invalid Wire chain id ${chainId}`) - } - - const deployment = OutpostDeployments.find( - candidate => candidate.wire.chainId === chainId - ) - - if (deployment == null) { - throw new Error(`No outpost deployment for Wire chain ${chainId}`) - } - return deployment -} diff --git a/packages/sdk-outpost/src/deployments/current.json b/packages/sdk-outpost/src/deployments/current.json deleted file mode 100644 index ba18902..0000000 --- a/packages/sdk-outpost/src/deployments/current.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "id": "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361" -} diff --git a/packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json b/packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json deleted file mode 100644 index 8a3f4bb..0000000 --- a/packages/sdk-outpost/src/deployments/data/365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023/274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "schemaVersion": 1, - "id": "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023-274b3c60e7da", - "artifactBundle": { - "generatedAt": "2026-07-31T15:47:46Z", - "sourceArchiveSha256": "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", - "clusterManifestSha256": "2e650017d311678ac427d671e5289a0875751eef6829f9239d8eb0e25b821030", - "deploymentChecksum": "274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509", - "snapshotChecksum": "95bde008eb560dd173c410e1010a885c9660e3dd2399d554c97210d0caa7ef6a", - "platformRelease": { - "tag": "v1.0.0", - "url": "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - "manifest": { - "repository": "Wire-Network/wire-platform-manifest", - "revision": "78ed083740e62a03d9ea873ff0a9a44db23ca195" - }, - "libraries": { - "repository": "Wire-Network/wire-libraries-ts", - "revision": "3cfda4a238e4e8d98bda836e857e6679b85f44fa" - } - }, - "sources": { - "wireTools": { - "repository": "Wire-Network/wire-tools-ts", - "revision": "ac4ea7a2783f81d03f13a62ead2fa173cf12094f" - }, - "wireSysio": { - "repository": "Wire-Network/wire-sysio", - "revision": "235501b0ad4612ee842c428182f84cd66ef803fc" - }, - "wireEthereum": { - "repository": "Wire-Network/wire-ethereum", - "revision": "c1ea82b2b3cffacecec35e5c186e82e381f6be67" - }, - "wireSolana": { - "repository": "Wire-Network/wire-solana", - "revision": "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" - } - } - }, - "wire": { - "chainId": "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023" - }, - "ethereum": { - "chainId": 31337, - "contracts": { - "OPP": { - "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - "artifactSha256": "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" - }, - "OPPInbound": { - "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - "artifactSha256": "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" - }, - "OperatorRegistry": { - "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - "artifactSha256": "d9ce20dce4d4f5b039bdd52df69037c8c289f9a419b420efdac6c02cafbd5607" - }, - "ReserveManager": { - "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - "artifactSha256": "1df4221be4fc24617d3368877e5962214ae55330362bb644028e56518d12b17f" - } - } - }, - "solana": { - "genesisHash": "3rVuMvjfU8SGyyfYWsmkhJNHSsrbxaGLLzdwnYZvWadc", - "programs": { - "liqsolCore": { - "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - "artifactSha256": "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" - } - } - } -} diff --git a/packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json b/packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json deleted file mode 100644 index 2e48851..0000000 --- a/packages/sdk-outpost/src/deployments/data/ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96/467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "schemaVersion": 1, - "id": "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361", - "artifactBundle": { - "generatedAt": "2026-08-03T15:21:41Z", - "sourceArchiveSha256": "74f854b94f24830b76fdb749bbb229b4f725f06e67b7d3fcc00cc3b0c4db95ea", - "clusterManifestSha256": "8ee35815b7d23d1eb8ee02fd2e5d7d941c8aa2c96fe55ba20d124c8a94364d19", - "deploymentChecksum": "467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6", - "snapshotChecksum": "30f6df4c6b02cff393040599507b6894c04e9e7af473d7425b295f1a18e61434", - "platformRelease": { - "tag": "v1.0.0", - "url": "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - "manifest": { - "repository": "Wire-Network/wire-platform-manifest", - "revision": "4f556be5d7bdba5a23c87e39f91aa2ddace9c2b4" - }, - "libraries": { - "repository": "Wire-Network/wire-libraries-ts", - "revision": "1b8025381a105bf96a95bbdd58a1cfc012f79509" - } - }, - "sources": { - "wireTools": { - "repository": "Wire-Network/wire-tools-ts", - "revision": "763dda36c0a05cd2cfcc07191f06d7f04cf43f14" - }, - "wireSysio": { - "repository": "Wire-Network/wire-sysio", - "revision": "7dede884e0150d36fa788e85a119e10653ade8ca" - }, - "wireEthereum": { - "repository": "Wire-Network/wire-ethereum", - "revision": "d892c9458ad666adbccca913863ddf4e5e3d37a4" - }, - "wireSolana": { - "repository": "Wire-Network/wire-solana", - "revision": "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" - } - } - }, - "wire": { - "chainId": "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96" - }, - "ethereum": { - "chainId": 31337, - "contracts": { - "OPP": { - "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - "artifactSha256": "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" - }, - "OPPInbound": { - "address": "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - "artifactSha256": "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" - }, - "OperatorRegistry": { - "address": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - "artifactSha256": "2caf33014eb645412eee872c2868faa3cd5543a07b14b931e3c14018da03b34d" - }, - "ReserveManager": { - "address": "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - "artifactSha256": "42d640e0fae007112c8b920b80901e43dcd4e1896ed670a8331f2ba1bc41a29e" - } - } - }, - "solana": { - "genesisHash": "6sk74BT2qUhnAVQ2fBH87Yyh3kLyZmVJkQDWCfjS5v6a", - "programs": { - "liqsolCore": { - "address": "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - "artifactSha256": "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" - } - } - } -} diff --git a/packages/sdk-outpost/src/deployments/generated/Catalog.ts b/packages/sdk-outpost/src/deployments/generated/Catalog.ts deleted file mode 100644 index 8c59178..0000000 --- a/packages/sdk-outpost/src/deployments/generated/Catalog.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ - -/** Untrusted deployment documents validated by Registry at module load. */ -export const OutpostDeploymentDocuments: readonly unknown[] = [ - { - schemaVersion: 1, - id: "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023-274b3c60e7da", - artifactBundle: { - generatedAt: "2026-07-31T15:47:46Z", - sourceArchiveSha256: - "6bf71096477ef11393c98faa5dca0b89a18978c7d59e9f0ce69caf35117ac4d8", - clusterManifestSha256: - "2e650017d311678ac427d671e5289a0875751eef6829f9239d8eb0e25b821030", - deploymentChecksum: - "274b3c60e7da564a644d7d30dcd07e4dbe4b66186b6188156a67b25278455509", - snapshotChecksum: - "95bde008eb560dd173c410e1010a885c9660e3dd2399d554c97210d0caa7ef6a", - platformRelease: { - tag: "v1.0.0", - url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - manifest: { - repository: "Wire-Network/wire-platform-manifest", - revision: "78ed083740e62a03d9ea873ff0a9a44db23ca195" - }, - libraries: { - repository: "Wire-Network/wire-libraries-ts", - revision: "3cfda4a238e4e8d98bda836e857e6679b85f44fa" - } - }, - sources: { - wireTools: { - repository: "Wire-Network/wire-tools-ts", - revision: "ac4ea7a2783f81d03f13a62ead2fa173cf12094f" - }, - wireSysio: { - repository: "Wire-Network/wire-sysio", - revision: "235501b0ad4612ee842c428182f84cd66ef803fc" - }, - wireEthereum: { - repository: "Wire-Network/wire-ethereum", - revision: "c1ea82b2b3cffacecec35e5c186e82e381f6be67" - }, - wireSolana: { - repository: "Wire-Network/wire-solana", - revision: "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" - } - } - }, - wire: { - chainId: - "365c441604ccfde28b6608c012c4e1c70545a90409ee2a74d8c6bf365ec61023" - }, - ethereum: { - chainId: 31337, - contracts: { - OPP: { - address: "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - artifactSha256: - "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" - }, - OPPInbound: { - address: "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - artifactSha256: - "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" - }, - OperatorRegistry: { - address: "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - artifactSha256: - "d9ce20dce4d4f5b039bdd52df69037c8c289f9a419b420efdac6c02cafbd5607" - }, - ReserveManager: { - address: "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - artifactSha256: - "1df4221be4fc24617d3368877e5962214ae55330362bb644028e56518d12b17f" - } - } - }, - solana: { - genesisHash: "3rVuMvjfU8SGyyfYWsmkhJNHSsrbxaGLLzdwnYZvWadc", - programs: { - liqsolCore: { - address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - artifactSha256: - "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" - } - } - } - }, - { - schemaVersion: 1, - id: "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361", - artifactBundle: { - generatedAt: "2026-08-03T15:21:41Z", - sourceArchiveSha256: - "74f854b94f24830b76fdb749bbb229b4f725f06e67b7d3fcc00cc3b0c4db95ea", - clusterManifestSha256: - "8ee35815b7d23d1eb8ee02fd2e5d7d941c8aa2c96fe55ba20d124c8a94364d19", - deploymentChecksum: - "467ffab13361cb1094dfb5b1ccb29e89f356421bdbed4f4d11c87f29afd977d6", - snapshotChecksum: - "30f6df4c6b02cff393040599507b6894c04e9e7af473d7425b295f1a18e61434", - platformRelease: { - tag: "v1.0.0", - url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - manifest: { - repository: "Wire-Network/wire-platform-manifest", - revision: "4f556be5d7bdba5a23c87e39f91aa2ddace9c2b4" - }, - libraries: { - repository: "Wire-Network/wire-libraries-ts", - revision: "1b8025381a105bf96a95bbdd58a1cfc012f79509" - } - }, - sources: { - wireTools: { - repository: "Wire-Network/wire-tools-ts", - revision: "763dda36c0a05cd2cfcc07191f06d7f04cf43f14" - }, - wireSysio: { - repository: "Wire-Network/wire-sysio", - revision: "7dede884e0150d36fa788e85a119e10653ade8ca" - }, - wireEthereum: { - repository: "Wire-Network/wire-ethereum", - revision: "d892c9458ad666adbccca913863ddf4e5e3d37a4" - }, - wireSolana: { - repository: "Wire-Network/wire-solana", - revision: "a9fe169f9c8b536d4f8184c18c2ca66b44592e29" - } - } - }, - wire: { - chainId: - "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96" - }, - ethereum: { - chainId: 31337, - contracts: { - OPP: { - address: "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", - artifactSha256: - "5fa0298b0d6ed2e966dd2856ec563de1517b81483913e5b9b26d2c6d6a032b2d" - }, - OPPInbound: { - address: "0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d", - artifactSha256: - "00011fd6bbdb87b3e5dcd1a5e1ef2a993a0635d3054303e8e95848783cc15963" - }, - OperatorRegistry: { - address: "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb", - artifactSha256: - "2caf33014eb645412eee872c2868faa3cd5543a07b14b931e3c14018da03b34d" - }, - ReserveManager: { - address: "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - artifactSha256: - "42d640e0fae007112c8b920b80901e43dcd4e1896ed670a8331f2ba1bc41a29e" - } - } - }, - solana: { - genesisHash: "6sk74BT2qUhnAVQ2fBH87Yyh3kLyZmVJkQDWCfjS5v6a", - programs: { - liqsolCore: { - address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - artifactSha256: - "76f09f63be1f858dad6ba92754a568b996179d438ad651a258dc0adcf07cce41" - } - } - } - } -] - -/** Deployment whose ABI and IDL surfaces own the generated client types. */ -export const CurrentOutpostDeploymentId = - "ca8d3a9de01ad03daacdfb586b0da40b14a1b06834a70d2be5189378c90fdf96-467ffab13361" diff --git a/packages/sdk-outpost/src/deployments/index.ts b/packages/sdk-outpost/src/deployments/index.ts index f087137..29919be 100644 --- a/packages/sdk-outpost/src/deployments/index.ts +++ b/packages/sdk-outpost/src/deployments/index.ts @@ -1,3 +1,2 @@ -export * from "./Registry.js" export * from "./Schema.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts index c238b58..7d66b3f 100644 --- a/packages/sdk-outpost/src/index.ts +++ b/packages/sdk-outpost/src/index.ts @@ -1,4 +1,5 @@ export * from "./clients/index.js" +export * from "./artifacts/index.js" export * from "./contracts/index.js" export * from "./deployments/index.js" export * from "./programs/index.js" diff --git a/packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts b/packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts deleted file mode 100644 index 55b81cc..0000000 --- a/packages/sdk-outpost/src/programs/solana/generated/LiqsolCore.ts +++ /dev/null @@ -1,8509 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* eslint-disable */ -import type { Idl } from "@coral-xyz/anchor" - -const liqsolCoreIdlValue = { - address: "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - metadata: { - name: "liqsolCore", - version: "0.1.0", - spec: "0.1.0", - description: "Created with Anchor" - }, - instructions: [ - { - name: "addAttestation", - discriminator: [206, 82, 129, 170, 54, 159, 161, 156], - accounts: [ - { - name: "authority", - signer: true - }, - { - name: "config" - }, - { - name: "outboundMessageBuffer", - writable: true - } - ], - args: [ - { - name: "attestationType", - type: "i32" - }, - { - name: "data", - type: "bytes" - } - ] - }, - { - name: "addTopPerformersBatch", - docs: [ - "Process batch of ranks for addition (top performers from leaderboard)" - ], - discriminator: [152, 7, 241, 69, 197, 73, 32, 12], - accounts: [ - { - name: "allocationState", - writable: true - }, - { - name: "activeList", - writable: true - }, - { - name: "graveyardList", - writable: true - }, - { - name: "leaderboardState" - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for threshold parameters"] - }, - { - name: "authority", - signer: true - } - ], - args: [] - }, - { - name: "adminForceUnbondRole", - discriminator: [80, 107, 27, 49, 126, 25, 31, 238], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState" - }, - { - name: "user", - docs: ["The user whose role bond is being force-unbonded"] - }, - { - name: "outpostAccount", - writable: true - } - ], - args: [ - { - name: "role", - type: { - defined: { - name: "role" - } - } - } - ] - }, - { - name: "aggregateStakeMetrics", - docs: [ - "V2: Aggregate stake metrics across all validators using PDA architecture" - ], - discriminator: [13, 245, 47, 202, 170, 73, 98, 207], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "stakeMetrics", - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "activeList" - } - ], - args: [] - }, - { - name: "bondRole", - discriminator: [143, 136, 20, 230, 136, 103, 107, 167], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "globalState" - }, - { - name: "outpostAccount", - writable: true - } - ], - args: [ - { - name: "role", - type: { - defined: { - name: "role" - } - } - } - ] - }, - { - name: "calculateUnstakeAllocations", - docs: [ - "Calculate unstake allocations across validators (batched, up to 10 per call)", - "Distributes the FROZEN processing amount proportionally based on active stake", - "Call this after accumulating requests via accumulate_unstake_request" - ], - discriminator: [156, 232, 48, 116, 107, 60, 136, 140], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeAllocationState", - docs: [ - "Stake allocation state - to track unstake allocation batching" - ], - writable: true - }, - { - name: "stakeMetrics", - docs: [ - "Stake metrics - to validate total unstake amount is available" - ] - }, - { - name: "activeList", - docs: [ - "Active validator list - to verify validators are in active list" - ] - }, - { - name: "maintenanceLedger", - docs: ["Maintenance ledger - to track last unstake allocation epoch"], - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - } - ], - args: [] - }, - { - name: "calculateValidatorAllocations", - discriminator: [48, 217, 8, 168, 228, 221, 140, 112], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeAllocationState", - docs: ["Stake allocation state - to track rebalancing progress"], - writable: true - }, - { - name: "stakeMetrics", - docs: ["Stake metrics - to get current total active stake"] - }, - { - name: "activeList", - docs: [ - "Active validator list - to verify validators are in active list" - ] - }, - { - name: "reservePool", - docs: ["Reserve pool - to read current balance"], - writable: true - }, - { - name: "maintenanceLedger", - docs: ["Maintenance ledger - to track last rebalance epoch"], - writable: true - }, - { - name: "clock" - }, - { - name: "global", - docs: [ - "Global withdraw operator state - to read total_encumbered_funds" - ] - }, - { - name: "globalConfig", - docs: ["Global config for rebalancing thresholds"] - } - ], - args: [] - }, - { - name: "cancelCreateReserve", - discriminator: [218, 158, 127, 156, 61, 162, 19, 255], - accounts: [ - { - name: "creator", - writable: true, - signer: true - }, - { - name: "config" - }, - { - name: "reserve" - }, - { - name: "outboundMessageBuffer", - writable: true - } - ], - args: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "reserveCode", - type: "u64" - } - ] - }, - { - name: "claimRewards", - discriminator: [4, 144, 132, 71, 116, 23, 151, 80], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "userAta", - writable: true - }, - { - name: "userRecord", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "liqsolMint" - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - docs: ["The bucket's associated token account holding liqSOL"], - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "claimWithdraw", - docs: [ - "Pay user (stub) and close/burn the receipt via CPI to nft_factory." - ], - discriminator: [232, 89, 154, 117, 16, 204, 182, 224], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "global", - docs: ["Global operator state"], - writable: true - }, - { - name: "mintAuthority" - }, - { - name: "receiptData", - writable: true - }, - { - name: "mintAccount", - writable: true - }, - { - name: "ownerAta", - writable: true - }, - { - name: "reservePool", - writable: true - }, - { - name: "vault" - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "globalConfig", - docs: ["Global config for claim_withdrawals_enabled check"] - }, - { - name: "tokenProgram" - }, - { - name: "stakeProgram" - }, - { - name: "systemProgram" - }, - { - name: "associatedTokenProgram" - } - ], - args: [] - }, - { - name: "cleanupEnvelopeChunks", - discriminator: [224, 118, 156, 99, 9, 136, 14, 207], - accounts: [ - { - name: "reaper", - signer: true - }, - { - name: "config" - }, - { - name: "latestOutboundEnvelope" - }, - { - name: "chunkBuffer", - writable: true - }, - { - name: "uploader", - writable: true - } - ], - args: [ - { - name: "epochIndex", - type: "u32" - } - ] - }, - { - name: "cleanupGraveyardBatch", - docs: [ - "Cleanup graveyard validators batch: remove validators that have been NotDelegated for > 10 epochs", - "This function should be called after aggregate_stake_metrics.", - "Validators meeting the cleanup criteria will have their PDAs closed and rent returned to admin." - ], - discriminator: [241, 120, 180, 4, 160, 109, 206, 71], - accounts: [ - { - name: "graveyardList", - writable: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "globalConfig" - }, - { - name: "clock" - }, - { - name: "cranky", - writable: true, - signer: true - } - ], - args: [] - }, - { - name: "commitUnderwrite", - discriminator: [88, 172, 141, 118, 9, 74, 188, 117], - accounts: [ - { - name: "underwriter", - writable: true, - signer: true - }, - { - name: "operatorRegistry" - }, - { - name: "outboundMessageBuffer", - writable: true - } - ], - args: [ - { - name: "uicBytes", - type: "bytes" - } - ] - }, - { - name: "completeUnbondRole", - discriminator: [204, 50, 36, 17, 192, 156, 246, 64], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState" - }, - { - name: "user", - docs: ["The user whose unbond is being completed"] - }, - { - name: "outpostAccount", - writable: true - } - ], - args: [ - { - name: "role", - type: { - defined: { - name: "role" - } - } - } - ] - }, - { - name: "completeWithdraw", - discriminator: [172, 129, 141, 17, 95, 253, 251, 98], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "user", - writable: true - }, - { - name: "outpostAccount", - writable: true - }, - { - name: "liqsolMint", - writable: true - }, - { - name: "poolAuthority" - }, - { - name: "pretokenPurchaseHistory", - writable: true - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "senderUserRecord", - writable: true - }, - { - name: "receiverUserRecord", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "liqsolPoolAta", - writable: true - }, - { - name: "userAta", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "userKey", - type: "pubkey" - }, - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "concludeMergeActivating", - docs: [ - "Conclude merge activating - marks merge complete if all validators processed or 0 validators" - ], - discriminator: [207, 32, 222, 98, 243, 188, 38, 67], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "processingState", - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "activeList" - }, - { - name: "graveyardList" - }, - { - name: "clock" - } - ], - args: [] - }, - { - name: "concludeMergeDeactivating", - docs: [ - "Conclude merge deactivating - marks merge complete if all validators processed or 0 validators" - ], - discriminator: [66, 206, 43, 71, 122, 97, 33, 24], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "processingState", - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "withdrawGlobal", - writable: true - }, - { - name: "activeList" - }, - { - name: "graveyardList" - }, - { - name: "clock" - } - ], - args: [] - }, - { - name: "concludeSyncStakes", - docs: [ - "Conclude sync stakes - marks sync complete if all validators processed or 0 validators" - ], - discriminator: [77, 127, 231, 78, 151, 23, 237, 207], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "processingState", - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "activeList" - }, - { - name: "graveyardList" - }, - { - name: "clock" - } - ], - args: [] - }, - { - name: "createReserve", - discriminator: [26, 161, 211, 19, 90, 218, 112, 235], - accounts: [ - { - name: "creator", - writable: true, - signer: true - }, - { - name: "config" - }, - { - name: "reserve", - writable: true - }, - { - name: "reserveVault", - writable: true - }, - { - name: "mint" - }, - { - name: "creatorAta", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "reserveCode", - type: "u64" - }, - { - name: "externalTokenAmount", - type: "u64" - }, - { - name: "requestedWireAmount", - type: "u64" - }, - { - name: "connectorWeightBps", - type: "u32" - }, - { - name: "name", - type: "string" - }, - { - name: "description", - type: "string" - }, - { - name: "isPrivate", - type: "bool" - } - ] - }, - { - name: "createReserveNative", - discriminator: [124, 173, 189, 251, 64, 230, 215, 6], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "authority", - signer: true - }, - { - name: "config" - }, - { - name: "reserve", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "reserveCode", - type: "u64" - }, - { - name: "externalTokenAmount", - type: "u64" - }, - { - name: "requestedWireAmount", - type: "u64" - }, - { - name: "connectorWeightBps", - type: "u32" - }, - { - name: "name", - type: "string" - }, - { - name: "description", - type: "string" - } - ] - }, - { - name: "createReserveSplAuthority", - discriminator: [168, 158, 192, 109, 179, 81, 156, 173], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "authority", - signer: true - }, - { - name: "config" - }, - { - name: "reserve", - writable: true - }, - { - name: "reserveVault", - writable: true - }, - { - name: "mint" - }, - { - name: "authorityAta", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "reserveCode", - type: "u64" - }, - { - name: "externalTokenAmount", - type: "u64" - }, - { - name: "requestedWireAmount", - type: "u64" - }, - { - name: "connectorWeightBps", - type: "u32" - }, - { - name: "name", - type: "string" - }, - { - name: "description", - type: "string" - } - ] - }, - { - name: "deposit", - discriminator: [242, 35, 198, 137, 82, 225, 242, 182], - accounts: [ - { - name: "depositor", - writable: true, - signer: true - }, - { - name: "config" - }, - { - name: "operatorRegistry", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "vault", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "operatorType", - type: "u32" - }, - { - name: "tokenCode", - type: "u64" - }, - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "depositNonNative", - discriminator: [75, 182, 44, 132, 167, 101, 31, 138], - accounts: [ - { - name: "depositor", - writable: true, - signer: true - }, - { - name: "config" - }, - { - name: "operatorRegistry", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "mint" - }, - { - name: "depositorAta", - writable: true - }, - { - name: "collateralVault", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [ - { - name: "chainCode", - type: "u64" - }, - { - name: "tokenCode", - type: "u64" - }, - { - name: "reserveCode", - type: "u64" - }, - { - name: "operatorType", - type: "u32" - }, - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "depositToReserve", - discriminator: [8, 79, 123, 129, 146, 140, 178, 128], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "depositor", - writable: true, - signer: true - }, - { - name: "reservePool", - writable: true - }, - { - name: "vault" - }, - { - name: "ephemeralStake", - writable: true - }, - { - name: "controllerState" - }, - { - name: "stakeProgram" - }, - { - name: "systemProgram" - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "rent" - } - ], - args: [ - { - name: "amount", - type: "u64" - }, - { - name: "seed", - type: "u32" - } - ] - }, - { - name: "desynd", - discriminator: [12, 71, 102, 46, 8, 179, 29, 190], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "liqsolMint", - writable: true - }, - { - name: "globalState", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "userAta", - writable: true - }, - { - name: "poolAuthority" - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "senderUserRecord", - writable: true - }, - { - name: "receiverUserRecord", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "liqsolPoolAta", - writable: true - }, - { - name: "outpostAccount", - docs: ["User's outpost account"], - writable: true - }, - { - name: "pretokenPurchaseHistory", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "associatedTokenProgram" - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "discardEnvelopeChunks", - discriminator: [180, 10, 216, 16, 101, 165, 10, 70], - accounts: [ - { - name: "uploader", - docs: [ - "The operator that uploaded (and rent-paid) the buffer. Authorization is", - "structural: the buffer PDA's third seed is this signer's key, so the", - "account constraint can only ever resolve the signer's OWN buffer —", - "no other operator's in-flight upload is reachable from here." - ], - writable: true, - signer: true - }, - { - name: "chunkBuffer", - writable: true - } - ], - args: [ - { - name: "epochIndex", - type: "u32" - } - ] - }, - { - name: "emitOutboundEnvelope", - discriminator: [142, 109, 163, 152, 3, 80, 224, 157], - accounts: [ - { - name: "authority", - docs: [ - "The outpost authority. The standalone emit is a recovery escape hatch", - "only — an open signer here could advance the outbound chain tip to a", - "digest the depot never accepted, so it is gated exactly like the other", - "admin instructions. Even the authority is bound by the guards in", - "`emit_outbound_inner`: the emitted epoch must be exactly the next", - "outbound slot AND already accepted by the inbound cursor, so a", - "recovery emit can only fill an accepted-but-unemitted gap and can", - "never preempt a pending epoch's consensus-triggered emit." - ], - writable: true, - signer: true - }, - { - name: "config", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "outboundEnvelopes", - writable: true - }, - { - name: "latestOutboundEnvelope", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "wireEpochIndex", - type: "u32" - } - ] - }, - { - name: "epochIn", - discriminator: [85, 70, 55, 132, 50, 198, 135, 115], - accounts: [ - { - name: "operator", - writable: true, - signer: true - }, - { - name: "config", - writable: true - }, - { - name: "operatorRegistry", - writable: true - }, - { - name: "epochDeliveries", - writable: true - }, - { - name: "chunkBuffer", - writable: true - }, - { - name: "inboundEnvelopes", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "outboundEnvelopes", - writable: true - }, - { - name: "latestOutboundEnvelope", - writable: true - }, - { - name: "vault", - writable: true - }, - { - name: "reserveAggregate", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "epochIndex", - type: "u32" - }, - { - name: "chunkIndex", - type: "u16" - }, - { - name: "totalChunks", - type: "u16" - }, - { - name: "totalBytes", - type: "u32" - }, - { - name: "chunkData", - type: "bytes" - } - ] - }, - { - name: "finalizeOutpostAccount", - discriminator: [181, 14, 39, 201, 210, 148, 241, 187], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "poolAuthority" - }, - { - name: "outpostAccount", - writable: true - }, - { - name: "pretokenPurchaseHistory" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "getMinMaxResolvedEpochDeactivations", - docs: [ - "Get minimum max_resolved_epoch_deactivations from MaintenanceLedger", - "This is designed to be called via CPI from other programs" - ], - discriminator: [171, 169, 39, 207, 181, 67, 86, 73], - accounts: [ - { - name: "epochState" - } - ], - args: [], - returns: "u16" - }, - { - name: "hasRole", - discriminator: [218, 136, 44, 87, 142, 247, 141, 195], - accounts: [ - { - name: "user", - docs: ["User whose role status is being checked."] - }, - { - name: "outpostAccount" - }, - { - name: "globalState" - } - ], - args: [ - { - name: "role", - type: { - defined: { - name: "role" - } - } - } - ], - returns: "bool" - }, - { - name: "initBucket", - docs: ["Done///"], - discriminator: [237, 69, 61, 218, 18, 60, 21, 236], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "liqsolMint" - }, - { - name: "systemProgram" - }, - { - name: "tokenProgram" - }, - { - name: "associatedTokenProgram" - } - ], - args: [] - }, - { - name: "initReserve", - discriminator: [138, 245, 71, 225, 153, 4, 3, 43], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "authority", - signer: true - }, - { - name: "config" - }, - { - name: "reserveAggregate", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initTrancheState", - discriminator: [87, 134, 47, 11, 241, 14, 118, 201], - accounts: [ - { - name: "authority", - writable: true, - signer: true - }, - { - name: "trancheState", - writable: true - }, - { - name: "chainlinkFeed" - }, - { - name: "chainlinkProgram" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initWireConfig", - discriminator: [109, 159, 158, 174, 192, 150, 14, 34], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalState", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initialize", - discriminator: [175, 175, 109, 31, 13, 152, 155, 237], - accounts: [ - { - name: "authority", - writable: true, - signer: true - }, - { - name: "liqsolMint" - }, - { - name: "distributionState", - writable: true - }, - { - name: "bucketAuthority" - }, - { - name: "poolAuthority" - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [] - }, - { - name: "initializeActiveList", - docs: ["Initialize the active validator list (zero-copy)"], - discriminator: [222, 123, 57, 119, 223, 4, 150, 36], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "activeList", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeEpochState", - docs: ["Done///"], - discriminator: [139, 122, 53, 254, 85, 205, 138, 245], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "epochState", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeGlobalConfig", - discriminator: [113, 216, 122, 131, 225, 209, 22, 55], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "payer", - writable: true, - signer: true - }, - { - name: "program" - }, - { - name: "programData" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeGraveyardList", - docs: ["Initialize the graveyard validator list (zero-copy)"], - discriminator: [178, 8, 179, 111, 75, 19, 130, 176], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "graveyardList", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeOutpost", - discriminator: [9, 54, 169, 104, 32, 218, 81, 11], - accounts: [ - { - name: "authority", - writable: true, - signer: true - }, - { - name: "config", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "operatorRegistry", - writable: true - }, - { - name: "inboundEnvelopes", - writable: true - }, - { - name: "outboundEnvelopes", - writable: true - }, - { - name: "latestOutboundEnvelope", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "chainCode", - type: "u64" - } - ] - }, - { - name: "initializePayRateHistory", - docs: ["Done///"], - discriminator: [157, 190, 74, 135, 91, 232, 250, 122], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "payRateHistory", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializePayoutState", - docs: ["Done///"], - discriminator: [105, 120, 7, 121, 238, 221, 62, 160], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "payoutState", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializePretokenPurchaseHistory", - docs: ["Admin-only: initialize PretokenPurchaseHistory PDA for a pool"], - discriminator: [140, 166, 196, 128, 189, 240, 159, 1], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalConfig" - }, - { - name: "pretokenPurchaseHistory", - writable: true - }, - { - name: "poolAuthority" - }, - { - name: "globalState", - writable: true - }, - { - name: "poolPretokenRecord", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeProcessingState", - docs: ["Done///"], - discriminator: [228, 202, 164, 194, 29, 134, 125, 242], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "processingState", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeReservePool", - docs: ["Done///"], - discriminator: [4, 7, 171, 131, 156, 172, 150, 220], - accounts: [ - { - name: "reservePool", - writable: true - }, - { - name: "vault" - }, - { - name: "payer", - writable: true, - signer: true - }, - { - name: "controllerState", - writable: true - }, - { - name: "stakeProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [] - }, - { - name: "initializeStakeAllocationState", - discriminator: [159, 99, 175, 136, 251, 241, 88, 82], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeAllocationState", - writable: true - }, - { - name: "clock" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeStakeControllerState", - docs: ["Done///"], - discriminator: [220, 247, 13, 165, 202, 250, 102, 197], - accounts: [ - { - name: "controllerState", - writable: true - }, - { - name: "payer", - writable: true, - signer: true - }, - { - name: "authority", - signer: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeStakeMetrics", - docs: ["Done///"], - discriminator: [203, 209, 129, 123, 12, 17, 20, 175], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeMetrics", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeVault", - docs: ["Done///"], - discriminator: [48, 191, 163, 44, 71, 129, 63, 164], - accounts: [ - { - name: "vault", - writable: true - }, - { - name: "payer", - writable: true, - signer: true - }, - { - name: "controllerState", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "initializeWithdrawGlobal", - discriminator: [110, 0, 210, 101, 59, 75, 224, 158], - accounts: [ - { - name: "authority", - writable: true, - signer: true - }, - { - name: "liqsolMint", - docs: ["liqSOL Token-2022 mint"] - }, - { - name: "global", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [] - }, - { - name: "initializeWithdrawMetadata", - discriminator: [0, 170, 135, 3, 35, 58, 213, 75], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "metadata", - writable: true - }, - { - name: "globalConfig" - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "args", - type: { - defined: { - name: "metadataArgs" - } - } - } - ] - }, - { - name: "mergeActivatingStakes", - docs: [ - "V2: Merge activating transient stakes using PDA architecture", - "Returns the number of epochs successfully merged" - ], - discriminator: [181, 183, 76, 92, 57, 11, 212, 189], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "vault", - writable: true - }, - { - name: "treasury", - docs: [ - "(treasury funded it at creation), closing the rent loop within the protocol." - ], - writable: true - }, - { - name: "activeList", - docs: ["Active validators list (zero-copy)"] - }, - { - name: "graveyardList", - docs: [ - "Graveyard validators list (zero-copy) - needed to check validators in cooldown" - ] - }, - { - name: "validatorInfo", - docs: ["Validator info PDA for the validator being processed"], - writable: true - }, - { - name: "validatorTransient", - docs: [ - "Validator transient tracking PDA for the validator being processed" - ], - writable: true - }, - { - name: "stakeProgram" - }, - { - name: "systemProgram" - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "rent" - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - } - ], - args: [ - { - name: "voteAccount", - type: "pubkey" - } - ], - returns: "u16" - }, - { - name: "mergeDeactivatedStakes", - docs: ["V2: Merge fully deactivated stakes back to reserve"], - discriminator: [160, 255, 180, 104, 216, 98, 248, 73], - accounts: [ - { - name: "globalConfig" - }, - { - name: "cranky", - signer: true - }, - { - name: "vault", - writable: true - }, - { - name: "activeList", - docs: ["Active validators list (zero-copy)"] - }, - { - name: "graveyardList", - docs: [ - "Graveyard validators list (zero-copy) - needed to check validators in cooldown" - ] - }, - { - name: "validatorInfo", - docs: ["Validator info PDA for the validator being processed"], - writable: true - }, - { - name: "validatorTransient", - docs: [ - "Validator transient tracking PDA for the validator being processed" - ], - writable: true - }, - { - name: "withdrawGlobal", - writable: true - }, - { - name: "stakeProgram" - }, - { - name: "systemProgram" - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "rent" - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "reservePool", - docs: [ - "(principal stays). The merged-in rent is then withdrawn to treasury." - ], - writable: true - }, - { - name: "treasury", - docs: [ - "back from reserve, closing the rent loop (treasury funded it at creation)." - ], - writable: true - } - ], - args: [ - { - name: "voteAccount", - type: "pubkey" - } - ] - }, - { - name: "migrateBatchOrchestrator", - docs: [ - "One-shot migration: realloc BatchOrchestrator for the four per-op", - "`*_started_epoch: u16` fields + restored `_reserved` buffer.", - "Idempotent, ungated. `payer` covers the rent delta." - ], - discriminator: [130, 240, 40, 175, 53, 209, 232, 11], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "batchOrchestrator", - docs: ["is the only authorization needed; the op is idempotent."], - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "migrateBatchOrchestratorV16", - docs: [ - "One-shot migration: stamp BatchOrchestrator's v1.6.0 epoch pins", - "(unstake_started_epoch + cursors_epoch) to the current epoch so a", - "mid-epoch upgrade doesn't wipe live cursors. Admin-gated, idempotent", - "within an epoch; refuses re-runs after an epoch boundary (a late", - "re-stamp would bless dead cursors as live)." - ], - discriminator: [124, 12, 96, 155, 218, 4, 229, 56], - accounts: [ - { - name: "globalConfig" - }, - { - name: "admin", - writable: true, - signer: true - }, - { - name: "batchOrchestrator", - writable: true - } - ], - args: [] - }, - { - name: "migrateStakeAllocationState", - docs: [ - "One-shot migration: explicitly zero StakeAllocationState.rebalance_started_epoch", - "(repurposed from the deprecated addition_target_rank slot). Admin-gated, idempotent." - ], - discriminator: [40, 175, 21, 85, 88, 249, 223, 73], - accounts: [ - { - name: "globalConfig" - }, - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeAllocationState", - writable: true - } - ], - args: [] - }, - { - name: "migrateStakeMetrics", - docs: [ - "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)" - ], - discriminator: [183, 154, 168, 221, 78, 179, 112, 165], - accounts: [ - { - name: "globalConfig" - }, - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeMetrics", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "migrateUserRecord", - discriminator: [6, 118, 249, 178, 209, 106, 197, 25], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalConfig" - }, - { - name: "userAta" - }, - { - name: "userRecord", - writable: true - }, - { - name: "distributionState" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "migrateValidatorInfoBatch", - docs: [ - "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)", - "Pass validator_info PDAs via remaining_accounts" - ], - discriminator: [250, 77, 53, 116, 38, 22, 12, 100], - accounts: [ - { - name: "globalConfig" - }, - { - name: "admin", - writable: true, - signer: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "processGraveyardValidatorsBatch", - docs: [ - "Process graveyard validators batch: check transient resolution, queue main stake deactivation", - "Validators in graveyard with resolved transients will have their main stake queued for deactivation" - ], - discriminator: [141, 178, 8, 118, 133, 183, 86, 233], - accounts: [ - { - name: "graveyardList", - writable: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - }, - { - name: "clock" - }, - { - name: "authority", - signer: true - } - ], - args: [] - }, - { - name: "processPayCycle", - docs: ["Done///"], - discriminator: [98, 183, 240, 247, 39, 248, 198, 224], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "stakeMetrics", - writable: true - }, - { - name: "payoutState", - writable: true - }, - { - name: "payRateHistory", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "liqsolMint", - writable: true - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "stakeControllerAuthority", - writable: true - }, - { - name: "mintAuthority" - }, - { - name: "liqsolProgram" - }, - { - name: "tokenProgram" - }, - { - name: "instructions" - }, - { - name: "globalConfig", - docs: ["Global config for process_pay_cycle_enabled check"] - } - ], - args: [] - }, - { - name: "processStakeOrders", - docs: [ - "V2: Process stake orders using PDA architecture with pre-calculated allocations", - "Validators must be sent contiguously from the active list starting at validators_processed_this_epoch" - ], - discriminator: [92, 161, 223, 219, 54, 232, 40, 16], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "reservePool", - writable: true - }, - { - name: "treasury", - docs: [ - "(system transfer, treasury signs). Falls back to admin only if treasury is dry." - ], - writable: true - }, - { - name: "vault" - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "activeList", - docs: ["Active validator list - used to get total validator count"] - }, - { - name: "stakeAllocationState", - docs: [ - "Stake allocation state - to verify allocations have been calculated for current epoch" - ], - writable: true - }, - { - name: "stakeProgram" - }, - { - name: "systemProgram" - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "stakeConfig" - }, - { - name: "rent" - }, - { - name: "globalConfig", - docs: ["Global config for process_stake_orders_enabled check"] - } - ], - args: [ - { - name: "callerFundsRent", - type: "bool" - } - ] - }, - { - name: "processTransferHook", - discriminator: [167, 45, 151, 64, 209, 186, 192, 78], - accounts: [ - { - name: "sourceToken" - }, - { - name: "destinationToken" - }, - { - name: "senderUserRecord", - writable: true - }, - { - name: "receiverUserRecord", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "bucketTokenAccount" - } - ], - args: [ - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "processUnstakeOrders", - docs: [ - "V2: Process unstake orders by splitting and deactivating stakes", - "Validators must be sent contiguously: first from active list, then graveyard list" - ], - discriminator: [44, 122, 251, 185, 253, 193, 250, 191], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "vault", - writable: true - }, - { - name: "treasury", - docs: [ - "here (system transfer, treasury signs). Falls back to admin only if dry.", - "Reserve no longer sources rent, so it's not needed by this instruction." - ], - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "activeList", - docs: ["Active validator list - used to get total validator count"] - }, - { - name: "graveyardList", - docs: [ - "Graveyard validator list - allows unstaking from graveyard validators" - ] - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "stakeConfig" - }, - { - name: "rent" - }, - { - name: "systemProgram" - }, - { - name: "stakeProgram" - }, - { - name: "globalConfig", - docs: ["Global config for process_unstake_orders_enabled check"] - } - ], - args: [ - { - name: "callerFundsRent", - type: "bool" - } - ] - }, - { - name: "purchase", - discriminator: [21, 93, 113, 154, 193, 160, 242, 168], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "liqsolMint", - writable: true - }, - { - name: "globalState", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "buyerAta", - writable: true - }, - { - name: "poolAuthority" - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "senderUserRecord", - writable: true - }, - { - name: "receiverUserRecord", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "liqsolPoolAta", - writable: true - }, - { - name: "outpostAccount", - docs: ["User's pretoken deposit record"], - writable: true - }, - { - name: "trancheState", - writable: true - }, - { - name: "userPretokenRecord", - writable: true - }, - { - name: "chainlinkFeed" - }, - { - name: "chainlinkProgram" - }, - { - name: "tokenProgram" - }, - { - name: "associatedTokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "pretokenPurchaseHistory", - writable: true - } - ], - args: [ - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "purchaseFromYield", - discriminator: [232, 143, 47, 77, 246, 113, 31, 202], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "globalState", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "liqsolMint" - }, - { - name: "poolAuthority", - docs: ["Pool authority PDA"] - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "liqsolPoolAta", - docs: [ - "Pool's liqSOL ATA - deterministically derived from pool_authority + liqsol_mint" - ], - writable: true - }, - { - name: "liqsolPoolUserRecord", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "tokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "trancheState", - writable: true - }, - { - name: "poolPretokenRecord", - writable: true - }, - { - name: "chainlinkFeed" - }, - { - name: "chainlinkProgram" - }, - { - name: "pretokenPurchaseHistory", - writable: true - } - ], - args: [] - }, - { - name: "recordPrice", - discriminator: [210, 113, 46, 101, 107, 218, 83, 51], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "trancheState" - }, - { - name: "priceHistory", - writable: true - }, - { - name: "chainlinkProgram" - }, - { - name: "chainlinkFeed" - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "refreshStakeMetricsPostLateEpoch", - docs: [ - "Refresh stake metrics after all late-epoch operations (ProcessStakeOrders, ProcessUnstakeOrders)", - "Requires Distribution + UnstakeOrder as prerequisites", - "Tracks completion in last_post_late_epoch_stake_metrics_refresh_epoch" - ], - discriminator: [11, 226, 87, 114, 47, 159, 99, 157], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "stakeMetrics", - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "activeList" - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - } - ], - args: [] - }, - { - name: "refreshStakeMetricsPostSync", - docs: [ - "V2: Refresh stake metrics after removal selection + PDA setup", - "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites", - "Tracks completion in last_post_sync_stake_metrics_refresh_epoch" - ], - discriminator: [177, 250, 32, 155, 196, 199, 199, 249], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "stakeMetrics", - writable: true - }, - { - name: "epochState", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "activeList" - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - } - ], - args: [] - }, - { - name: "refund", - discriminator: [2, 96, 183, 251, 63, 208, 46, 46], - accounts: [ - { - name: "associatedTokenProgram" - }, - { - name: "user", - writable: true, - signer: true - }, - { - name: "globalState", - writable: true - }, - { - name: "outpostAccount", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "poolAuthority" - }, - { - name: "liqsolPoolAta", - writable: true - }, - { - name: "refundLiqsolAta", - writable: true - }, - { - name: "liqsolPoolUserRecord", - writable: true - }, - { - name: "userRecord", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "liqsolMint" - }, - { - name: "tokenProgram" - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "pretokenPurchaseHistory", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "registerSystemPda", - discriminator: [110, 93, 36, 156, 179, 69, 54, 210], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalConfig" - }, - { - name: "pdaOwner", - docs: [ - "The PDA whose user record we're creating — must be system-owned (no program data)." - ] - }, - { - name: "pdaAta" - }, - { - name: "userRecord", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - docs: [ - "The bucket's associated token account holding liqSOL (for index sync)" - ], - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "registerUser", - discriminator: [2, 241, 150, 223, 99, 214, 116, 97], - accounts: [ - { - name: "payer", - writable: true, - signer: true - }, - { - name: "userAta" - }, - { - name: "userRecord", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - docs: [ - "The bucket's associated token account holding liqSOL (for index sync)" - ], - writable: true - }, - { - name: "systemProgram" - } - ], - args: [] - }, - { - name: "removeLowPerformersBatch", - docs: ["Process batch of validators for removal (below exit threshold)"], - discriminator: [91, 142, 166, 98, 245, 245, 159, 44], - accounts: [ - { - name: "activeList", - writable: true - }, - { - name: "graveyardList", - writable: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "allocationState" - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - }, - { - name: "authority", - signer: true - } - ], - args: [] - }, - { - name: "requestSwap", - discriminator: [170, 167, 97, 14, 88, 175, 39, 108], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "config" - }, - { - name: "reserve", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "sourceTokenCode", - type: "u64" - }, - { - name: "sourceReserveCode", - type: "u64" - }, - { - name: "sourceAmount", - type: "u64" - }, - { - name: "targetChainCode", - type: "u64" - }, - { - name: "targetTokenCode", - type: "u64" - }, - { - name: "targetReserveCode", - type: "u64" - }, - { - name: "targetRecipient", - type: "bytes" - }, - { - name: "targetAmount", - type: "u64" - }, - { - name: "targetToleranceBps", - type: "u32" - } - ] - }, - { - name: "requestSwapSpl", - discriminator: [119, 83, 153, 185, 164, 202, 45, 38], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "config" - }, - { - name: "reserve", - writable: true - }, - { - name: "reserveVault", - writable: true - }, - { - name: "mint" - }, - { - name: "userAta", - writable: true - }, - { - name: "outboundMessageBuffer", - writable: true - }, - { - name: "tokenProgram" - } - ], - args: [ - { - name: "sourceTokenCode", - type: "u64" - }, - { - name: "sourceReserveCode", - type: "u64" - }, - { - name: "sourceAmount", - type: "u64" - }, - { - name: "targetChainCode", - type: "u64" - }, - { - name: "targetTokenCode", - type: "u64" - }, - { - name: "targetReserveCode", - type: "u64" - }, - { - name: "targetRecipient", - type: "bytes" - }, - { - name: "targetAmount", - type: "u64" - }, - { - name: "targetToleranceBps", - type: "u32" - } - ] - }, - { - name: "requestUnbondRole", - discriminator: [223, 225, 84, 83, 115, 183, 80, 33], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "globalState" - }, - { - name: "outpostAccount", - writable: true - } - ], - args: [ - { - name: "role", - type: { - defined: { - name: "role" - } - } - } - ] - }, - { - name: "requestWithdraw", - discriminator: [137, 95, 187, 96, 250, 138, 31, 182], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "owner", - docs: ["Recipient of the NFT receipt (can be user)"], - writable: true - }, - { - name: "global", - docs: ["Global operator state"], - writable: true - }, - { - name: "liqsolMint", - docs: [ - "liqSOL mint reference (must match Global.liqsol_mint so we can read decimals)" - ], - writable: true - }, - { - name: "userAta", - writable: true - }, - { - name: "userRecord", - writable: true - }, - { - name: "distributionState", - docs: ["Distribution state for index tracking"], - writable: true - }, - { - name: "bucketTokenAccount", - docs: [ - "The bucket's token account holding liqSOL (for sync_index balance)" - ], - writable: true - }, - { - name: "reservePool", - docs: [ - "Reserve pool - to check available balance for instant withdrawals" - ], - writable: true - }, - { - name: "stakeAllocationState", - docs: ["Stake allocation state - for accumulate_unstake_request"], - writable: true - }, - { - name: "stakeMetrics", - docs: ["Stake metrics - for accumulate_unstake_request"] - }, - { - name: "maintenanceLedger", - docs: ["Maintenance ledger - for accumulate_unstake_request"] - }, - { - name: "globalConfig", - docs: ["Global config for min_unstake_request setting"] - }, - { - name: "clock" - }, - { - name: "mintAuthority" - }, - { - name: "receiptData", - writable: true - }, - { - name: "metadata", - writable: true - }, - { - name: "nftMint", - docs: [ - "Uses global.next_receipt_id for deterministic, collision-free address generation" - ], - writable: true - }, - { - name: "nftAta", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "tokenInterface" - }, - { - name: "associatedTokenProgram" - }, - { - name: "systemProgram" - }, - { - name: "rent" - } - ], - args: [ - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "setAdmin", - discriminator: [251, 163, 0, 52, 91, 194, 187, 92], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "admin", - signer: true - }, - { - name: "newAuthority" - } - ], - args: [] - }, - { - name: "setCranky", - discriminator: [232, 48, 178, 74, 194, 60, 143, 164], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "admin", - signer: true - }, - { - name: "newAuthority" - } - ], - args: [] - }, - { - name: "setPaused", - discriminator: [91, 60, 125, 192, 176, 225, 166, 218], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState", - writable: true - } - ], - args: [ - { - name: "paused", - type: "bool" - } - ] - }, - { - name: "setRetentionConfig", - discriminator: [224, 115, 230, 164, 16, 100, 30, 234], - accounts: [ - { - name: "authority", - signer: true - }, - { - name: "config", - writable: true - } - ], - args: [ - { - name: "retentionEpochs", - type: "u32" - } - ] - }, - { - name: "setRolePrincipal", - discriminator: [33, 199, 203, 50, 60, 167, 90, 92], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState", - writable: true - } - ], - args: [ - { - name: "role", - type: { - defined: { - name: "role" - } - } - }, - { - name: "principal", - type: "u64" - } - ] - }, - { - name: "setRoleWarmupDuration", - discriminator: [229, 188, 179, 162, 56, 173, 228, 68], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState", - writable: true - } - ], - args: [ - { - name: "durationSeconds", - type: "i64" - } - ] - }, - { - name: "setTokenAddress", - discriminator: [231, 130, 7, 149, 155, 155, 110, 53], - accounts: [ - { - name: "authority", - signer: true - }, - { - name: "config", - writable: true - } - ], - args: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "mint", - type: "pubkey" - } - ] - }, - { - name: "setTokenPrecision", - discriminator: [202, 218, 56, 157, 228, 15, 175, 107], - accounts: [ - { - name: "authority", - signer: true - }, - { - name: "config", - writable: true - } - ], - args: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "decimals", - type: "u8" - } - ] - }, - { - name: "setWireState", - discriminator: [62, 194, 254, 126, 251, 69, 35, 228], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState", - writable: true - } - ], - args: [ - { - name: "wireState", - type: { - defined: { - name: "wireState" - } - } - } - ] - }, - { - name: "setupValidatorPdasBatch", - discriminator: [115, 37, 9, 246, 144, 224, 178, 79], - accounts: [ - { - name: "authority", - writable: true, - signer: true - }, - { - name: "activeList", - writable: true - }, - { - name: "processingState", - writable: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "allocationState", - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - }, - { - name: "systemProgram", - docs: ["Needed for manual PDA creation"] - } - ], - args: [] - }, - { - name: "slashBond", - discriminator: [143, 246, 51, 243, 88, 198, 217, 48], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "globalConfig" - }, - { - name: "globalState", - writable: true - }, - { - name: "user", - docs: ["The user being slashed"] - }, - { - name: "outpostAccount", - writable: true - } - ], - args: [] - }, - { - name: "solToLiqsol", - discriminator: [250, 110, 1, 100, 71, 3, 235, 113], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "depositAuthority", - writable: true - }, - { - name: "systemProgram" - }, - { - name: "tokenProgram" - }, - { - name: "associatedTokenProgram" - }, - { - name: "liqsolProgram" - }, - { - name: "payRateHistory" - }, - { - name: "stakeProgram" - }, - { - name: "liqsolMint", - writable: true - }, - { - name: "userAta", - writable: true - }, - { - name: "liqsolMintAuthority" - }, - { - name: "reservePool", - writable: true - }, - { - name: "vault" - }, - { - name: "ephemeralStake", - writable: true - }, - { - name: "controllerState", - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for deposit settings"] - }, - { - name: "payoutState", - writable: true - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - docs: ["The bucket's associated token account"], - writable: true - }, - { - name: "userRecord", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "instructionsSysvar" - }, - { - name: "clock" - }, - { - name: "stakeHistory" - }, - { - name: "rent" - } - ], - args: [ - { - name: "amount", - type: "u64" - }, - { - name: "seed", - type: "u32" - } - ] - }, - { - name: "syncActiveScores", - discriminator: [38, 188, 30, 93, 139, 1, 140, 168], - accounts: [ - { - name: "activeList", - writable: true - }, - { - name: "leaderboardState" - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for late epoch slot gate"] - }, - { - name: "authority", - signer: true - } - ], - args: [] - }, - { - name: "syncLeaderboardScoresBatch", - docs: ["region: Validator Leaderboard Syncing"], - discriminator: [52, 11, 210, 173, 90, 5, 48, 50], - accounts: [ - { - name: "leaderboardState" - }, - { - name: "processingState", - writable: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "authority", - signer: true - } - ], - args: [] - }, - { - name: "syncMainStakeAccounts", - docs: [ - "V2: Sync main stake accounts using PDA architecture (batched)", - "Processes validators in batches via remaining_accounts (batch size is enforced client-side)", - "Note: Only syncs primary delegated stakes, not transient stakes" - ], - discriminator: [159, 17, 201, 39, 89, 62, 65, 135], - accounts: [ - { - name: "admin", - signer: true - }, - { - name: "processingState", - docs: ["Processing state for tracking batch progress"], - writable: true - }, - { - name: "epochState", - docs: ["Epoch state to mark completion"], - writable: true - }, - { - name: "activeList", - docs: [ - "Active validator list - to check validator counts and membership" - ] - }, - { - name: "graveyardList", - docs: [ - "Graveyard validator list - graveyard validators also need syncing for merge operations" - ] - }, - { - name: "stakeHistory" - }, - { - name: "vault", - writable: true - }, - { - name: "reservePool", - writable: true - }, - { - name: "stakeProgram" - }, - { - name: "clock" - } - ], - args: [] - }, - { - name: "syncValidatorSelectionThresholds", - docs: [ - "Calculate and store entry/exit thresholds from validator leaderboard" - ], - discriminator: [102, 171, 32, 136, 205, 105, 208, 225], - accounts: [ - { - name: "leaderboardState" - }, - { - name: "allocationState", - writable: true - }, - { - name: "maintenanceLedger", - writable: true - }, - { - name: "globalConfig", - docs: ["Global config for min_vpp_entry and min_vpp_exit"] - }, - { - name: "authority", - signer: true - } - ], - args: [] - }, - { - name: "synd", - discriminator: [153, 175, 231, 40, 44, 65, 175, 172], - accounts: [ - { - name: "user", - writable: true, - signer: true - }, - { - name: "liqsolMint", - writable: true - }, - { - name: "globalState", - writable: true - }, - { - name: "distributionState", - writable: true - }, - { - name: "userAta", - writable: true - }, - { - name: "poolAuthority" - }, - { - name: "bucketAuthority" - }, - { - name: "bucketTokenAccount", - writable: true - }, - { - name: "bucketUserRecord", - writable: true - }, - { - name: "senderUserRecord", - writable: true - }, - { - name: "receiverUserRecord", - writable: true - }, - { - name: "extraAccountMetaList" - }, - { - name: "liqsolCoreProgram" - }, - { - name: "transferHookProgram" - }, - { - name: "liqsolPoolAta", - writable: true - }, - { - name: "outpostAccount", - docs: ["User's pretoken deposit record"], - writable: true - }, - { - name: "pretokenPurchaseHistory", - writable: true - }, - { - name: "tokenProgram" - }, - { - name: "associatedTokenProgram" - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "amount", - type: "u64" - } - ] - }, - { - name: "updateConfigBool", - discriminator: [79, 36, 65, 239, 188, 35, 13, 160], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "admin", - signer: true - } - ], - args: [ - { - name: "key", - type: { - defined: { - name: "configKeyBool" - } - } - }, - { - name: "value", - type: "bool" - } - ] - }, - { - name: "updateConfigU16", - discriminator: [149, 9, 244, 25, 46, 136, 59, 173], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "admin", - signer: true - } - ], - args: [ - { - name: "key", - type: { - defined: { - name: "configKeyU16" - } - } - }, - { - name: "value", - type: "u16" - } - ] - }, - { - name: "updateConfigU64", - discriminator: [120, 43, 124, 106, 97, 80, 208, 123], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "admin", - signer: true - } - ], - args: [ - { - name: "key", - type: { - defined: { - name: "configKeyU64" - } - } - }, - { - name: "value", - type: "u64" - } - ] - }, - { - name: "updateConfigU8", - discriminator: [17, 160, 31, 134, 222, 250, 229, 253], - accounts: [ - { - name: "globalConfig", - writable: true - }, - { - name: "admin", - signer: true - } - ], - args: [ - { - name: "key", - type: { - defined: { - name: "configKeyU8" - } - } - }, - { - name: "value", - type: "u8" - } - ] - }, - { - name: "updateGrowthParameters", - discriminator: [172, 187, 237, 233, 250, 160, 115, 239], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalConfig" - }, - { - name: "trancheState", - writable: true - }, - { - name: "priceHistory", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "supplyGrowthBps", - type: "u16" - }, - { - name: "priceGrowthCents", - type: "u16" - } - ] - }, - { - name: "updatePriceBounds", - discriminator: [241, 116, 141, 65, 61, 95, 232, 28], - accounts: [ - { - name: "admin", - writable: true, - signer: true - }, - { - name: "globalConfig" - }, - { - name: "trancheState", - writable: true - }, - { - name: "priceHistory", - writable: true - }, - { - name: "systemProgram" - } - ], - args: [ - { - name: "minPriceUsd", - type: "u64" - }, - { - name: "maxPriceUsd", - type: "u64" - }, - { - name: "maxStalenessSeconds", - type: "i64" - } - ] - } - ], - accounts: [ - { - name: "batchOrchestrator", - discriminator: [70, 163, 206, 225, 7, 189, 73, 94] - }, - { - name: "distributionState", - discriminator: [7, 25, 94, 15, 208, 170, 4, 103] - }, - { - name: "envelopeChunks", - discriminator: [51, 126, 62, 161, 85, 175, 66, 63] - }, - { - name: "envelopeLog", - discriminator: [73, 107, 128, 29, 76, 210, 155, 113] - }, - { - name: "epochDeliveries", - discriminator: [134, 83, 77, 28, 26, 189, 174, 190] - }, - { - name: "global", - discriminator: [167, 232, 232, 177, 200, 108, 114, 127] - }, - { - name: "globalConfig", - discriminator: [149, 8, 156, 202, 160, 252, 176, 217] - }, - { - name: "globalState", - discriminator: [163, 46, 74, 168, 216, 123, 133, 98] - }, - { - name: "latestOutboundEnvelope", - discriminator: [74, 80, 163, 159, 178, 236, 249, 15] - }, - { - name: "leaderboardState", - discriminator: [211, 181, 29, 120, 189, 4, 106, 111] - }, - { - name: "liqReceiptData", - discriminator: [75, 119, 90, 79, 25, 200, 9, 46] - }, - { - name: "maintenanceLedger", - discriminator: [140, 250, 92, 173, 147, 65, 26, 39] - }, - { - name: "operatorRegistry", - discriminator: [194, 188, 172, 240, 220, 209, 36, 100] - }, - { - name: "outboundMessageBuffer", - discriminator: [133, 145, 100, 61, 28, 106, 209, 197] - }, - { - name: "outpostAccount", - discriminator: [87, 205, 242, 192, 212, 51, 26, 93] - }, - { - name: "outpostConfig", - discriminator: [211, 233, 11, 174, 26, 119, 188, 182] - }, - { - name: "payRateHistory", - discriminator: [139, 8, 65, 111, 71, 41, 187, 218] - }, - { - name: "payoutState", - discriminator: [106, 54, 13, 167, 203, 44, 168, 150] - }, - { - name: "pretokenPurchaseHistory", - discriminator: [33, 71, 113, 206, 33, 180, 236, 131] - }, - { - name: "priceHistory", - discriminator: [38, 241, 40, 19, 42, 228, 93, 152] - }, - { - name: "reserve", - discriminator: [43, 242, 204, 202, 26, 247, 59, 127] - }, - { - name: "reserveAggregate", - discriminator: [46, 66, 28, 2, 223, 209, 19, 45] - }, - { - name: "stakeAllocationState", - discriminator: [23, 238, 120, 198, 156, 165, 151, 119] - }, - { - name: "stakeControllerState", - discriminator: [218, 168, 114, 136, 80, 186, 29, 218] - }, - { - name: "stakeMetrics", - discriminator: [91, 84, 217, 97, 98, 38, 18, 143] - }, - { - name: "tokenMetadata", - discriminator: [237, 215, 132, 182, 24, 127, 175, 173] - }, - { - name: "trancheState", - discriminator: [212, 231, 254, 24, 238, 63, 92, 105] - }, - { - name: "userPretokenRecord", - discriminator: [117, 99, 159, 251, 98, 253, 6, 238] - }, - { - name: "userRecord", - discriminator: [210, 252, 132, 218, 191, 85, 173, 167] - }, - { - name: "validatorInfoAccount", - discriminator: [195, 243, 81, 187, 172, 232, 57, 59] - }, - { - name: "validatorList", - discriminator: [131, 181, 125, 127, 46, 36, 40, 167] - }, - { - name: "validatorTransientAccount", - discriminator: [97, 207, 155, 142, 86, 170, 118, 161] - } - ], - events: [ - { - name: "epochResolved", - discriminator: [62, 81, 212, 223, 209, 104, 51, 65] - }, - { - name: "graveyardDeactivationQueuedEvent", - discriminator: [131, 241, 122, 229, 108, 21, 67, 37] - }, - { - name: "graveyardValidatorCleanedEvent", - discriminator: [3, 252, 58, 228, 135, 135, 104, 34] - }, - { - name: "pretokenPurchased", - discriminator: [39, 1, 143, 191, 8, 14, 80, 41] - }, - { - name: "stakesMerged", - discriminator: [3, 16, 51, 153, 152, 186, 19, 97] - }, - { - name: "validatorAddedEvent", - discriminator: [71, 123, 103, 213, 174, 178, 82, 130] - }, - { - name: "validatorRemovedEvent", - discriminator: [49, 23, 179, 208, 124, 3, 231, 59] - }, - { - name: "validatorSwappedEvent", - discriminator: [33, 50, 10, 35, 69, 113, 96, 180] - }, - { - name: "validatorsSyncedEvent", - discriminator: [119, 121, 49, 120, 230, 132, 109, 214] - }, - { - name: "withdrawClaimed", - discriminator: [77, 130, 89, 38, 239, 172, 174, 85] - }, - { - name: "withdrawRequested", - discriminator: [114, 16, 240, 206, 93, 128, 151, 39] - } - ], - errors: [ - { - code: 6000, - name: "envelopeDecodeFailed", - msg: "Envelope protobuf decode failed" - }, - { - code: 6001, - name: "attestationDecodeFailed", - msg: "Attestation protobuf decode failed" - }, - { - code: 6002, - name: "nonSequentialEpoch", - msg: "Non-sequential epoch index" - }, - { - code: 6003, - name: "epochHashMismatch", - msg: "Previous envelope hash mismatch" - }, - { - code: 6004, - name: "operatorAlreadyDelivered", - msg: "Operator already delivered this epoch" - }, - { - code: 6005, - name: "notActiveOperator", - msg: "Caller is not an active batch operator" - }, - { - code: 6006, - name: "emptyOperatorGroups", - msg: "Operator group list cannot be empty while roster is initialized" - }, - { - code: 6007, - name: "outboundMessageBufferOverflow", - msg: "Outbound message buffer capacity exceeded" - }, - { - code: 6008, - name: "unauthorized", - msg: "Unauthorized caller for attestation" - }, - { - code: 6009, - name: "operatorRegistryFull", - msg: "Operator registry is full; cannot add another operator" - }, - { - code: 6010, - name: "operatorGroupListFull", - msg: "Operator group count exceeds configured maximum" - }, - { - code: 6011, - name: "operatorGroupFull", - msg: "Operator group member count exceeds configured maximum" - }, - { - code: 6012, - name: "invalidSolanaAddressLength", - msg: "Solana address in Operators entry is not 32 bytes" - }, - { - code: 6013, - name: "epochDeliveryListFull", - msg: "Epoch delivery count exceeds configured maximum" - }, - { - code: 6014, - name: "unsupportedAttestationType", - msg: "Attestation type not supported by this outpost" - }, - { - code: 6015, - name: "zeroAmount", - msg: "Amount must be greater than zero" - }, - { - code: 6016, - name: "invalidOperatorType", - msg: "Invalid OperatorType for Solana outpost" - }, - { - code: 6017, - name: "invalidTokenKind", - msg: "Invalid TokenKind for deposit" - }, - { - code: 6018, - name: "invalidWireNameLength", - msg: "WIRE account name exceeds 13 characters" - }, - { - code: 6019, - name: "envelopeTooLarge", - msg: "Envelope data exceeds MAX_ENVELOPE_BYTES" - }, - { - code: 6020, - name: "invalidRetentionConfig", - msg: "Retention config invalid: full_retention_seconds < data_retention_epochs * epoch_duration_seconds" - }, - { - code: 6021, - name: "invalidEpochDuration", - msg: "Epoch duration must be non-zero" - }, - { - code: 6022, - name: "envelopeKindMismatch", - msg: "Envelope kind does not match account type" - }, - { - code: 6023, - name: "envelopeStillInRetention", - msg: "Envelope pruning attempted on record still inside retention window" - }, - { - code: 6024, - name: "invalidChunkCount", - msg: "Chunk count must be in 1..=MAX_CHUNKS" - }, - { - code: 6025, - name: "chunkIndexOutOfRange", - msg: "Chunk index out of range for declared total_chunks" - }, - { - code: 6026, - name: "chunkTooLarge", - msg: "Chunk payload exceeds MAX_CHUNK_BYTES" - }, - { - code: 6027, - name: "chunkSizeMismatch", - msg: "Chunk size does not match the declared envelope shape" - }, - { - code: 6028, - name: "chunkOutOfOrder", - msg: "Chunk arrived out of order; chunks must be submitted sequentially" - }, - { - code: 6029, - name: "chunkBufferEpochMismatch", - msg: "Chunk buffer header locked to a different epoch" - }, - { - code: 6030, - name: "chunkBufferShapeMismatch", - msg: "Chunk buffer header locked to a different total_chunks/total_bytes" - }, - { - code: 6031, - name: "chunkBufferOperatorMismatch", - msg: "Chunk buffer was opened by a different operator" - }, - { - code: 6032, - name: "chunkCleanupNotYetEligible", - msg: "Chunk cleanup is not eligible until the epoch has advanced" - }, - { - code: 6033, - name: "oversizedQueuedMessage", - msg: "A single queued outbound message exceeds MAX_ENVELOPE_BYTES; cannot pack into an envelope" - }, - { - code: 6034, - name: "collateralLedgerOverflow", - msg: "Collateral ledger has reached MAX_COLLATERAL_ENTRIES capacity" - }, - { - code: 6035, - name: "callerNotRegistered", - msg: "Caller is not present in the operator registry" - }, - { - code: 6036, - name: "wrongOperatorType", - msg: "Caller's operator role does not match the action's required role" - }, - { - code: 6037, - name: "operatorNotActive", - msg: "Caller's operator status is not ACTIVE" - }, - { - code: 6038, - name: "reserveNotFound", - msg: "Reserve PDA not found for the supplied (token_code, reserve_code)" - }, - { - code: 6039, - name: "reserveWrongStatus", - msg: "Reserve is not in the status required by the action" - }, - { - code: 6040, - name: "reserveNotCreator", - msg: "Caller does not match the reserve's creator" - }, - { - code: 6041, - name: "tokenCodeNotConfigured", - msg: "Token code is not configured in outpost_config.token_addresses_by_code" - }, - { - code: 6042, - name: "badConnectorWeight", - msg: "Connector weight must be in 1..=10_000 basis points" - }, - { - code: 6043, - name: "reserveNameTooLong", - msg: "Reserve name exceeds RESERVE_NAME_MAX_BYTES" - }, - { - code: 6044, - name: "reserveDescriptionTooLong", - msg: "Reserve description exceeds RESERVE_DESCRIPTION_MAX_BYTES" - }, - { - code: 6045, - name: "tokenAddressesFull", - msg: "Token addresses table is full; cannot register another entry" - }, - { - code: 6046, - name: "zeroReserveAmount", - msg: "Reserve external_token_amount must be greater than zero" - }, - { - code: 6047, - name: "swapUnknownSlugName", - msg: "requestSwap: slug_name parameter is UNKNOWN (zero)" - }, - { - code: 6048, - name: "swapEmptyRecipient", - msg: "requestSwap: target_recipient is empty" - }, - { - code: 6049, - name: "swapZeroSourceAmount", - msg: "requestSwap: source_amount must be > 0" - }, - { - code: 6050, - name: "swapSourceNotNative", - msg: "requestSwap: source token must be native (this pass)" - }, - { - code: 6051, - name: "swapSourceReserveUnavailable", - msg: "requestSwap: source reserve unavailable" - }, - { - code: 6052, - name: "arithmeticOverflow", - msg: "arithmetic overflow during reserve accounting" - }, - { - code: 6053, - name: "swapSourceIsNative", - msg: "requestSwapSpl: source token must be SPL, not native" - }, - { - code: 6054, - name: "swapSplMintMismatch", - msg: "SPL mint does not match outpost_config binding for this token_code" - }, - { - code: 6055, - name: "precisionUnconfigured", - msg: "token precision not configured — call set_token_precision first" - }, - { - code: 6056, - name: "recipientAtaCreationFailed", - msg: "handle_swap_remit: recipient ATA creation failed on-chain" - }, - { - code: 6057, - name: "terminalChunkNotEmpty", - msg: "epoch_in: the terminal finalize call must carry no chunk data" - }, - { - code: 6058, - name: "terminalChunkBeforeDataComplete", - msg: "epoch_in: terminal finalize before every data chunk was uploaded" - }, - { - code: 6059, - name: "envelopeEpochMismatch", - msg: "Decoded envelope epoch does not match the epoch_in instruction epoch" - }, - { - code: 6060, - name: "nonCanonicalPreviousEnvelopeHash", - msg: "previous_envelope_hash is not in canonical form" - }, - { - code: 6061, - name: "reserveCreatorAtaNotCanonical", - msg: "createReserve: creator ATA is not the canonical account for this mint" - }, - { - code: 6062, - name: "emitBeforeEpochAccepted", - msg: "Outbound emit for an epoch the inbound cursor has not accepted" - }, - { - code: 6063, - name: "envelopeWrongDestination", - msg: "envelope destination is not an SVM chain" - }, - { - code: 7000, - name: "destinationAccountDoesNotExist", - msg: "Destination stake account does not exist" - }, - { - code: 7001, - name: "sourceAccountDoesNotExist", - msg: "Source stake account does not exist" - }, - { - code: 7002, - name: "invalidDestinationOwner", - msg: "Destination account not owned by stake program" - }, - { - code: 7003, - name: "invalidSourceOwner", - msg: "Source account not owned by stake program" - }, - { - code: 7004, - name: "clockBorrowFailed", - msg: "Failed to borrow clock data" - }, - { - code: 7005, - name: "clockDeserializeFailed", - msg: "Failed to deserialize clock" - }, - { - code: 7006, - name: "destinationAnalysisFailed", - msg: "Failed to analyze destination stake account" - }, - { - code: 7007, - name: "sourceAnalysisFailed", - msg: "Failed to analyze source stake account" - }, - { - code: 7008, - name: "destinationStillActivating", - msg: "Destination stake is still activating" - }, - { - code: 7009, - name: "destinationDeactivating", - msg: "Destination stake is deactivating" - }, - { - code: 7010, - name: "sourceStillActivating", - msg: "Source stake is still activating" - }, - { - code: 7011, - name: "sourceDeactivating", - msg: "Source stake is deactivating" - }, - { - code: 7012, - name: "destinationBorrowFailed", - msg: "Failed to borrow destination account data" - }, - { - code: 7013, - name: "destinationParseFailed", - msg: "Failed to parse destination stake state" - }, - { - code: 7014, - name: "sourceBorrowFailed", - msg: "Failed to borrow source account data" - }, - { - code: 7015, - name: "sourceParseFailed", - msg: "Failed to parse source stake state" - }, - { - code: 7016, - name: "differentValidators", - msg: "Stakes are delegated to different validators" - }, - { - code: 7017, - name: "differentStakers", - msg: "Stakes have different staker authorities" - }, - { - code: 7018, - name: "differentWithdrawers", - msg: "Stakes have different withdrawer authorities" - }, - { - code: 7019, - name: "authoritiesNotFound", - msg: "Could not extract authorities from accounts" - }, - { - code: 7020, - name: "mergeInstructionFailed", - msg: "Merge instruction failed" - }, - { - code: 7021, - name: "epochRewardsActive", - msg: "Epoch rewards distribution is active - stake operations blocked" - }, - { - code: 7022, - name: "differentCreditsObserved", - msg: "Stakes have different credits_observed - cannot merge until both earn same rewards" - }, - { - code: 7100, - name: "accountBorrowFailed", - msg: "Util Acc borrow Failed" - }, - { - code: 7200, - name: "invalidAuthority", - msg: "Only the configured admin may perform this action" - }, - { - code: 7201, - name: "invalidAccountOwner", - msg: "OutpostAccount does not belong to the signer" - }, - { - code: 7202, - name: "roleNotEnabled", - msg: "Role is not enabled (principal is 0)" - }, - { - code: 7203, - name: "alreadyBondedForRole", - msg: "Already bonded for this role" - }, - { - code: 7204, - name: "notBondedForRole", - msg: "Not bonded for this role" - }, - { - code: 7205, - name: "insufficientStakedLiqsol", - msg: "Insufficient staked liqSOL for bonding" - }, - { - code: 7206, - name: "bondStillInWarmup", - msg: "Bond still in warmup period" - }, - { - code: 7207, - name: "alreadyUnbonding", - msg: "Unbond already requested for this role" - }, - { - code: 7208, - name: "notUnbonding", - msg: "Unbond not requested for this role" - }, - { - code: 7209, - name: "notBonded", - msg: "User has no active bonds" - }, - { - code: 7210, - name: "missingRole", - msg: "Actor does not have required role" - }, - { - code: 7211, - name: "overflow", - msg: "Arithmetic overflow" - }, - { - code: 7212, - name: "underflow", - msg: "Arithmetic underflow" - }, - { - code: 7213, - name: "invalidWarmupDuration", - msg: "Invalid warmup duration" - }, - { - code: 7300, - name: "depositTooSmall", - msg: "Deposit amount is below minimum required" - }, - { - code: 7301, - name: "notInitialized", - msg: "Deposit Router not initialized" - }, - { - code: 7302, - name: "invalidAuthority", - msg: "Invalid authority" - }, - { - code: 7303, - name: "insufficientFunds", - msg: "Insufficient funds" - }, - { - code: 7304, - name: "overflow", - msg: "Arithmetic overflow" - }, - { - code: 7305, - name: "calculationFailure", - msg: "Calculation failure" - }, - { - code: 7306, - name: "nothingToMint", - msg: "Cannot mint zero tokens" - }, - { - code: 7307, - name: "invalidAccount", - msg: "Invalid account provided" - }, - { - code: 7308, - name: "insufficientFundsForStake", - msg: "Insufficient funds remaining after reserving fees to proceed with staking" - }, - { - code: 7309, - name: "unauthorizedProgram", - msg: "Unauthorized program attempting to call this instruction" - }, - { - code: 7310, - name: "depositsDisabled", - msg: "Deposits are currently disabled" - }, - { - code: 7400, - name: "noRewardsToClaim", - msg: "No rewards to claim" - }, - { - code: 7401, - name: "insufficientBalance", - msg: "Insufficient balance" - }, - { - code: 7402, - name: "insufficientFunds", - msg: "Insufficient funds" - }, - { - code: 7403, - name: "unauthorized", - msg: "Unauthorized - caller is not the distribution authority" - }, - { - code: 7404, - name: "invalidMint", - msg: "Invalid mint" - }, - { - code: 7405, - name: "invalidOwner", - msg: "Invalid owner" - }, - { - code: 7406, - name: "invalidBucketAccount", - msg: "Invalid bucket token account" - }, - { - code: 7407, - name: "invalidUserRecord", - msg: "Invalid user record" - }, - { - code: 7408, - name: "invalidWithdrawal", - msg: "Invalid withdrawal - balance increased instead of decreased" - }, - { - code: 7409, - name: "invalidWithdrawalAmount", - msg: "Invalid withdrawal - request must be greater than 0" - }, - { - code: 7410, - name: "invalidProgramId", - msg: "Invalid program ID" - }, - { - code: 7411, - name: "instructionIntrospectionFailed", - msg: "Instruction introspection failed" - }, - { - code: 7412, - name: "transferNotInProgress", - msg: "Transfer hook not active for this token account" - }, - { - code: 7413, - name: "shareZeroTransfer", - msg: "Amount too small resulting in zero share transfer" - }, - { - code: 7414, - name: "receiptFulfilled", - msg: "Receipt already fulfilled" - }, - { - code: 7415, - name: "insufficientBucketBalance", - msg: "Insufficient bucket balance to fulfill claim" - }, - { - code: 7416, - name: "claimCalculationError", - msg: "Claim calculation error" - }, - { - code: 7417, - name: "overflow", - msg: "Arithmetic overflow" - }, - { - code: 7418, - name: "underflow", - msg: "Arithmetic underflow" - }, - { - code: 7419, - name: "balanceBelowTracked", - msg: "Balance below tracked amount — possible token burn detected" - }, - { - code: 7420, - name: "legacyUserRecordMigrationRequired", - msg: "Legacy user record must be migrated via register_user or migrate_user_record before claiming or transfers" - }, - { - code: 7421, - name: "amountExceedsEntitled", - msg: "Requested amount exceeds share-backed entitlement — cap at max_withdrawable or use full-ATA withdraw" - }, - { - code: 7500, - name: "unauthorized", - msg: "Unauthorized: The authority does not match the controller state's authority." - }, - { - code: 7501, - name: "noUpgradeAuthority", - msg: "Program has no upgrade authority (immutable)." - }, - { - code: 7502, - name: "percentOutOfRange", - msg: "Percent config value must be in 0..=100" - }, - { - code: 7503, - name: "percentInversion", - msg: "Percent config would invert hysteresis: entry must be <= exit" - }, - { - code: 7504, - name: "unstakeDeltaBelowSplitMinimum", - msg: "min_rebalance_unstake_delta must be >= MIN_STAKE_DELEGATION (1 SOL)" - }, - { - code: 7600, - name: "insufficientFunds", - msg: "Insufficient funds" - }, - { - code: 7601, - name: "invalidValidator", - msg: "Invalid validator" - }, - { - code: 7602, - name: "noSuitableValidator", - msg: "No suitable validator found" - }, - { - code: 7603, - name: "ticketNotFound", - msg: "Unstake ticket not found" - }, - { - code: 7604, - name: "ticketNotClaimable", - msg: "Ticket not claimable yet" - }, - { - code: 7605, - name: "unauthorized", - msg: "Unauthorized" - }, - { - code: 7606, - name: "arithmeticOverflow", - msg: "Arithmetic overflow" - }, - { - code: 7607, - name: "accountAlreadyExists", - msg: "Account already exists" - }, - { - code: 7608, - name: "invalidStakeAccount", - msg: "Invalid stake account" - }, - { - code: 7609, - name: "invalidThreshold", - msg: "Invalid threshold value" - }, - { - code: 7610, - name: "invalidAccountData", - msg: "Invalid account data" - }, - { - code: 7611, - name: "invalidVoteAccount", - msg: "Invalid vote account" - }, - { - code: 7612, - name: "stakesNotYetActive", - msg: "Stakes not yet active" - }, - { - code: 7613, - name: "epochDistributionAlreadyDone", - msg: "Invalid epoch" - }, - { - code: 7614, - name: "epochAlreadyResolved", - msg: "Epoch already resolved" - }, - { - code: 7615, - name: "mergeFailed", - msg: "Merge failed" - }, - { - code: 7616, - name: "reservePoolNotInitialized", - msg: "Reserve pool not initialized" - }, - { - code: 7617, - name: "invalidEphemeralAccount", - msg: "Invalid ephemeral account" - }, - { - code: 7618, - name: "invalidStakeAccount0", - msg: "Invalid stake account 0" - }, - { - code: 7619, - name: "epochNotReadyForResolution", - msg: "Epoch Table Not Ready To be resolved" - }, - { - code: 7620, - name: "insufficientSlotsElapsed", - msg: "Function called too soon in epoch, should be called close to epoch boundary" - }, - { - code: 7621, - name: "epochRewardsActive", - msg: "Epoch rewards distribution is active - stake operations blocked" - }, - { - code: 7622, - name: "validatorSyncRequired", - msg: "Validator sync required - please call sync_validator_stakes first" - }, - { - code: 7623, - name: "tooSmallDeposit", - msg: "Deposit amount too small" - }, - { - code: 7624, - name: "allocationsNotCalculated", - msg: "Allocations not calculated for current epoch - please run rebalance_validators first" - }, - { - code: 7625, - name: "invalidAccountCount", - msg: "Invalid account count - expected different number of accounts" - }, - { - code: 7626, - name: "invalidValidatorInfo", - msg: "Invalid ValidatorInfo account" - }, - { - code: 7627, - name: "unstakeAllocationsNotCalculated", - msg: "Unstake allocations must be calculated before validator allocations - please run calculate_unstake_allocations first" - }, - { - code: 7628, - name: "invalidReservePoolAccount", - msg: "Invalid reserve pool account" - }, - { - code: 7629, - name: "preReqsUnmet", - msg: "Some Pre Req Not Met, Look at Solana Logs for details" - }, - { - code: 7630, - name: "systemBusy", - msg: "System busy: stake metrics are stale from a recent unstake — please retry shortly" - }, - { - code: 7631, - name: "updateInProgress", - msg: "Update in progress: stake metrics are being refreshed for this epoch — please retry shortly" - }, - { - code: 7632, - name: "maintenanceMergeRequired", - msg: "Maintenance Merge Transients Failed - please run merge_activating_stakes first" - }, - { - code: 7633, - name: "unstakeTooSMall", - msg: "Unstake Request Too Small" - }, - { - code: 7634, - name: "operationInProgress", - msg: "Operation already in progress" - }, - { - code: 7635, - name: "noOperationInProgress", - msg: "No operation currently in progress" - }, - { - code: 7636, - name: "invalidSequence", - msg: "Invalid sequence - expected different index or rank" - }, - { - code: 7637, - name: "validatorNotFound", - msg: "Validator not found in leaderboard" - }, - { - code: 7638, - name: "invalidRank", - msg: "Invalid rank - exceeds validator count" - }, - { - code: 7639, - name: "noValidatorsInLeaderboard", - msg: "No validators in leaderboard" - }, - { - code: 7640, - name: "noValidatorsFound", - msg: "No validators found in active list" - }, - { - code: 7641, - name: "graveyardFull", - msg: "Graveyard list is full" - }, - { - code: 7642, - name: "validatorHasActiveStake", - msg: "Validator still has active stake - cannot cleanup until stake is repatriated" - }, - { - code: 7643, - name: "validatorHasPendingDeactivations", - msg: "Validator has pending deactivations - cannot cleanup until all deactivations complete" - }, - { - code: 7644, - name: "validatorNotUndelegated", - msg: "Validator is not in NotDelegated state - stake must be fully deactivated before cleanup" - }, - { - code: 7645, - name: "batchSizeTooLarge", - msg: "Batch size exceeds maximum allowed" - }, - { - code: 7646, - name: "stakingDisabled", - msg: "Staking is currently disabled" - }, - { - code: 7647, - name: "withdrawalsDisabled", - msg: "Withdrawals are currently disabled" - }, - { - code: 7648, - name: "emergencyModeActive", - msg: "Emergency mode is active" - }, - { - code: 7649, - name: "processStakeOrdersDisabled", - msg: "Process stake orders is currently disabled" - }, - { - code: 7650, - name: "processUnstakeOrdersDisabled", - msg: "Process unstake orders is currently disabled" - }, - { - code: 7651, - name: "processPayCycleDisabled", - msg: "Process pay cycle is currently disabled" - }, - { - code: 7652, - name: "validatorRecordNotUpdated", - msg: "Validator record not updated for current epoch" - }, - { - code: 7653, - name: "lateEpochSlotGateNotMet", - msg: "Late epoch operation called too early - minimum slots not yet elapsed" - }, - { - code: 7654, - name: "indexOutOfBounds", - msg: "Index out of bounds" - }, - { - code: 7655, - name: "accountAlreadyMigrated", - msg: "Account already at target size, migration not needed" - }, - { - code: 7656, - name: "treasuryRentUnfunded", - msg: "Treasury can't cover stake-account rent and caller opted out of fronting it" - }, - { - code: 7700, - name: "invalidChainlinkProgram", - msg: "Invalid Chainlink program account" - }, - { - code: 7701, - name: "invalidChainlinkFeed", - msg: "Invalid Chainlink feed account" - }, - { - code: 7702, - name: "arithmeticOverflow", - msg: "Arithmetic overflow in calculation" - }, - { - code: 7703, - name: "invalidCalculation", - msg: "Invalid calculation result" - }, - { - code: 7704, - name: "decimalPrecisionMismatch", - msg: "Decimal precision mismatch" - }, - { - code: 7705, - name: "missingNextTranche", - msg: "Next tranche account required but not provided" - }, - { - code: 7706, - name: "insufficientNextTrancheSupply", - msg: "Insufficient pretokens in next tranche" - }, - { - code: 7707, - name: "trancheExhausted", - msg: "Current tranche exhausted" - }, - { - code: 7708, - name: "invalidPretokenPrice", - msg: "Invalid pretoken price" - }, - { - code: 7709, - name: "chainlinkPriceFetchFailed", - msg: "Failed to fetch SOL price from Chainlink" - }, - { - code: 7710, - name: "stalePrice", - msg: "Chainlink price data is stale" - }, - { - code: 7711, - name: "priceOutOfBounds", - msg: "Price out of valid bounds" - }, - { - code: 7712, - name: "invalidGrowthBps", - msg: "Invalid growth BPS value (must be <= 10000)" - }, - { - code: 7713, - name: "unauthorized", - msg: "Unauthorized: caller is not admin" - }, - { - code: 7714, - name: "emptyPriceHistory", - msg: "Price history is empty" - }, - { - code: 7715, - name: "insufficientFunds", - msg: "Insufficient funds for pretoken purchase" - }, - { - code: 7716, - name: "exceededTrancheLimit", - msg: "Exceeded tranche limit, split purchase into multiple transactions" - }, - { - code: 7717, - name: "zeroPretokensPurchased", - msg: "Deposit too small to purchase any pretokens at current tranche price" - }, - { - code: 7718, - name: "invalidRoundData", - msg: "Invalid round data from Chainlink feed" - }, - { - code: 7719, - name: "invalidStaleness", - msg: "max_staleness_seconds must be > 0 - any non-positive value would brick price reads" - }, - { - code: 7800, - name: "unauthorized", - msg: "Unauthorized access" - }, - { - code: 7801, - name: "maxValidatorsReached", - msg: "Maximum validators reached" - }, - { - code: 7802, - name: "validatorAlreadyExists", - msg: "Validator already exists" - }, - { - code: 7803, - name: "validatorNotFound", - msg: "Validator not found" - }, - { - code: 7804, - name: "invalidStakeUpdateType", - msg: "Invalid stake update type" - }, - { - code: 7805, - name: "invalidVoteAccount", - msg: "Invalid vote account provided" - }, - { - code: 7806, - name: "invalidInputLength", - msg: "Invalid input length - all vectors must have same length" - }, - { - code: 7807, - name: "invalidStakeAccount", - msg: "Invalid Stake Account" - }, - { - code: 7808, - name: "arithmeticOverflow", - msg: "Arithmetic overflow" - }, - { - code: 7809, - name: "insufficientTransientStake", - msg: "Insufficient transient stake" - }, - { - code: 7810, - name: "transientTrackingFull", - msg: "Transient tracking is full (100 entries max)" - }, - { - code: 7811, - name: "validatorStillInCooldown", - msg: "Validator is still in cooldown period" - }, - { - code: 7812, - name: "invalidVppScore", - msg: "VPP score must be between 0 and 100" - }, - { - code: 7900, - name: "unauthorized", - msg: "Unauthorized admin attempting to call this instruction" - }, - { - code: 7901, - name: "invalidAmount", - msg: "Invalid amount" - }, - { - code: 7902, - name: "dDayNotSet", - msg: "D-Day is not set" - }, - { - code: 7903, - name: "dDayActive", - msg: "D-Day is active - stakes not allowed" - }, - { - code: 7904, - name: "invalidLiqsolMint", - msg: "Invalid liqSOL mint address" - }, - { - code: 7905, - name: "insufficientFunds", - msg: "Insufficient funds in user account" - }, - { - code: 7906, - name: "insufficientStake", - msg: "Insufficient staked amount for withdrawal" - }, - { - code: 7907, - name: "insufficientShares", - msg: "Insufficient shares for withdrawal" - }, - { - code: 7908, - name: "overflow", - msg: "Arithmetic overflow" - }, - { - code: 7909, - name: "underflow", - msg: "Arithmetic underflow" - }, - { - code: 7910, - name: "emptyLiqsolPool", - msg: "No liqSOL deposits registered in the pool" - }, - { - code: 7911, - name: "noLiqsolPosition", - msg: "No liqSOL position recorded for this user" - }, - { - code: 7912, - name: "noStakeDeposit", - msg: "No stake deposit found (only pretoken purchases exist)" - }, - { - code: 7913, - name: "rawSolBucketUnimplemented", - msg: "Raw SOL bucket handling is not implemented yet" - }, - { - code: 7914, - name: "noAccumulatedYield", - msg: "No accumulated yield available to consume" - }, - { - code: 7915, - name: "refundsNotActive", - msg: "Refunds are not active" - }, - { - code: 7916, - name: "noRefundablePosition", - msg: "No refundable position found for this user" - }, - { - code: 7917, - name: "systemPaused", - msg: "System is currently paused" - }, - { - code: 7918, - name: "refundsActive", - msg: "Refunds are active - operation not allowed" - }, - { - code: 7919, - name: "receiptLocked", - msg: "OutpostAccount is locked by an active bond" - }, - { - code: 7920, - name: "invalidWireState", - msg: "Invalid wire state for this operation" - }, - { - code: 8000, - name: "invalidUserRecord", - msg: "Invalid user record" - }, - { - code: 8001, - name: "insufficientBalance", - msg: "Insufficient balance" - }, - { - code: 8002, - name: "overflow", - msg: "Arithmetic overflow" - }, - { - code: 8003, - name: "arithmeticUnderflow", - msg: "Arithmetic underflow" - }, - { - code: 8004, - name: "alreadyFulfilled", - msg: "Receipt already fulfilled" - }, - { - code: 8005, - name: "notYetServiceable", - msg: "Receipt not yet serviceable" - }, - { - code: 8006, - name: "badFrontierOrder", - msg: "Frontier receipts out of order or unexpected id" - }, - { - code: 8007, - name: "missingNftToken", - msg: "User does not hold the NFT receipt token" - }, - { - code: 8008, - name: "withdrawalsDisabled", - msg: "Withdrawals are currently disabled" - }, - { - code: 8009, - name: "claimWithdrawalsDisabled", - msg: "Claim withdrawals are currently disabled" - } - ], - types: [ - { - name: "attestationData", - type: { - kind: "struct", - fields: [ - { - name: "attestationType", - type: "i32" - }, - { - name: "data", - type: "bytes" - } - ] - } - }, - { - name: "batchOrchestrator", - docs: [ - "Holds resume positions for batched ops - cursors only, no value.", - "", - "Rule of thumb for what lives here vs StakeAllocationState: this account is", - "for WIPEABLE positions. Completion truth is in MaintenanceLedger, so a stale", - 'cursor\'s staleness response is just "zero it" (sweep_stale_cursors does that', - "blanket at every epoch boundary). Anything that carries money/accounting and", - "needs abort/recover on staleness belongs on StakeAllocationState next to its", - "cycle, not here. The aggregation temps are the one grandfathered exception -", - "they carry value, so they sit outside the sweep behind their own mode-tag +", - "started_epoch guard.", - "", - "On liveness: ops here have no in_progress bools - a nonzero cursor/mode-tag", - "IS the liveness signal (see graveyard_locked, WIN-60). That inference works", - "because zero is out-of-band by construction for these fields: cursor at 0 =", - "no progress = idle, same state. Don't copy this pattern to fields where zero", - "is a real value (epochs, amounts) - those need an explicit bool." - ], - type: { - kind: "struct", - fields: [ - { - name: "validatorsProcessedThisEpoch", - type: "u8" - }, - { - name: "validatorsMergeProcessedThisEpoch", - type: "u16" - }, - { - name: "validatorsDeactivatingMergeProcessed", - type: "u16" - }, - { - name: "validatorsSyncProcessedThisEpoch", - type: "u16" - }, - { - name: "validatorsUnstakeProcessedThisEpoch", - type: "u16" - }, - { - name: "validatorsAggregateProcessedThisEpoch", - type: "u16" - }, - { - name: "tempTotalActiveStake", - type: "u64" - }, - { - name: "tempTotalTransientStake", - type: "u64" - }, - { - name: "tempTotalReward", - type: "u64" - }, - { - name: "tempTotalUnstakeableStake", - type: "u64" - }, - { - name: "bump", - type: "u8" - }, - { - name: "infraNextIndex", - docs: ["Next active_list index to process for PDA setup"], - type: "u16" - }, - { - name: "infosNextIndex", - docs: ["Next active_list index to process for infos sync"], - type: "u16" - }, - { - name: "leaderboardScoresNextIndex", - docs: ["Next leaderboard registry index to process for score sync"], - type: "u16" - }, - { - name: "removalNextIndex", - docs: ["Next index in active list to check for removal"], - type: "u16" - }, - { - name: "additionNextRank", - docs: ["Next rank in leaderboard to check for addition"], - type: "u16" - }, - { - name: "additionTargetRank", - docs: ["Target (inclusive) leaderboard rank to process up to"], - type: "u16" - }, - { - name: "graveyardNextIndex", - docs: ["Next index in graveyard list to process"], - type: "u16" - }, - { - name: "graveyardCleanupNextIndex", - docs: ["Next index in graveyard list to check for cleanup"], - type: "u16" - }, - { - name: "aggregateModeTag", - docs: [ - "Tracks which aggregation mode currently owns the shared temp fields.", - "0 = idle,", - "1 = Normal,", - "2 = PostSync,", - "3 = PostLateEpoch.", - "Prevents cross-mode state contamination when modes share the same vars." - ], - type: "u8" - }, - { - name: "aggregationStartedEpoch", - docs: [ - "The epoch when the current aggregation batch started.", - "Prevents stale partial accumulators from being committed if an epoch boundary is crossed mid-aggregation." - ], - type: "u64" - }, - { - name: "mevClaimsNextIndex", - docs: ["Next active_list index to process for MEV tip claims"], - type: "u16" - }, - { - name: "tempTotalMevReward", - docs: ["Temporary accumulator for MEV rewards across batches"], - type: "u64" - }, - { - name: "tempTotalOutstandingAmountToUnstake", - docs: [ - "Temporary accumulator for sum of validators' amount_to_unstake across batches" - ], - type: "u64" - }, - { - name: "validatorsSyncStartedEpoch", - docs: ["Owns validators_sync_processed_this_epoch."], - type: "u16" - }, - { - name: "leaderboardScoresStartedEpoch", - docs: ["Owns leaderboard_scores_next_index."], - type: "u16" - }, - { - name: "graveyardCleanupStartedEpoch", - docs: ["Owns graveyard_cleanup_next_index."], - type: "u16" - }, - { - name: "additionStartedEpoch", - docs: ["Owns addition_next_rank + addition_target_rank."], - type: "u16" - }, - { - name: "unstakeStartedEpoch", - docs: [ - "Owns validators_unstake_processed_this_epoch. A nonzero cursor from a", - "dead epoch is not a real lock — this pin lets consumers tell stale", - "leftovers apart from a live in-epoch traversal." - ], - type: "u16" - }, - { - name: "cursorsEpoch", - docs: [ - "Every cursor on this account is a per-epoch resume position — at an", - "epoch boundary any nonzero one is stale garbage. The first batch op to", - "touch this account in a new epoch wipes them all in one swing via", - "sweep_stale_cursors, so no op ever resumes against a list that", - "selection reshuffled since. Backstop for the per-op pins above." - ], - type: "u16" - }, - { - name: "reserved", - type: { - array: ["u8", 60] - } - } - ] - } - }, - { - name: "collateralEntry", - type: { - kind: "struct", - fields: [ - { - name: "depositor", - type: "pubkey" - }, - { - name: "tokenCode", - type: "u64" - }, - { - name: "amount", - type: "u64" - } - ] - } - }, - { - name: "configKeyBool", - docs: [ - "Keys for bool config values (feature flags) - stored as bits in a u16", - "Bit positions: 0=Deposits, 1=Withdrawals, 2=ClaimWithdrawals, 3=ProcessStake,", - "4=ProcessUnstake, 5=ProcessPayCycle, 6=Rebalancing, 7-15=Reserved" - ], - type: { - kind: "enum", - variants: [ - { - name: "depositsEnabled" - }, - { - name: "withdrawalsEnabled" - }, - { - name: "claimWithdrawalsEnabled" - }, - { - name: "processStakeOrdersEnabled" - }, - { - name: "processUnstakeOrdersEnabled" - }, - { - name: "processPayCycleEnabled" - }, - { - name: "rebalancingEnabled" - } - ] - } - }, - { - name: "configKeyU16", - docs: ["Keys for u16 config values (small counts, thresholds, ranks)"], - type: { - kind: "enum", - variants: [ - { - name: "cooldownEpochs" - }, - { - name: "depositFeeEpochsMultiplier" - }, - { - name: "minVppEntry" - }, - { - name: "minVppExit" - }, - { - name: "tinyNetworkThreshold" - }, - { - name: "smallNetworkThreshold" - }, - { - name: "mediumNetworkThreshold" - }, - { - name: "largeNetworkEntryRank" - }, - { - name: "largeNetworkExitRank" - } - ] - } - }, - { - name: "configKeyU64", - docs: ["Keys for u64 config values (large amounts, rates)"], - type: { - kind: "enum", - variants: [ - { - name: "minUserDeposit" - }, - { - name: "minUnstakeRequest" - }, - { - name: "minRebalanceStakeDelta" - }, - { - name: "minRebalanceUnstakeDelta" - }, - { - name: "transientThreshold" - }, - { - name: "minLateEpochSlotGate" - } - ] - } - }, - { - name: "configKeyU8", - docs: ["Keys for u8 config values (percentages 0-100)"], - type: { - kind: "enum", - variants: [ - { - name: "smallNetworkEntryPercent" - }, - { - name: "smallNetworkExitPercent" - }, - { - name: "mediumNetworkEntryPercent" - }, - { - name: "mediumNetworkExitPercent" - } - ] - } - }, - { - name: "distributionState", - type: { - kind: "struct", - fields: [ - { - name: "liqsolMint", - type: "pubkey" - }, - { - name: "currentIndex", - type: "u64" - }, - { - name: "totalShares", - docs: ["Sum of all user shares across the system"], - type: "u64" - }, - { - name: "lastBucketBalance", - docs: [ - "Last observed bucket balance used for incremental index updates" - ], - type: "u64" - }, - { - name: "bump", - type: "u8" - }, - { - name: "bucketBump", - docs: [ - "Cached bucket authority bump to avoid repeated find_program_address calls" - ], - type: "u8" - }, - { - name: "poolBump", - docs: [ - "Cached pool authority bump to avoid repeated find_program_address calls" - ], - type: "u8" - }, - { - name: "bucketAuthority", - docs: [ - "Cached bucket authority pubkey for transfer-hook optimization" - ], - type: "pubkey" - }, - { - name: "poolAuthority", - docs: [ - "Cached pool authority pubkey for transfer-hook optimization" - ], - type: "pubkey" - } - ] - } - }, - { - name: "envelopeChunks", - type: { - kind: "struct", - fields: [ - { - name: "bump", - type: "u8" - }, - { - name: "epochIndex", - type: "u32" - }, - { - name: "operator", - type: "pubkey" - }, - { - name: "totalChunks", - type: "u16" - }, - { - name: "totalBytes", - type: "u32" - }, - { - name: "receivedChunks", - type: "u16" - }, - { - name: "data", - type: "bytes" - } - ] - } - }, - { - name: "envelopeLog", - type: { - kind: "struct", - fields: [ - { - name: "envelopes", - type: { - vec: { - defined: { - name: "envelopeRecord" - } - } - } - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "envelopeRecord", - type: { - kind: "struct", - fields: [ - { - name: "epochIndex", - type: "u32" - }, - { - name: "emittedAt", - type: "u64" - }, - { - name: "checksum", - type: { - array: ["u8", 32] - } - } - ] - } - }, - { - name: "epochDeliveries", - type: { - kind: "struct", - fields: [ - { - name: "epochIndex", - type: "u32" - }, - { - name: "deliveries", - type: { - vec: { - defined: { - name: "operatorDelivery" - } - } - } - }, - { - name: "consensusReached", - type: "bool" - }, - { - name: "consensusHash", - type: { - array: ["u8", 32] - } - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "epochResolved", - type: { - kind: "struct", - fields: [ - { - name: "validator", - type: "pubkey" - }, - { - name: "epoch", - type: "u64" - }, - { - name: "totalStakeAmount", - type: "u64" - }, - { - name: "maxIndex", - type: "u32" - } - ] - } - }, - { - name: "failedSwapRemit", - type: { - kind: "struct", - fields: [ - { - name: "originalSwapRemitId", - type: { - array: ["u8", 32] - } - }, - { - name: "recipientAddress", - type: { - array: ["u8", 32] - } - }, - { - name: "tokenCode", - type: "u64" - }, - { - name: "amount", - type: "u64" - }, - { - name: "timestamp", - type: "i64" - }, - { - name: "reasonLen", - type: "u8" - }, - { - name: "reason", - type: { - array: ["u8", 32] - } - } - ] - } - }, - { - name: "global", - docs: [ - "Global operator state. Epoch-based model: receipts are serviceable", - "when `epoch <= serviceable_epoch` as reported by an external runtime." - ], - type: { - kind: "struct", - fields: [ - { - name: "bump", - type: "u8" - }, - { - name: "authority", - docs: [ - "DEPRECATED: Originally intended as authority for serviceable_epoch updates,", - "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.", - "Retained to preserve account layout." - ], - type: "pubkey" - }, - { - name: "liqsolMint", - docs: ["Token-2022 liqSOL mint burned on withdraw."], - type: "pubkey" - }, - { - name: "serviceableEpoch", - docs: ["Highest epoch that is currently claimable."], - type: "u64" - }, - { - name: "totalEncumberedFunds", - docs: [ - "Total SOL encumbered for pending withdrawal requests.", - "This amount is reserved from the reserve pool and will be paid out when receipts are claimed." - ], - type: "u64" - }, - { - name: "nextReceiptId", - docs: ["Monotonic counter for generating unique receipt IDs"], - type: "u64" - } - ] - } - }, - { - name: "globalConfig", - docs: ["Zero-copy global config PDA"], - serialization: "bytemuckunsafe", - repr: { - kind: "c" - }, - type: { - kind: "struct", - fields: [ - { - name: "bump", - type: "u8" - }, - { - name: "padding", - type: { - array: ["u8", 7] - } - }, - { - name: "admin", - type: "pubkey" - }, - { - name: "cranky", - type: "pubkey" - }, - { - name: "reservedPubkey", - type: { - array: ["pubkey", 1] - } - }, - { - name: "minUserDeposit", - docs: ["Minimum SOL amount a user can deposit"], - type: "u64" - }, - { - name: "minUnstakeRequest", - docs: ["Minimum SOL amount for an unstake/withdrawal request"], - type: "u64" - }, - { - name: "minRebalanceStakeDelta", - docs: ["Minimum stake delta to trigger a stake rebalance order"], - type: "u64" - }, - { - name: "minRebalanceUnstakeDelta", - docs: [ - "Minimum unstake delta to trigger an unstake rebalance order" - ], - type: "u64" - }, - { - name: "transientThreshold", - docs: [ - "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.", - "Rebalance now counts all transient stake on both sides of the delta equation,", - "so the per-validator threshold gate was removed." - ], - type: "u64" - }, - { - name: "minLateEpochSlotGate", - docs: [ - "Minimum slots that must have elapsed in the epoch before late epoch operations can execute" - ], - type: "u64" - }, - { - name: "reservedU64", - type: { - array: ["u64", 2] - } - }, - { - name: "cooldownEpochs", - docs: [ - "Epochs a validator must wait in the graveyard before it is booted. This begins after the last recorded state change" - ], - type: "u16" - }, - { - name: "depositFeeMultiplier", - docs: [ - 'Multiplier for deposit fee calculation, this would be average "pay rate x number of epochs we expect the stake to warm up"' - ], - type: "u16" - }, - { - name: "minVppEntry", - docs: [ - "Minimum VPP score required to enter the active validator set, this is a fall back for when the val set is really small" - ], - type: "u16" - }, - { - name: "minVppExit", - docs: [ - "VPP score threshold below which a validator is removed from active set, again a fall back" - ], - type: "u16" - }, - { - name: "tinyNetworkThreshold", - docs: [ - 'Max validators for "tiny" network band (uses fixed VPP thresholds) as above' - ], - type: "u16" - }, - { - name: "smallNetworkThreshold", - docs: [ - 'Max validators for "small" network band (uses percentile-based selection)' - ], - type: "u16" - }, - { - name: "mediumNetworkThreshold", - docs: [ - 'Max validators for "medium" network band (uses percentile-based selection)' - ], - type: "u16" - }, - { - name: "largeNetworkEntryRank", - docs: [ - "Fixed rank threshold to enter active set in large networks (0-indexed)" - ], - type: "u16" - }, - { - name: "largeNetworkExitRank", - docs: [ - "Fixed rank threshold to exit active set in large networks (0-indexed)" - ], - type: "u16" - }, - { - name: "reservedU16", - type: { - array: ["u16", 3] - } - }, - { - name: "smallNetworkEntryPercent", - docs: [ - "Percentile rank required to enter active set in small networks" - ], - type: "u8" - }, - { - name: "smallNetworkExitPercent", - docs: [ - "Percentile rank below which validators exit in small networks" - ], - type: "u8" - }, - { - name: "mediumNetworkEntryPercent", - docs: [ - "Percentile rank required to enter active set in medium networks" - ], - type: "u8" - }, - { - name: "mediumNetworkExitPercent", - docs: [ - "Percentile rank below which validators exit in medium networks" - ], - type: "u8" - }, - { - name: "reservedU8", - type: { - array: ["u8", 2] - } - }, - { - name: "featureFlags", - docs: [ - "Bit 0: DepositsEnabled, Bit 1: WithdrawalsEnabled, Bit 2: ClaimWithdrawalsEnabled,", - "Bit 3: ProcessStakeOrdersEnabled, Bit 4: ProcessUnstakeOrdersEnabled,", - "Bit 5: ProcessPayCycleEnabled, Bit 6: RebalancingEnabled, Bits 7-15: Reserved" - ], - type: "u16" - }, - { - name: "reservedFlags", - type: { - array: ["u16", 1] - } - }, - { - name: "reservedTrailing", - type: { - array: ["u8", 32] - } - } - ] - } - }, - { - name: "globalState", - type: { - kind: "struct", - fields: [ - { - name: "deployedAt", - docs: [ - "Legacy refund timer fields retained to preserve account layout.", - "Refund activation is controlled exclusively through `wire_state`." - ], - type: "i64" - }, - { - name: "refundDelaySeconds", - type: "i64" - }, - { - name: "paused", - docs: [ - "Global pause flag - when true, all operations except refunds are disabled" - ], - type: "bool" - }, - { - name: "totalStakedLiqsol", - docs: [ - "Aggregate liqSOL staked through pretokens (maps to distribution tracked balance)" - ], - type: "u64" - }, - { - name: "totalPurchasedLiqsol", - docs: [ - "Aggregate liqSOL pretoken purchases (part of distribution tracked balance)" - ], - type: "u64" - }, - { - name: "totalShares", - docs: [ - "Total shares issued to all users (for share/index yield isolation)" - ], - type: "u64" - }, - { - name: "protocolShares", - docs: [ - "Total shares issued to protocol (for share/index yield isolation)" - ], - type: "u64" - }, - { - name: "currentIndex", - docs: [ - "Current share-to-token exchange rate (scaled by INDEX_SCALE = 1e12)", - "Starts at INDEX_SCALE (1.0) and grows as yield accrues" - ], - type: "u64" - }, - { - name: "expectedPoolBalance", - docs: [ - "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).", - "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield." - ], - type: "u64" - }, - { - name: "yieldAccumulatedLiqsol", - docs: [ - "Accumulated liqSOL yield available for protocol pretoken purchases" - ], - type: "u64" - }, - { - name: "rolePrincipals", - docs: [ - "Required principal (liqSOL) per role [YieldOp, BatchOp, Underwriter, PoolOp]" - ], - type: { - array: ["u64", 4] - } - }, - { - name: "roleWarmupDuration", - docs: [ - "Warmup duration in seconds (applies when ANY new role is bonded)" - ], - type: "i64" - }, - { - name: "wireState", - type: { - defined: { - name: "wireState" - } - } - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "graveyardDeactivationQueuedEvent", - docs: [ - "Event emitted when a graveyard validator's main stake deactivation is queued" - ], - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - type: "pubkey" - }, - { - name: "amountToUnstake", - type: "u64" - } - ] - } - }, - { - name: "graveyardValidatorCleanedEvent", - docs: ["Event emitted when a graveyard validator is cleaned up"], - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - type: "pubkey" - }, - { - name: "epochsSinceStateChange", - type: "u16" - } - ] - } - }, - { - name: "latestOutboundEnvelope", - type: { - kind: "struct", - fields: [ - { - name: "epochIndex", - type: "u32" - }, - { - name: "checksum", - type: { - array: ["u8", 32] - } - }, - { - name: "data", - type: "bytes" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "leaderboardState", - docs: [ - "Central leaderboard state using parallel arrays for efficient ranking and CPI access", - "Stores VPP scores and sorted rankings for up to 1024 validators", - "Uses zero-copy for efficient access from other programs via CPI" - ], - serialization: "bytemuck", - repr: { - kind: "c" - }, - type: { - kind: "struct", - fields: [ - { - name: "scores", - docs: [ - "VPP scores indexed by registry_index (0-100 range)", - "registry_index is assigned on first validator registration and never changes" - ], - type: { - array: ["u8", 1024] - } - }, - { - name: "sortedIndices", - docs: [ - "Validator indices sorted by VPP score descending", - "sorted_indices[0] = registry_index of highest VPP validator", - "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc." - ], - type: { - array: ["u16", 1024] - } - }, - { - name: "voteAccounts", - docs: [ - "Vote account pubkeys indexed by registry_index", - "Allows CPI callers to get vote accounts for top N validators" - ], - type: { - array: [ - { - defined: { - name: "pubkeyBytes" - } - }, - 1024 - ] - } - }, - { - name: "numValidators", - docs: ["Number of active validators currently in the leaderboard"], - type: "u16" - }, - { - name: "bump", - docs: ["PDA bump seed"], - type: "u8" - }, - { - name: "align", - docs: ["Alignment byte (keeps u16 fields below properly aligned)"], - type: "u8" - }, - { - name: "crankNextIndex", - docs: [ - "Next validator index to process during crank_update_scores" - ], - type: "u16" - }, - { - name: "lastCrankEpoch", - docs: [ - "Last epoch when crank_update_scores completed all validators" - ], - type: "u16" - }, - { - name: "crankStartedEpoch", - docs: [ - "Epoch when start_crank was called (signals an active crank cycle)" - ], - type: "u16" - } - ] - } - }, - { - name: "liqReceiptData", - type: { - kind: "struct", - fields: [ - { - name: "receiptId", - type: "u64" - }, - { - name: "liqports", - type: "u64" - }, - { - name: "epoch", - type: "u64" - }, - { - name: "fulfilled", - type: "bool" - } - ] - } - }, - { - name: "maintenanceLedger", - type: { - kind: "struct", - fields: [ - { - name: "lastSyncEpoch", - type: "u16" - }, - { - name: "lastValidatorScoreSyncEpoch", - type: "u16" - }, - { - name: "lastLeaderboardScoresSyncEpoch", - type: "u16" - }, - { - name: "lastActiveInfosSyncedEpoch", - docs: [ - "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout." - ], - type: "u16" - }, - { - name: "lastUpdatedStakeMetricsEpoch", - type: "u64" - }, - { - name: "lastDistributionEpoch", - type: { - option: "u64" - } - }, - { - name: "lastDistributionSlot", - docs: [ - "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout." - ], - type: { - option: "u64" - } - }, - { - name: "lastMergeDeactivatingTransientsEpoch", - type: "u64" - }, - { - name: "lastRebalanceAllocationEpoch", - type: "u64" - }, - { - name: "lastMergeActivatingTransientsEpoch", - type: "u64" - }, - { - name: "lastUnstakeEpoch", - type: { - option: "u64" - } - }, - { - name: "lastUnstakeAllocationEpoch", - type: "u64" - }, - { - name: "minMaxResolvedEpochDeactivations", - type: "u16" - }, - { - name: "lastThresholdSyncEpoch", - type: "u16" - }, - { - name: "lastValidatorRemovalSelectionEpoch", - type: "u16" - }, - { - name: "lastValidatorAdditionSelectionEpoch", - type: "u16" - }, - { - name: "lastValidatorPdaSetupEpoch", - type: "u16" - }, - { - name: "lastGraveyardProcessingEpoch", - type: "u16" - }, - { - name: "lastPostSyncStakeMetricsRefreshEpoch", - type: "u16" - }, - { - name: "lastGraveyardCleanupEpoch", - type: "u16" - }, - { - name: "lastPostLateEpochStakeMetricsRefreshEpoch", - type: "u16" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "metadataArgs", - type: { - kind: "struct", - fields: [ - { - name: "name", - type: "string" - }, - { - name: "symbol", - type: "string" - }, - { - name: "uri", - type: "string" - } - ] - } - }, - { - name: "operatorDelivery", - type: { - kind: "struct", - fields: [ - { - name: "operator", - type: "pubkey" - }, - { - name: "envelopeHash", - type: { - array: ["u8", 32] - } - } - ] - } - }, - { - name: "operatorGroup", - type: { - kind: "struct", - fields: [ - { - name: "members", - type: { - vec: "pubkey" - } - } - ] - } - }, - { - name: "operatorMapping", - type: { - kind: "struct", - fields: [ - { - name: "wireName", - type: "u64" - }, - { - name: "solAddress", - type: "pubkey" - }, - { - name: "role", - type: "u32" - }, - { - name: "status", - type: "u32" - }, - { - name: "slashedAt", - type: "i64" - }, - { - name: "terminatedAt", - type: "i64" - } - ] - } - }, - { - name: "operatorRegistry", - type: { - kind: "struct", - fields: [ - { - name: "activeGroupIndex", - type: "u32" - }, - { - name: "groups", - type: { - vec: { - defined: { - name: "operatorGroup" - } - } - } - }, - { - name: "operators", - type: { - vec: { - defined: { - name: "operatorMapping" - } - } - } - }, - { - name: "collateralByCode", - type: { - vec: { - defined: { - name: "collateralEntry" - } - } - } - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "outboundMessageBuffer", - type: { - kind: "struct", - fields: [ - { - name: "attestationCount", - type: "u16" - }, - { - name: "usedDataBytes", - type: "u32" - }, - { - name: "entries", - type: { - vec: { - defined: { - name: "attestationData" - } - } - } - }, - { - name: "nextSwapId", - type: "u64" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "outpostAccount", - type: { - kind: "struct", - fields: [ - { - name: "user", - type: "pubkey" - }, - { - name: "stakedLiqsol", - docs: [ - "STAKE deposits (withdrawable pre-D-Day)", - "Principal amount staked (for display/tracking)" - ], - type: "u64" - }, - { - name: "stakedShares", - docs: [ - "Shares from staking (actual accounting for yield isolation)" - ], - type: "u64" - }, - { - name: "purchasedLiqsol", - docs: [ - "WARRANT_PURCHASE deposits with liqSOL (permanent)", - "Principal amount spent on pretokens (for display/tracking)" - ], - type: "u64" - }, - { - name: "purchasedShares", - docs: [ - "Shares from liqSOL pretoken purchases (actual accounting for yield isolation)" - ], - type: "u64" - }, - { - name: "bondedPrincipals", - docs: ["LiqSOL locked by bonds per role"], - type: { - array: ["u64", 4] - } - }, - { - name: "bondedRoles", - docs: [ - "Bitmap of bonded roles (bits 0-3 for YieldOp, BatchOp, Underwriter, PoolOp)" - ], - type: "u8" - }, - { - name: "unbondRequested", - docs: ["Bitmap of roles with pending unbond requests (bits 0-3)"], - type: "u8" - }, - { - name: "warmupEndsAt", - docs: [ - "Warmup end timestamp - has_role returns false until this time" - ], - type: "i64" - }, - { - name: "bump", - type: "u8" - }, - { - name: "accumulatedPretokenYield", - type: { - option: "u64" - } - }, - { - name: "lastEpochSyndLiqsol", - type: { - option: "u64" - } - }, - { - name: "lastSyndEpoch", - type: { - option: "u64" - } - } - ] - } - }, - { - name: "outpostConfig", - type: { - kind: "struct", - fields: [ - { - name: "authority", - type: "pubkey" - }, - { - name: "chainCode", - type: "u64" - }, - { - name: "nextEpochIndex", - type: "u32" - }, - { - name: "previousEpochHash", - type: { - array: ["u8", 32] - } - }, - { - name: "previousOutboundEpochHash", - docs: [ - "Chain tip for the OUTBOUND (outpost → depot) stream: the canonical", - "epoch digest (`keccak256(encoded envelope)`, `envelope_hash` empty) of", - "this outpost's own previous emit. Stamped into each outbound", - "envelope's `previous_envelope_hash` and advanced after every emit —", - "SEC-114 per-stream chaining; the depot's inbound verification drops a", - "cross-stream link (the inbound tip `previous_epoch_hash`) as a chain", - "break. All-zero = genesis (no emit on this stream yet)." - ], - type: { - array: ["u8", 32] - } - }, - { - name: "epochDurationSec", - type: "u32" - }, - { - name: "currentEpochStartedAt", - type: "i64" - }, - { - name: "registryInitialized", - type: "bool" - }, - { - name: "lastMessageId", - type: { - array: ["u8", 32] - } - }, - { - name: "lastMessageTimestamp", - type: "u64" - }, - { - name: "envelopeRetentionEpochs", - type: "u32" - }, - { - name: "tokenAddressesByCode", - type: { - vec: { - defined: { - name: "tokenAddressEntry" - } - } - } - }, - { - name: "precisionByTokenCode", - type: { - vec: { - defined: { - name: "tokenPrecisionEntry" - } - } - } - }, - { - name: "configVersion", - type: "u8" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "payRateEntry", - type: { - kind: "struct", - fields: [ - { - name: "timestamp", - type: "i64" - }, - { - name: "scaledRate", - type: "u64" - } - ] - } - }, - { - name: "payRateHistory", - type: { - kind: "struct", - fields: [ - { - name: "currentIndex", - type: "u16" - }, - { - name: "totalEntriesAdded", - type: "u64" - }, - { - name: "entries", - type: { - vec: { - defined: { - name: "payRateEntry" - } - } - } - }, - { - name: "maxEntries", - type: "u16" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "payoutState", - type: { - kind: "struct", - fields: [ - { - name: "totalYieldPaidOutEpoch", - type: "u64" - }, - { - name: "feesRemainingToDistribute", - type: "u64" - }, - { - name: "totalFeesDeposited", - type: "u64" - }, - { - name: "totalCumulativePayoutAlltime", - type: "u128" - }, - { - name: "totalCumulativePayoutEpoch", - type: "u64" - }, - { - name: "timestamp", - type: "i64" - }, - { - name: "epoch", - type: "u16" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "pretokenPurchaseHistory", - serialization: "bytemuck", - repr: { - kind: "c" - }, - type: { - kind: "struct", - fields: [ - { - name: "startingEpoch", - type: "u64" - }, - { - name: "latestEpoch", - type: "u64" - }, - { - name: "purchasedPerEpoch", - type: { - array: ["u64", 100] - } - }, - { - name: "syndPerEpoch", - type: { - array: ["u64", 100] - } - }, - { - name: "bump", - type: "u8" - }, - { - name: "padding", - type: { - array: ["u8", 7] - } - } - ] - } - }, - { - name: "pretokenPurchased", - type: { - kind: "struct", - fields: [ - { - name: "user", - type: "pubkey" - }, - { - name: "trancheNumber", - type: "u64" - }, - { - name: "pretokensPurchased", - type: "u64" - } - ] - } - }, - { - name: "priceHistory", - docs: [ - "Price history for windowed moving average calculations", - "All prices stored in 8-decimal precision" - ], - type: { - kind: "struct", - fields: [ - { - name: "windowSize", - docs: ["Number of prices to keep in the moving average window"], - type: "u8" - }, - { - name: "prices", - docs: ["Circular buffer of recent prices (fixed size, 8-dec each)"], - type: { - array: ["u64", 10] - } - }, - { - name: "count", - docs: ["Number of valid entries in the prices array (0-10)"], - type: "u8" - }, - { - name: "nextIndex", - type: "u8" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "pubkeyBytes", - docs: [ - "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.", - "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`." - ], - serialization: "bytemuck", - repr: { - kind: "transparent" - }, - type: { - kind: "struct", - fields: [ - { - name: "bytes", - type: { - array: ["u8", 32] - } - } - ] - } - }, - { - name: "reserve", - type: { - kind: "struct", - fields: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "reserveCode", - type: "u64" - }, - { - name: "externalTokenAmount", - type: "u64" - }, - { - name: "requestedWireAmount", - type: "u64" - }, - { - name: "connectorWeightBps", - type: "u32" - }, - { - name: "status", - type: { - defined: { - name: "reserveStatus" - } - } - }, - { - name: "creator", - type: "pubkey" - }, - { - name: "custodyMint", - docs: [ - "Mint/native mode pinned at reserve creation. `NATIVE_TOKEN_MARKER`", - "means the reserve custodies lamports; any other pubkey is the SPL mint", - "held by the `reserve_vault`. Terminal handlers (SwapRemit, SwapRevert,", - "ReserveCreateCancelled) read this instead of the mutable", - "`OutpostConfig.token_addresses_by_code`, so an admin re-point of a", - "token_code between creation and dispatch cannot change how an", - "already-created reserve settles." - ], - type: "pubkey" - }, - { - name: "custodyDecimals", - docs: [ - "Chain-side decimals pinned at reserve creation. Native reserves use", - "`DEPOT_PRECISION_DECIMALS`; SPL reserves use the source mint's", - "`decimals` at creation time." - ], - type: "u8" - }, - { - name: "nameLen", - type: "u8" - }, - { - name: "nameBytes", - type: { - array: ["u8", 64] - } - }, - { - name: "descriptionLen", - type: "u16" - }, - { - name: "descriptionBytes", - type: { - array: ["u8", 256] - } - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "reserveAggregate", - type: { - kind: "struct", - fields: [ - { - name: "failedRemits", - type: { - array: [ - { - defined: { - name: "failedSwapRemit" - } - }, - 8 - ] - } - }, - { - name: "failedRemitsHead", - type: "u8" - }, - { - name: "failedRemitsTotal", - type: "u64" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "reserveStatus", - docs: [ - "Local Borsh enum (NOT the proto enum): tags Pending=0, Active=1, Cancelled=2." - ], - type: { - kind: "enum", - variants: [ - { - name: "pending" - }, - { - name: "active" - }, - { - name: "cancelled" - } - ] - } - }, - { - name: "role", - repr: { - kind: "rust" - }, - type: { - kind: "enum", - variants: [ - { - name: "yieldOperator" - }, - { - name: "batchOperator" - }, - { - name: "underwriter" - }, - { - name: "poolOperator" - } - ] - } - }, - { - name: "stakeAllocationState", - docs: [ - "Stake allocation state tracking for validator stake distribution and unstake orders", - "Tracks both staking allocations (VPP-based) and unstake order batching", - "", - "Rule of thumb for what lives here vs BatchOrchestrator: this account holds", - "CONSERVED-VALUE cycles (frozen amounts, distributed totals, snapshots) - you", - "can never blanket-zero these, a stale cycle gets aborted/recovered instead", - "(see start_unstake_allocation's remainder recovery and abort_rebalance).", - "That's also why the *_started_epoch pins live here and not on BO: the pin is", - "part of its cycle record and must be stamped/cleared atomically with it by", - "the cycle's own start/abort methods, so pin and cycle can't desync. Pure", - "resume cursors with no value attached belong on BatchOrchestrator, where the", - "epoch sweep can wipe them for free.", - "", - "The in_progress bools here are deliberately explicit, NOT inferred like BO", - "does with its cursors. Inference needs a signal whose zero is out-of-band,", - "and every candidate here has a meaningful zero: epoch 0 is real (localnet),", - "an unstake-only rebalance legitimately distributes 0, and the processed", - "counter being nonzero-while-open is an accident of call sites, not a", - "guarantee. Plus these cycles have a state BO ops don't: open-but-stale with", - "recoverable frozen value - stale here means recover, not wipe, so it must", - "stay distinguishable from idle." - ], - type: { - kind: "struct", - fields: [ - { - name: "totalActiveVpp", - docs: [ - "Sum of all VPP scores (0-100 each) for Trusted validators in the active list.", - "Max with 200 validators at 100 each = 20,000, fits in u32.", - "", - "Authoritatively recomputed by `conclude_addition_selection` from the active", - "list's `vpp` fields at the end of every addition-selection cycle, so any", - "intra-cycle drift from removals/score updates is wiped before allocation", - "uses this as a denominator. Do not maintain incrementally." - ], - type: "u32" - }, - { - name: "bump", - docs: ["Bump seed for PDA"], - type: "u8" - }, - { - name: "initialReserveBalance", - docs: [ - "Initial reserve balance when distribution cycle started (for batched distribution)" - ], - type: "u64" - }, - { - name: "pendingUnstakeAmountThisEpoch", - docs: [ - "Accumulates unstake requests during the epoch (before allocation starts)", - "Resets to 0 when allocation cycle begins" - ], - type: "u64" - }, - { - name: "unstakeAllocationInProgress", - docs: [ - "Whether unstake allocation is currently in progress (batched processing)" - ], - type: "bool" - }, - { - name: "validatorsProcessedThisUnstakeAllocation", - docs: [ - "Number of validators processed in the current unstake allocation batch" - ], - type: "u16" - }, - { - name: "processingUnstakeAmountThisAllocation", - docs: [ - "FROZEN amount being allocated across all batches this cycle", - "Set at start of allocation, prevents race conditions with new requests" - ], - type: "u64" - }, - { - name: "amountDistributedThisUnstakeAllocation", - docs: [ - "Tracks cumulative amount distributed across all batches in current unstake allocation cycle" - ], - type: "u64" - }, - { - name: "rebalanceInProgress", - docs: [ - "Whether rebalancing is currently in progress (batched processing)" - ], - type: "bool" - }, - { - name: "validatorsProcessedThisRebalance", - docs: [ - "Number of validators processed in the current rebalance cycle" - ], - type: "u16" - }, - { - name: "totalAmountToDistributeThisRebalance", - docs: [ - "Total amount to distribute for this rebalance cycle (after subtracting encumbered funds and buffer)", - "Saved at the start to ensure consistency across all batches" - ], - type: "u64" - }, - { - name: "cumulativeStakeRequestedThisRebalance", - docs: [ - "Tracks cumulative stake requested (sum of positive deltas) across all batches in current rebalance cycle" - ], - type: "u64" - }, - { - name: "rebalanceStakeScaleFactor", - docs: [ - "Scale factor to apply during process_stake_orders (uses PAY_RATE_SCALE_FACTOR precision)", - "Set to PAY_RATE_SCALE_FACTOR (1.0) if no scaling needed, or lower if cumulative > available" - ], - type: "u64" - }, - { - name: "isSmallDistributionMode", - docs: [ - "Whether we're in small distribution mode (not enough for VPP-based distribution)", - "In this mode, we distribute evenly to first N validators instead of using VPP ratios" - ], - type: "bool" - }, - { - name: "validatorsToFundThisRebalance", - docs: [ - "Number of validators to fund in small distribution mode", - "Calculated as floor(total_to_distribute / MIN_STAKE_DELEGATION)" - ], - type: "u16" - }, - { - name: "amountPerValidatorThisRebalance", - docs: [ - "Amount each validator gets in small distribution mode", - "Calculated as total_to_distribute / validators_to_fund" - ], - type: "u64" - }, - { - name: "selectionEntryThresholdVpp", - docs: [ - "Entry threshold VPP from leaderboard (validators must meet this to be added, 0-100)" - ], - type: "u8" - }, - { - name: "selectionExitThresholdVpp", - docs: [ - "Exit threshold VPP from leaderboard (validators below this are removed, 0-100)" - ], - type: "u8" - }, - { - name: "additionInProgress", - docs: ["DEPRECATED — see BatchOrchestrator. Always false."], - type: "bool" - }, - { - name: "unstakeAllocationStartedEpoch", - docs: [ - "Epoch in which the current unstake allocation cycle was started.", - "Used to detect stale cycles that span epoch boundaries — if the epoch", - "has advanced, the cycle is reset and restarted to avoid resuming", - "against a mutated validator active list.", - "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)" - ], - type: "u16" - }, - { - name: "rebalanceStartedEpoch", - docs: [ - "Epoch in which the current rebalance cycle was started. Same job as", - "unstake_allocation_started_epoch above — a cycle whose epoch no longer", - "matches is stale (active list may have been reshuffled by selection)", - "and gets aborted + restarted instead of resumed.", - "(Repurposed from the deprecated addition_target_rank field — always 0 on mainnet.)" - ], - type: "u16" - }, - { - name: "validatorsAddedThisSelection", - docs: ["DEPRECATED — see BatchOrchestrator. Always 0."], - type: "u16" - }, - { - name: "removalInProgress", - docs: ["DEPRECATED — see BatchOrchestrator. Always false."], - type: "bool" - }, - { - name: "removalNextIndex", - docs: [ - "DEPRECATED — see BatchOrchestrator.removal_next_index. Always 0." - ], - type: "u16" - }, - { - name: "removalActiveListSnapshot", - docs: ["DEPRECATED — see BatchOrchestrator. Always 0."], - type: "u16" - }, - { - name: "validatorsRemovedThisSelection", - docs: ["DEPRECATED — see BatchOrchestrator. Always 0."], - type: "u16" - } - ] - } - }, - { - name: "stakeControllerState", - type: { - kind: "struct", - fields: [ - { - name: "authority", - type: "pubkey" - }, - { - name: "vaultInitialized", - type: "bool" - }, - { - name: "reservePoolInitialized", - type: "bool" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "stakeMetrics", - type: { - kind: "struct", - fields: [ - { - name: "currentActiveStake", - type: "u64" - }, - { - name: "transientActiveStake", - type: "u64" - }, - { - name: "actualSystemYieldReceived", - type: "u64" - }, - { - name: "solSystemPayRate", - type: "u64" - }, - { - name: "unstakeableStake", - type: "u64" - }, - { - name: "bump", - type: "u8" - }, - { - name: "mevReward", - docs: [ - "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)" - ], - type: "u64" - }, - { - name: "totalOutstandingAmountToUnstake", - docs: [ - "WNS-16: total amount_to_unstake across all validators at last metrics refresh.", - "Represents allocated-but-not-yet-deactivated unstake obligations.", - "Subtracted from unstakeable_stake in admission control to prevent double-promising." - ], - type: "u64" - }, - { - name: "reserved", - docs: ["Reserved space for future use"], - type: { - array: ["u8", 24] - } - } - ] - } - }, - { - name: "stakesMerged", - type: { - kind: "struct", - fields: [ - { - name: "validator", - type: "pubkey" - }, - { - name: "epoch", - type: "u64" - }, - { - name: "count", - type: "u32" - }, - { - name: "amount", - type: "u64" - } - ] - } - }, - { - name: "tokenAddressEntry", - type: { - kind: "struct", - fields: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "mint", - type: "pubkey" - } - ] - } - }, - { - name: "tokenMetadata", - type: { - kind: "struct", - fields: [ - { - name: "name", - type: "string" - }, - { - name: "symbol", - type: "string" - }, - { - name: "uri", - type: "string" - } - ] - } - }, - { - name: "tokenPrecisionEntry", - type: { - kind: "struct", - fields: [ - { - name: "tokenCode", - type: "u64" - }, - { - name: "decimals", - type: "u8" - } - ] - } - }, - { - name: "trancheState", - docs: [ - "All u64 values use 8-decimal precision (SCALE = 1e8 = 100,000,000)", - "Example: $193.32 is stored as 19332000000" - ], - type: { - kind: "struct", - fields: [ - { - name: "currentTrancheNumber", - type: "u64" - }, - { - name: "currentTrancheSupply", - type: "u64" - }, - { - name: "currentTranchePriceUsd", - type: "u64" - }, - { - name: "totalPretokensSold", - type: "u64" - }, - { - name: "initialTrancheSupply", - type: "u64" - }, - { - name: "supplyGrowthBps", - docs: ["Supply growth in basis points (e.g., 100 = 1%, max 10000)"], - type: "u16" - }, - { - name: "priceGrowthCents", - docs: ["Price growth in cents per tranche (0.01 USD units)"], - type: "u16" - }, - { - name: "minPriceUsd", - docs: ["Minimum valid SOL/USD price for validation (8-dec)"], - type: "u64" - }, - { - name: "maxPriceUsd", - docs: ["Maximum valid SOL/USD price for validation (8-dec)"], - type: "u64" - }, - { - name: "maxStalenessSeconds", - docs: ["Maximum staleness in seconds for Chainlink data"], - type: "i64" - }, - { - name: "chainlinkProgram", - docs: ["Chainlink program address"], - type: "pubkey" - }, - { - name: "chainlinkFeed", - docs: ["Chainlink price feed PDA"], - type: "pubkey" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "userPretokenRecord", - type: { - kind: "struct", - fields: [ - { - name: "user", - type: "pubkey" - }, - { - name: "totalSolDeposited", - type: "u64" - }, - { - name: "totalPretokensPurchased", - type: "u64" - }, - { - name: "lastTrancheNumber", - type: "u64" - }, - { - name: "lastTranchePriceUsd", - type: "u64" - }, - { - name: "bump", - type: "u8" - } - ] - } - }, - { - name: "userRecord", - type: { - kind: "struct", - fields: [ - { - name: "shares", - docs: [ - "User's share of the distribution pool", - "entitled_balance = shares * current_index / INDEX_SCALE" - ], - type: "u64" - }, - { - name: "bump", - type: "u8" - }, - { - name: "trackedBalance", - docs: ["Last reconciled liqSOL token balance for this user ATA"], - type: "u64" - } - ] - } - }, - { - name: "validatorAddedEvent", - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - type: "pubkey" - }, - { - name: "vpp", - type: "u8" - } - ] - } - }, - { - name: "validatorInfoAccount", - docs: [ - "Per-validator information account", - 'Seed: ["validator_info", vote_account]' - ], - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - docs: ["Vote account this info belongs to"], - type: "pubkey" - }, - { - name: "vpp", - docs: ["Validator Performance Points (0-100 score)"], - type: "u8" - }, - { - name: "bump", - docs: ["Bump seed for PDA"], - type: "u8" - }, - { - name: "currentActiveStake", - docs: ["Fully active stake earning rewards"], - type: "u64" - }, - { - name: "epochReward", - docs: [ - "Rewards earned in the last epoch", - "This is update in the function: sync_validator_stakes_v2 and is a simple subtraction of current - previous active stake. This does cater for deactivations etc. so", - "no worries" - ], - type: "u64" - }, - { - name: "transientActiveStake", - docs: ["Stake warming up (activating), not fully active yet"], - type: "u64" - }, - { - name: "transientDeactivatingStake", - docs: [ - "Stake cooling down (deactivating), no longer earning rewards" - ], - type: "u64" - }, - { - name: "lastChainSyncEpoch", - docs: [ - "When was this entry last updated from the chain?", - "This is update in the function: sync_validator_stakes_v2" - ], - type: "u16" - }, - { - name: "lastScoreSyncEpoch", - docs: [ - "When was this VPP score last updated from our Validator Leaderboard program?" - ], - type: "u16" - }, - { - name: "lastStateChangeEpoch", - docs: [ - "When was the validator state last changed? (helps determine cooldowns)" - ], - type: "u16" - }, - { - name: "amountToStake", - docs: ["The amount of stake to stake"], - type: "u64" - }, - { - name: "amountToUnstake", - docs: ["The amount of stake to unstake"], - type: "u64" - }, - { - name: "validatorRepute", - docs: ["State of the validator"], - type: { - defined: { - name: "validatorReputation" - } - } - }, - { - name: "validatorState", - type: { - defined: { - name: "validatorState" - } - } - }, - { - name: "stateTransitionTriggerStakeAmount", - type: "u64" - }, - { - name: "mevEarned", - docs: ["MEV reward swept for this validator in the current epoch"], - type: "u64" - }, - { - name: "rebalanceUnstakePending", - docs: [ - "The share of amount_to_unstake that came from rebalance this epoch.", - "amount_to_unstake mixes two things with different rules: user-withdrawal", - "shares are DEBT (back receipts, never resettable) while the rebalance", - "share is INTENT (recomputed from target-vs-effective every cycle,", - "replaceable). This field makes the intent part separable so a new", - "rebalance cycle can drop a dead cycle's contribution instead of adding", - "on top of it, without ever touching user debt.", - "(Carved from _reserved - those bytes are structurally zero: introduced", - "via realloc(len, true) in migrate_validator_info_batch and zeroed by", - 'initialize() on fresh PDAs, never written since. Zero = "all existing', - "amount_to_unstake is debt\", which is exactly today's safe behavior.)" - ], - type: "u64" - }, - { - name: "rebalanceUnstakeEpoch", - docs: [ - "Epoch the rebalance component was stamped. A mismatch with the current", - "epoch means the component is a dead cycle's intent - subtract and re-add." - ], - type: "u16" - }, - { - name: "reserved", - docs: ["Reserved space for future use"], - type: { - array: ["u8", 14] - } - } - ] - } - }, - { - name: "validatorList", - docs: [ - "Zero-copy validator list account", - "Stores a fixed-capacity array of validator vote account pubkeys" - ], - serialization: "bytemuckunsafe", - repr: { - kind: "c" - }, - type: { - kind: "struct", - fields: [ - { - name: "count", - docs: ["Current number of validators in the list"], - type: "u32" - }, - { - name: "capacity", - docs: ["Maximum capacity of the list"], - type: "u32" - }, - { - name: "bump", - docs: ["PDA bump seed"], - type: "u8" - }, - { - name: "padding", - docs: ["Padding for alignment"], - type: { - array: ["u8", 7] - } - }, - { - name: "validators", - docs: [ - "Fixed array of validator vote account pubkeys", - "Using Option to allow for empty slots (None = empty)" - ], - type: { - array: [ - { - defined: { - name: "validatorListEntry" - } - }, - 200 - ] - } - } - ] - } - }, - { - name: "validatorListEntry", - serialization: "bytemuckunsafe", - repr: { - kind: "c" - }, - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - docs: ["Vote account pubkey (all zeros = empty slot)"], - type: "pubkey" - }, - { - name: "registryIndex", - docs: [ - "Immutable index into the validator leaderboard arrays (u16::MAX = unknown)" - ], - type: "u16" - }, - { - name: "pdasInitialized", - docs: [ - "Whether per-validator PDAs (info/transient) are initialized" - ], - type: "bool" - }, - { - name: "vpp", - docs: [ - "Cached VPP score (0-100) refreshed at the start of a maintenance run" - ], - type: "u8" - }, - { - name: "pad", - docs: [ - "Padding to keep 8-byte alignment (32 + 2 + 1 + 1 + 4 = 40 bytes)" - ], - type: { - array: ["u8", 4] - } - } - ] - } - }, - { - name: "validatorRemovedEvent", - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - type: "pubkey" - }, - { - name: "vpp", - type: "u8" - } - ] - } - }, - { - name: "validatorReputation", - type: { - kind: "enum", - variants: [ - { - name: "trusted" - }, - { - name: "blacklisted" - }, - { - name: "underPerforming" - } - ] - } - }, - { - name: "validatorState", - type: { - kind: "enum", - variants: [ - { - name: "warming" - }, - { - name: "notDelegated" - }, - { - name: "cooling" - }, - { - name: "warm" - }, - { - name: "readyToCool" - } - ] - } - }, - { - name: "validatorSwappedEvent", - type: { - kind: "struct", - fields: [ - { - name: "removedVote", - type: "pubkey" - }, - { - name: "removedVpp", - type: "u8" - }, - { - name: "addedVote", - type: "pubkey" - }, - { - name: "addedVpp", - type: "u8" - } - ] - } - }, - { - name: "validatorTransientAccount", - docs: [ - "Per-validator transient stake tracking account", - 'Seed: ["validator_transient", vote_account]', - "", - "This account tracks the resolution status of transient stake accounts", - "(both activating and deactivating) for a specific validator." - ], - type: { - kind: "struct", - fields: [ - { - name: "voteAccount", - docs: ["Vote account this transient tracking belongs to"], - type: "pubkey" - }, - { - name: "bump", - docs: ["Bump seed for PDA"], - type: "u8" - }, - { - name: "padding", - docs: ["Padding for alignment"], - type: { - array: ["u8", 7] - } - }, - { - name: "maxResolvedEpochDeactivations", - docs: [ - "The epoch number for which we have resolved the deactivating stakes", - "(resolved = deactivated and merged into the stake pool reserve)" - ], - type: "u16" - }, - { - name: "maxResolvedActivatingStake", - docs: [ - "The epoch number for which we have resolved the activating stakes", - "(resolved = fully activated and merged into the main stake account)" - ], - type: "u16" - }, - { - name: "lastUpdatedEpochActivations", - docs: [ - "When did we last check if there are pending activated transient stakes that need to be merged in" - ], - type: "u16" - }, - { - name: "lastUpdatedEpochDeactivations", - docs: [ - "When did we last check if there were pending deactivated stakes that need to be merged into the reserve pool" - ], - type: "u16" - } - ] - } - }, - { - name: "validatorsSyncedEvent", - type: { - kind: "struct", - fields: [ - { - name: "updatedCount", - type: "u32" - }, - { - name: "notFoundCount", - type: "u32" - }, - { - name: "epoch", - type: "u64" - } - ] - } - }, - { - name: "wireState", - type: { - kind: "enum", - variants: [ - { - name: "preLaunch" - }, - { - name: "postLaunch" - }, - { - name: "refund" - } - ] - } - }, - { - name: "withdrawClaimed", - type: { - kind: "struct", - fields: [ - { - name: "epoch", - type: "u64" - }, - { - name: "amount", - type: "u64" - }, - { - name: "user", - type: "pubkey" - } - ] - } - }, - { - name: "withdrawRequested", - type: { - kind: "struct", - fields: [ - { - name: "epoch", - type: "u64" - }, - { - name: "amount", - type: "u64" - }, - { - name: "user", - type: "pubkey" - }, - { - name: "receiptId", - type: "u64" - } - ] - } - } - ] -} as const - -/** Strict Anchor IDL type generated from the checked-in liqsol_core artifact. */ -export type LiqsolCore = Idl & typeof liqsolCoreIdlValue - -/** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ -export const liqsolCoreIdl = liqsolCoreIdlValue as LiqsolCore diff --git a/packages/sdk-outpost/src/programs/solana/generated/index.ts b/packages/sdk-outpost/src/programs/solana/generated/index.ts deleted file mode 100644 index 678debf..0000000 --- a/packages/sdk-outpost/src/programs/solana/generated/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./LiqsolCore.js" diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts new file mode 100644 index 0000000..01f0dce --- /dev/null +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -0,0 +1,89 @@ +import { + EthereumContractName, + OutpostArtifactManifests, + SolanaProgramName, + type OutpostDeployment, + parseOutpostDeployment +} from "@wireio/sdk-outpost" + +const TestHash = "a".repeat(64), + TestRevision = "b".repeat(40), + TestWireChainId = "c".repeat(64), + TestEthereumAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + TestSolanaGenesisHash = "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", + TestSolanaProgramAddress = "11111111111111111111111111111111" + +/** Create a valid runtime deployment aligned with the compiled artifact packages. */ +export function createDeploymentFixture(): OutpostDeployment { + const ethereumContracts = Object.fromEntries( + Object.values(EthereumContractName).map(contractName => [ + contractName, + { + address: TestEthereumAddress, + artifactSha256: + OutpostArtifactManifests.ethereum.contracts[contractName] + .artifactSha256 + } + ]) + ), + deployment = { + schemaVersion: 1, + id: `${TestWireChainId}-${TestHash.slice(0, 12)}`, + artifactBundle: { + generatedAt: "2026-07-31T15:47:46Z", + sourceArchiveSha256: TestHash, + clusterManifestSha256: TestHash, + deploymentChecksum: TestHash, + snapshotChecksum: TestHash, + platformRelease: { + tag: "v1.0.0", + url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", + manifest: { + repository: "Wire-Network/wire-platform-manifest", + revision: TestRevision + }, + libraries: { + repository: "Wire-Network/wire-libraries-ts", + revision: TestRevision + } + }, + sources: { + wireTools: { + repository: "Wire-Network/wire-tools-ts", + revision: TestRevision + }, + wireSysio: { + repository: "Wire-Network/wire-sysio", + revision: TestRevision + }, + wireEthereum: { + repository: "Wire-Network/wire-ethereum", + revision: TestRevision + }, + wireSolana: { + repository: "Wire-Network/wire-solana", + revision: TestRevision + } + } + }, + wire: { chainId: TestWireChainId }, + ethereum: { + chainId: 31_337, + contracts: ethereumContracts + }, + solana: { + genesisHash: TestSolanaGenesisHash, + programs: { + [SolanaProgramName.liqsolCore]: { + address: TestSolanaProgramAddress, + artifactSha256: + OutpostArtifactManifests.solana.programs[ + SolanaProgramName.liqsolCore + ].idlSha256 + } + } + } + } + + return parseOutpostDeployment(deployment) +} diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index a0d9d99..95b4a02 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -1,67 +1,61 @@ -import Crypto from "node:crypto" -import Fs from "node:fs" -import Path from "node:path" - import { - CurrentOutpostDeployment, EthereumContractName, OPP__factory, OperatorRegistry__factory, - OutpostDeployments, + OutpostArtifactManifests, + OutpostChainFamily, ReserveManager__factory, SolanaProgramName, + assertOutpostArtifactCompatibility, liqsolCoreIdl } from "@wireio/sdk-outpost" -const PackagePath = Path.resolve(__dirname, "../..") +import { createDeploymentFixture } from "../Fixtures.js" -function sha256(file: string): string { - return Crypto.createHash("sha256").update(Fs.readFileSync(file)).digest("hex") -} +describe("source-owned outpost artifacts", () => { + it("records exact producer package identity", () => { + expect(OutpostArtifactManifests.ethereum.package.name).toBe( + "@wireio/outpost-ethereum-artifacts" + ) + expect(OutpostArtifactManifests.solana.package.name).toBe( + "@wireio/outpost-solana-artifacts" + ) + }) -describe("versioned deployment assets", () => { - it.each(OutpostDeployments)( - "matches every $id artifact digest", - deployment => { - Object.values(EthereumContractName).forEach(contractName => { - const contract = deployment.ethereum.contracts[contractName] + it.each(Object.values(OutpostChainFamily))( + "accepts a runtime deployment aligned with %s artifacts", + family => { + expect(() => + assertOutpostArtifactCompatibility(createDeploymentFixture(), family) + ).not.toThrow() + } + ) - expect( - sha256( - Path.join( - PackagePath, - "src/assets", - deployment.wire.chainId, - deployment.artifactBundle.deploymentChecksum, - "ethereum", - `${contractName}.json` - ) - ) - ).toBe(contract.artifactSha256) - }) + it("rejects a runtime deployment with an incompatible Ethereum ABI", () => { + const deployment = createDeploymentFixture() + deployment.ethereum.contracts[ + EthereumContractName.ReserveManager + ].artifactSha256 = "f".repeat(64) - const program = deployment.solana.programs[SolanaProgramName.liqsolCore] + expect(() => + assertOutpostArtifactCompatibility( + deployment, + OutpostChainFamily.ethereum + ) + ).toThrow("Ethereum ReserveManager artifact mismatch") + }) - expect( - sha256( - Path.join( - PackagePath, - "src/assets", - deployment.wire.chainId, - deployment.artifactBundle.deploymentChecksum, - "solana", - "liqsol_core.json" - ) - ) - ).toBe(program.artifactSha256) - } - ) + it("rejects a runtime deployment with an incompatible Solana IDL", () => { + const deployment = createDeploymentFixture() + deployment.solana.programs[SolanaProgramName.liqsolCore].artifactSha256 = + "f".repeat(64) - it("generates the current callable swap and collateral surfaces", () => { - expect(liqsolCoreIdl.address).toBe( - CurrentOutpostDeployment.solana.programs[SolanaProgramName.liqsolCore] - .address - ) + expect(() => + assertOutpostArtifactCompatibility(deployment, OutpostChainFamily.solana) + ).toThrow("Solana liqsolCore artifact mismatch") + }) + + it("generates the callable swap and collateral surfaces", () => { expect(OPP__factory.abi.length).toBeGreaterThan(0) expect( OPP__factory.createInterface().getFunction("addAttestation") diff --git a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts index 68be32e..9a73766 100644 --- a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts @@ -3,20 +3,22 @@ import { Connection, Keypair, SystemProgram } from "@solana/web3.js" import { providers } from "ethers" import { - CurrentOutpostDeployment, EthereumOutpostClient, OutpostChainFamily, OutpostClient, SolanaOutpostClient } from "@wireio/sdk-outpost" +import { createDeploymentFixture } from "../Fixtures.js" -function createSolanaProvider(): AnchorProvider { +function createSolanaProvider( + deployment = createDeploymentFixture() +): AnchorProvider { const connection = new Connection("http://127.0.0.1:8899"), provider = new AnchorProvider(connection, new Wallet(Keypair.generate())) jest .spyOn(connection, "getGenesisHash") - .mockResolvedValue(CurrentOutpostDeployment.solana.genesisHash) + .mockResolvedValue(deployment.solana.genesisHash) jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ data: Buffer.alloc(0), executable: true, @@ -29,9 +31,10 @@ function createSolanaProvider(): AnchorProvider { describe("OutpostClient", () => { it("preserves the precise Ethereum client type", async () => { - const provider = new providers.JsonRpcProvider() + const deployment = createDeploymentFixture(), + provider = new providers.JsonRpcProvider() jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: CurrentOutpostDeployment.ethereum.chainId, + chainId: deployment.ethereum.chainId, name: "wire-outpost" }) jest.spyOn(provider, "getCode").mockResolvedValue("0x01") @@ -39,7 +42,7 @@ describe("OutpostClient", () => { const client = await OutpostClient.create({ family: OutpostChainFamily.ethereum, options: { - deployment: CurrentOutpostDeployment, + deployment, connection: provider } }) @@ -48,11 +51,12 @@ describe("OutpostClient", () => { }) it("preserves the precise Solana client type", async () => { + const deployment = createDeploymentFixture() const client = await OutpostClient.create({ family: OutpostChainFamily.solana, options: { - deployment: CurrentOutpostDeployment, - provider: createSolanaProvider() + deployment, + provider: createSolanaProvider(deployment) } }) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 8cb8039..1e7d15d 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -3,9 +3,9 @@ import { providers } from "ethers" import { EthereumContractName, EthereumOutpostClient, - OutpostDeployments, type OutpostDeployment } from "@wireio/sdk-outpost" +import { createDeploymentFixture } from "../../Fixtures.js" const DeployedCode = "0x01" @@ -22,28 +22,25 @@ function createProvider( } describe("EthereumOutpostClient", () => { - it.each(OutpostDeployments)( - "verifies $id and returns a generated contract type", - async deployment => { - const provider = createProvider(deployment), - client = await EthereumOutpostClient.create({ - deployment, - connection: provider - }), - reserveManager = client.contract(EthereumContractName.ReserveManager) + it("verifies a deployment and returns a generated contract type", async () => { + const deployment = createDeploymentFixture(), + provider = createProvider(deployment), + client = await EthereumOutpostClient.create({ + deployment, + connection: provider + }), + reserveManager = client.contract(EthereumContractName.ReserveManager) - expect(reserveManager.address).toBe( - deployment.ethereum.contracts[EthereumContractName.ReserveManager] - .address - ) - expect(provider.getCode).toHaveBeenCalledTimes( - Object.values(EthereumContractName).length - ) - } - ) + expect(reserveManager.address).toBe( + deployment.ethereum.contracts[EthereumContractName.ReserveManager].address + ) + expect(provider.getCode).toHaveBeenCalledTimes( + Object.values(EthereumContractName).length + ) + }) it("rejects the wrong Ethereum chain", async () => { - const deployment = OutpostDeployments[0], + const deployment = createDeploymentFixture(), provider = createProvider(deployment) jest.spyOn(provider, "getNetwork").mockResolvedValue({ chainId: 1, @@ -59,7 +56,7 @@ describe("EthereumOutpostClient", () => { }) it("rejects a configured contract without bytecode", async () => { - const deployment = OutpostDeployments[0], + const deployment = createDeploymentFixture(), provider = createProvider(deployment) jest.spyOn(provider, "getCode").mockResolvedValue("0x") diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index 1119b6d..88e7457 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -2,11 +2,11 @@ import { AnchorProvider, Wallet } from "@coral-xyz/anchor" import { Connection, Keypair, SystemProgram } from "@solana/web3.js" import { - OutpostDeployments, type OutpostDeployment, SolanaOutpostClient, SolanaProgramName } from "@wireio/sdk-outpost" +import { createDeploymentFixture } from "../../Fixtures.js" function createProvider(deployment: OutpostDeployment): AnchorProvider { const connection = new Connection("http://127.0.0.1:8899"), @@ -26,24 +26,22 @@ function createProvider(deployment: OutpostDeployment): AnchorProvider { } describe("SolanaOutpostClient", () => { - it.each(OutpostDeployments)( - "verifies $id and returns a generated program type", - async deployment => { - const provider = createProvider(deployment), - client = await SolanaOutpostClient.create({ - deployment, - provider - }), - program = client.program(SolanaProgramName.liqsolCore) + it("verifies a deployment and returns its runtime program address", async () => { + const deployment = createDeploymentFixture(), + provider = createProvider(deployment), + client = await SolanaOutpostClient.create({ + deployment, + provider + }), + program = client.program(SolanaProgramName.liqsolCore) - expect(program.programId.toBase58()).toBe( - deployment.solana.programs[SolanaProgramName.liqsolCore].address - ) - } - ) + expect(program.programId.toBase58()).toBe( + deployment.solana.programs[SolanaProgramName.liqsolCore].address + ) + }) it("rejects the wrong Solana cluster", async () => { - const deployment = OutpostDeployments[0], + const deployment = createDeploymentFixture(), provider = createProvider(deployment) jest .spyOn(provider.connection, "getGenesisHash") @@ -58,7 +56,7 @@ describe("SolanaOutpostClient", () => { }) it("rejects a configured program that is not executable", async () => { - const deployment = OutpostDeployments[0], + const deployment = createDeploymentFixture(), provider = createProvider(deployment) jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue(null) diff --git a/packages/sdk-outpost/tests/deployments/Registry.test.ts b/packages/sdk-outpost/tests/deployments/Registry.test.ts deleted file mode 100644 index 3963089..0000000 --- a/packages/sdk-outpost/tests/deployments/Registry.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { - CurrentOutpostDeployment, - OutpostDeployments, - assertOutpostDeployment, - getOutpostDeployment -} from "@wireio/sdk-outpost" - -describe("assertOutpostDeployment", () => { - it.each(OutpostDeployments)( - "resolves $id from its parent Wire chain", - deployment => { - expect(assertOutpostDeployment(deployment.wire.chainId)).toBe(deployment) - expect(getOutpostDeployment(deployment.id)).toBe(deployment) - } - ) - - it("keeps the generated deployment explicit", () => { - expect(OutpostDeployments).toContain(CurrentOutpostDeployment) - expect(OutpostDeployments).toHaveLength(2) - }) - - it("accepts sdk-core compatible chain identity objects", () => { - const deployment = OutpostDeployments[0] - - expect( - assertOutpostDeployment({ hexString: deployment.wire.chainId }) - ).toBe(deployment) - }) - - it("rejects an unsupported Wire chain", () => { - const unsupportedChainId = "f".repeat(64) - - expect(() => assertOutpostDeployment(unsupportedChainId)).toThrow( - unsupportedChainId - ) - }) -}) diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index 2c4c1e4..e3bfe40 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -2,89 +2,22 @@ import { EthereumContractName, parseOutpostDeployment } from "@wireio/sdk-outpost" - -const Hash = "a".repeat(64), - Revision = "b".repeat(40), - WireChainId = "c".repeat(64), - EthereumAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - SolanaAddress = "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH" - -function createDeploymentFixture() { - const ethereumContract = { - address: EthereumAddress, - artifactSha256: Hash - } - return { - schemaVersion: 1, - id: `${WireChainId}-${Hash.slice(0, 12)}`, - artifactBundle: { - generatedAt: "2026-07-31T15:47:46Z", - sourceArchiveSha256: Hash, - clusterManifestSha256: Hash, - deploymentChecksum: Hash, - snapshotChecksum: Hash, - platformRelease: { - tag: "v1.0.0", - url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - manifest: { - repository: "Wire-Network/wire-platform-manifest", - revision: Revision - }, - libraries: { - repository: "Wire-Network/wire-libraries-ts", - revision: Revision - } - }, - sources: { - wireTools: { - repository: "Wire-Network/wire-tools-ts", - revision: Revision - }, - wireSysio: { - repository: "Wire-Network/wire-sysio", - revision: Revision - }, - wireEthereum: { - repository: "Wire-Network/wire-ethereum", - revision: Revision - }, - wireSolana: { - repository: "Wire-Network/wire-solana", - revision: Revision - } - } - }, - wire: { chainId: WireChainId }, - ethereum: { - chainId: 31_337, - contracts: { - OPP: ethereumContract, - OPPInbound: ethereumContract, - OperatorRegistry: ethereumContract, - ReserveManager: ethereumContract - } - }, - solana: { - genesisHash: SolanaAddress, - programs: { - liqsolCore: { - address: SolanaAddress, - artifactSha256: Hash - } - } - } - } -} +import { createDeploymentFixture } from "../Fixtures.js" describe("OutpostDeploymentSchema", () => { it("parses a valid deployment with its Wire chain identity", () => { const deployment = parseOutpostDeployment(createDeploymentFixture()) - expect(deployment.id).toBe(`${WireChainId}-${Hash.slice(0, 12)}`) - expect(deployment.wire.chainId).toBe(WireChainId) + expect(deployment.id).toBe( + `${deployment.wire.chainId}-${deployment.artifactBundle.deploymentChecksum.slice(0, 12)}` + ) expect( deployment.ethereum.contracts[EthereumContractName.ReserveManager].address - ).toBe(EthereumAddress) + ).toBe( + createDeploymentFixture().ethereum.contracts[ + EthereumContractName.ReserveManager + ].address + ) }) it("rejects an invalid contract address", () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c1425e9..a9eae32 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,6 +75,9 @@ importers: typescript-eslint: specifier: ^8.64.0 version: 8.64.0(eslint@10.7.0)(typescript@6.0.2) + zx: + specifier: ^8.8.5 + version: 8.8.5 examples/web-logging-example: dependencies: @@ -4286,6 +4289,11 @@ packages: zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zx@8.8.5: + resolution: {integrity: sha512-SNgDF5L0gfN7FwVOdEFguY3orU5AkfFZm9B5YSHog/UDHv+lvmd82ZAsOenOkQixigwH2+yyH198AwNdKhj+RA==} + engines: {node: '>= 12.17.0'} + hasBin: true + snapshots: '@3fv/guard@1.4.39': @@ -8982,3 +8990,5 @@ snapshots: yocto-queue@0.1.0: {} zod@4.4.3: {} + + zx@8.8.5: {} diff --git a/scripts/sdk-outpost/clean.mjs b/scripts/sdk-outpost/clean.mjs new file mode 100644 index 0000000..8129996 --- /dev/null +++ b/scripts/sdk-outpost/clean.mjs @@ -0,0 +1,8 @@ +#!/usr/bin/env zx + +import { fs, path } from "zx" + +import { PackagePath } from "./config.mjs" + +/** Remove compiled sdk-outpost package outputs. */ +await fs.rm(path.join(PackagePath, "lib"), { force: true, recursive: true }) diff --git a/scripts/sdk-outpost/config.mjs b/scripts/sdk-outpost/config.mjs new file mode 100644 index 0000000..3585fb3 --- /dev/null +++ b/scripts/sdk-outpost/config.mjs @@ -0,0 +1,30 @@ +import { fileURLToPath } from "node:url" + +import { fs, path } from "zx" + +const ScriptPath = path.dirname(fileURLToPath(import.meta.url)) + +/** Absolute path to the wire-libraries-ts repository root. */ +export const RepositoryPath = path.resolve(ScriptPath, "../..") + +/** Absolute path to the sdk-outpost package. */ +export const PackagePath = path.join(RepositoryPath, "packages/sdk-outpost") + +/** sdk-outpost package manifest used as the dependency resolution root. */ +export const PackageManifestPath = path.join(PackagePath, "package.json") + +/** Source-owned Ethereum artifact package consumed at SDK build time. */ +export const EthereumArtifactPackageName = "@wireio/outpost-ethereum-artifacts" + +/** Source-owned Solana artifact package consumed at SDK build time. */ +export const SolanaArtifactPackageName = "@wireio/outpost-solana-artifacts" + +/** Parse one JSON file from disk. */ +export async function readJson(file) { + return JSON.parse(await fs.readFile(file, "utf8")) +} + +/** Fail a build-time invariant with a focused message. */ +export function assert(condition, message) { + if (!condition) throw new Error(message) +} diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs new file mode 100644 index 0000000..af0d2d8 --- /dev/null +++ b/scripts/sdk-outpost/generate.mjs @@ -0,0 +1,149 @@ +#!/usr/bin/env zx + +import { createRequire } from "node:module" + +import { format } from "prettier" +import { $, fs, path } from "zx" + +import { + EthereumArtifactPackageName, + PackageManifestPath, + PackagePath, + SolanaArtifactPackageName, + assert, + readJson +} from "./config.mjs" + +const PackageRequire = createRequire(PackageManifestPath), + EthereumManifestPath = PackageRequire.resolve( + `${EthereumArtifactPackageName}/manifest.json` + ), + SolanaManifestPath = PackageRequire.resolve( + `${SolanaArtifactPackageName}/manifest.json` + ), + EthereumOutputPath = path.join( + PackagePath, + "src/contracts/ethereum/generated" + ), + SolanaOutputPath = path.join(PackagePath, "src/programs/solana/generated"), + ArtifactOutputPath = path.join(PackagePath, "src/artifacts/generated"), + EthereumContractNames = [ + "OPP", + "OPPInbound", + "OperatorRegistry", + "ReserveManager" + ], + SolanaProgramName = "liqsolCore", + TypechainPath = path.join(PackagePath, "node_modules/.bin/typechain") + +/** Resolve one exported file from a source-owned artifact package. */ +function resolveArtifact(packageName, artifactPath) { + return PackageRequire.resolve(`${packageName}/${artifactPath}`) +} + +/** Format generated TypeScript according to repository rules. */ +async function formatTypescript(source) { + return format(source, { + parser: "typescript", + semi: false, + singleQuote: false, + trailingComma: "none" + }) +} + +const [ethereumManifest, solanaManifest] = await Promise.all([ + readJson(EthereumManifestPath), + readJson(SolanaManifestPath) +]) + +assert( + ethereumManifest.package.name === EthereumArtifactPackageName, + `Unexpected Ethereum artifact package ${ethereumManifest.package.name}` +) +assert( + solanaManifest.package.name === SolanaArtifactPackageName, + `Unexpected Solana artifact package ${solanaManifest.package.name}` +) +assert( + EthereumContractNames.every(name => ethereumManifest.contracts[name] != null), + "Ethereum artifact package does not cover the sdk-outpost contract surface" +) +assert( + solanaManifest.programs[SolanaProgramName] != null, + "Solana artifact package does not cover liqsol_core" +) + +await Promise.all( + [EthereumOutputPath, SolanaOutputPath, ArtifactOutputPath].map(outputPath => + fs.rm(outputPath, { force: true, recursive: true }) + ) +) +await Promise.all( + [SolanaOutputPath, ArtifactOutputPath].map(outputPath => + fs.mkdir(outputPath, { recursive: true }) + ) +) + +const ethereumInputs = EthereumContractNames.map(name => + resolveArtifact( + EthereumArtifactPackageName, + ethereumManifest.contracts[name].path + ) +) + +await $({ + cwd: PackagePath +})`${TypechainPath} --target ethers-v5 --node16-modules --out-dir ${EthereumOutputPath} ${ethereumInputs}` + +const { convertIdlToCamelCase } = PackageRequire( + "@coral-xyz/anchor/dist/cjs/idl.js" + ), + solanaProgram = solanaManifest.programs[SolanaProgramName], + rawIdl = await readJson( + resolveArtifact(SolanaArtifactPackageName, solanaProgram.idlPath) + ), + idl = convertIdlToCamelCase(rawIdl), + solanaSource = await formatTypescript(` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + import type { Idl } from "@coral-xyz/anchor" + + const liqsolCoreIdlValue = ${JSON.stringify(idl, null, 2)} as const + + /** Strict Anchor IDL type generated from the wire-solana artifact package. */ + export type LiqsolCore = Idl & Omit + + /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ + export const liqsolCoreIdl = liqsolCoreIdlValue as LiqsolCore + `), + artifactSource = await formatTypescript(` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + + /** Exact source-owned artifact manifests compiled into this SDK build. */ + export const OutpostArtifactManifests = ${JSON.stringify( + { + ethereum: ethereumManifest, + solana: solanaManifest + }, + null, + 2 + )} as const + `) + +await Promise.all([ + fs.writeFile(path.join(SolanaOutputPath, "LiqsolCore.ts"), solanaSource), + fs.writeFile( + path.join(SolanaOutputPath, "index.ts"), + 'export * from "./LiqsolCore.js"\n' + ), + fs.writeFile(path.join(ArtifactOutputPath, "Manifests.ts"), artifactSource), + fs.writeFile( + path.join(ArtifactOutputPath, "index.ts"), + 'export * from "./Manifests.js"\n' + ) +]) + +process.stdout.write( + `Generated sdk-outpost clients from ${ethereumManifest.package.name}@${ethereumManifest.package.version} and ${solanaManifest.package.name}@${solanaManifest.package.version}\n` +) diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs new file mode 100644 index 0000000..d2da4ad --- /dev/null +++ b/scripts/sdk-outpost/verify-package.mjs @@ -0,0 +1,93 @@ +#!/usr/bin/env zx + +import { createRequire } from "node:module" +import { pathToFileURL } from "node:url" + +import { fs, path } from "zx" + +import { PackagePath, assert, readJson } from "./config.mjs" + +const packageJson = await readJson(path.join(PackagePath, "package.json")), + readme = await fs.readFile(path.join(PackagePath, "README.md"), "utf8"), + ExpectedRepository = "https://github.com/Wire-Network/wire-libraries-ts", + ExpectedPublishedFiles = ["lib/cjs", "lib/esm", "README.md"], + ExpectedExports = [ + "EthereumOutpostClient", + "OutpostArtifactManifests", + "OutpostClient", + "SolanaOutpostClient", + "assertOutpostArtifactCompatibility", + "parseOutpostDeployment" + ] + +assert(packageJson.name === "@wireio/sdk-outpost", "Unexpected package name") +assert(packageJson.private === false, "Package must be public") +assert( + packageJson.publishConfig?.access === "public", + "Package access must be public" +) +assert( + packageJson.repository?.url === ExpectedRepository, + "Repository URL must match provenance source" +) +assert( + packageJson.repository?.directory === "packages/sdk-outpost", + "Repository directory is incorrect" +) +assert( + packageJson.license === "FSL-1.1-Apache-2.0", + "Package license is missing" +) +assert( + JSON.stringify(packageJson.files) === JSON.stringify(ExpectedPublishedFiles), + "Published files must stay limited to built outputs and README" +) +assert( + !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(readme), + "Public README contains an environment-specific release label" +) + +await Promise.all( + [ + "lib/cjs/index.js", + "lib/cjs/index.d.ts", + "lib/cjs/package.json", + "lib/esm/index.js", + "lib/esm/index.d.ts", + "lib/esm/package.json" + ].map(outputPath => fs.access(path.join(PackagePath, outputPath))) +) + +/** Return every file beneath a package output directory. */ +async function filesUnder(directory) { + const entries = await fs.readdir(directory, { withFileTypes: true }), + paths = await Promise.all( + entries.map(entry => { + const child = path.join(directory, entry.name) + return entry.isDirectory() ? filesUnder(child) : [child] + }) + ) + + return paths.flat() +} + +const publishedOutputPaths = await filesUnder(path.join(PackagePath, "lib")) +assert( + publishedOutputPaths.every( + outputPath => !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(outputPath) + ), + "Built output contains an environment-specific release label" +) + +const require = createRequire(import.meta.url), + cjs = require(path.join(PackagePath, packageJson.main)), + esm = await import(pathToFileURL(path.join(PackagePath, packageJson.module))) + +ExpectedExports.forEach(name => { + assert(name in cjs, `CommonJS entrypoint is missing ${name}`) + assert(name in esm, `ES module entrypoint is missing ${name}`) +}) + +process.stdout.write( + "Verified sdk-outpost package boundaries and entrypoints\n" +) From e126e159b4f91d521616bac0cfea289334d6ea11 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 4 Aug 2026 15:33:29 -0400 Subject: [PATCH 13/48] Link source-owned outpost artifacts in platform builds --- .pnpmfile.cjs | 79 +++++++++++++++++++++++++++++++++++++++++---------- BUILD.bazel | 24 +++++++++------- CLAUDE.md | 3 ++ README.md | 6 ++++ 4 files changed, 86 insertions(+), 26 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index b2bca3e..7422bba 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -4,9 +4,9 @@ * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. * * Usage: - * 1. Add packages you want to link to the `localOverrides` map below. - * 2. Run `pnpm install` — pnpm will use these local paths instead of the registry. - * 3. Comment out or remove entries to revert to registry versions. + * 1. Build the required sibling-repository artifact outputs. + * 2. Set the corresponding WIRE_LINK_LOCAL_* environment variable. + * 3. Run `pnpm install --lockfile=false` to use local paths instead of the registry. * * Docs: https://pnpm.io/pnpmfile */ @@ -14,6 +14,20 @@ const Path = require("path") const Fs = require("node:fs") +const linkLocalOppModelsEnv = "WIRE_LINK_LOCAL_OPP_MODELS" +const linkLocalOutpostArtifactsEnv = "WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS" +const localOppModelTargets = ["typescript", "solidity"] +const localOutpostArtifactPackages = [ + [ + "@wireio/outpost-ethereum-artifacts", + Path.resolve(__dirname, "..", "wire-ethereum", "sdk-artifacts") + ], + [ + "@wireio/outpost-solana-artifacts", + Path.resolve(__dirname, "..", "wire-solana", "sdk-artifacts") + ] +] + /** * Checks whether a path exists and is a directory, without throwing. * @@ -28,26 +42,61 @@ function isDirectory(dirPath) { } } +/** + * Checks whether an opt-in local-link environment variable is enabled. + * + * @param {string} name + * @returns {boolean} + */ +function isEnabledEnvironment(name) { + return process.env[name] === "1" || process.env[name] === "true" +} + /** * Map of package names to their local directory in wire-libraries-ts. * Uncomment the entries you want to link locally. */ const localOverrides = {} -// AS THE PROTOBUF LIBS HAVE BEEN RELOCATED TO SYSIO -// WE CAN NOW USE THE MODELS WITHOUT ISSUE. -// CIRCULAR DEP REMOVED +/** + * Links local OPP model outputs for platform builds that already built wire-sysio. + * Normal package installs keep registry resolution so pnpm-lock.yaml is portable. + */ +function appendLocalOppModelOverrides() { + if (!isEnabledEnvironment(linkLocalOppModelsEnv)) { + return + } + + localOppModelTargets + .map(target => [ + `@wireio/opp-${target}-models`, + Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) + ]) + .filter(([, path]) => isDirectory(path)) + .forEach(([pkgName, path]) => { + localOverrides[pkgName] = path + }) +} + +/** + * Links source-owned outpost packages generated by sibling chain repositories. + * Standalone and release installs keep registry resolution so their lockfile + * remains portable and exact published versions stay authoritative. + */ +function appendLocalOutpostArtifactOverrides() { + if (!isEnabledEnvironment(linkLocalOutpostArtifactsEnv)) { + return + } -const wireOPPPkgPaths = ["typescript", "solidity"].map(target => [ - `@wireio/opp-${target}-models`, - Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) -]) + localOutpostArtifactPackages + .filter(([, path]) => isDirectory(path)) + .forEach(([pkgName, path]) => { + localOverrides[pkgName] = path + }) +} -wireOPPPkgPaths - .filter(([, path]) => isDirectory(path)) - .forEach(([pkgName, path]) => { - localOverrides[pkgName] = path - }) +appendLocalOppModelOverrides() +appendLocalOutpostArtifactOverrides() /** * `readPackage` hook, which links locally available versions of diff --git a/BUILD.bazel b/BUILD.bazel index 5bfda7a..4f37ee4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,14 +2,13 @@ # wire-libraries-ts — @wireio/sdk-core, @wireio/shared, wallet ext, and the # OPP model code generators. pnpm workspace (packages/*). # ============================================================================= -# Chain position 3: depends on //wire-sysio:build. This is a REAL functional -# edge, not just ordering: the repo's .pnpmfile.cjs resolves -# @wireio/opp-typescript-models from wire-sysio/build/opp/typescript, and -# sdk-core's tsc build references symbols from the current proto (e.g. -# ChainKind.EVM). Build wire-sysio first and that codegen exists; skip it and -# pnpm falls back to the stale registry @wireio/opp-typescript-models, which -# fails to compile (verified 2026-05-26). The wire-sysio dep guarantees the -# codegen is on disk before this runs. +# Chain position 3: depends on //wire-sysio:build and the two source-owned +# outpost-artifact targets. These are REAL functional edges, not just ordering: +# the repo's .pnpmfile.cjs resolves OPP models from wire-sysio/build/opp and the +# generated @wireio/outpost-{ethereum,solana}-artifacts packages from their +# sibling chain repositories. The dedicated producer targets depend only on +# wire-sysio, which keeps the graph acyclic before the full Ethereum and Solana +# builds follow libraries-ts. # ============================================================================= load("//:build_defs.bzl", "js_workspace_build") @@ -32,9 +31,12 @@ filegroup( js_workspace_build( name = "build", - # wire-sysio emits the OPP codegen this repo's .pnpmfile.cjs consumes. - deps = ["//wire-sysio:build"], - install_cmd = "WIRE_LINK_LOCAL_OPP_MODELS=1 pnpm install --lockfile=false", + deps = [ + "//wire-ethereum:outpost_artifacts", + "//wire-solana:outpost_artifacts", + "//wire-sysio:build", + ], + install_cmd = "WIRE_LINK_LOCAL_OPP_MODELS=1 WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1 pnpm install --lockfile=false", package_manager = "pnpm", tags = ["ts"], # Unit tests gate the platform build (and thus the e2e gate) — skippable diff --git a/CLAUDE.md b/CLAUDE.md index 06ea477..3bcb519 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,6 +8,8 @@ pnpm install # Install registry deps (pnpm 10.34.5, Node >=22) # Link local OPP models from wire-sysio: WIRE_LINK_LOCAL_OPP_MODELS=1 pnpm install --lockfile=false +# Link generated source-owned ETH/SOL outpost artifact packages: +WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1 pnpm install --lockfile=false pnpm build # Build all packages via tsc -b pnpm build:dev # Watch mode (incremental) pnpm test # Build + jest (all packages) @@ -228,6 +230,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. - Runtime addresses, chain identities, deployment provenance, and artifact digests come from the platform manifest pipeline. A cluster respin with unchanged interfaces must not require a producer artifact or SDK release. - Client creation rejects runtime deployment digests that do not match the producer artifacts compiled into the SDK. If a producer interface changes, publish an immutable artifact version and update the exact sdk-outpost build dependency. +- Coordinated platform builds set `WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1` only after the sibling Ethereum and Solana artifact targets succeed. Standalone and release installs use exact published package versions. - Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; staking migration remains separate scope. - `sdk-outpost` releases run through the repository-wide patch workflow. Keep `prepack` and both CI release checks passing; do not manually bump or publish the package outside the documented first-release recovery path. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 diff --git a/README.md b/README.md index 03359c4..95bd0ad 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,12 @@ pnpm test GitHub Actions builds hybrid package outputs, generates `sdk-outpost` clients from the exact `wire-ethereum` and `wire-solana` artifact packages, verifies its entrypoints, increments every publishable workspace package, and publishes to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. See [`packages/sdk-outpost/RELEASING.md`](packages/sdk-outpost/RELEASING.md) for its artifact prerequisites and first-publication checklist. +Coordinated `repo`-tool platform builds generate those artifact packages in the +sibling chain repositories and opt into local resolution with +`WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1`. Standalone and release installs leave the +flag unset and consume exact published versions; the local link is a development +and cross-repository validation path, not a replacement publication channel. + ## Project Structure ``` From a20ea7bc11e7332ead3bac195a19786069a49a8b Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 4 Aug 2026 15:50:00 -0400 Subject: [PATCH 14/48] Narrow local artifact linking to pnpm --- .pnpmfile.cjs | 28 +++++++++++++--------------- BUILD.bazel | 24 +++++++++++------------- CLAUDE.md | 3 --- README.md | 6 ------ 4 files changed, 24 insertions(+), 37 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 7422bba..228bbda 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -4,9 +4,9 @@ * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. * * Usage: - * 1. Build the required sibling-repository artifact outputs. - * 2. Set the corresponding WIRE_LINK_LOCAL_* environment variable. - * 3. Run `pnpm install --lockfile=false` to use local paths instead of the registry. + * 1. Add packages you want to link to the `localOverrides` map below. + * 2. Run `pnpm install` — pnpm will use these local paths instead of the registry. + * 3. Comment out or remove entries to revert to registry versions. * * Docs: https://pnpm.io/pnpmfile */ @@ -42,16 +42,6 @@ function isDirectory(dirPath) { } } -/** - * Checks whether an opt-in local-link environment variable is enabled. - * - * @param {string} name - * @returns {boolean} - */ -function isEnabledEnvironment(name) { - return process.env[name] === "1" || process.env[name] === "true" -} - /** * Map of package names to their local directory in wire-libraries-ts. * Uncomment the entries you want to link locally. @@ -63,7 +53,11 @@ const localOverrides = {} * Normal package installs keep registry resolution so pnpm-lock.yaml is portable. */ function appendLocalOppModelOverrides() { - if (!isEnabledEnvironment(linkLocalOppModelsEnv)) { + const shouldLinkLocalOppModels = + process.env[linkLocalOppModelsEnv] === "1" || + process.env[linkLocalOppModelsEnv] === "true" + + if (!shouldLinkLocalOppModels) { return } @@ -84,7 +78,11 @@ function appendLocalOppModelOverrides() { * remains portable and exact published versions stay authoritative. */ function appendLocalOutpostArtifactOverrides() { - if (!isEnabledEnvironment(linkLocalOutpostArtifactsEnv)) { + const shouldLinkLocalOutpostArtifacts = + process.env[linkLocalOutpostArtifactsEnv] === "1" || + process.env[linkLocalOutpostArtifactsEnv] === "true" + + if (!shouldLinkLocalOutpostArtifacts) { return } diff --git a/BUILD.bazel b/BUILD.bazel index 4f37ee4..5bfda7a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,13 +2,14 @@ # wire-libraries-ts — @wireio/sdk-core, @wireio/shared, wallet ext, and the # OPP model code generators. pnpm workspace (packages/*). # ============================================================================= -# Chain position 3: depends on //wire-sysio:build and the two source-owned -# outpost-artifact targets. These are REAL functional edges, not just ordering: -# the repo's .pnpmfile.cjs resolves OPP models from wire-sysio/build/opp and the -# generated @wireio/outpost-{ethereum,solana}-artifacts packages from their -# sibling chain repositories. The dedicated producer targets depend only on -# wire-sysio, which keeps the graph acyclic before the full Ethereum and Solana -# builds follow libraries-ts. +# Chain position 3: depends on //wire-sysio:build. This is a REAL functional +# edge, not just ordering: the repo's .pnpmfile.cjs resolves +# @wireio/opp-typescript-models from wire-sysio/build/opp/typescript, and +# sdk-core's tsc build references symbols from the current proto (e.g. +# ChainKind.EVM). Build wire-sysio first and that codegen exists; skip it and +# pnpm falls back to the stale registry @wireio/opp-typescript-models, which +# fails to compile (verified 2026-05-26). The wire-sysio dep guarantees the +# codegen is on disk before this runs. # ============================================================================= load("//:build_defs.bzl", "js_workspace_build") @@ -31,12 +32,9 @@ filegroup( js_workspace_build( name = "build", - deps = [ - "//wire-ethereum:outpost_artifacts", - "//wire-solana:outpost_artifacts", - "//wire-sysio:build", - ], - install_cmd = "WIRE_LINK_LOCAL_OPP_MODELS=1 WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1 pnpm install --lockfile=false", + # wire-sysio emits the OPP codegen this repo's .pnpmfile.cjs consumes. + deps = ["//wire-sysio:build"], + install_cmd = "WIRE_LINK_LOCAL_OPP_MODELS=1 pnpm install --lockfile=false", package_manager = "pnpm", tags = ["ts"], # Unit tests gate the platform build (and thus the e2e gate) — skippable diff --git a/CLAUDE.md b/CLAUDE.md index 3bcb519..06ea477 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,8 +8,6 @@ pnpm install # Install registry deps (pnpm 10.34.5, Node >=22) # Link local OPP models from wire-sysio: WIRE_LINK_LOCAL_OPP_MODELS=1 pnpm install --lockfile=false -# Link generated source-owned ETH/SOL outpost artifact packages: -WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1 pnpm install --lockfile=false pnpm build # Build all packages via tsc -b pnpm build:dev # Watch mode (incremental) pnpm test # Build + jest (all packages) @@ -230,7 +228,6 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. - Runtime addresses, chain identities, deployment provenance, and artifact digests come from the platform manifest pipeline. A cluster respin with unchanged interfaces must not require a producer artifact or SDK release. - Client creation rejects runtime deployment digests that do not match the producer artifacts compiled into the SDK. If a producer interface changes, publish an immutable artifact version and update the exact sdk-outpost build dependency. -- Coordinated platform builds set `WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1` only after the sibling Ethereum and Solana artifact targets succeed. Standalone and release installs use exact published package versions. - Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; staking migration remains separate scope. - `sdk-outpost` releases run through the repository-wide patch workflow. Keep `prepack` and both CI release checks passing; do not manually bump or publish the package outside the documented first-release recovery path. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 diff --git a/README.md b/README.md index 95bd0ad..03359c4 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,6 @@ pnpm test GitHub Actions builds hybrid package outputs, generates `sdk-outpost` clients from the exact `wire-ethereum` and `wire-solana` artifact packages, verifies its entrypoints, increments every publishable workspace package, and publishes to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. See [`packages/sdk-outpost/RELEASING.md`](packages/sdk-outpost/RELEASING.md) for its artifact prerequisites and first-publication checklist. -Coordinated `repo`-tool platform builds generate those artifact packages in the -sibling chain repositories and opt into local resolution with -`WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS=1`. Standalone and release installs leave the -flag unset and consume exact published versions; the local link is a development -and cross-repository validation path, not a replacement publication channel. - ## Project Structure ``` From 35897500cfdcc91f6b75df3158c66dcf09109a4b Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 4 Aug 2026 15:51:55 -0400 Subject: [PATCH 15/48] Narrow sdk-outpost integration scope --- .gitignore | 1 - CLAUDE.md | 15 ++++----------- README.md | 4 ++-- package.json | 2 +- pnpm-lock.yaml | 16 ++++++++-------- pnpm-workspace.yaml | 1 - 6 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 1890c88..c43a8bb 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,6 @@ yarn-error.log* # JUnit test-result output (CI artifact) /reports/ -/junit.xml # oh-my-claudecode runtime state (operational artifacts, never committed) .omc/ diff --git a/CLAUDE.md b/CLAUDE.md index 06ea477..2f2b154 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -194,8 +194,6 @@ Every new/modified symbol ships unit tests in the same change. Tests never assum ## CI/CD -- Use product- or change-focused branch names, commit messages, pull-request titles, and pull-request descriptions. Do not add automated-authoring labels or attribution to repository history or review metadata. - GitHub Actions (`.github/workflows/publish-npm.yaml`): - Triggers on push to `master` (skips if `[skip release]` in commit message) - Bumps all packages patch version (`pnpm -r exec -- pnpm version patch`) @@ -221,15 +219,10 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns strictly typed Ethereum/Solana clients and validates caller-supplied runtime deployments. Canonical ABIs and IDLs are published by `wire-ethereum` and `wire-solana`; do not copy their outputs into this repository or import generated OPP model packages. -- `sdk-outpost` deployment payloads are untrusted data boundaries validated with Zod. ABI/IDL-derived contract and program types remain generator-owned and must never be re-declared as Zod schemas. -- `scripts/sdk-outpost/` consumes exact producer artifact package versions with `zx`. Generated TypeChain, Anchor, and artifact-manifest sources are ignored build outputs compiled into the release; never edit or commit them. -- `sdk-outpost` clients accept caller-owned Ethers/Anchor providers, verify chain identity and deployed bytecode/program executability during asynchronous creation, and expose one typed `OutpostClient` facade. Do not hard-code RPC transport into deployment records. -- Consumer feature gates must combine SDK deployment verification with flow-specific platform capability checks. A connected typed contract or program is not proof that stake, swap, settlement, or retry lifecycles are operational. -- Runtime addresses, chain identities, deployment provenance, and artifact digests come from the platform manifest pipeline. A cluster respin with unchanged interfaces must not require a producer artifact or SDK release. -- Client creation rejects runtime deployment digests that do not match the producer artifacts compiled into the SDK. If a producer interface changes, publish an immutable artifact version and update the exact sdk-outpost build dependency. -- Hub swap integration should consume `sdk-outpost` for typed external `ReserveManager`, `OperatorRegistry`, and `liqsol_core` access. Wire-chain orchestration stays in `sdk-core`; staking migration remains separate scope. -- `sdk-outpost` releases run through the repository-wide patch workflow. Keep `prepack` and both CI release checks passing; do not manually bump or publish the package outside the documented first-release recovery path. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied deployments. Canonical ABIs and IDLs come from exact packages published by `wire-ethereum` and `wire-solana`; generated clients are ignored build outputs and must not be copied or edited here. +- `sdk-outpost` accepts caller-owned providers and runtime manifest data. A cluster respin with unchanged interfaces must not require an artifact or SDK release. +- A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. +- Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/README.md b/README.md index 03359c4..d4bdc0c 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi ## Requirements -- **Node.js** 24 for CI and releases -- **pnpm** 10.34.5 through Corepack +- **Node.js** >= 24 +- **pnpm** >= 9 ## Getting Started diff --git a/package.json b/package.json index fe61981..6d3bf09 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w --preserveWatchOutput", - "build": "pnpm --dir packages/sdk-outpost run prepare:compile && pnpm run compile && pnpm -r --if-present run fix:hybrid:exports", + "build": "pnpm --dir packages/sdk-outpost run prepare:compile && pnpm run compile && pnpm --dir packages/sdk-outpost run fix:hybrid:exports", "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9eae32..ade7455 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-aSegbCvK5TyBUeMcgQLjFgZgcFmq1CMqHT+lQb93Qks= +pnpmfileChecksum: sha256-l5MT63RFu2+KTSHDSf/PtK5iN6T6YIAeV3ky+GtQlBk= importers: @@ -19,7 +19,7 @@ importers: dependencies: '@wireio/opp-typescript-models': specifier: ^1.0.26 - version: 1.0.47 + version: 1.0.30 devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -144,7 +144,7 @@ importers: version: 1.9.7 '@wireio/opp-typescript-models': specifier: ^1.0.26 - version: 1.0.47 + version: 1.0.30 '@wireio/shared': specifier: workspace:* version: link:../shared @@ -1658,8 +1658,8 @@ packages: webpack-dev-server: optional: true - '@wireio/opp-typescript-models@1.0.47': - resolution: {integrity: sha512-YmeRvOSXUgNtG6S2ASIs/5UDz4BbkGOv3B58yVvRkV/OoSoQhQSe1my9+evG8gKb126VxmgJ/n9OS4Zh0Ifcjw==} + '@wireio/opp-typescript-models@1.0.30': + resolution: {integrity: sha512-g6DSdq5KULRhp604sYkT0u+0TgjORoc+26FIUdepIeFJpEm9YlBKkJshXTUnDdUKz8fB6LUhW2NRQp/shIgrUg==} '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -5698,7 +5698,7 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 22.20.0 + '@types/node': 25.5.0 '@types/debug@4.1.13': dependencies: @@ -5827,7 +5827,7 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 22.20.0 + '@types/node': 25.5.0 '@types/yargs-parser@21.0.3': {} @@ -6096,7 +6096,7 @@ snapshots: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.104.1) - '@wireio/opp-typescript-models@1.0.47': + '@wireio/opp-typescript-models@1.0.30': dependencies: '@protobuf-ts/runtime': 2.11.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6b24193..5eef171 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -12,7 +12,6 @@ overrides: prettier: 3.8.1 "typechain>prettier": 2.8.8 tracer: 1.3.0 - uuid: "11" webpack: 5.104.1 webpack-cli: 6.0.1 webpack-dev-server: 6.0.0 From 601be0a1f3e04571bd95ebe7638e8472db37f718 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 4 Aug 2026 16:01:16 -0400 Subject: [PATCH 16/48] Keep root publishing documentation unchanged --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4bdc0c..2bb1546 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ pnpm test ## Publishing -GitHub Actions builds hybrid package outputs, generates `sdk-outpost` clients from the exact `wire-ethereum` and `wire-solana` artifact packages, verifies its entrypoints, increments every publishable workspace package, and publishes to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. See [`packages/sdk-outpost/RELEASING.md`](packages/sdk-outpost/RELEASING.md) for its artifact prerequisites and first-publication checklist. +GitHub Actions publishes non-private workspace packages to npm with provenance. Each published package manifest must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` or npm will reject provenance validation. ## Project Structure From 03f1ad87a5eace00ee7c26d420a781dbe79b3f1c Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 4 Aug 2026 17:00:38 -0400 Subject: [PATCH 17/48] build: link local outpost artifact outputs --- .pnpmfile.cjs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 228bbda..74d3802 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -20,11 +20,23 @@ const localOppModelTargets = ["typescript", "solidity"] const localOutpostArtifactPackages = [ [ "@wireio/outpost-ethereum-artifacts", - Path.resolve(__dirname, "..", "wire-ethereum", "sdk-artifacts") + Path.resolve( + __dirname, + "..", + "wire-ethereum", + "build", + "sdk-artifacts" + ) ], [ "@wireio/outpost-solana-artifacts", - Path.resolve(__dirname, "..", "wire-solana", "sdk-artifacts") + Path.resolve( + __dirname, + "..", + "wire-solana", + "build", + "sdk-artifacts" + ) ] ] From 69087c4e414b62750e11f700ab51f18e81ff87e4 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Wed, 5 Aug 2026 13:18:54 -0400 Subject: [PATCH 18/48] feat(sdk-outpost): verify immutable deployment profiles --- CLAUDE.md | 4 +- packages/sdk-outpost/README.md | 61 +++-- packages/sdk-outpost/RELEASING.md | 12 +- .../src/artifacts/Compatibility.ts | 27 +-- .../clients/ethereum/EthereumOutpostClient.ts | 53 ++--- .../sdk-outpost/src/clients/ethereum/Types.ts | 6 +- .../src/clients/solana/SolanaOutpostClient.ts | 43 +--- .../sdk-outpost/src/clients/solana/Types.ts | 6 +- .../sdk-outpost/src/deployments/Schema.ts | 107 ++++----- packages/sdk-outpost/src/index.ts | 1 + .../verification/OutpostDeploymentVerifier.ts | 225 ++++++++++++++++++ .../sdk-outpost/src/verification/Types.ts | 30 +++ .../sdk-outpost/src/verification/index.ts | 2 + packages/sdk-outpost/tests/Fixtures.ts | 173 ++++++++++---- .../tests/assets/Artifacts.test.ts | 29 ++- .../tests/clients/OutpostClient.test.ts | 68 ++---- .../ethereum/EthereumOutpostClient.test.ts | 81 ++++--- .../solana/SolanaOutpostClient.test.ts | 108 +++++---- .../tests/deployments/Schema.test.ts | 41 ++-- .../OutpostDeploymentVerifier.test.ts | 43 ++++ scripts/sdk-outpost/verify-package.mjs | 3 +- 21 files changed, 732 insertions(+), 391 deletions(-) create mode 100644 packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts create mode 100644 packages/sdk-outpost/src/verification/Types.ts create mode 100644 packages/sdk-outpost/src/verification/index.ts create mode 100644 packages/sdk-outpost/tests/verification/OutpostDeploymentVerifier.test.ts diff --git a/CLAUDE.md b/CLAUDE.md index 2f2b154..f1ad87f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -219,8 +219,8 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied deployments. Canonical ABIs and IDLs come from exact packages published by `wire-ethereum` and `wire-solana`; generated clients are ignored build outputs and must not be copied or edited here. -- `sdk-outpost` accepts caller-owned providers and runtime manifest data. A cluster respin with unchanged interfaces must not require an artifact or SDK release. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact packages published by `wire-ethereum` and `wire-solana`; generated clients are ignored build outputs and must not be copied or edited here. +- `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index c66b650..6bc464d 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -5,8 +5,8 @@ alongside a Wire chain. `@wireio/sdk-core` owns Wire-chain identity, signing, and `sysio.*` workflows. This package owns verified external-chain clients. Contract ABIs are published -by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and runtime -deployment data remains caller-supplied. +by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable +deployment profiles remain caller-supplied. Available on npm: @@ -26,37 +26,48 @@ module entrypoints with TypeScript declarations. | Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager` | | Solana | `liqsol_core` | -Client creation verifies all three boundaries before returning: +Client creation verifies all four boundaries before returning: -- the supplied deployment digests match the ABI/IDL packages compiled into this +- the supplied ABI/IDL digests match the producer packages compiled into this SDK release; - the provider is connected to the expected external chain; -- every configured contract has bytecode and every configured Solana program is - executable. +- every Ethereum proxy resolves through its EIP-1967 implementation slot to the + configured implementation address and exact implementation code hash; +- every Solana program resolves through the upgradeable loader to the configured + ProgramData account and exact ProgramData hash. These checks prove deployment compatibility, not end-to-end feature readiness. Applications must still gate swaps, staking, settlement, retry, funding, and underwriting using platform capability evidence. -## Runtime deployment data +## Deployment profiles -The SDK does not contain a network catalog. Resolve the selected Wire network -group in the application, load its deployment document from the platform -manifest pipeline, and validate that untrusted input with -`parseOutpostDeployment`. +The SDK does not contain a mutable network or endpoint catalog. Resolve the +selected Wire network group in the application, load its immutable deployment +profile from the platform release/deployment pipeline, and validate that +untrusted input with `parseOutpostDeploymentProfile`. -A deployment document carries: +A deployment profile carries: - the full parent Wire chain ID; -- the Ethereum chain ID and deployed contract addresses; -- the Solana genesis hash and deployed program addresses; -- platform and source provenance; -- deployment and interface digests used for compatibility checks. +- one deployment checksum and deployment-checksum-derived profile ID; +- the Ethereum chain ID, proxy addresses, implementation addresses, ABI hashes, + and exact live implementation code hashes; +- the Solana genesis hash, program and ProgramData addresses, IDL hash, and + exact live ProgramData hash. RPC URLs, private keys, wallet state, and mutable capability results are not SDK -data. A cluster respin updates the runtime deployment document without requiring -an SDK or interface-package release when the underlying ABI and IDL are -unchanged. +data. Keep mutable RPC/explorer endpoints in a separate catalog that points to a +deployment-profile ID. A cluster respin with the same deployable code creates a +new profile without requiring a producer-artifact or SDK release. + +| Change | Producer artifact release | `sdk-outpost` release | Deployment profile | +| ------------------------------------------------------- | ------------------------- | --------------------- | ----------------------------------------- | +| Same-code chain respin | No | No | New | +| Contract/program binary change with unchanged ABI/IDL | Yes | No | New | +| ABI or IDL change | Yes | Yes | New | +| Asset/reserve onboarding without code/interface changes | No | No | Update operational configuration/evidence | +| RPC or explorer rotation | No | No | Update endpoint catalog only | ## Usage @@ -70,14 +81,14 @@ import { EthereumContractName, OutpostChainFamily, OutpostClient, - parseOutpostDeployment + parseOutpostDeploymentProfile } from "@wireio/sdk-outpost" -const deployment = parseOutpostDeployment(clusterManifest.outpost) +const profile = parseOutpostDeploymentProfile(platformRelease.outpostProfile) const ethereum = await OutpostClient.create({ family: OutpostChainFamily.ethereum, options: { - deployment, + profile, connection: new providers.JsonRpcProvider(ethereumRpcUrl) } }) @@ -96,7 +107,7 @@ import { const solana = await OutpostClient.create({ family: OutpostChainFamily.solana, - options: { deployment, provider: anchorProvider } + options: { profile, provider: anchorProvider } }) const liqsol = solana.program(SolanaProgramName.liqsolCore) ``` @@ -105,7 +116,7 @@ const liqsol = solana.program(SolanaProgramName.liqsolCore) `@wireio/outpost-ethereum-artifacts` and `@wireio/outpost-solana-artifacts` are build-time inputs. Their exact manifests are compiled into -`OutpostArtifactManifests` for deployment compatibility and readiness reporting. +`OutpostArtifactManifests` for interface compatibility and readiness reporting. Generated TypeChain and Anchor sources are ignored local build outputs; they are compiled into the published package and are never maintained by hand in this repository. @@ -116,7 +127,7 @@ repository. `OPP`, `OPPInbound`, and `liqsol_core` access. - Use `@wireio/sdk-core` for Wire transaction construction, reserve and token registries, underwriting state, and settlement correlation. -- Rebuild external clients whenever the selected Wire network group changes. +- Recreate external clients whenever the selected deployment profile changes. - Combine SDK deployment verification with flow-specific capability gates before enabling a product action. diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index 5ab7196..133208f 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -11,10 +11,12 @@ The package consumes exact build-time versions of: - `@wireio/outpost-ethereum-artifacts`, published from `wire-ethereum`; - `@wireio/outpost-solana-artifacts`, published from `wire-solana`. -Publish a new producer package only when its source ABI or IDL changes. A new -deployment, address, endpoint, or network-group respin belongs in the runtime -platform manifest and does not require these packages or `sdk-outpost` to be -republished. +Publish a new producer package when its ABI/IDL or deployable contract/program +binary changes. Publish `sdk-outpost` when its public behavior changes or a new +ABI/IDL must be compiled into generated clients. A same-code deployment respin, +address change, or endpoint rotation does not require either package to be +republished; emit a new immutable deployment profile for a respin and update the +separate endpoint catalog for mutable endpoints. Before updating either dependency, verify its npm provenance, source revision, artifact checksums, and immutable version. Keep both versions exact in @@ -28,7 +30,7 @@ pnpm-compatible install. - Generate clients only through `scripts/sdk-outpost/generate.mjs`; never edit generated TypeChain, Anchor, or artifact-manifest sources by hand. - Confirm the package contains no secrets, RPC credentials, private keys, - addresses, or mutable environment configuration. + deployment addresses, or mutable environment configuration. - Keep `repository.url` exactly equal to `https://github.com/Wire-Network/wire-libraries-ts` for npm provenance. diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index 40297fc..79b8042 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -3,46 +3,45 @@ import { match } from "ts-pattern" import { EthereumContractName, OutpostChainFamily, - OutpostDeployment, + OutpostDeploymentProfile, SolanaProgramName } from "../deployments/index.js" import { OutpostArtifactManifests } from "./generated/index.js" -/** Assert that one deployment digest matches the interface compiled into the SDK. */ -function assertArtifactDigest( +/** Assert that one profile digest matches the interface compiled into the SDK. */ +function assertInterfaceDigest( actual: string, expected: string, label: string ): void { if (actual !== expected) { throw new Error( - `${label} artifact mismatch: expected ${expected}, received ${actual}` + `${label} interface mismatch: expected ${expected}, received ${actual}` ) } } -/** Verify that a runtime deployment matches this SDK's source-owned artifacts. */ +/** Verify that a deployment profile matches this SDK's source-owned interfaces. */ export function assertOutpostArtifactCompatibility( - deployment: OutpostDeployment, + profile: OutpostDeploymentProfile, family: OutpostChainFamily ): void { match(family) .with(OutpostChainFamily.ethereum, () => Object.values(EthereumContractName).forEach(contractName => - assertArtifactDigest( - deployment.ethereum.contracts[contractName].artifactSha256, - OutpostArtifactManifests.ethereum.contracts[contractName] - .artifactSha256, - `Ethereum ${contractName}` + assertInterfaceDigest( + profile.ethereum.contracts[contractName].abiSha256, + OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, + `Ethereum ${contractName} ABI` ) ) ) .with(OutpostChainFamily.solana, () => Object.values(SolanaProgramName).forEach(programName => - assertArtifactDigest( - deployment.solana.programs[programName].artifactSha256, + assertInterfaceDigest( + profile.solana.programs[programName].idlSha256, OutpostArtifactManifests.solana.programs[programName].idlSha256, - `Solana ${programName}` + `Solana ${programName} IDL` ) ) ) diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index d5757be..61fbd62 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -1,7 +1,6 @@ import { providers, Signer } from "ethers" import { match } from "ts-pattern" -import { assertOutpostArtifactCompatibility } from "../../artifacts/index.js" import { OPPInbound__factory, OPP__factory, @@ -12,6 +11,7 @@ import { EthereumContractName, OutpostChainFamily } from "../../deployments/index.js" +import { OutpostDeploymentVerifier } from "../../verification/index.js" import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" function resolveProvider( @@ -26,36 +26,18 @@ function resolveProvider( /** Strictly typed access to one verified Ethereum outpost deployment. */ export class EthereumOutpostClient { - private static readonly EmptyCode = "0x" - - /** Create a client after verifying chain identity and deployed bytecode. */ + /** Create a client after verifying its interface and exact live implementation. */ static async create( options: EthereumOutpostClientOptions ): Promise { - const { connection, deployment } = options, - provider = resolveProvider(connection), - network = await provider.getNetwork() - - assertOutpostArtifactCompatibility(deployment, OutpostChainFamily.ethereum) - - if (network.chainId !== deployment.ethereum.chainId) { - throw new Error( - `Ethereum chain mismatch: expected ${deployment.ethereum.chainId}, received ${network.chainId}` - ) - } + const { connection, profile } = options, + provider = resolveProvider(connection) - await Promise.all( - Object.values(EthereumContractName).map(async contractName => { - const { address } = deployment.ethereum.contracts[contractName], - code = await provider.getCode(address) - - if (code === EthereumOutpostClient.EmptyCode) { - throw new Error( - `Ethereum contract ${contractName} is not deployed at ${address}` - ) - } - }) - ) + await OutpostDeploymentVerifier.verify({ + family: OutpostChainFamily.ethereum, + profile, + provider + }) return new EthereumOutpostClient(options, provider) } @@ -65,38 +47,37 @@ export class EthereumOutpostClient { readonly provider: providers.Provider ) {} - /** Deployment used to verify and connect this client. */ - get deployment(): EthereumOutpostClientOptions["deployment"] { - return this.options.deployment + /** Deployment profile used to verify and connect this client. */ + get profile(): EthereumOutpostClientOptions["profile"] { + return this.options.profile } /** Connect a generated contract client by its typed deployment name. */ contract(name: T): EthereumContractMap[T] { - const { connection, deployment } = this.options, + const { connection, profile } = this.options, contract = match(name as EthereumContractName) .with(EthereumContractName.OPP, () => OPP__factory.connect( - deployment.ethereum.contracts[EthereumContractName.OPP].address, + profile.ethereum.contracts[EthereumContractName.OPP].address, connection ) ) .with(EthereumContractName.OPPInbound, () => OPPInbound__factory.connect( - deployment.ethereum.contracts[EthereumContractName.OPPInbound] - .address, + profile.ethereum.contracts[EthereumContractName.OPPInbound].address, connection ) ) .with(EthereumContractName.OperatorRegistry, () => OperatorRegistry__factory.connect( - deployment.ethereum.contracts[EthereumContractName.OperatorRegistry] + profile.ethereum.contracts[EthereumContractName.OperatorRegistry] .address, connection ) ) .with(EthereumContractName.ReserveManager, () => ReserveManager__factory.connect( - deployment.ethereum.contracts[EthereumContractName.ReserveManager] + profile.ethereum.contracts[EthereumContractName.ReserveManager] .address, connection ) diff --git a/packages/sdk-outpost/src/clients/ethereum/Types.ts b/packages/sdk-outpost/src/clients/ethereum/Types.ts index 9a08bbe..0006b2c 100644 --- a/packages/sdk-outpost/src/clients/ethereum/Types.ts +++ b/packages/sdk-outpost/src/clients/ethereum/Types.ts @@ -6,13 +6,13 @@ import type { OperatorRegistry, ReserveManager } from "../../contracts/ethereum/index.js" -import type { OutpostDeployment } from "../../deployments/index.js" +import type { OutpostDeploymentProfile } from "../../deployments/index.js" import { EthereumContractName } from "../../deployments/index.js" /** Inputs required to connect an Ethereum outpost client. */ export interface EthereumOutpostClientOptions { - /** Validated deployment selected from the parent Wire chain. */ - deployment: OutpostDeployment + /** Immutable deployment profile selected from the parent Wire chain. */ + profile: OutpostDeploymentProfile /** Ethers provider or connected signer for the target Ethereum chain. */ connection: providers.Provider | Signer } diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index a96648a..0ec4383 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -1,46 +1,27 @@ import { Program } from "@coral-xyz/anchor" -import { PublicKey } from "@solana/web3.js" import { match } from "ts-pattern" -import { assertOutpostArtifactCompatibility } from "../../artifacts/index.js" import { OutpostChainFamily, SolanaProgramName } from "../../deployments/index.js" import { LiqsolCore, liqsolCoreIdl } from "../../programs/solana/index.js" +import { OutpostDeploymentVerifier } from "../../verification/index.js" import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" /** Strictly typed access to one verified Solana outpost deployment. */ export class SolanaOutpostClient { - /** Create a client after verifying cluster identity and executable programs. */ + /** Create a client after verifying its interface and exact live program data. */ static async create( options: SolanaOutpostClientOptions ): Promise { - const { deployment, provider } = options, - genesisHash = await provider.connection.getGenesisHash() + const { profile, provider } = options - assertOutpostArtifactCompatibility(deployment, OutpostChainFamily.solana) - - if (genesisHash !== deployment.solana.genesisHash) { - throw new Error( - `Solana genesis mismatch: expected ${deployment.solana.genesisHash}, received ${genesisHash}` - ) - } - - await Promise.all( - Object.values(SolanaProgramName).map(async programName => { - const { address } = deployment.solana.programs[programName], - account = await provider.connection.getAccountInfo( - new PublicKey(address) - ) - - if (account == null || !account.executable) { - throw new Error( - `Solana program ${programName} is not executable at ${address}` - ) - } - }) - ) + await OutpostDeploymentVerifier.verify({ + family: OutpostChainFamily.solana, + profile, + connection: provider.connection + }) return new SolanaOutpostClient(options) } @@ -48,7 +29,7 @@ export class SolanaOutpostClient { private constructor(private readonly options: SolanaOutpostClientOptions) { const address = - options.deployment.solana.programs[SolanaProgramName.liqsolCore].address + options.profile.solana.programs[SolanaProgramName.liqsolCore].address this.liqsolCore = new Program( { ...liqsolCoreIdl, address }, @@ -61,9 +42,9 @@ export class SolanaOutpostClient { return this.options.provider } - /** Deployment used to verify and connect this client. */ - get deployment(): SolanaOutpostClientOptions["deployment"] { - return this.options.deployment + /** Deployment profile used to verify and connect this client. */ + get profile(): SolanaOutpostClientOptions["profile"] { + return this.options.profile } /** Return a generated Anchor program client by typed deployment name. */ diff --git a/packages/sdk-outpost/src/clients/solana/Types.ts b/packages/sdk-outpost/src/clients/solana/Types.ts index 23d737c..f9c02b6 100644 --- a/packages/sdk-outpost/src/clients/solana/Types.ts +++ b/packages/sdk-outpost/src/clients/solana/Types.ts @@ -1,13 +1,13 @@ import type { AnchorProvider, Program } from "@coral-xyz/anchor" -import type { OutpostDeployment } from "../../deployments/index.js" +import type { OutpostDeploymentProfile } from "../../deployments/index.js" import { SolanaProgramName } from "../../deployments/index.js" import type { LiqsolCore } from "../../programs/solana/index.js" /** Inputs required to connect a Solana outpost client. */ export interface SolanaOutpostClientOptions { - /** Validated deployment selected from the parent Wire chain. */ - deployment: OutpostDeployment + /** Immutable deployment profile selected from the parent Wire chain. */ + profile: OutpostDeploymentProfile /** Anchor provider for the target Solana cluster. */ provider: AnchorProvider } diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index 4aa7569..0a54442 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -4,12 +4,20 @@ import { z } from "zod" import { EthereumContractName, SolanaProgramName } from "./Types.js" -const SourceRevisionSchema = z.string().regex(/^[0-9a-f]{8,40}$/), - Sha256Schema = z.string().regex(/^[0-9a-f]{64}$/), +const Sha256Schema = z.string().regex(/^[0-9a-f]{64}$/), WireChainIdSchema = z.string().regex(/^[0-9a-f]{64}$/), - EthereumAddressSchema = z - .string() - .refine(ethersUtils.isAddress, "Invalid Ethereum address"), + EthereumAddressSchema = z.string().transform((value, context) => { + try { + return ethersUtils.getAddress(value) + } catch (error: unknown) { + const message = error instanceof Error ? error.message : String(error) + context.addIssue({ + code: "custom", + message: `Invalid Ethereum address: ${message}` + }) + return z.NEVER + } + }), SolanaAddressSchema = z.string().transform((value, context) => { try { return new PublicKey(value).toBase58() @@ -23,92 +31,69 @@ const SourceRevisionSchema = z.string().regex(/^[0-9a-f]{8,40}$/), } }) -/** Source repository identity embedded in an artifact bundle. */ -export const ArtifactSourceSchema = z.object({ - repository: z.string().regex(/^Wire-Network\/[a-z0-9-]+$/), - revision: SourceRevisionSchema -}) - -/** Metadata proving where an SDK artifact bundle came from. */ -export const ArtifactBundleSchema = z.object({ - generatedAt: z.iso.datetime(), - sourceArchiveSha256: Sha256Schema, - clusterManifestSha256: Sha256Schema, - deploymentChecksum: Sha256Schema, - snapshotChecksum: Sha256Schema, - platformRelease: z.object({ - tag: z.string().regex(/^v\d+\.\d+\.\d+$/), - url: z.url(), - manifest: ArtifactSourceSchema, - libraries: ArtifactSourceSchema - }), - sources: z.object({ - wireTools: ArtifactSourceSchema, - wireSysio: ArtifactSourceSchema, - wireEthereum: ArtifactSourceSchema, - wireSolana: ArtifactSourceSchema - }) -}) - -/** Runtime metadata for one deployed Ethereum contract. */ -export const EthereumContractDeploymentSchema = z.object({ +/** Compatibility and runtime identity for one deployed Ethereum contract. */ +export const EthereumContractDeploymentProfileSchema = z.object({ address: EthereumAddressSchema, - artifactSha256: Sha256Schema + implementationAddress: EthereumAddressSchema, + abiSha256: Sha256Schema, + implementationCodeSha256: Sha256Schema }) -/** Runtime metadata for one deployed Solana program. */ -export const SolanaProgramDeploymentSchema = z.object({ +/** Compatibility and runtime identity for one deployed Solana program. */ +export const SolanaProgramDeploymentProfileSchema = z.object({ address: SolanaAddressSchema, - artifactSha256: Sha256Schema + programDataAddress: SolanaAddressSchema, + idlSha256: Sha256Schema, + programDataSha256: Sha256Schema }) -/** Complete deployment schema for a Wire network group. */ -export const OutpostDeploymentSchema = z +/** Immutable compatibility profile for one Wire outpost deployment. */ +export const OutpostDeploymentProfileSchema = z .object({ schemaVersion: z.literal(1), id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), - artifactBundle: ArtifactBundleSchema, + deploymentChecksum: Sha256Schema, wire: z.object({ chainId: WireChainIdSchema }), ethereum: z.object({ chainId: z.number().int().positive(), contracts: z.object({ - [EthereumContractName.OPP]: EthereumContractDeploymentSchema, - [EthereumContractName.OPPInbound]: EthereumContractDeploymentSchema, + [EthereumContractName.OPP]: EthereumContractDeploymentProfileSchema, + [EthereumContractName.OPPInbound]: + EthereumContractDeploymentProfileSchema, [EthereumContractName.OperatorRegistry]: - EthereumContractDeploymentSchema, - [EthereumContractName.ReserveManager]: EthereumContractDeploymentSchema + EthereumContractDeploymentProfileSchema, + [EthereumContractName.ReserveManager]: + EthereumContractDeploymentProfileSchema }) }), solana: z.object({ genesisHash: SolanaAddressSchema, programs: z.object({ - [SolanaProgramName.liqsolCore]: SolanaProgramDeploymentSchema + [SolanaProgramName.liqsolCore]: SolanaProgramDeploymentProfileSchema }) }) }) - .superRefine((deployment, context) => { - const expectedId = `${deployment.wire.chainId}-${deployment.artifactBundle.deploymentChecksum.slice(0, 12)}` - if (deployment.id !== expectedId) { + .superRefine((profile, context) => { + const expectedId = `${profile.wire.chainId}-${profile.deploymentChecksum.slice(0, 12)}` + if (profile.id !== expectedId) { context.addIssue({ code: "custom", - message: `Deployment id must be ${expectedId}`, + message: `Deployment profile id must be ${expectedId}`, path: ["id"] }) } }) -/** Parsed source-repository identity. */ -export type ArtifactSource = z.infer - -/** Parsed artifact-bundle provenance. */ -export type ArtifactBundle = z.infer - -/** Parsed, runtime-safe outpost deployment. */ -export type OutpostDeployment = z.infer +/** Parsed, runtime-safe outpost deployment profile. */ +export type OutpostDeploymentProfile = z.infer< + typeof OutpostDeploymentProfileSchema +> -/** Validate an untrusted deployment document at its JSON boundary. */ -export function parseOutpostDeployment(value: unknown): OutpostDeployment { - return OutpostDeploymentSchema.parse(value) +/** Validate an untrusted deployment profile at its JSON boundary. */ +export function parseOutpostDeploymentProfile( + value: unknown +): OutpostDeploymentProfile { + return OutpostDeploymentProfileSchema.parse(value) } diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts index 7d66b3f..17e3e60 100644 --- a/packages/sdk-outpost/src/index.ts +++ b/packages/sdk-outpost/src/index.ts @@ -3,3 +3,4 @@ export * from "./artifacts/index.js" export * from "./contracts/index.js" export * from "./deployments/index.js" export * from "./programs/index.js" +export * from "./verification/index.js" diff --git a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts new file mode 100644 index 0000000..2b551b2 --- /dev/null +++ b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts @@ -0,0 +1,225 @@ +import { PublicKey } from "@solana/web3.js" +import type { AccountInfo, Connection } from "@solana/web3.js" +import type { BytesLike, providers } from "ethers" +import { utils as ethersUtils } from "ethers" +import { match } from "ts-pattern" + +import { assertOutpostArtifactCompatibility } from "../artifacts/index.js" +import { + EthereumContractName, + OutpostChainFamily, + SolanaProgramName, + type OutpostDeploymentProfile +} from "../deployments/index.js" +import type { OutpostDeploymentVerificationInput } from "./Types.js" + +const EmptyEthereumCode = "0x", + Eip1967ImplementationStorageSlot = + "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", + Eip1967ImplementationAddressOffset = 12, + UpgradeableLoaderStateTagByteLength = 4, + SolanaPublicKeyByteLength = 32, + UpgradeableLoaderProgramDataAddressEnd = + UpgradeableLoaderStateTagByteLength + SolanaPublicKeyByteLength + +enum UpgradeableLoaderStateTag { + program = 2, + programData = 3 +} + +/** Canonical Solana upgradeable-loader program identity. */ +export const SolanaUpgradeableLoaderProgramId = new PublicKey( + "BPFLoaderUpgradeab1e11111111111111111111111" +) + +function sha256(value: BytesLike): string { + return ethersUtils.sha256(value).slice(2) +} + +function upgradeableLoaderStateTag(data: Uint8Array): number { + if (data.byteLength < UpgradeableLoaderStateTagByteLength) { + throw new Error("Solana upgradeable-loader account data is truncated") + } + return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint32( + 0, + true + ) +} + +function assertSolanaUpgradeableLoaderAccount( + account: AccountInfo, + address: string, + label: string +): void { + if (!account.owner.equals(SolanaUpgradeableLoaderProgramId)) { + throw new Error( + `${label} ${address} is not owned by the Solana upgradeable loader` + ) + } +} + +async function verifyEthereum( + profile: OutpostDeploymentProfile, + provider: providers.Provider +): Promise { + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) + + const network = await provider.getNetwork() + if (network.chainId !== profile.ethereum.chainId) { + throw new Error( + `Ethereum chain mismatch: expected ${profile.ethereum.chainId}, received ${network.chainId}` + ) + } + + await Promise.all( + Object.values(EthereumContractName).map(async contractName => { + const contract = profile.ethereum.contracts[contractName], + proxyCode = await provider.getCode(contract.address) + + if (proxyCode === EmptyEthereumCode) { + throw new Error( + `Ethereum contract ${contractName} is not deployed at ${contract.address}` + ) + } + + const implementationWord = await provider.getStorageAt( + contract.address, + Eip1967ImplementationStorageSlot + ), + implementationAddress = ethersUtils.getAddress( + ethersUtils.hexDataSlice( + implementationWord, + Eip1967ImplementationAddressOffset + ) + ) + + if (implementationAddress !== contract.implementationAddress) { + throw new Error( + `Ethereum ${contractName} implementation mismatch: expected ${contract.implementationAddress}, received ${implementationAddress}` + ) + } + + const implementationCode = await provider.getCode(implementationAddress) + if (implementationCode === EmptyEthereumCode) { + throw new Error( + `Ethereum ${contractName} implementation is not deployed at ${implementationAddress}` + ) + } + + const implementationCodeSha256 = sha256(implementationCode) + if (implementationCodeSha256 !== contract.implementationCodeSha256) { + throw new Error( + `Ethereum ${contractName} implementation code mismatch: expected ${contract.implementationCodeSha256}, received ${implementationCodeSha256}` + ) + } + }) + ) +} + +async function verifySolana( + profile: OutpostDeploymentProfile, + connection: Connection +): Promise { + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.solana) + + const genesisHash = await connection.getGenesisHash() + if (genesisHash !== profile.solana.genesisHash) { + throw new Error( + `Solana genesis mismatch: expected ${profile.solana.genesisHash}, received ${genesisHash}` + ) + } + + await Promise.all( + Object.values(SolanaProgramName).map(async programName => { + const program = profile.solana.programs[programName], + programAccount = await connection.getAccountInfo( + new PublicKey(program.address) + ) + + if (programAccount == null || !programAccount.executable) { + throw new Error( + `Solana program ${programName} is not executable at ${program.address}` + ) + } + assertSolanaUpgradeableLoaderAccount( + programAccount, + program.address, + `Solana program ${programName}` + ) + + const programStateTag = upgradeableLoaderStateTag(programAccount.data) + if (programStateTag !== UpgradeableLoaderStateTag.program) { + throw new Error( + `Solana program ${programName} has invalid upgradeable-loader state ${programStateTag}` + ) + } + + if ( + programAccount.data.byteLength < UpgradeableLoaderProgramDataAddressEnd + ) { + throw new Error( + `Solana program ${programName} upgradeable-loader data is truncated` + ) + } + + const programDataAddress = new PublicKey( + programAccount.data.subarray( + UpgradeableLoaderStateTagByteLength, + UpgradeableLoaderProgramDataAddressEnd + ) + ).toBase58() + if (programDataAddress !== program.programDataAddress) { + throw new Error( + `Solana ${programName} ProgramData mismatch: expected ${program.programDataAddress}, received ${programDataAddress}` + ) + } + + const programDataAccount = await connection.getAccountInfo( + new PublicKey(programDataAddress) + ) + if (programDataAccount == null) { + throw new Error( + `Solana ${programName} ProgramData is not deployed at ${programDataAddress}` + ) + } + assertSolanaUpgradeableLoaderAccount( + programDataAccount, + programDataAddress, + `Solana ${programName} ProgramData` + ) + + const programDataStateTag = upgradeableLoaderStateTag( + programDataAccount.data + ) + if (programDataStateTag !== UpgradeableLoaderStateTag.programData) { + throw new Error( + `Solana ${programName} ProgramData has invalid upgradeable-loader state ${programDataStateTag}` + ) + } + + const programDataSha256 = sha256(programDataAccount.data) + if (programDataSha256 !== program.programDataSha256) { + throw new Error( + `Solana ${programName} ProgramData mismatch: expected ${program.programDataSha256}, received ${programDataSha256}` + ) + } + }) + ) +} + +/** Cross-chain facade for exact outpost deployment-profile verification. */ +export namespace OutpostDeploymentVerifier { + /** Verify chain identity, interface compatibility, and exact live runtime identity. */ + export async function verify( + input: OutpostDeploymentVerificationInput + ): Promise { + await match(input) + .with({ family: OutpostChainFamily.ethereum }, value => + verifyEthereum(value.profile, value.provider) + ) + .with({ family: OutpostChainFamily.solana }, value => + verifySolana(value.profile, value.connection) + ) + .exhaustive() + } +} diff --git a/packages/sdk-outpost/src/verification/Types.ts b/packages/sdk-outpost/src/verification/Types.ts new file mode 100644 index 0000000..001de4b --- /dev/null +++ b/packages/sdk-outpost/src/verification/Types.ts @@ -0,0 +1,30 @@ +import type { Connection } from "@solana/web3.js" +import type { providers } from "ethers" + +import type { OutpostDeploymentProfile } from "../deployments/index.js" +import { OutpostChainFamily } from "../deployments/index.js" + +/** Ethereum verification request for an outpost deployment profile. */ +export interface EthereumOutpostDeploymentVerificationInput { + /** External-chain family discriminator. */ + family: OutpostChainFamily.ethereum + /** Immutable deployment profile to verify. */ + profile: OutpostDeploymentProfile + /** Ethereum provider connected to the deployed contracts. */ + provider: providers.Provider +} + +/** Solana verification request for an outpost deployment profile. */ +export interface SolanaOutpostDeploymentVerificationInput { + /** External-chain family discriminator. */ + family: OutpostChainFamily.solana + /** Immutable deployment profile to verify. */ + profile: OutpostDeploymentProfile + /** Solana connection targeting the deployed program. */ + connection: Connection +} + +/** Typed verification input accepted by the cross-chain verifier facade. */ +export type OutpostDeploymentVerificationInput = + | EthereumOutpostDeploymentVerificationInput + | SolanaOutpostDeploymentVerificationInput diff --git a/packages/sdk-outpost/src/verification/index.ts b/packages/sdk-outpost/src/verification/index.ts new file mode 100644 index 0000000..89cba26 --- /dev/null +++ b/packages/sdk-outpost/src/verification/index.ts @@ -0,0 +1,2 @@ +export * from "./OutpostDeploymentVerifier.js" +export * from "./Types.js" diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts index 01f0dce..d4f2639 100644 --- a/packages/sdk-outpost/tests/Fixtures.ts +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -1,71 +1,77 @@ +import { AnchorProvider, Wallet } from "@coral-xyz/anchor" +import { Connection, Keypair, PublicKey } from "@solana/web3.js" +import { providers, utils as ethersUtils } from "ethers" + import { EthereumContractName, OutpostArtifactManifests, + type OutpostDeploymentProfile, SolanaProgramName, - type OutpostDeployment, - parseOutpostDeployment + SolanaUpgradeableLoaderProgramId, + parseOutpostDeploymentProfile } from "@wireio/sdk-outpost" const TestHash = "a".repeat(64), - TestRevision = "b".repeat(40), TestWireChainId = "c".repeat(64), - TestEthereumAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + TestEthereumProxyAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + TestEthereumImplementationAddress = + "0x7412BC256355ABD22dD53De3a38E8995b5d4c1D1", TestSolanaGenesisHash = "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", - TestSolanaProgramAddress = "11111111111111111111111111111111" + TestSolanaProgramAddress = "4vJ9JU1bJJE96FWSJKvHsmmFADCg4gpZQff4P3bkLKi", + TestSolanaProgramDataAddress = "8qbHbw2BbbTHBW1sbeqakYXVKRQM8Ne7pLK7m6CVfeR", + TestSolanaRpcUrl = "http://example.invalid", + UpgradeableLoaderStateTagByteLength = 4, + SolanaPublicKeyByteLength = 32, + ProgramAccountDataByteLength = + UpgradeableLoaderStateTagByteLength + SolanaPublicKeyByteLength, + ProgramDataAccountDataByteLength = 8, + ProgramStateTag = 2, + ProgramDataStateTag = 3 + +/** Runtime bytecode returned by the Ethereum provider fixture. */ +export const TestEthereumImplementationCode = "0x01" + +/** Encode the upgradeable-loader Program account for one ProgramData address. */ +export function createSolanaProgramAccountData( + programDataAddress: string +): Buffer { + const data = Buffer.alloc(ProgramAccountDataByteLength) + data.writeUInt32LE(ProgramStateTag, 0) + new PublicKey(programDataAddress) + .toBuffer() + .copy(data, UpgradeableLoaderStateTagByteLength) + return data +} + +/** Encode deterministic upgradeable-loader ProgramData account contents. */ +export function createSolanaProgramDataAccountData(): Buffer { + const data = Buffer.alloc(ProgramDataAccountDataByteLength) + data.writeUInt32LE(ProgramDataStateTag, 0) + data.writeUInt32LE(1, UpgradeableLoaderStateTagByteLength) + return data +} -/** Create a valid runtime deployment aligned with the compiled artifact packages. */ -export function createDeploymentFixture(): OutpostDeployment { +/** Create a valid profile aligned with the SDK's source-owned artifacts. */ +export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfile { const ethereumContracts = Object.fromEntries( Object.values(EthereumContractName).map(contractName => [ contractName, { - address: TestEthereumAddress, - artifactSha256: - OutpostArtifactManifests.ethereum.contracts[contractName] - .artifactSha256 + address: TestEthereumProxyAddress, + implementationAddress: TestEthereumImplementationAddress, + abiSha256: + OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, + implementationCodeSha256: ethersUtils + .sha256(TestEthereumImplementationCode) + .slice(2) } ]) ), - deployment = { + programData = createSolanaProgramDataAccountData(), + profile = { schemaVersion: 1, id: `${TestWireChainId}-${TestHash.slice(0, 12)}`, - artifactBundle: { - generatedAt: "2026-07-31T15:47:46Z", - sourceArchiveSha256: TestHash, - clusterManifestSha256: TestHash, - deploymentChecksum: TestHash, - snapshotChecksum: TestHash, - platformRelease: { - tag: "v1.0.0", - url: "https://github.com/Wire-Network/wire-platform-build-system/releases/tag/v1.0.0", - manifest: { - repository: "Wire-Network/wire-platform-manifest", - revision: TestRevision - }, - libraries: { - repository: "Wire-Network/wire-libraries-ts", - revision: TestRevision - } - }, - sources: { - wireTools: { - repository: "Wire-Network/wire-tools-ts", - revision: TestRevision - }, - wireSysio: { - repository: "Wire-Network/wire-sysio", - revision: TestRevision - }, - wireEthereum: { - repository: "Wire-Network/wire-ethereum", - revision: TestRevision - }, - wireSolana: { - repository: "Wire-Network/wire-solana", - revision: TestRevision - } - } - }, + deploymentChecksum: TestHash, wire: { chainId: TestWireChainId }, ethereum: { chainId: 31_337, @@ -76,14 +82,77 @@ export function createDeploymentFixture(): OutpostDeployment { programs: { [SolanaProgramName.liqsolCore]: { address: TestSolanaProgramAddress, - artifactSha256: + programDataAddress: TestSolanaProgramDataAddress, + idlSha256: OutpostArtifactManifests.solana.programs[ SolanaProgramName.liqsolCore - ].idlSha256 + ].idlSha256, + programDataSha256: ethersUtils.sha256(programData).slice(2) } } } } - return parseOutpostDeployment(deployment) + return parseOutpostDeploymentProfile(profile) +} + +/** Create an Ethereum provider aligned with one deployment profile. */ +export function createEthereumProviderFixture( + profile: OutpostDeploymentProfile +): providers.JsonRpcProvider { + const provider = new providers.JsonRpcProvider() + jest.spyOn(provider, "getNetwork").mockResolvedValue({ + chainId: profile.ethereum.chainId, + name: "wire-outpost" + }) + jest + .spyOn(provider, "getCode") + .mockResolvedValue(TestEthereumImplementationCode) + jest.spyOn(provider, "getStorageAt").mockImplementation(async address => { + const contract = Object.values(profile.ethereum.contracts).find( + deployment => deployment.address === address + ) + return ethersUtils.hexZeroPad( + contract?.implementationAddress ?? + profile.ethereum.contracts[EthereumContractName.OPP] + .implementationAddress, + 32 + ) + }) + return provider +} + +/** Create a Solana provider aligned with one deployment profile. */ +export function createSolanaProviderFixture( + profile: OutpostDeploymentProfile +): AnchorProvider { + const connection = new Connection(TestSolanaRpcUrl), + provider = new AnchorProvider(connection, new Wallet(Keypair.generate())), + program = profile.solana.programs[SolanaProgramName.liqsolCore] + + jest + .spyOn(connection, "getGenesisHash") + .mockResolvedValue(profile.solana.genesisHash) + jest.spyOn(connection, "getAccountInfo").mockImplementation(async address => { + if (address.equals(new PublicKey(program.address))) { + return { + data: createSolanaProgramAccountData(program.programDataAddress), + executable: true, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + } + } + if (address.equals(new PublicKey(program.programDataAddress))) { + return { + data: createSolanaProgramDataAccountData(), + executable: false, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + } + } + return null + }) + return provider } diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index 95b4a02..10a810c 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -10,7 +10,7 @@ import { liqsolCoreIdl } from "@wireio/sdk-outpost" -import { createDeploymentFixture } from "../Fixtures.js" +import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" describe("source-owned outpost artifacts", () => { it("records exact producer package identity", () => { @@ -26,33 +26,32 @@ describe("source-owned outpost artifacts", () => { "accepts a runtime deployment aligned with %s artifacts", family => { expect(() => - assertOutpostArtifactCompatibility(createDeploymentFixture(), family) + assertOutpostArtifactCompatibility( + createOutpostDeploymentProfileFixture(), + family + ) ).not.toThrow() } ) it("rejects a runtime deployment with an incompatible Ethereum ABI", () => { - const deployment = createDeploymentFixture() - deployment.ethereum.contracts[ - EthereumContractName.ReserveManager - ].artifactSha256 = "f".repeat(64) + const profile = createOutpostDeploymentProfileFixture() + profile.ethereum.contracts[EthereumContractName.ReserveManager].abiSha256 = + "f".repeat(64) expect(() => - assertOutpostArtifactCompatibility( - deployment, - OutpostChainFamily.ethereum - ) - ).toThrow("Ethereum ReserveManager artifact mismatch") + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) + ).toThrow("Ethereum ReserveManager ABI interface mismatch") }) it("rejects a runtime deployment with an incompatible Solana IDL", () => { - const deployment = createDeploymentFixture() - deployment.solana.programs[SolanaProgramName.liqsolCore].artifactSha256 = + const profile = createOutpostDeploymentProfileFixture() + profile.solana.programs[SolanaProgramName.liqsolCore].idlSha256 = "f".repeat(64) expect(() => - assertOutpostArtifactCompatibility(deployment, OutpostChainFamily.solana) - ).toThrow("Solana liqsolCore artifact mismatch") + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.solana) + ).toThrow("Solana liqsolCore IDL interface mismatch") }) it("generates the callable swap and collateral surfaces", () => { diff --git a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts index 9a73766..6340cee 100644 --- a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts @@ -1,64 +1,38 @@ -import { AnchorProvider, Wallet } from "@coral-xyz/anchor" -import { Connection, Keypair, SystemProgram } from "@solana/web3.js" -import { providers } from "ethers" - import { EthereumOutpostClient, OutpostChainFamily, OutpostClient, SolanaOutpostClient } from "@wireio/sdk-outpost" -import { createDeploymentFixture } from "../Fixtures.js" - -function createSolanaProvider( - deployment = createDeploymentFixture() -): AnchorProvider { - const connection = new Connection("http://127.0.0.1:8899"), - provider = new AnchorProvider(connection, new Wallet(Keypair.generate())) - - jest - .spyOn(connection, "getGenesisHash") - .mockResolvedValue(deployment.solana.genesisHash) - jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ - data: Buffer.alloc(0), - executable: true, - lamports: 1, - owner: SystemProgram.programId, - rentEpoch: 0 - }) - return provider -} +import { + createEthereumProviderFixture, + createOutpostDeploymentProfileFixture, + createSolanaProviderFixture +} from "../Fixtures.js" describe("OutpostClient", () => { it("preserves the precise Ethereum client type", async () => { - const deployment = createDeploymentFixture(), - provider = new providers.JsonRpcProvider() - jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: deployment.ethereum.chainId, - name: "wire-outpost" - }) - jest.spyOn(provider, "getCode").mockResolvedValue("0x01") - - const client = await OutpostClient.create({ - family: OutpostChainFamily.ethereum, - options: { - deployment, - connection: provider - } - }) + const profile = createOutpostDeploymentProfileFixture(), + client = await OutpostClient.create({ + family: OutpostChainFamily.ethereum, + options: { + profile, + connection: createEthereumProviderFixture(profile) + } + }) expect(client).toBeInstanceOf(EthereumOutpostClient) }) it("preserves the precise Solana client type", async () => { - const deployment = createDeploymentFixture() - const client = await OutpostClient.create({ - family: OutpostChainFamily.solana, - options: { - deployment, - provider: createSolanaProvider(deployment) - } - }) + const profile = createOutpostDeploymentProfileFixture(), + client = await OutpostClient.create({ + family: OutpostChainFamily.solana, + options: { + profile, + provider: createSolanaProviderFixture(profile) + } + }) expect(client).toBeInstanceOf(SolanaOutpostClient) }) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 1e7d15d..0cce7bb 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -1,70 +1,79 @@ -import { providers } from "ethers" +import { utils as ethersUtils } from "ethers" import { EthereumContractName, - EthereumOutpostClient, - type OutpostDeployment + EthereumOutpostClient } from "@wireio/sdk-outpost" -import { createDeploymentFixture } from "../../Fixtures.js" - -const DeployedCode = "0x01" - -function createProvider( - deployment: OutpostDeployment -): providers.JsonRpcProvider { - const provider = new providers.JsonRpcProvider() - jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: deployment.ethereum.chainId, - name: "wire-outpost" - }) - jest.spyOn(provider, "getCode").mockResolvedValue(DeployedCode) - return provider -} +import { + createEthereumProviderFixture, + createOutpostDeploymentProfileFixture +} from "../../Fixtures.js" describe("EthereumOutpostClient", () => { - it("verifies a deployment and returns a generated contract type", async () => { - const deployment = createDeploymentFixture(), - provider = createProvider(deployment), + it("verifies a profile and returns a generated contract type", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createEthereumProviderFixture(profile), client = await EthereumOutpostClient.create({ - deployment, + profile, connection: provider }), reserveManager = client.contract(EthereumContractName.ReserveManager) expect(reserveManager.address).toBe( - deployment.ethereum.contracts[EthereumContractName.ReserveManager].address + profile.ethereum.contracts[EthereumContractName.ReserveManager].address ) expect(provider.getCode).toHaveBeenCalledTimes( + Object.values(EthereumContractName).length * 2 + ) + expect(provider.getStorageAt).toHaveBeenCalledTimes( Object.values(EthereumContractName).length ) }) it("rejects the wrong Ethereum chain", async () => { - const deployment = createDeploymentFixture(), - provider = createProvider(deployment) + const profile = createOutpostDeploymentProfileFixture(), + provider = createEthereumProviderFixture(profile) jest.spyOn(provider, "getNetwork").mockResolvedValue({ chainId: 1, name: "mainnet" }) await expect( - EthereumOutpostClient.create({ - deployment, - connection: provider - }) + EthereumOutpostClient.create({ profile, connection: provider }) ).rejects.toThrow("Ethereum chain mismatch") }) - it("rejects a configured contract without bytecode", async () => { - const deployment = createDeploymentFixture(), - provider = createProvider(deployment) + it("rejects a configured proxy without bytecode", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createEthereumProviderFixture(profile) jest.spyOn(provider, "getCode").mockResolvedValue("0x") await expect( - EthereumOutpostClient.create({ - deployment, - connection: provider - }) + EthereumOutpostClient.create({ profile, connection: provider }) ).rejects.toThrow("is not deployed") }) + + it("rejects an implementation address mismatch", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createEthereumProviderFixture(profile) + jest + .spyOn(provider, "getStorageAt") + .mockResolvedValue(ethersUtils.hexZeroPad("0x01", 32)) + + await expect( + EthereumOutpostClient.create({ profile, connection: provider }) + ).rejects.toThrow("implementation mismatch") + }) + + it("rejects an implementation code mismatch", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createEthereumProviderFixture(profile) + profile.ethereum.contracts[ + EthereumContractName.ReserveManager + ].implementationCodeSha256 = "f".repeat(64) + + await expect( + EthereumOutpostClient.create({ profile, connection: provider }) + ).rejects.toThrow("implementation code mismatch") + }) }) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index 88e7457..d3d109a 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -1,70 +1,96 @@ -import { AnchorProvider, Wallet } from "@coral-xyz/anchor" -import { Connection, Keypair, SystemProgram } from "@solana/web3.js" +import { PublicKey } from "@solana/web3.js" import { - type OutpostDeployment, SolanaOutpostClient, - SolanaProgramName + SolanaProgramName, + SolanaUpgradeableLoaderProgramId } from "@wireio/sdk-outpost" -import { createDeploymentFixture } from "../../Fixtures.js" - -function createProvider(deployment: OutpostDeployment): AnchorProvider { - const connection = new Connection("http://127.0.0.1:8899"), - provider = new AnchorProvider(connection, new Wallet(Keypair.generate())) +import { + createOutpostDeploymentProfileFixture, + createSolanaProgramAccountData, + createSolanaProgramDataAccountData, + createSolanaProviderFixture +} from "../../Fixtures.js" - jest - .spyOn(connection, "getGenesisHash") - .mockResolvedValue(deployment.solana.genesisHash) - jest.spyOn(connection, "getAccountInfo").mockResolvedValue({ - data: Buffer.alloc(0), - executable: true, - lamports: 1, - owner: SystemProgram.programId, - rentEpoch: 0 - }) - return provider -} +const WrongProgramDataAddress = "SysvarRent111111111111111111111111111111111" describe("SolanaOutpostClient", () => { - it("verifies a deployment and returns its runtime program address", async () => { - const deployment = createDeploymentFixture(), - provider = createProvider(deployment), - client = await SolanaOutpostClient.create({ - deployment, - provider - }), + it("verifies a profile and returns its runtime program address", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + client = await SolanaOutpostClient.create({ profile, provider }), program = client.program(SolanaProgramName.liqsolCore) expect(program.programId.toBase58()).toBe( - deployment.solana.programs[SolanaProgramName.liqsolCore].address + profile.solana.programs[SolanaProgramName.liqsolCore].address ) }) it("rejects the wrong Solana cluster", async () => { - const deployment = createDeploymentFixture(), - provider = createProvider(deployment) + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile) jest .spyOn(provider.connection, "getGenesisHash") .mockResolvedValue("9".repeat(32)) await expect( - SolanaOutpostClient.create({ - deployment, - provider - }) + SolanaOutpostClient.create({ profile, provider }) ).rejects.toThrow("Solana genesis mismatch") }) it("rejects a configured program that is not executable", async () => { - const deployment = createDeploymentFixture(), - provider = createProvider(deployment) + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile) jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue(null) await expect( - SolanaOutpostClient.create({ - deployment, - provider - }) + SolanaOutpostClient.create({ profile, provider }) ).rejects.toThrow("is not executable") }) + + it("rejects a Program account pointing at another ProgramData account", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile) + jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue({ + data: createSolanaProgramAccountData(WrongProgramDataAddress), + executable: true, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + }) + + await expect( + SolanaOutpostClient.create({ profile, provider }) + ).rejects.toThrow("ProgramData mismatch") + }) + + it("rejects a ProgramData code mismatch", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + program = profile.solana.programs[SolanaProgramName.liqsolCore] + program.programDataSha256 = "f".repeat(64) + jest + .spyOn(provider.connection, "getAccountInfo") + .mockImplementation(async address => + address.equals(new PublicKey(program.address)) + ? { + data: createSolanaProgramAccountData(program.programDataAddress), + executable: true, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + } + : { + data: createSolanaProgramDataAccountData(), + executable: false, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + } + ) + + await expect( + SolanaOutpostClient.create({ profile, provider }) + ).rejects.toThrow("ProgramData mismatch") + }) }) diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index e3bfe40..6148060 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -1,49 +1,52 @@ import { EthereumContractName, - parseOutpostDeployment + parseOutpostDeploymentProfile } from "@wireio/sdk-outpost" -import { createDeploymentFixture } from "../Fixtures.js" +import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" -describe("OutpostDeploymentSchema", () => { - it("parses a valid deployment with its Wire chain identity", () => { - const deployment = parseOutpostDeployment(createDeploymentFixture()) +describe("OutpostDeploymentProfileSchema", () => { + it("parses a valid profile with its Wire chain identity", () => { + const profile = parseOutpostDeploymentProfile( + createOutpostDeploymentProfileFixture() + ) - expect(deployment.id).toBe( - `${deployment.wire.chainId}-${deployment.artifactBundle.deploymentChecksum.slice(0, 12)}` + expect(profile.id).toBe( + `${profile.wire.chainId}-${profile.deploymentChecksum.slice(0, 12)}` ) expect( - deployment.ethereum.contracts[EthereumContractName.ReserveManager].address + profile.ethereum.contracts[EthereumContractName.ReserveManager].address ).toBe( - createDeploymentFixture().ethereum.contracts[ + createOutpostDeploymentProfileFixture().ethereum.contracts[ EthereumContractName.ReserveManager ].address ) }) it("rejects an invalid contract address", () => { - const fixture = createDeploymentFixture() + const fixture = createOutpostDeploymentProfileFixture() fixture.ethereum.contracts.OPP.address = "not-an-address" - expect(() => parseOutpostDeployment(fixture)).toThrow( + expect(() => parseOutpostDeploymentProfile(fixture)).toThrow( "Invalid Ethereum address" ) }) - it("rejects an invalid Solana program address", () => { - const fixture = createDeploymentFixture() - fixture.solana.programs.liqsolCore.address = "not-a-program-address" + it("rejects an invalid Solana ProgramData address", () => { + const fixture = createOutpostDeploymentProfileFixture() + fixture.solana.programs.liqsolCore.programDataAddress = + "not-a-program-data-address" - expect(() => parseOutpostDeployment(fixture)).toThrow( + expect(() => parseOutpostDeploymentProfile(fixture)).toThrow( "Invalid Solana address" ) }) - it("rejects an environment-specific deployment id", () => { - const fixture = createDeploymentFixture() + it("rejects an environment-specific profile id", () => { + const fixture = createOutpostDeploymentProfileFixture() fixture.id = "named-environment" - expect(() => parseOutpostDeployment(fixture)).toThrow( - "Deployment id must be" + expect(() => parseOutpostDeploymentProfile(fixture)).toThrow( + "Deployment profile id must be" ) }) }) diff --git a/packages/sdk-outpost/tests/verification/OutpostDeploymentVerifier.test.ts b/packages/sdk-outpost/tests/verification/OutpostDeploymentVerifier.test.ts new file mode 100644 index 0000000..a3e0c5d --- /dev/null +++ b/packages/sdk-outpost/tests/verification/OutpostDeploymentVerifier.test.ts @@ -0,0 +1,43 @@ +import { + OutpostChainFamily, + OutpostDeploymentVerifier, + SolanaUpgradeableLoaderProgramId +} from "@wireio/sdk-outpost" +import { + createEthereumProviderFixture, + createOutpostDeploymentProfileFixture, + createSolanaProviderFixture +} from "../Fixtures.js" + +describe("OutpostDeploymentVerifier", () => { + it("verifies an Ethereum deployment through the generic facade", async () => { + const profile = createOutpostDeploymentProfileFixture() + + await expect( + OutpostDeploymentVerifier.verify({ + family: OutpostChainFamily.ethereum, + profile, + provider: createEthereumProviderFixture(profile) + }) + ).resolves.toBeUndefined() + }) + + it("verifies a Solana deployment through the generic facade", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile) + + await expect( + OutpostDeploymentVerifier.verify({ + family: OutpostChainFamily.solana, + profile, + connection: provider.connection + }) + ).resolves.toBeUndefined() + }) + + it("exports the canonical Solana upgradeable-loader identity", () => { + expect(SolanaUpgradeableLoaderProgramId.toBase58()).toBe( + "BPFLoaderUpgradeab1e11111111111111111111111" + ) + }) +}) diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs index d2da4ad..3f2b0e3 100644 --- a/scripts/sdk-outpost/verify-package.mjs +++ b/scripts/sdk-outpost/verify-package.mjs @@ -15,9 +15,10 @@ const packageJson = await readJson(path.join(PackagePath, "package.json")), "EthereumOutpostClient", "OutpostArtifactManifests", "OutpostClient", + "OutpostDeploymentVerifier", "SolanaOutpostClient", "assertOutpostArtifactCompatibility", - "parseOutpostDeployment" + "parseOutpostDeploymentProfile" ] assert(packageJson.name === "@wireio/sdk-outpost", "Unexpected package name") From d2e498e99b399e26273cb387d554abce3e026e73 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Wed, 5 Aug 2026 16:42:53 -0400 Subject: [PATCH 19/48] feat(sdk-outpost): add reserve swap workflows --- CLAUDE.md | 4 + package.json | 2 +- packages/sdk-outpost/README.md | 35 ++- packages/sdk-outpost/package.json | 3 +- .../clients/ethereum/EthereumOutpostClient.ts | 11 +- .../ethereum/EthereumReserveSwapClient.ts | 156 ++++++++++++ .../sdk-outpost/src/clients/ethereum/index.ts | 1 + .../src/clients/solana/SolanaOutpostClient.ts | 5 + .../clients/solana/SolanaReserveSwapClient.ts | 224 ++++++++++++++++++ .../sdk-outpost/src/clients/solana/index.ts | 1 + packages/sdk-outpost/src/index.ts | 1 + packages/sdk-outpost/src/reserves/Types.ts | 40 ++++ .../sdk-outpost/src/reserves/Validation.ts | 49 ++++ packages/sdk-outpost/src/reserves/index.ts | 2 + .../ethereum/EthereumOutpostClient.test.ts | 17 +- .../solana/SolanaOutpostClient.test.ts | 13 + .../tests/reserves/Validation.test.ts | 36 +++ pnpm-lock.yaml | 174 ++++++++++++++ 18 files changed, 764 insertions(+), 10 deletions(-) create mode 100644 packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts create mode 100644 packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts create mode 100644 packages/sdk-outpost/src/reserves/Types.ts create mode 100644 packages/sdk-outpost/src/reserves/Validation.ts create mode 100644 packages/sdk-outpost/src/reserves/index.ts create mode 100644 packages/sdk-outpost/tests/reserves/Validation.test.ts diff --git a/CLAUDE.md b/CLAUDE.md index f1ad87f..6b834e5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -220,6 +220,10 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact packages published by `wire-ethereum` and `wire-solana`; generated clients are ignored build outputs and must not be copied or edited here. +- `packages/sdk-outpost` owns external reserve-swap instruction assembly, + allowance handling, source submission, balance reads, and canonical + `sourceRequestId` extraction. Staking remains outside this package until its + dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. diff --git a/package.json b/package.json index 6d3bf09..92c17f1 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", - "test": "pnpm run build && jest", + "test": "pnpm run build && jest --selectProjects shared shared-node shared-web @wireio/sdk-core wallet-browser-ext wallet-ext-sdk && pnpm --filter @wireio/sdk-outpost run test", "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit", "clean": "./scripts/clean.sh && pnpm -r run clean", "prepare": "husky" diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 6bc464d..837e5e2 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -21,10 +21,10 @@ module entrypoints with TypeScript declarations. ## Supported surfaces -| Family | Generated clients | -| -------- | --------------------------------------------------------- | -| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager` | -| Solana | `liqsol_core` | +| Family | Generated clients and workflows | +| -------- | ------------------------------------------------------------------------- | +| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager`, reserve swaps | +| Solana | `liqsol_core`, native SOL and classic SPL reserve swaps | Client creation verifies all four boundaries before returning: @@ -95,6 +95,31 @@ const ethereum = await OutpostClient.create({ const reserves = ethereum.contract(EthereumContractName.ReserveManager) ``` +Wallet-connected clients expose verified reserve-swap workflows without a +separate deployment address book: + +```ts +const submission = await ethereum.swaps.requestNative({ + sourceTokenCode, + sourceReserveCode, + sourceAmount, + targetChainCode, + targetTokenCode, + targetReserveCode, + targetRecipient, + targetAmount, + targetToleranceBps +}) + +// Correlate this protocol id with sysio.uwrit; the transaction hash alone is +// only source-chain submission evidence. +console.log(submission.sourceRequestId) +``` + +Ethereum also exposes `requestErc20WithApproval`, `nativeBalance`, and +`erc20Balance`. Solana exposes `requestNative`, `requestSpl`, `nativeBalance`, +and `splBalance` through the same `client.swaps` ownership boundary. + Solana uses the same facade and returns the precise Anchor program type at the runtime program address: @@ -124,7 +149,7 @@ repository. ## Consumer boundaries - Use this package for typed external `ReserveManager`, `OperatorRegistry`, - `OPP`, `OPPInbound`, and `liqsol_core` access. + `OPP`, `OPPInbound`, `liqsol_core`, and source reserve-swap execution. - Use `@wireio/sdk-core` for Wire transaction construction, reserve and token registries, underwriting state, and settlement correlation. - Recreate external clients whenever the selected deployment profile changes. diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 489a4a5..45075f6 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -45,7 +45,7 @@ "generate": "zx ../../scripts/sdk-outpost/generate.mjs", "prepare:compile": "pnpm run clean && pnpm run generate", "build": "pnpm run prepare:compile && pnpm run compile && pnpm run fix:hybrid:exports", - "test": "pnpm run generate && jest", + "test": "pnpm run generate && NODE_OPTIONS=--experimental-vm-modules jest", "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", "verify:package": "zx ../../scripts/sdk-outpost/verify-package.mjs", "verify:release": "pnpm run build && pnpm run verify:package", @@ -55,6 +55,7 @@ "@coral-xyz/anchor": "^0.32.1", "@ethersproject/abi": "^5.8.0", "@ethersproject/providers": "^5.8.0", + "@solana/spl-token": "^0.3.11", "@solana/web3.js": "^1.98.4", "ethers": "^5.8.0", "ts-pattern": "^5.9.0", diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 61fbd62..2f5aa0d 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -13,6 +13,7 @@ import { } from "../../deployments/index.js" import { OutpostDeploymentVerifier } from "../../verification/index.js" import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" +import { EthereumReserveSwapClient } from "./EthereumReserveSwapClient.js" function resolveProvider( connection: providers.Provider | Signer @@ -45,7 +46,15 @@ export class EthereumOutpostClient { private readonly options: EthereumOutpostClientOptions, /** Provider verified against the configured Ethereum chain. */ readonly provider: providers.Provider - ) {} + ) { + this.swaps = new EthereumReserveSwapClient( + this.contract(EthereumContractName.ReserveManager), + options.connection + ) + } + + /** Reserve-swap writes and balance reads for this verified outpost. */ + readonly swaps: EthereumReserveSwapClient /** Deployment profile used to verify and connect this client. */ get profile(): EthereumOutpostClientOptions["profile"] { diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts new file mode 100644 index 0000000..275af9b --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts @@ -0,0 +1,156 @@ +import { + Contract, + Signer, + type BigNumberish, + type providers +} from "ethers" + +import type { ReserveManager } from "../../contracts/ethereum/index.js" +import type { ReserveManagerLib } from "../../contracts/ethereum/generated/ReserveManager.js" +import { + assertReserveSwapRequest, + type ReserveSwapRequest, + type ReserveSwapSubmission +} from "../../reserves/index.js" + +const ConfirmationCount = 1, + Erc20Interface = [ + "function allowance(address owner,address spender) view returns (uint256)", + "function approve(address spender,uint256 amount) returns (bool)", + "function balanceOf(address owner) view returns (uint256)" + ] + +/** Event fields required to extract a ReserveManager deposit id. */ +interface EthereumReserveSwapEvent { + event?: string + args?: readonly BigNumberish[] +} + +/** Reserve-swap writes and balance reads for one verified Ethereum outpost. */ +export class EthereumReserveSwapClient { + /** Create an Ethereum reserve-swap workflow bound to a verified deployment. */ + constructor( + private readonly reserveManager: ReserveManager, + private readonly connection: providers.Provider | Signer + ) {} + + /** Escrow native ETH and return the confirmed protocol deposit id. */ + async requestNative( + request: ReserveSwapRequest + ): Promise { + assertReserveSwapRequest(request) + this.assertSigner() + const parameters = this.nativeParameters(request), + overrides = { value: request.sourceAmount } + + await this.reserveManager.callStatic.requestSwap(...parameters, overrides) + const transaction = await this.reserveManager.requestSwap( + ...parameters, + overrides + ), + receipt = await transaction.wait(ConfirmationCount) + return { + transactionId: transaction.hash, + sourceRequestId: EthereumReserveSwapClient.parseSourceRequestId( + receipt.events + ) + } + } + + /** Approve and escrow an ERC-20 source amount, then return its deposit id. */ + async requestErc20WithApproval( + request: ReserveSwapRequest, + tokenAddress: string + ): Promise { + assertReserveSwapRequest(request) + const signer = this.assertSigner(), + owner = await signer.getAddress(), + token = new Contract(tokenAddress, Erc20Interface, signer), + allowance = await token.allowance(owner, this.reserveManager.address) + + if (allowance.lt(request.sourceAmount)) { + const approval = await token.approve( + this.reserveManager.address, + request.sourceAmount + ) + await approval.wait(ConfirmationCount) + } + + const arguments_ = this.swapArguments(request) + await this.reserveManager.callStatic.requestSwapErc20WithApproval(arguments_) + const transaction = + await this.reserveManager.requestSwapErc20WithApproval(arguments_), + receipt = await transaction.wait(ConfirmationCount) + return { + transactionId: transaction.hash, + sourceRequestId: EthereumReserveSwapClient.parseSourceRequestId( + receipt.events + ) + } + } + + /** Read the native balance of an Ethereum account. */ + async nativeBalance(address: string): Promise { + const provider = Signer.isSigner(this.connection) + ? this.connection.provider + : this.connection + if (provider == null) { + throw new Error("Ethereum signer must be connected to a provider") + } + return (await provider.getBalance(address)).toBigInt() + } + + /** Read the ERC-20 balance of an Ethereum account. */ + async erc20Balance(tokenAddress: string, address: string): Promise { + const token = new Contract(tokenAddress, Erc20Interface, this.connection) + return (await token.balanceOf(address)).toBigInt() + } + + private assertSigner(): Signer { + if (!Signer.isSigner(this.connection)) { + throw new Error("Ethereum reserve swap requires a connected signer.") + } + return this.connection + } + + private nativeParameters(request: ReserveSwapRequest) { + return [ + request.sourceTokenCode, + request.sourceReserveCode, + request.targetChainCode, + request.targetTokenCode, + request.targetReserveCode, + request.targetRecipient, + request.targetAmount, + request.targetToleranceBps + ] as const + } + + private swapArguments( + request: ReserveSwapRequest + ): ReserveManagerLib.SwapArgsStruct { + return { + sourceTokenCode: request.sourceTokenCode, + sourceReserveCode: request.sourceReserveCode, + sourceAmount: request.sourceAmount, + targetChainCode: request.targetChainCode, + targetTokenCode: request.targetTokenCode, + targetReserveCode: request.targetReserveCode, + targetRecipient: request.targetRecipient, + targetAmount: request.targetAmount, + targetToleranceBps: request.targetToleranceBps + } + } + + /** Parse the canonical deposit id emitted by `requestSwap*`. */ + static parseSourceRequestId( + events: readonly EthereumReserveSwapEvent[] | undefined + ): bigint { + const event = events?.find(candidate => candidate.event === "SwapDeposit"), + id = event?.args?.[0] + if (id == null) { + throw new Error("Confirmed Ethereum reserve swap did not emit SwapDeposit.") + } + return BigInt(id.toString()) + } +} diff --git a/packages/sdk-outpost/src/clients/ethereum/index.ts b/packages/sdk-outpost/src/clients/ethereum/index.ts index 300bba5..b828c96 100644 --- a/packages/sdk-outpost/src/clients/ethereum/index.ts +++ b/packages/sdk-outpost/src/clients/ethereum/index.ts @@ -1,2 +1,3 @@ +export * from "./EthereumReserveSwapClient.js" export * from "./EthereumOutpostClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 0ec4383..2d27d7f 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -8,6 +8,7 @@ import { import { LiqsolCore, liqsolCoreIdl } from "../../programs/solana/index.js" import { OutpostDeploymentVerifier } from "../../verification/index.js" import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" +import { SolanaReserveSwapClient } from "./SolanaReserveSwapClient.js" /** Strictly typed access to one verified Solana outpost deployment. */ export class SolanaOutpostClient { @@ -35,8 +36,12 @@ export class SolanaOutpostClient { { ...liqsolCoreIdl, address }, options.provider ) + this.swaps = new SolanaReserveSwapClient(options.provider, this.liqsolCore) } + /** Reserve-swap writes and balance reads for this verified outpost. */ + readonly swaps: SolanaReserveSwapClient + /** Provider verified against the configured Solana cluster. */ get provider(): SolanaOutpostClientOptions["provider"] { return this.options.provider diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts new file mode 100644 index 0000000..8ec84e7 --- /dev/null +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts @@ -0,0 +1,224 @@ +import { BN, type AnchorProvider, type Program } from "@coral-xyz/anchor" +import { + getAssociatedTokenAddressSync, + TOKEN_PROGRAM_ID +} from "@solana/spl-token" +import { + PublicKey, + SystemProgram, + Transaction, + type TransactionInstruction +} from "@solana/web3.js" +import { utils as ethersUtils } from "ethers" + +import type { LiqsolCore } from "../../programs/solana/index.js" +import { + assertReserveSwapRequest, + assertReserveUnsigned64, + type ReserveSwapRequest, + type ReserveSwapSubmission, + type SolanaSplReserveSwapRequest +} from "../../reserves/index.js" + +const ConfirmationCommitment = "confirmed", + OutpostConfigSeed = Buffer.from("outpost_config"), + ReserveSeed = Buffer.from("opp_reserve"), + ReserveVaultSeed = Buffer.from("opp_reserve_vault"), + OutboundMessageBufferSeed = Buffer.from("outbound_message_buffer"), + Unsigned64ByteLength = 8, + SwapDepositLog = /opp_outpost: SwapDeposit id=(\d+)\b/ + +/** Reserve-swap writes and balance reads for one verified Solana outpost. */ +export class SolanaReserveSwapClient { + /** Create a Solana reserve-swap workflow bound to a verified deployment. */ + constructor( + private readonly provider: AnchorProvider, + private readonly program: Program + ) {} + + /** Build a native-SOL reserve-swap instruction without signing it. */ + async createNativeInstruction( + request: ReserveSwapRequest + ): Promise { + assertReserveSwapRequest(request) + const user = this.assertWallet() + return this.program.methods + .requestSwap(...this.instructionArguments(request)) + .accounts({ + user, + config: this.deriveAddress([OutpostConfigSeed]), + reserve: this.deriveReserveAddress(ReserveSeed, request), + outboundMessageBuffer: this.deriveAddress([ + OutboundMessageBufferSeed + ]), + systemProgram: SystemProgram.programId + }) + .instruction() + } + + /** Escrow native SOL and return the confirmed protocol deposit id. */ + async requestNative( + request: ReserveSwapRequest + ): Promise { + return this.submit(await this.createNativeInstruction(request)) + } + + /** Build a classic SPL reserve-swap instruction without signing it. */ + async createSplInstruction( + request: SolanaSplReserveSwapRequest + ): Promise { + assertReserveSwapRequest(request) + const user = this.assertWallet(), + { + userTokenAccount = getAssociatedTokenAddressSync( + request.mint, + user, + false, + TOKEN_PROGRAM_ID + ) + } = request + + return this.program.methods + .requestSwapSpl(...this.instructionArguments(request)) + .accounts({ + user, + config: this.deriveAddress([OutpostConfigSeed]), + reserve: this.deriveReserveAddress(ReserveSeed, request), + reserveVault: this.deriveReserveAddress(ReserveVaultSeed, request), + mint: request.mint, + userAta: userTokenAccount, + outboundMessageBuffer: this.deriveAddress([ + OutboundMessageBufferSeed + ]), + tokenProgram: TOKEN_PROGRAM_ID + }) + .instruction() + } + + /** Escrow a classic SPL token and return the confirmed protocol deposit id. */ + async requestSpl( + request: SolanaSplReserveSwapRequest + ): Promise { + return this.submit(await this.createSplInstruction(request)) + } + + /** Read the native SOL balance of one account. */ + async nativeBalance(owner = this.assertWallet()): Promise { + return BigInt( + await this.provider.connection.getBalance( + owner, + ConfirmationCommitment + ) + ) + } + + /** Read a classic SPL token balance, returning zero when the ATA is absent. */ + async splBalance( + mint: PublicKey, + owner = this.assertWallet() + ): Promise { + const tokenAccount = getAssociatedTokenAddressSync( + mint, + owner, + false, + TOKEN_PROGRAM_ID + ), + account = await this.provider.connection.getAccountInfo( + tokenAccount, + ConfirmationCommitment + ) + if (account == null) return 0n + const balance = await this.provider.connection.getTokenAccountBalance( + tokenAccount, + ConfirmationCommitment + ) + return BigInt(balance.value.amount) + } + + private assertWallet(): PublicKey { + const publicKey = this.provider.wallet.publicKey + if (publicKey == null) { + throw new Error("Solana reserve swap requires a connected wallet.") + } + return publicKey + } + + private deriveAddress(seeds: Buffer[]): PublicKey { + return PublicKey.findProgramAddressSync(seeds, this.program.programId)[0] + } + + private deriveReserveAddress( + seed: Buffer, + request: ReserveSwapRequest + ): PublicKey { + return this.deriveAddress([ + seed, + this.unsigned64Seed(request.sourceTokenCode, "sourceTokenCode"), + this.unsigned64Seed(request.sourceReserveCode, "sourceReserveCode") + ]) + } + + private unsigned64Seed( + value: ReserveSwapRequest["sourceTokenCode"], + field: string + ): Buffer { + return new BN(assertReserveUnsigned64(value, field).toString()).toArrayLike( + Buffer, + "le", + Unsigned64ByteLength + ) + } + + private instructionArguments(request: ReserveSwapRequest) { + return [ + this.unsigned64(request.sourceTokenCode, "sourceTokenCode"), + this.unsigned64(request.sourceReserveCode, "sourceReserveCode"), + this.unsigned64(request.sourceAmount, "sourceAmount"), + this.unsigned64(request.targetChainCode, "targetChainCode"), + this.unsigned64(request.targetTokenCode, "targetTokenCode"), + this.unsigned64(request.targetReserveCode, "targetReserveCode"), + Buffer.from(ethersUtils.arrayify(request.targetRecipient)), + this.unsigned64(request.targetAmount, "targetAmount"), + request.targetToleranceBps + ] as const + } + + private unsigned64( + value: ReserveSwapRequest["sourceTokenCode"], + field: string + ): BN { + return new BN(assertReserveUnsigned64(value, field).toString()) + } + + private async submit( + instruction: TransactionInstruction + ): Promise { + const transactionId = await this.provider.sendAndConfirm( + new Transaction().add(instruction), + [], + { commitment: ConfirmationCommitment } + ), + transaction = await this.provider.connection.getTransaction( + transactionId, + { + commitment: ConfirmationCommitment, + maxSupportedTransactionVersion: 0 + } + ), + sourceRequestId = SolanaReserveSwapClient.parseSourceRequestId( + transaction?.meta?.logMessages ?? [] + ) + return { transactionId, sourceRequestId } + } + + /** Parse the canonical deposit id logged by `request_swap*`. */ + static parseSourceRequestId(logMessages: readonly string[]): bigint { + const match = logMessages + .map(message => message.match(SwapDepositLog)) + .find(candidate => candidate != null) + if (match == null) { + throw new Error("Confirmed Solana reserve swap did not log SwapDeposit.") + } + return BigInt(match[1]) + } +} diff --git a/packages/sdk-outpost/src/clients/solana/index.ts b/packages/sdk-outpost/src/clients/solana/index.ts index 36da129..531fbf0 100644 --- a/packages/sdk-outpost/src/clients/solana/index.ts +++ b/packages/sdk-outpost/src/clients/solana/index.ts @@ -1,2 +1,3 @@ +export * from "./SolanaReserveSwapClient.js" export * from "./SolanaOutpostClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts index 17e3e60..0f6cffb 100644 --- a/packages/sdk-outpost/src/index.ts +++ b/packages/sdk-outpost/src/index.ts @@ -3,4 +3,5 @@ export * from "./artifacts/index.js" export * from "./contracts/index.js" export * from "./deployments/index.js" export * from "./programs/index.js" +export * from "./reserves/index.js" export * from "./verification/index.js" diff --git a/packages/sdk-outpost/src/reserves/Types.ts b/packages/sdk-outpost/src/reserves/Types.ts new file mode 100644 index 0000000..7d9522b --- /dev/null +++ b/packages/sdk-outpost/src/reserves/Types.ts @@ -0,0 +1,40 @@ +import type { PublicKey } from "@solana/web3.js" +import type { BigNumberish, BytesLike } from "ethers" + +/** Confirmed source-outpost submission used to correlate a swap with Wire. */ +export interface ReserveSwapSubmission { + /** External-chain transaction signature or hash. */ + transactionId: string + /** Protocol deposit id copied into `sysio.uwrit::uwreqs.source_tx_id`. */ + sourceRequestId: bigint +} + +/** Reserve-swap request shared by Ethereum and Solana outposts. */ +export interface ReserveSwapRequest { + /** Packed source token slug. */ + sourceTokenCode: BigNumberish + /** Packed source reserve discriminator. */ + sourceReserveCode: BigNumberish + /** Escrowed source amount in external-chain base units. */ + sourceAmount: BigNumberish + /** Packed destination chain slug. */ + targetChainCode: BigNumberish + /** Packed destination token slug. */ + targetTokenCode: BigNumberish + /** Packed destination reserve discriminator or WIRE sentinel. */ + targetReserveCode: BigNumberish + /** Recipient bytes interpreted by the destination chain. */ + targetRecipient: BytesLike + /** Current destination quote in depot units. */ + targetAmount: BigNumberish + /** Maximum accepted quote drift in basis points. */ + targetToleranceBps: number +} + +/** Classic SPL source details for a Solana reserve swap. */ +export interface SolanaSplReserveSwapRequest extends ReserveSwapRequest { + /** SPL mint configured for the source token code. */ + mint: PublicKey + /** Optional source token account; the wallet ATA is used when omitted. */ + userTokenAccount?: PublicKey +} diff --git a/packages/sdk-outpost/src/reserves/Validation.ts b/packages/sdk-outpost/src/reserves/Validation.ts new file mode 100644 index 0000000..7d4ec2c --- /dev/null +++ b/packages/sdk-outpost/src/reserves/Validation.ts @@ -0,0 +1,49 @@ +import { BigNumber, utils as ethersUtils } from "ethers" + +import type { ReserveSwapRequest } from "./Types.js" + +const MaximumUnsigned64 = BigNumber.from("18446744073709551615"), + MinimumReserveValue = BigNumber.from(1), + MinimumToleranceBps = 0, + MaximumToleranceBps = 10_000 + +/** Validate one value against the positive unsigned 64-bit protocol boundary. */ +export function assertReserveUnsigned64( + value: ReserveSwapRequest["sourceTokenCode"], + field: string +): BigNumber { + let parsed: BigNumber + try { + parsed = BigNumber.from(value) + } catch (error: unknown) { + throw new Error(`${field} must be an integer.`, { cause: error }) + } + if (parsed.lt(MinimumReserveValue) || parsed.gt(MaximumUnsigned64)) { + throw new Error(`${field} must be between 1 and uint64 max.`) + } + return parsed +} + +/** Validate portable reserve-swap fields before opening a wallet prompt. */ +export function assertReserveSwapRequest(request: ReserveSwapRequest): void { + assertReserveUnsigned64(request.sourceTokenCode, "sourceTokenCode") + assertReserveUnsigned64(request.sourceReserveCode, "sourceReserveCode") + assertReserveUnsigned64(request.sourceAmount, "sourceAmount") + assertReserveUnsigned64(request.targetChainCode, "targetChainCode") + assertReserveUnsigned64(request.targetTokenCode, "targetTokenCode") + assertReserveUnsigned64(request.targetReserveCode, "targetReserveCode") + assertReserveUnsigned64(request.targetAmount, "targetAmount") + + if ( + !Number.isInteger(request.targetToleranceBps) || + request.targetToleranceBps < MinimumToleranceBps || + request.targetToleranceBps > MaximumToleranceBps + ) { + throw new Error( + `targetToleranceBps must be between ${MinimumToleranceBps} and ${MaximumToleranceBps}.` + ) + } + if (ethersUtils.arrayify(request.targetRecipient).length === 0) { + throw new Error("targetRecipient is required.") + } +} diff --git a/packages/sdk-outpost/src/reserves/index.ts b/packages/sdk-outpost/src/reserves/index.ts new file mode 100644 index 0000000..421334f --- /dev/null +++ b/packages/sdk-outpost/src/reserves/index.ts @@ -0,0 +1,2 @@ +export * from "./Types.js" +export * from "./Validation.js" diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 0cce7bb..cbb0b63 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -1,8 +1,9 @@ -import { utils as ethersUtils } from "ethers" +import { BigNumber, utils as ethersUtils } from "ethers" import { EthereumContractName, - EthereumOutpostClient + EthereumOutpostClient, + EthereumReserveSwapClient } from "@wireio/sdk-outpost" import { createEthereumProviderFixture, @@ -22,6 +23,7 @@ describe("EthereumOutpostClient", () => { expect(reserveManager.address).toBe( profile.ethereum.contracts[EthereumContractName.ReserveManager].address ) + expect(client.swaps).toBeInstanceOf(EthereumReserveSwapClient) expect(provider.getCode).toHaveBeenCalledTimes( Object.values(EthereumContractName).length * 2 ) @@ -30,6 +32,17 @@ describe("EthereumOutpostClient", () => { ) }) + it("parses the protocol deposit id from a confirmed receipt", () => { + const events = [ + { event: "SwapDeposit", args: [BigNumber.from(42)] } + ] + + expect(EthereumReserveSwapClient.parseSourceRequestId(events)).toBe(42n) + expect(() => EthereumReserveSwapClient.parseSourceRequestId([])).toThrow( + "did not emit SwapDeposit" + ) + }) + it("rejects the wrong Ethereum chain", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createEthereumProviderFixture(profile) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index d3d109a..f2dc305 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -3,6 +3,7 @@ import { PublicKey } from "@solana/web3.js" import { SolanaOutpostClient, SolanaProgramName, + SolanaReserveSwapClient, SolanaUpgradeableLoaderProgramId } from "@wireio/sdk-outpost" import { @@ -24,6 +25,18 @@ describe("SolanaOutpostClient", () => { expect(program.programId.toBase58()).toBe( profile.solana.programs[SolanaProgramName.liqsolCore].address ) + expect(client.swaps).toBeInstanceOf(SolanaReserveSwapClient) + }) + + it("parses the protocol deposit id from confirmed program logs", () => { + expect( + SolanaReserveSwapClient.parseSourceRequestId([ + "Program log: opp_outpost: SwapDeposit id=42 hash=abc" + ]) + ).toBe(42n) + expect(() => SolanaReserveSwapClient.parseSourceRequestId([])).toThrow( + "did not log SwapDeposit" + ) }) it("rejects the wrong Solana cluster", async () => { diff --git a/packages/sdk-outpost/tests/reserves/Validation.test.ts b/packages/sdk-outpost/tests/reserves/Validation.test.ts new file mode 100644 index 0000000..61914c4 --- /dev/null +++ b/packages/sdk-outpost/tests/reserves/Validation.test.ts @@ -0,0 +1,36 @@ +import { + assertReserveSwapRequest, + assertReserveUnsigned64, + type ReserveSwapRequest +} from "@wireio/sdk-outpost" + +const request: ReserveSwapRequest = { + sourceTokenCode: 1, + sourceReserveCode: 2, + sourceAmount: 3, + targetChainCode: 4, + targetTokenCode: 5, + targetReserveCode: 6, + targetRecipient: Uint8Array.from([7]), + targetAmount: 8, + targetToleranceBps: 500 +} + +describe("reserve swap validation", () => { + it("accepts a portable positive request", () => { + expect(() => assertReserveSwapRequest(request)).not.toThrow() + expect(assertReserveUnsigned64(8, "value").toNumber()).toBe(8) + }) + + it("rejects an empty recipient and values outside uint64", () => { + expect(() => + assertReserveSwapRequest({ + ...request, + targetRecipient: new Uint8Array() + }) + ).toThrow("targetRecipient is required") + expect(() => assertReserveUnsigned64(0, "value")).toThrow( + "between 1 and uint64 max" + ) + }) +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ade7455..b7ab43e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -206,6 +206,9 @@ importers: '@ethersproject/providers': specifier: ^5.8.0 version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + '@solana/spl-token': + specifier: ^0.3.11 + version: 0.3.11(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6))(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)(utf-8-validate@6.0.6) '@solana/web3.js': specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) @@ -1189,22 +1192,58 @@ packages: resolution: {integrity: sha512-0JFs3V2y2M9tKW5na/qxe69Zv+uxLMO7QBbhxF/FHu/Gp2NFZAAL9tWl9PU02xxo07pb3G9FTyjNc6D5uZrJIg==} engines: {node: '>=18.0.0'} + '@solana/buffer-layout-utils@0.2.0': + resolution: {integrity: sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==} + engines: {node: '>= 10'} + '@solana/buffer-layout@4.0.1': resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} engines: {node: '>=5.10'} + '@solana/codecs-core@2.0.0-rc.1': + resolution: {integrity: sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==} + peerDependencies: + typescript: '>=5' + '@solana/codecs-core@2.3.0': resolution: {integrity: sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==} engines: {node: '>=20.18.0'} peerDependencies: typescript: '>=5.3.3' + '@solana/codecs-data-structures@2.0.0-rc.1': + resolution: {integrity: sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==} + peerDependencies: + typescript: '>=5' + + '@solana/codecs-numbers@2.0.0-rc.1': + resolution: {integrity: sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==} + peerDependencies: + typescript: '>=5' + '@solana/codecs-numbers@2.3.0': resolution: {integrity: sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==} engines: {node: '>=20.18.0'} peerDependencies: typescript: '>=5.3.3' + '@solana/codecs-strings@2.0.0-rc.1': + resolution: {integrity: sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==} + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + typescript: '>=5' + + '@solana/codecs@2.0.0-rc.1': + resolution: {integrity: sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==} + peerDependencies: + typescript: '>=5' + + '@solana/errors@2.0.0-rc.1': + resolution: {integrity: sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==} + hasBin: true + peerDependencies: + typescript: '>=5' + '@solana/errors@2.3.0': resolution: {integrity: sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==} engines: {node: '>=20.18.0'} @@ -1212,6 +1251,23 @@ packages: peerDependencies: typescript: '>=5.3.3' + '@solana/options@2.0.0-rc.1': + resolution: {integrity: sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==} + peerDependencies: + typescript: '>=5' + + '@solana/spl-token-metadata@0.1.6': + resolution: {integrity: sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.95.3 + + '@solana/spl-token@0.3.11': + resolution: {integrity: sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.88.0 + '@solana/web3.js@1.98.4': resolution: {integrity: sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==} @@ -1829,6 +1885,16 @@ packages: bech32@1.1.4: resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + bigint-buffer@1.1.5: + resolution: {integrity: sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==} + engines: {node: '>= 10.0.0'} + + bignumber.js@9.3.1: + resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==} + + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} @@ -2437,6 +2503,9 @@ packages: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} + fastestsmallesttextencoderdecoder@1.0.22: + resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==} + fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -2453,6 +2522,9 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -5575,27 +5647,115 @@ snapshots: dependencies: tslib: 2.8.1 + '@solana/buffer-layout-utils@0.2.0(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6)': + dependencies: + '@solana/buffer-layout': 4.0.1 + '@solana/web3.js': 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + bigint-buffer: 1.1.5 + bignumber.js: 9.3.1 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + '@solana/buffer-layout@4.0.1': dependencies: buffer: 6.0.3 + '@solana/codecs-core@2.0.0-rc.1(typescript@6.0.2)': + dependencies: + '@solana/errors': 2.0.0-rc.1(typescript@6.0.2) + typescript: 6.0.2 + '@solana/codecs-core@2.3.0(typescript@6.0.2)': dependencies: '@solana/errors': 2.3.0(typescript@6.0.2) typescript: 6.0.2 + '@solana/codecs-data-structures@2.0.0-rc.1(typescript@6.0.2)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@6.0.2) + '@solana/errors': 2.0.0-rc.1(typescript@6.0.2) + typescript: 6.0.2 + + '@solana/codecs-numbers@2.0.0-rc.1(typescript@6.0.2)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@6.0.2) + '@solana/errors': 2.0.0-rc.1(typescript@6.0.2) + typescript: 6.0.2 + '@solana/codecs-numbers@2.3.0(typescript@6.0.2)': dependencies: '@solana/codecs-core': 2.3.0(typescript@6.0.2) '@solana/errors': 2.3.0(typescript@6.0.2) typescript: 6.0.2 + '@solana/codecs-strings@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@6.0.2) + '@solana/errors': 2.0.0-rc.1(typescript@6.0.2) + fastestsmallesttextencoderdecoder: 1.0.22 + typescript: 6.0.2 + + '@solana/codecs@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2) + '@solana/options': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2) + typescript: 6.0.2 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/errors@2.0.0-rc.1(typescript@6.0.2)': + dependencies: + chalk: 5.6.2 + commander: 12.1.0 + typescript: 6.0.2 + '@solana/errors@2.3.0(typescript@6.0.2)': dependencies: chalk: 5.6.2 commander: 14.0.3 typescript: 6.0.2 + '@solana/options@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@6.0.2) + '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2) + '@solana/errors': 2.0.0-rc.1(typescript@6.0.2) + typescript: 6.0.2 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/spl-token-metadata@0.1.6(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)': + dependencies: + '@solana/codecs': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2) + '@solana/web3.js': 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + - typescript + + '@solana/spl-token@0.3.11(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6))(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)(utf-8-validate@6.0.6)': + dependencies: + '@solana/buffer-layout': 4.0.1 + '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + '@solana/spl-token-metadata': 0.1.6(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2) + '@solana/web3.js': 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + buffer: 6.0.3 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + '@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6)': dependencies: '@babel/runtime': 7.29.7 @@ -6270,6 +6430,16 @@ snapshots: bech32@1.1.4: {} + bigint-buffer@1.1.5: + dependencies: + bindings: 1.5.0 + + bignumber.js@9.3.1: {} + + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + bluebird@3.7.2: {} bn.js@4.12.4: {} @@ -6909,6 +7079,8 @@ snapshots: fastest-levenshtein@1.0.16: {} + fastestsmallesttextencoderdecoder@1.0.22: {} + fb-watchman@2.0.2: dependencies: bser: 2.1.1 @@ -6921,6 +7093,8 @@ snapshots: dependencies: flat-cache: 4.0.1 + file-uri-to-path@1.0.0: {} + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 From 2f819d7d329ed4bc7df2d52030b6f8e4485db179 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 7 Aug 2026 10:06:58 -0400 Subject: [PATCH 20/48] fix: align Solana reserve swaps with deployed outpost --- .../clients/solana/SolanaReserveSwapClient.ts | 83 ++++++++++-- .../solana/SolanaOutpostClient.test.ts | 123 +++++++++++++++++- 2 files changed, 193 insertions(+), 13 deletions(-) diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts index 8ec84e7..6a66b31 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts @@ -7,7 +7,8 @@ import { PublicKey, SystemProgram, Transaction, - type TransactionInstruction + type TransactionInstruction, + type VersionedTransactionResponse } from "@solana/web3.js" import { utils as ethersUtils } from "ethers" @@ -21,9 +22,14 @@ import { } from "../../reserves/index.js" const ConfirmationCommitment = "confirmed", + ConfirmationPollIntervalMs = 1_500, + SolanaConfirmationStatus = { + confirmed: "confirmed", + finalized: "finalized" + } as const, OutpostConfigSeed = Buffer.from("outpost_config"), - ReserveSeed = Buffer.from("opp_reserve"), - ReserveVaultSeed = Buffer.from("opp_reserve_vault"), + ReserveSeed = Buffer.from("reserve"), + ReserveVaultSeed = Buffer.from("reserve_vault"), OutboundMessageBufferSeed = Buffer.from("outbound_message_buffer"), Unsigned64ByteLength = 8, SwapDepositLog = /opp_outpost: SwapDeposit id=(\d+)\b/ @@ -193,22 +199,75 @@ export class SolanaReserveSwapClient { private async submit( instruction: TransactionInstruction ): Promise { - const transactionId = await this.provider.sendAndConfirm( - new Transaction().add(instruction), - [], - { commitment: ConfirmationCommitment } + const connection = this.provider.connection, + latestBlockhash = await connection.getLatestBlockhash( + ConfirmationCommitment + ), + transaction = new Transaction({ + feePayer: this.assertWallet(), + blockhash: latestBlockhash.blockhash, + lastValidBlockHeight: latestBlockhash.lastValidBlockHeight + }).add(instruction), + signedTransaction = await this.provider.wallet.signTransaction( + transaction + ), + transactionId = await connection.sendRawTransaction( + signedTransaction.serialize(), + { preflightCommitment: ConfirmationCommitment } ), - transaction = await this.provider.connection.getTransaction( + confirmedTransaction = await this.waitForConfirmedTransaction( + transactionId, + latestBlockhash.lastValidBlockHeight + ), + sourceRequestId = SolanaReserveSwapClient.parseSourceRequestId( + confirmedTransaction.meta?.logMessages ?? [] + ) + return { transactionId, sourceRequestId } + } + + /** Poll one submitted signature until Solana records success or a terminal error. */ + private async waitForConfirmedTransaction( + transactionId: string, + lastValidBlockHeight: number + ): Promise { + const connection = this.provider.connection, + [statusResponse, blockHeight] = await Promise.all([ + connection.getSignatureStatuses([transactionId], { + searchTransactionHistory: true + }), + connection.getBlockHeight(ConfirmationCommitment) + ]), + status = statusResponse.value[0] + + if (status?.err != null) { + throw new Error( + `Solana reserve swap ${transactionId} failed: ${JSON.stringify(status.err)}` + ) + } + + const confirmed = + status?.confirmationStatus === SolanaConfirmationStatus.confirmed || + status?.confirmationStatus === SolanaConfirmationStatus.finalized + if (confirmed) { + const confirmedTransaction = await connection.getTransaction( transactionId, { commitment: ConfirmationCommitment, maxSupportedTransactionVersion: 0 } - ), - sourceRequestId = SolanaReserveSwapClient.parseSourceRequestId( - transaction?.meta?.logMessages ?? [] ) - return { transactionId, sourceRequestId } + if (confirmedTransaction != null) return confirmedTransaction + } else if (status == null && blockHeight > lastValidBlockHeight) { + throw new Error( + `Solana reserve swap ${transactionId} expired before it was recorded on chain.` + ) + } + + await new Promise(resolve => setTimeout(resolve, ConfirmationPollIntervalMs)) + return this.waitForConfirmedTransaction( + transactionId, + lastValidBlockHeight + ) } /** Parse the canonical deposit id logged by `request_swap*`. */ diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index f2dc305..01a20ab 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -1,6 +1,7 @@ -import { PublicKey } from "@solana/web3.js" +import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js" import { + type ReserveSwapRequest, SolanaOutpostClient, SolanaProgramName, SolanaReserveSwapClient, @@ -14,6 +15,25 @@ import { } from "../../Fixtures.js" const WrongProgramDataAddress = "SysvarRent111111111111111111111111111111111" +const SubmittedSignature = "3".repeat(64) + +const reserveSwapRequest: ReserveSwapRequest = { + sourceTokenCode: 1, + sourceReserveCode: 2, + sourceAmount: 3, + targetChainCode: 4, + targetTokenCode: 5, + targetReserveCode: 6, + targetRecipient: Uint8Array.from([7]), + targetAmount: 8, + targetToleranceBps: 500 +} + +function unsigned64Seed(value: bigint): Buffer { + const seed = Buffer.alloc(8) + seed.writeBigUInt64LE(value) + return seed +} describe("SolanaOutpostClient", () => { it("verifies a profile and returns its runtime program address", async () => { @@ -39,6 +59,107 @@ describe("SolanaOutpostClient", () => { ) }) + it("derives native reserve accounts from the deployed program seeds", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + client = await SolanaOutpostClient.create({ profile, provider }), + instruction = await client.swaps.createNativeInstruction( + reserveSwapRequest + ), + programAddress = new PublicKey( + profile.solana.programs[SolanaProgramName.liqsolCore].address + ), + expectedReserve = PublicKey.findProgramAddressSync( + [ + Buffer.from("reserve"), + unsigned64Seed(1n), + unsigned64Seed(2n) + ], + programAddress + )[0] + + expect(instruction.keys[2].pubkey.equals(expectedReserve)).toBe(true) + }) + + it("derives SPL reserve vaults from the deployed program seeds", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + client = await SolanaOutpostClient.create({ profile, provider }), + instruction = await client.swaps.createSplInstruction({ + ...reserveSwapRequest, + mint: Keypair.generate().publicKey + }), + programAddress = new PublicKey( + profile.solana.programs[SolanaProgramName.liqsolCore].address + ), + expectedVault = PublicKey.findProgramAddressSync( + [ + Buffer.from("reserve_vault"), + unsigned64Seed(1n), + unsigned64Seed(2n) + ], + programAddress + )[0] + + expect(instruction.keys[3].pubkey.equals(expectedVault)).toBe(true) + }) + + it("polls a submitted reserve swap until Solana confirms it", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + client = await SolanaOutpostClient.create({ profile, provider }), + instruction = SystemProgram.transfer({ + fromPubkey: provider.wallet.publicKey, + toPubkey: provider.wallet.publicKey, + lamports: 1 + }) + jest.spyOn(client.swaps, "createNativeInstruction").mockResolvedValue(instruction) + jest.spyOn(provider.connection, "getLatestBlockhash").mockResolvedValue({ + blockhash: Keypair.generate().publicKey.toBase58(), + lastValidBlockHeight: 100 + }) + jest.spyOn(provider.connection, "sendRawTransaction").mockResolvedValue(SubmittedSignature) + jest.spyOn(provider.connection, "getSignatureStatuses").mockResolvedValue({ + context: { slot: 10 }, + value: [{ slot: 10, confirmations: 1, err: null, confirmationStatus: "confirmed" }] + }) + jest.spyOn(provider.connection, "getBlockHeight").mockResolvedValue(10) + jest.spyOn(provider.connection, "getTransaction").mockResolvedValue({ + meta: { logMessages: ["Program log: opp_outpost: SwapDeposit id=42 hash=abc"] } + } as never) + + await expect(client.swaps.requestNative(reserveSwapRequest)).resolves.toEqual({ + transactionId: SubmittedSignature, + sourceRequestId: 42n + }) + }) + + it("reports an explicit on-chain reserve swap failure", async () => { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + client = await SolanaOutpostClient.create({ profile, provider }), + instruction = SystemProgram.transfer({ + fromPubkey: provider.wallet.publicKey, + toPubkey: provider.wallet.publicKey, + lamports: 1 + }) + jest.spyOn(client.swaps, "createNativeInstruction").mockResolvedValue(instruction) + jest.spyOn(provider.connection, "getLatestBlockhash").mockResolvedValue({ + blockhash: Keypair.generate().publicKey.toBase58(), + lastValidBlockHeight: 100 + }) + jest.spyOn(provider.connection, "sendRawTransaction").mockResolvedValue(SubmittedSignature) + jest.spyOn(provider.connection, "getSignatureStatuses").mockResolvedValue({ + context: { slot: 10 }, + value: [{ slot: 10, confirmations: 1, err: { InstructionError: [2, "Custom"] }, confirmationStatus: "confirmed" }] + }) + jest.spyOn(provider.connection, "getBlockHeight").mockResolvedValue(10) + + await expect(client.swaps.requestNative(reserveSwapRequest)).rejects.toThrow( + `Solana reserve swap ${SubmittedSignature} failed` + ) + }) + it("rejects the wrong Solana cluster", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createSolanaProviderFixture(profile) From c663fea93e1d8c85bb74bf8fde0835b913b91a82 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 7 Aug 2026 11:16:46 -0400 Subject: [PATCH 21/48] fix: add gas headroom to Ethereum reserve swaps --- packages/sdk-outpost/README.md | 8 ++- .../ethereum/EthereumReserveSwapClient.ts | 50 ++++++++++++-- .../ethereum/EthereumOutpostClient.test.ts | 69 +++++++++++++++++-- 3 files changed, 112 insertions(+), 15 deletions(-) diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 837e5e2..7fe7a37 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -22,9 +22,9 @@ module entrypoints with TypeScript declarations. ## Supported surfaces | Family | Generated clients and workflows | -| -------- | ------------------------------------------------------------------------- | -| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager`, reserve swaps | -| Solana | `liqsol_core`, native SOL and classic SPL reserve swaps | +| -------- | ------------------------------------------------------------------------ | +| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager`, reserve swaps | +| Solana | `liqsol_core`, native SOL and classic SPL reserve swaps | Client creation verifies all four boundaries before returning: @@ -155,6 +155,8 @@ repository. - Recreate external clients whenever the selected deployment profile changes. - Combine SDK deployment verification with flow-specific capability gates before enabling a product action. +- Ethereum reserve-swap submissions estimate the live call and add 25% gas + headroom for nested OPP execution; unused gas is not charged. ## Maintainer commands diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts index 275af9b..28a3f03 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts @@ -1,4 +1,5 @@ import { + BigNumber, Contract, Signer, type BigNumberish, @@ -13,12 +14,14 @@ import { type ReserveSwapSubmission } from "../../reserves/index.js" -const ConfirmationCount = 1, +const BasisPointDenominator = 10_000, + ConfirmationCount = 1, Erc20Interface = [ "function allowance(address owner,address spender) view returns (uint256)", "function approve(address spender,uint256 amount) returns (bool)", "function balanceOf(address owner) view returns (uint256)" - ] + ], + SubmissionGasHeadroomBps = 2_500 /** Event fields required to extract a ReserveManager deposit id. */ interface EthereumReserveSwapEvent { @@ -44,10 +47,20 @@ export class EthereumReserveSwapClient { overrides = { value: request.sourceAmount } await this.reserveManager.callStatic.requestSwap(...parameters, overrides) - const transaction = await this.reserveManager.requestSwap( + const estimatedGas = await this.reserveManager.estimateGas.requestSwap( ...parameters, overrides ), + submissionOverrides = { + ...overrides, + gasLimit: + EthereumReserveSwapClient.addSubmissionGasHeadroom(estimatedGas) + } + + const transaction = await this.reserveManager.requestSwap( + ...parameters, + submissionOverrides + ), receipt = await transaction.wait(ConfirmationCount) return { transactionId: transaction.hash, @@ -77,9 +90,21 @@ export class EthereumReserveSwapClient { } const arguments_ = this.swapArguments(request) - await this.reserveManager.callStatic.requestSwapErc20WithApproval(arguments_) - const transaction = - await this.reserveManager.requestSwapErc20WithApproval(arguments_), + await this.reserveManager.callStatic.requestSwapErc20WithApproval( + arguments_ + ) + const estimatedGas = + await this.reserveManager.estimateGas.requestSwapErc20WithApproval( + arguments_ + ), + overrides = { + gasLimit: + EthereumReserveSwapClient.addSubmissionGasHeadroom(estimatedGas) + } + const transaction = await this.reserveManager.requestSwapErc20WithApproval( + arguments_, + overrides + ), receipt = await transaction.wait(ConfirmationCount) return { transactionId: transaction.hash, @@ -142,6 +167,15 @@ export class EthereumReserveSwapClient { } } + /** Add bounded headroom to estimates that traverse OPP delegate calls. */ + static addSubmissionGasHeadroom(estimatedGas: BigNumberish): BigNumber { + const gas = BigNumber.from(estimatedGas) + return gas + .mul(BasisPointDenominator + SubmissionGasHeadroomBps) + .add(BasisPointDenominator - 1) + .div(BasisPointDenominator) + } + /** Parse the canonical deposit id emitted by `requestSwap*`. */ static parseSourceRequestId( events: readonly EthereumReserveSwapEvent[] | undefined @@ -149,7 +183,9 @@ export class EthereumReserveSwapClient { const event = events?.find(candidate => candidate.event === "SwapDeposit"), id = event?.args?.[0] if (id == null) { - throw new Error("Confirmed Ethereum reserve swap did not emit SwapDeposit.") + throw new Error( + "Confirmed Ethereum reserve swap did not emit SwapDeposit." + ) } return BigInt(id.toString()) } diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index cbb0b63..5e981f4 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -1,9 +1,10 @@ -import { BigNumber, utils as ethersUtils } from "ethers" +import { BigNumber, utils as ethersUtils, Wallet } from "ethers" import { EthereumContractName, EthereumOutpostClient, - EthereumReserveSwapClient + EthereumReserveSwapClient, + type ReserveSwapRequest } from "@wireio/sdk-outpost" import { createEthereumProviderFixture, @@ -11,6 +12,66 @@ import { } from "../../Fixtures.js" describe("EthereumOutpostClient", () => { + it("submits native reserve swaps with estimated gas headroom", async () => { + const request: ReserveSwapRequest = { + sourceTokenCode: 1, + sourceReserveCode: 2, + sourceAmount: 3, + targetChainCode: 4, + targetTokenCode: 5, + targetReserveCode: 6, + targetRecipient: new Uint8Array([7]), + targetAmount: 8, + targetToleranceBps: 500 + }, + wait = jest.fn().mockResolvedValue({ + events: [{ event: "SwapDeposit", args: [BigNumber.from(42)] }] + }), + requestSwap = jest.fn().mockResolvedValue({ hash: "0xabc", wait }), + reserveManager = { + callStatic: { requestSwap: jest.fn().mockResolvedValue(null) }, + estimateGas: { + requestSwap: jest.fn().mockResolvedValue(BigNumber.from(100_000)) + }, + requestSwap + } as unknown as ConstructorParameters< + typeof EthereumReserveSwapClient + >[0], + client = new EthereumReserveSwapClient( + reserveManager, + Wallet.createRandom() + ) + + await expect(client.requestNative(request)).resolves.toEqual({ + transactionId: "0xabc", + sourceRequestId: 42n + }) + expect(requestSwap).toHaveBeenCalledWith( + request.sourceTokenCode, + request.sourceReserveCode, + request.targetChainCode, + request.targetTokenCode, + request.targetReserveCode, + request.targetRecipient, + request.targetAmount, + request.targetToleranceBps, + { + value: request.sourceAmount, + gasLimit: BigNumber.from(125_000) + } + ) + expect(wait).toHaveBeenCalledWith(1) + }) + + it("adds 25% gas headroom to reserve swap submissions", () => { + expect(EthereumReserveSwapClient.addSubmissionGasHeadroom(789_767)).toEqual( + BigNumber.from(987_209) + ) + expect(EthereumReserveSwapClient.addSubmissionGasHeadroom(1)).toEqual( + BigNumber.from(2) + ) + }) + it("verifies a profile and returns a generated contract type", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createEthereumProviderFixture(profile), @@ -33,9 +94,7 @@ describe("EthereumOutpostClient", () => { }) it("parses the protocol deposit id from a confirmed receipt", () => { - const events = [ - { event: "SwapDeposit", args: [BigNumber.from(42)] } - ] + const events = [{ event: "SwapDeposit", args: [BigNumber.from(42)] }] expect(EthereumReserveSwapClient.parseSourceRequestId(events)).toBe(42n) expect(() => EthereumReserveSwapClient.parseSourceRequestId([])).toThrow( From a032e8af64ec775209b3712b8f7d12b9df26eb38 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 7 Aug 2026 14:00:55 -0400 Subject: [PATCH 22/48] fix(sdk-outpost): preserve Solana account namespace types --- CLAUDE.md | 1 + README.md | 5 +++++ packages/sdk-outpost/README.md | 6 ++++++ .../sdk-outpost/tests/assets/Artifacts.test.ts | 8 ++++++++ scripts/sdk-outpost/generate.mjs | 16 +++++++++++++--- 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6b834e5..4759385 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -220,6 +220,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact packages published by `wire-ethereum` and `wire-solana`; generated clients are ignored build outputs and must not be copied or edited here. +- `scripts/sdk-outpost/generate.mjs` must preserve literal Solana IDL account names in `LiqsolCore`; widening the generated type to base `Idl` erases precise `Program["account"]` members. - `packages/sdk-outpost` owns external reserve-swap instruction assembly, allowance handling, source submission, balance reads, and canonical `sourceRequestId` extraction. Staking remains outside this package until its diff --git a/README.md b/README.md index 2bb1546..1e1fc6a 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi | [`@wireio/wallet-ext-sdk`](packages/wallet-ext-sdk/) | Client SDK for the Wire Wallet browser extension | [![npm](https://img.shields.io/npm/v/@wireio/wallet-ext-sdk)](https://www.npmjs.com/package/@wireio/wallet-ext-sdk) | | [`@wireio/wallet-browser-ext`](packages/wallet-browser-ext/) | Chrome extension developer wallet for Wire | *private* | +The `sdk-outpost` generator preserves the source Solana IDL's literal account +names, so Anchor consumers retain precise `Program["account"]` +members after regeneration. Generated clients remain build outputs and must not +be edited by hand. + ## Examples | Example | Description | diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 7fe7a37..404b836 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -137,6 +137,12 @@ const solana = await OutpostClient.create({ const liqsol = solana.program(SolanaProgramName.liqsolCore) ``` +The generated `LiqsolCore` type preserves the IDL's literal account namespace, +including `Program["account"]["outpostConfig"]` and +`Program["account"]["reserve"]`. Regenerate from the source artifact +package; never widen the IDL to the base `Idl` type or edit generated Anchor +output by hand. + ## Artifact ownership `@wireio/outpost-ethereum-artifacts` and `@wireio/outpost-solana-artifacts` are diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index 10a810c..ec423ab 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -1,3 +1,5 @@ +import type { Program } from "@coral-xyz/anchor" + import { EthereumContractName, OPP__factory, @@ -6,6 +8,7 @@ import { OutpostChainFamily, ReserveManager__factory, SolanaProgramName, + type LiqsolCore, assertOutpostArtifactCompatibility, liqsolCoreIdl } from "@wireio/sdk-outpost" @@ -55,6 +58,10 @@ describe("source-owned outpost artifacts", () => { }) it("generates the callable swap and collateral surfaces", () => { + const accountNames: Array["account"]> = [ + "outpostConfig", + "reserve" + ] expect(OPP__factory.abi.length).toBeGreaterThan(0) expect( OPP__factory.createInterface().getFunction("addAttestation") @@ -82,5 +89,6 @@ describe("source-owned outpost artifacts", () => { "commitUnderwrite" ]) ) + expect(accountNames).toEqual(["outpostConfig", "reserve"]) }) }) diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs index af0d2d8..5780354 100644 --- a/scripts/sdk-outpost/generate.mjs +++ b/scripts/sdk-outpost/generate.mjs @@ -108,13 +108,23 @@ const { convertIdlToCamelCase } = PackageRequire( /* eslint-disable */ import type { Idl } from "@coral-xyz/anchor" - const liqsolCoreIdlValue = ${JSON.stringify(idl, null, 2)} as const + /** Remove readonly modifiers while preserving the generated IDL's literal names. */ + type MutableIdl = T extends object + ? { -readonly [Key in keyof T]: MutableIdl } + : T + + /** Capture a precise mutable IDL type for Anchor's generated namespaces. */ + function mutableIdl(value: T): MutableIdl { + return value as MutableIdl + } + + const liqsolCoreIdlValue = mutableIdl(${JSON.stringify(idl, null, 2)}) /** Strict Anchor IDL type generated from the wire-solana artifact package. */ - export type LiqsolCore = Idl & Omit + export type LiqsolCore = typeof liqsolCoreIdlValue /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ - export const liqsolCoreIdl = liqsolCoreIdlValue as LiqsolCore + export const liqsolCoreIdl = liqsolCoreIdlValue `), artifactSource = await formatTypescript(` /* Autogenerated file. Do not edit manually. */ From 4632308e4c6fca898d2a58c79f909a869425c0db Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 11 Aug 2026 11:37:17 -0400 Subject: [PATCH 23/48] docs(sdk-outpost): clarify first-release gates --- CLAUDE.md | 5 +++-- README.md | 7 ++++++- packages/sdk-outpost/README.md | 12 ++++++++++-- packages/sdk-outpost/RELEASING.md | 8 ++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4759385..947aa9e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,7 +36,7 @@ pnpm workspaces with TypeScript composite project references. No Lerna/Nx. | `@wireio/shared-web` | Web-specific utilities | No | ESM | | `@wireio/shared-node` | Node.js utilities | Yes | Hybrid ESM+CJS | | `@wireio/sdk-core` | Wire blockchain SDK types/primitives | Yes | Hybrid ESM+CJS | -| `@wireio/sdk-outpost` | Typed, verified external-chain outpost clients | Yes | Hybrid ESM+CJS | +| `@wireio/sdk-outpost` | Typed, verified external-chain outpost clients | No — first release pending | Hybrid ESM+CJS | | `@wireio/wallet-ext-sdk` | Wallet extension client SDK | Yes | ESM | | `@wireio/wallet-browser-ext` | Chrome extension developer wallet | No | Webpack bundle | @@ -219,7 +219,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact packages published by `wire-ethereum` and `wire-solana`; generated clients are ignored build outputs and must not be copied or edited here. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact producer packages owned by `wire-ethereum` and `wire-solana`; until their first publication, local sibling artifacts are testing inputs only. Generated clients are ignored build outputs and must not be copied or edited here. - `scripts/sdk-outpost/generate.mjs` must preserve literal Solana IDL account names in `LiqsolCore`; widening the generated type to base `Idl` erases precise `Program["account"]` members. - `packages/sdk-outpost` owns external reserve-swap instruction assembly, allowance handling, source submission, balance reads, and canonical @@ -228,6 +228,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. +- Do not describe `sdk-outpost` as npm-available until `npm view` succeeds for both exact producer artifact versions and `@wireio/sdk-outpost`, and a clean frozen install passes without sibling links. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/README.md b/README.md index 1e1fc6a..09f9450 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi | [`@wireio/shared-web`](packages/shared-web/) | Web-specific utilities | *private* | | [`@wireio/shared-node`](packages/shared-node/) | Node.js-specific utilities | *private* | | [`@wireio/sdk-core`](packages/sdk-core/) | Wire blockchain SDK core types, primitives, signing helpers, generated `sysio` contract proxy, and domain workflows such as multisig and reserves | [![npm](https://img.shields.io/npm/v/@wireio/sdk-core)](https://www.npmjs.com/package/@wireio/sdk-core) | -| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed Ethereum and Solana outpost clients generated from source-owned artifact packages | [![npm](https://img.shields.io/npm/v/@wireio/sdk-outpost)](https://www.npmjs.com/package/@wireio/sdk-outpost) | +| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed Ethereum and Solana outpost clients generated from source-owned artifact packages | *first release pending* | | [`@wireio/wallet-ext-sdk`](packages/wallet-ext-sdk/) | Client SDK for the Wire Wallet browser extension | [![npm](https://img.shields.io/npm/v/@wireio/wallet-ext-sdk)](https://www.npmjs.com/package/@wireio/wallet-ext-sdk) | | [`@wireio/wallet-browser-ext`](packages/wallet-browser-ext/) | Chrome extension developer wallet for Wire | *private* | @@ -19,6 +19,11 @@ names, so Anchor consumers retain precise `Program["account"]` members after regeneration. Generated clients remain build outputs and must not be edited by hand. +`@wireio/sdk-outpost` and its two producer artifact packages are not yet +available from npm. Local sibling links are valid for integration testing but +do not prove a frozen registry install and must not be committed as the final +consumer dependency. + ## Examples | Example | Description | diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 404b836..7a23556 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,14 +8,22 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Available on npm: +Publication status as of August 10, 2026: the first npm release is pending. +`@wireio/sdk-outpost@0.0.0` is a workspace development version, and the exact +Ethereum and Solana producer artifact packages are also unpublished. Sibling +checkouts may be used for local integration testing, but they are not release +evidence. -## Install +## Install after the first release ```sh npm install @wireio/sdk-outpost ``` +Before using the registry command, verify that both producer artifact versions +and `@wireio/sdk-outpost` resolve through `npm view`. Do not replace that check +with a committed machine-local link or a weakened frozen install. + Node.js 22 or newer is supported. The package publishes CommonJS and native ES module entrypoints with TypeScript declarations. diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index 133208f..d78315f 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -4,6 +4,14 @@ `@wireio/sdk-core`. Do not manually change its version or publish a workspace directory outside this process. +## Current first-release state + +As of August 10, 2026, neither exact producer artifact package nor +`@wireio/sdk-outpost` is listed on npm. The producer branches may be tested as +siblings, but the SDK lockfile and frozen-install gate must remain blocked until +the real registry packages exist. Do not generate lockfile entries from local +paths or advertise the package as installable before the registry checks pass. + ## Artifact prerequisites The package consumes exact build-time versions of: From 2041e1abe703028b7d7d4f4f1b62222bb4ecaa58 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 11 Aug 2026 11:42:46 -0400 Subject: [PATCH 24/48] fix(sdk-outpost): bind clients to producer runtimes --- CLAUDE.md | 2 +- packages/sdk-outpost/README.md | 23 +++-- packages/sdk-outpost/RELEASING.md | 12 ++- .../src/artifacts/Compatibility.ts | 88 ++++++++++++++++++ .../ethereum/EthereumReserveSwapClient.ts | 24 +++-- .../verification/OutpostDeploymentVerifier.ts | 14 ++- packages/sdk-outpost/tests/Fixtures.ts | 85 +++++++++++++---- .../ethereum/EthereumOutpostClient.test.ts | 38 ++++++++ .../solana/SolanaOutpostClient.test.ts | 36 +++++++ scripts/sdk-outpost/generate.mjs | 93 +++++++++++++++++-- 10 files changed, 371 insertions(+), 44 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 947aa9e..19b7af0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -225,7 +225,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c allowance handling, source submission, balance reads, and canonical `sourceRequestId` extraction. Staking remains outside this package until its dedicated migration. -- `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release. +- `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. - Do not describe `sdk-outpost` as npm-available until `npm view` succeeds for both exact producer artifact versions and `@wireio/sdk-outpost`, and a clean frozen install passes without sibling links. diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 7a23556..d89fc61 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -40,9 +40,10 @@ Client creation verifies all four boundaries before returning: SDK release; - the provider is connected to the expected external chain; - every Ethereum proxy resolves through its EIP-1967 implementation slot to the - configured implementation address and exact implementation code hash; + configured implementation address, exact implementation code hash, and the + producer package's normalized runtime template; - every Solana program resolves through the upgradeable loader to the configured - ProgramData account and exact ProgramData hash. + ProgramData account, exact ProgramData hash, and producer program binary. These checks prove deployment compatibility, not end-to-end feature readiness. Applications must still gate swaps, staking, settlement, retry, funding, and @@ -55,6 +56,11 @@ selected Wire network group in the application, load its immutable deployment profile from the platform release/deployment pipeline, and validate that untrusted input with `parseOutpostDeploymentProfile`. +Schema validation and the checksum-derived profile ID do not authenticate a +profile. Load profiles only through the platform's authenticated release +channel; deployment-profile signing and distribution remain release-pipeline +responsibilities rather than SDK-owned mutable network data. + A deployment profile carries: - the full parent Wire chain ID; @@ -72,7 +78,7 @@ new profile without requiring a producer-artifact or SDK release. | Change | Producer artifact release | `sdk-outpost` release | Deployment profile | | ------------------------------------------------------- | ------------------------- | --------------------- | ----------------------------------------- | | Same-code chain respin | No | No | New | -| Contract/program binary change with unchanged ABI/IDL | Yes | No | New | +| Contract/program binary change with unchanged ABI/IDL | Yes | Yes | New | | ABI or IDL change | Yes | Yes | New | | Asset/reserve onboarding without code/interface changes | No | No | Update operational configuration/evidence | | RPC or explorer rotation | No | No | Update endpoint catalog only | @@ -154,11 +160,12 @@ output by hand. ## Artifact ownership `@wireio/outpost-ethereum-artifacts` and `@wireio/outpost-solana-artifacts` are -build-time inputs. Their exact manifests are compiled into -`OutpostArtifactManifests` for interface compatibility and readiness reporting. -Generated TypeChain and Anchor sources are ignored local build outputs; they are -compiled into the published package and are never maintained by hand in this -repository. +build-time inputs. Generation verifies every packaged ABI, IDL, normalized +runtime template, and program binary before compiling exact manifests into +`OutpostArtifactManifests`. Runtime verification then binds live executable +bytes to those producer artifacts. Generated TypeChain and Anchor sources are +ignored local build outputs; they are compiled into the published package and +are never maintained by hand in this repository. ## Consumer boundaries diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index d78315f..ee7c4f4 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -21,10 +21,11 @@ The package consumes exact build-time versions of: Publish a new producer package when its ABI/IDL or deployable contract/program binary changes. Publish `sdk-outpost` when its public behavior changes or a new -ABI/IDL must be compiled into generated clients. A same-code deployment respin, -address change, or endpoint rotation does not require either package to be -republished; emit a new immutable deployment profile for a respin and update the -separate endpoint catalog for mutable endpoints. +ABI, IDL, normalized Ethereum runtime, or Solana program binary must be compiled +into deployment verification. A same-code deployment respin, address change, or +endpoint rotation does not require either package to be republished; emit a new +immutable deployment profile for a respin and update the separate endpoint +catalog for mutable endpoints. Before updating either dependency, verify its npm provenance, source revision, artifact checksums, and immutable version. Keep both versions exact in @@ -39,6 +40,9 @@ pnpm-compatible install. generated TypeChain, Anchor, or artifact-manifest sources by hand. - Confirm the package contains no secrets, RPC credentials, private keys, deployment addresses, or mutable environment configuration. +- Confirm deployment profiles are distributed through the authenticated + platform release channel; their schema and checksum-derived IDs are not + signatures. - Keep `repository.url` exactly equal to `https://github.com/Wire-Network/wire-libraries-ts` for npm provenance. diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index 79b8042..03075a9 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -1,4 +1,5 @@ import { match } from "ts-pattern" +import { utils as ethersUtils } from "ethers" import { EthereumContractName, @@ -8,6 +9,93 @@ import { } from "../deployments/index.js" import { OutpostArtifactManifests } from "./generated/index.js" +const SolanaProgramDataMetadataByteLength = 45 + +/** Byte range occupied by one linked Ethereum library address. */ +interface EthereumRuntimeLinkReference { + readonly start: number + readonly length: number +} + +/** Return the SHA-256 digest for chain runtime bytes. */ +function sha256(value: Uint8Array): string { + return ethersUtils.sha256(value).slice(2) +} + +/** Zero environment-specific linked-library addresses in live runtime code. */ +function normalizeEthereumRuntimeCode( + code: string, + linkReferences: readonly EthereumRuntimeLinkReference[] +): Uint8Array { + const runtimeCode = Uint8Array.from(ethersUtils.arrayify(code)) + let previousReferenceEnd = 0 + + linkReferences.forEach(({ start, length }) => { + const referenceEnd = start + length + if ( + !Number.isInteger(start) || + !Number.isInteger(length) || + length <= 0 || + start < previousReferenceEnd || + referenceEnd > runtimeCode.length + ) { + throw new Error("Ethereum artifact has invalid runtime link references") + } + runtimeCode.fill(0, start, referenceEnd) + previousReferenceEnd = referenceEnd + }) + + return runtimeCode +} + +/** Verify live Ethereum code against its source-owned runtime template. */ +export function assertEthereumRuntimeArtifactCompatibility( + contractName: EthereumContractName, + code: string +): void { + const artifact = OutpostArtifactManifests.ethereum.contracts[contractName], + normalizedCode = normalizeEthereumRuntimeCode( + code, + artifact.runtimeLinkReferences + ) + + if (normalizedCode.length !== artifact.runtimeBytecodeLength) { + throw new Error( + `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` + ) + } + const digest = sha256(normalizedCode) + if (digest !== artifact.runtimeBytecodeSha256) { + throw new Error( + `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` + ) + } +} + +/** Verify live Solana executable bytes against the source-owned program binary. */ +export function assertSolanaProgramArtifactCompatibility( + programName: SolanaProgramName, + programData: Uint8Array +): void { + const artifact = OutpostArtifactManifests.solana.programs[programName], + programBinaryEnd = + SolanaProgramDataMetadataByteLength + artifact.programBinaryLength + + if (programData.length < programBinaryEnd) { + throw new Error( + `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` + ) + } + const digest = sha256( + programData.subarray(SolanaProgramDataMetadataByteLength, programBinaryEnd) + ) + if (digest !== artifact.programBinarySha256) { + throw new Error( + `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` + ) + } +} + /** Assert that one profile digest matches the interface compiled into the SDK. */ function assertInterfaceDigest( actual: string, diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts index 28a3f03..f836e11 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts @@ -81,13 +81,14 @@ export class EthereumReserveSwapClient { token = new Contract(tokenAddress, Erc20Interface, signer), allowance = await token.allowance(owner, this.reserveManager.address) - if (allowance.lt(request.sourceAmount)) { - const approval = await token.approve( - this.reserveManager.address, - request.sourceAmount - ) + await EthereumReserveSwapClient.approvalAmounts( + allowance, + request.sourceAmount + ).reduce>(async (previousApproval, amount) => { + await previousApproval + const approval = await token.approve(this.reserveManager.address, amount) await approval.wait(ConfirmationCount) - } + }, Promise.resolve()) const arguments_ = this.swapArguments(request) await this.reserveManager.callStatic.requestSwapErc20WithApproval( @@ -176,6 +177,17 @@ export class EthereumReserveSwapClient { .div(BasisPointDenominator) } + /** Return the safe approval sequence for zero-first ERC-20 implementations. */ + static approvalAmounts( + currentAllowance: BigNumberish, + requiredAllowance: BigNumberish + ): readonly BigNumber[] { + const current = BigNumber.from(currentAllowance), + required = BigNumber.from(requiredAllowance) + if (current.gte(required)) return [] + return current.isZero() ? [required] : [BigNumber.from(0), required] + } + /** Parse the canonical deposit id emitted by `requestSwap*`. */ static parseSourceRequestId( events: readonly EthereumReserveSwapEvent[] | undefined diff --git a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts index 2b551b2..0c2dd65 100644 --- a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts +++ b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts @@ -4,7 +4,11 @@ import type { BytesLike, providers } from "ethers" import { utils as ethersUtils } from "ethers" import { match } from "ts-pattern" -import { assertOutpostArtifactCompatibility } from "../artifacts/index.js" +import { + assertEthereumRuntimeArtifactCompatibility, + assertOutpostArtifactCompatibility, + assertSolanaProgramArtifactCompatibility +} from "../artifacts/index.js" import { EthereumContractName, OutpostChainFamily, @@ -112,6 +116,10 @@ async function verifyEthereum( `Ethereum ${contractName} implementation code mismatch: expected ${contract.implementationCodeSha256}, received ${implementationCodeSha256}` ) } + assertEthereumRuntimeArtifactCompatibility( + contractName, + implementationCode + ) }) ) } @@ -203,6 +211,10 @@ async function verifySolana( `Solana ${programName} ProgramData mismatch: expected ${program.programDataSha256}, received ${programDataSha256}` ) } + assertSolanaProgramArtifactCompatibility( + programName, + programDataAccount.data + ) }) ) } diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts index d4f2639..e9fa292 100644 --- a/packages/sdk-outpost/tests/Fixtures.ts +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -1,5 +1,7 @@ import { AnchorProvider, Wallet } from "@coral-xyz/anchor" import { Connection, Keypair, PublicKey } from "@solana/web3.js" +import { readFileSync } from "node:fs" +import { createRequire } from "node:module" import { providers, utils as ethersUtils } from "ethers" import { @@ -13,9 +15,6 @@ import { const TestHash = "a".repeat(64), TestWireChainId = "c".repeat(64), - TestEthereumProxyAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", - TestEthereumImplementationAddress = - "0x7412BC256355ABD22dD53De3a38E8995b5d4c1D1", TestSolanaGenesisHash = "5nBtmutQLrRKBUxNfHJPDjiW5u8id6QM9Hhjg1D1g1XH", TestSolanaProgramAddress = "4vJ9JU1bJJE96FWSJKvHsmmFADCg4gpZQff4P3bkLKi", TestSolanaProgramDataAddress = "8qbHbw2BbbTHBW1sbeqakYXVKRQM8Ne7pLK7m6CVfeR", @@ -24,12 +23,47 @@ const TestHash = "a".repeat(64), SolanaPublicKeyByteLength = 32, ProgramAccountDataByteLength = UpgradeableLoaderStateTagByteLength + SolanaPublicKeyByteLength, - ProgramDataAccountDataByteLength = 8, + SolanaProgramDataMetadataByteLength = 45, + SolanaProgramDataPaddingByteLength = 16, ProgramStateTag = 2, - ProgramDataStateTag = 3 + ProgramDataStateTag = 3, + TestEthereumProxyAddressBase = 100, + TestEthereumImplementationAddressBase = 200, + TestEthereumProxyCode = "0x01", + PackageRequire = createRequire(__filename), + SolanaProgramArtifact = + OutpostArtifactManifests.solana.programs[SolanaProgramName.liqsolCore], + SolanaProgramBinary = readFileSync( + PackageRequire.resolve( + `${OutpostArtifactManifests.solana.package.name}/${SolanaProgramArtifact.programBinaryPath}` + ) + ) + +/** Create one deterministic Ethereum address for a fixture index. */ +function createEthereumAddress(index: number): string { + return ethersUtils.getAddress( + ethersUtils.hexZeroPad(ethersUtils.hexlify(index), 20) + ) +} -/** Runtime bytecode returned by the Ethereum provider fixture. */ -export const TestEthereumImplementationCode = "0x01" +/** Create linked live implementation code from one producer runtime template. */ +export function createEthereumImplementationCode( + contractName: EthereumContractName +): string { + const artifact = OutpostArtifactManifests.ethereum.contracts[contractName], + runtimeCode = Buffer.from( + readFileSync( + PackageRequire.resolve( + `${OutpostArtifactManifests.ethereum.package.name}/${artifact.runtimeBytecodePath}` + ) + ) + ) + + artifact.runtimeLinkReferences.forEach(({ start, length }) => + runtimeCode.fill(1, start, start + length) + ) + return ethersUtils.hexlify(runtimeCode) +} /** Encode the upgradeable-loader Program account for one ProgramData address. */ export function createSolanaProgramAccountData( @@ -45,24 +79,31 @@ export function createSolanaProgramAccountData( /** Encode deterministic upgradeable-loader ProgramData account contents. */ export function createSolanaProgramDataAccountData(): Buffer { - const data = Buffer.alloc(ProgramDataAccountDataByteLength) + const data = Buffer.alloc( + SolanaProgramDataMetadataByteLength + + SolanaProgramBinary.length + + SolanaProgramDataPaddingByteLength + ) data.writeUInt32LE(ProgramDataStateTag, 0) - data.writeUInt32LE(1, UpgradeableLoaderStateTagByteLength) + data.writeBigUInt64LE(1n, UpgradeableLoaderStateTagByteLength) + SolanaProgramBinary.copy(data, SolanaProgramDataMetadataByteLength) return data } /** Create a valid profile aligned with the SDK's source-owned artifacts. */ export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfile { const ethereumContracts = Object.fromEntries( - Object.values(EthereumContractName).map(contractName => [ + Object.values(EthereumContractName).map((contractName, index) => [ contractName, { - address: TestEthereumProxyAddress, - implementationAddress: TestEthereumImplementationAddress, + address: createEthereumAddress(TestEthereumProxyAddressBase + index), + implementationAddress: createEthereumAddress( + TestEthereumImplementationAddressBase + index + ), abiSha256: OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, implementationCodeSha256: ethersUtils - .sha256(TestEthereumImplementationCode) + .sha256(createEthereumImplementationCode(contractName)) .slice(2) } ]) @@ -105,9 +146,21 @@ export function createEthereumProviderFixture( chainId: profile.ethereum.chainId, name: "wire-outpost" }) - jest - .spyOn(provider, "getCode") - .mockResolvedValue(TestEthereumImplementationCode) + jest.spyOn(provider, "getCode").mockImplementation(async address => { + const implementation = Object.entries(profile.ethereum.contracts).find( + ([, deployment]) => deployment.implementationAddress === address + ) + if (implementation != null) { + return createEthereumImplementationCode( + implementation[0] as EthereumContractName + ) + } + return Object.values(profile.ethereum.contracts).some( + deployment => deployment.address === address + ) + ? TestEthereumProxyCode + : "0x" + }) jest.spyOn(provider, "getStorageAt").mockImplementation(async address => { const contract = Object.values(profile.ethereum.contracts).find( deployment => deployment.address === address diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 5e981f4..cb13c2b 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -7,6 +7,7 @@ import { type ReserveSwapRequest } from "@wireio/sdk-outpost" import { + createEthereumImplementationCode, createEthereumProviderFixture, createOutpostDeploymentProfileFixture } from "../../Fixtures.js" @@ -72,6 +73,20 @@ describe("EthereumOutpostClient", () => { ) }) + it("resets nonzero ERC-20 allowances before increasing them", () => { + expect( + EthereumReserveSwapClient.approvalAmounts(2, 3).map(amount => + amount.toNumber() + ) + ).toEqual([0, 3]) + expect( + EthereumReserveSwapClient.approvalAmounts(0, 3).map(amount => + amount.toNumber() + ) + ).toEqual([3]) + expect(EthereumReserveSwapClient.approvalAmounts(3, 3)).toEqual([]) + }) + it("verifies a profile and returns a generated contract type", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createEthereumProviderFixture(profile), @@ -148,4 +163,27 @@ describe("EthereumOutpostClient", () => { EthereumOutpostClient.create({ profile, connection: provider }) ).rejects.toThrow("implementation code mismatch") }) + + it("rejects live code from another producer runtime", async () => { + const profile = createOutpostDeploymentProfileFixture(), + contract = profile.ethereum.contracts[EthereumContractName.OPP], + incompatibleCodeBytes = ethersUtils.arrayify( + createEthereumImplementationCode(EthereumContractName.OPP) + ) + incompatibleCodeBytes[0] ^= 1 + const incompatibleCode = ethersUtils.hexlify(incompatibleCodeBytes), + incompatibleCodeSha256 = ethersUtils.sha256(incompatibleCode).slice(2) + contract.implementationCodeSha256 = incompatibleCodeSha256 + const provider = createEthereumProviderFixture(profile), + getCode = (provider.getCode as jest.Mock).getMockImplementation() + jest.spyOn(provider, "getCode").mockImplementation(async address => + address === contract.implementationAddress + ? incompatibleCode + : getCode(address) + ) + + await expect( + EthereumOutpostClient.create({ profile, connection: provider }) + ).rejects.toThrow("artifact runtime") + }) }) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index 01a20ab..b9d504b 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -1,4 +1,5 @@ import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js" +import { utils as ethersUtils } from "ethers" import { type ReserveSwapRequest, @@ -16,6 +17,7 @@ import { const WrongProgramDataAddress = "SysvarRent111111111111111111111111111111111" const SubmittedSignature = "3".repeat(64) +const SolanaProgramDataMetadataByteLength = 45 const reserveSwapRequest: ReserveSwapRequest = { sourceTokenCode: 1, @@ -227,4 +229,38 @@ describe("SolanaOutpostClient", () => { SolanaOutpostClient.create({ profile, provider }) ).rejects.toThrow("ProgramData mismatch") }) + + it("rejects ProgramData executable bytes from another producer binary", async () => { + const profile = createOutpostDeploymentProfileFixture(), + program = profile.solana.programs[SolanaProgramName.liqsolCore], + incompatibleProgramData = createSolanaProgramDataAccountData() + incompatibleProgramData[SolanaProgramDataMetadataByteLength] ^= 1 + program.programDataSha256 = ethersUtils + .sha256(incompatibleProgramData) + .slice(2) + const provider = createSolanaProviderFixture(profile) + jest + .spyOn(provider.connection, "getAccountInfo") + .mockImplementation(async address => + address.equals(new PublicKey(program.address)) + ? { + data: createSolanaProgramAccountData(program.programDataAddress), + executable: true, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + } + : { + data: incompatibleProgramData, + executable: false, + lamports: 1, + owner: SolanaUpgradeableLoaderProgramId, + rentEpoch: 0 + } + ) + + await expect( + SolanaOutpostClient.create({ profile, provider }) + ).rejects.toThrow("artifact program mismatch") + }) }) diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs index 5780354..741d2d6 100644 --- a/scripts/sdk-outpost/generate.mjs +++ b/scripts/sdk-outpost/generate.mjs @@ -1,5 +1,6 @@ #!/usr/bin/env zx +import Crypto from "node:crypto" import { createRequire } from "node:module" import { format } from "prettier" @@ -41,6 +42,21 @@ function resolveArtifact(packageName, artifactPath) { return PackageRequire.resolve(`${packageName}/${artifactPath}`) } +/** Return the SHA-256 digest for generated artifact bytes. */ +function sha256(value) { + return Crypto.createHash("sha256").update(value).digest("hex") +} + +/** Serialize one ABI exactly as its producer computes the interface digest. */ +function formatJson(value) { + return `${JSON.stringify(value, null, 2)}\n` +} + +/** Verify one package-owned artifact before it can generate SDK code. */ +function assertArtifactDigest(actual, expected, label) { + assert(actual === expected, `${label} checksum mismatch`) +} + /** Format generated TypeScript according to repository rules. */ async function formatTypescript(source) { return format(source, { @@ -51,7 +67,8 @@ async function formatTypescript(source) { }) } -const [ethereumManifest, solanaManifest] = await Promise.all([ +const [packageManifest, ethereumManifest, solanaManifest] = await Promise.all([ + readJson(PackageManifestPath), readJson(EthereumManifestPath), readJson(SolanaManifestPath) ]) @@ -64,6 +81,16 @@ assert( solanaManifest.package.name === SolanaArtifactPackageName, `Unexpected Solana artifact package ${solanaManifest.package.name}` ) +assert( + packageManifest.devDependencies[EthereumArtifactPackageName] === + ethereumManifest.package.version, + `Ethereum artifact version ${ethereumManifest.package.version} does not match sdk-outpost` +) +assert( + packageManifest.devDependencies[SolanaArtifactPackageName] === + solanaManifest.package.version, + `Solana artifact version ${solanaManifest.package.version} does not match sdk-outpost` +) assert( EthereumContractNames.every(name => ethereumManifest.contracts[name] != null), "Ethereum artifact package does not cover the sdk-outpost contract surface" @@ -84,11 +111,35 @@ await Promise.all( ) ) -const ethereumInputs = EthereumContractNames.map(name => - resolveArtifact( - EthereumArtifactPackageName, - ethereumManifest.contracts[name].path - ) +const ethereumInputs = await Promise.all( + EthereumContractNames.map(async name => { + const contract = ethereumManifest.contracts[name], + abiPath = resolveArtifact(EthereumArtifactPackageName, contract.path), + runtimeBytecodePath = resolveArtifact( + EthereumArtifactPackageName, + contract.runtimeBytecodePath + ), + [artifact, runtimeBytecode] = await Promise.all([ + readJson(abiPath), + fs.readFile(runtimeBytecodePath) + ]) + + assertArtifactDigest( + sha256(formatJson(artifact.abi)), + contract.abiSha256, + `Ethereum ${name} ABI` + ) + assert( + runtimeBytecode.length === contract.runtimeBytecodeLength, + `Ethereum ${name} runtime bytecode length mismatch` + ) + assertArtifactDigest( + sha256(runtimeBytecode), + contract.runtimeBytecodeSha256, + `Ethereum ${name} runtime bytecode` + ) + return abiPath + }) ) await $({ @@ -99,9 +150,35 @@ const { convertIdlToCamelCase } = PackageRequire( "@coral-xyz/anchor/dist/cjs/idl.js" ), solanaProgram = solanaManifest.programs[SolanaProgramName], - rawIdl = await readJson( - resolveArtifact(SolanaArtifactPackageName, solanaProgram.idlPath) + solanaIdlPath = resolveArtifact( + SolanaArtifactPackageName, + solanaProgram.idlPath ), + solanaProgramBinaryPath = resolveArtifact( + SolanaArtifactPackageName, + solanaProgram.programBinaryPath + ), + [rawIdlSource, solanaProgramBinary] = await Promise.all([ + fs.readFile(solanaIdlPath), + fs.readFile(solanaProgramBinaryPath) + ]) + +assertArtifactDigest( + sha256(rawIdlSource), + solanaProgram.idlSha256, + "Solana liqsolCore IDL" +) +assert( + solanaProgramBinary.length === solanaProgram.programBinaryLength, + "Solana liqsolCore program binary length mismatch" +) +assertArtifactDigest( + sha256(solanaProgramBinary), + solanaProgram.programBinarySha256, + "Solana liqsolCore program binary" +) + +const rawIdl = JSON.parse(rawIdlSource.toString("utf8")), idl = convertIdlToCamelCase(rawIdl), solanaSource = await formatTypescript(` /* Autogenerated file. Do not edit manually. */ From d1f35f8b5b59c0f0f6acac7f6c8916c481becde7 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 7 Aug 2026 13:20:51 -0400 Subject: [PATCH 25/48] feat(sdk-core): match reserve pairs atomically --- packages/sdk-core/README.md | 15 +++++++ packages/sdk-core/package.json | 5 +++ .../src/contracts/sysio/reserv/Client.ts | 22 ++++++++- .../src/contracts/sysio/reserv/Types.ts | 8 ++++ .../contracts/sysio/reserv/Client.test.ts | 45 +++++++++++++++++++ 5 files changed, 94 insertions(+), 1 deletion(-) diff --git a/packages/sdk-core/README.md b/packages/sdk-core/README.md index 483042f..1016b50 100644 --- a/packages/sdk-core/README.md +++ b/packages/sdk-core/README.md @@ -122,8 +122,23 @@ await reserves.pushMatchReserve({ matcher: "alice", wireAmount: pending[0].requestedWireAmount }) + +// Several pending rows can be activated atomically in one signed transaction. +await reserves.pushMatchReserves({ + matches: pending.map(reserve => ({ + chainCode: reserve.chainCode, + tokenCode: reserve.tokenCode, + reserveCode: reserve.reserveCode, + matcher: "alice", + wireAmount: reserve.requestedWireAmount + })) +}) ``` +`pushMatchReserves` preserves the supplied action order and rejects an empty +match list. The Wire transaction is atomic: either every `matchreserve` action +is accepted or none is applied. + ## Reserve swaps Reserve swap integrations compose three on-chain sources instead of carrying a diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index a02446a..7d88a39 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -30,6 +30,11 @@ "types": "./lib/esm/*.d.ts" } }, + "typesVersions": { + "*": { + "*": ["lib/esm/*"] + } + }, "access": "public", "license": "FSL-1.1-Apache-2.0", "scripts": { diff --git a/packages/sdk-core/src/contracts/sysio/reserv/Client.ts b/packages/sdk-core/src/contracts/sysio/reserv/Client.ts index 8f000b9..2d13a8b 100644 --- a/packages/sdk-core/src/contracts/sysio/reserv/Client.ts +++ b/packages/sdk-core/src/contracts/sysio/reserv/Client.ts @@ -14,7 +14,11 @@ import type * as SysioContracts from "../../../types/SysioContractTypes.js" import type { ContractTableRowsOptions } from "../../Contract.js" import { getSysioContract, type SysioContractClient } from "../Client.js" -import { buildSwapQuoteAction, matchReserveActionData } from "./Actions.js" +import { + buildMatchReserveAction, + buildSwapQuoteAction, + matchReserveActionData +} from "./Actions.js" import { DEFAULT_RESERV_CONTRACT, DEFAULT_RESERVE_QUERY_LIMIT @@ -27,6 +31,7 @@ import { import type { ListReservesOptions, PushMatchReserveOptions, + PushMatchReservesOptions, ReserveClientOptions, ReserveIdentity, ReserveQuoteOptions, @@ -271,6 +276,21 @@ export class ReserveClient { ) } + /** Builds and pushes one signed Wire transaction that activates several pending reserves atomically. */ + async pushMatchReserves( + options: PushMatchReservesOptions, + pushOptions: TransactionExtraOptions = options.pushOptions || {} + ): Promise>> { + if (options.matches.length === 0) { + throw new Error("At least one reserve match is required.") + } + + return this.client.pushTransaction( + options.matches.map(buildMatchReserveAction), + pushOptions + ) + } + /** Reads the current on-chain quote for one reserve route. */ async getSwapQuote(options: ReserveQuoteOptions): Promise { const response = await this.sendReadOnlyAction( diff --git a/packages/sdk-core/src/contracts/sysio/reserv/Types.ts b/packages/sdk-core/src/contracts/sysio/reserv/Types.ts index cf0a434..ed5b265 100644 --- a/packages/sdk-core/src/contracts/sysio/reserv/Types.ts +++ b/packages/sdk-core/src/contracts/sysio/reserv/Types.ts @@ -59,6 +59,14 @@ export interface PushMatchReserveOptions extends MatchReserveOptions { pushOptions?: TransactionExtraOptions } +/** Options for atomically matching several pending reserves on Wire. */ +export interface PushMatchReservesOptions { + /** Ordered reserve matches included in one Wire transaction. */ + matches: readonly MatchReserveOptions[] + /** Optional push behavior such as finality waiting. */ + pushOptions?: TransactionExtraOptions +} + /** Options for a read-only reserve-to-reserve quote. */ export interface ReserveQuoteOptions { /** Source reserve identity. */ diff --git a/packages/sdk-core/tests/contracts/sysio/reserv/Client.test.ts b/packages/sdk-core/tests/contracts/sysio/reserv/Client.test.ts index 359a1c2..a52a606 100644 --- a/packages/sdk-core/tests/contracts/sysio/reserv/Client.test.ts +++ b/packages/sdk-core/tests/contracts/sysio/reserv/Client.test.ts @@ -163,6 +163,51 @@ describe("ReserveClient", () => { expect(action.authorization.map(String)).toEqual(["alice@active"]) }) + test("pushes ordered reserve matches in one Wire transaction", async () => { + const { client, pushTransaction } = clientFixture() + + await expect( + client.pushMatchReserves({ + matches: [ + { + chainCode: "ETHEREUM", + tokenCode: "ETH", + reserveCode: "PRIVATE", + matcher: "alice", + wireAmount: "2500000000" + }, + { + chainCode: "SOLANA", + tokenCode: "USDC", + reserveCode: "PRIVATE", + matcher: "alice", + wireAmount: "2500000000" + } + ] + }) + ).resolves.toEqual({ transaction_id: "reserve-trx" }) + + const [actions] = pushTransaction.mock.calls[0] + expect(actions).toHaveLength(2) + expect(actions.map(action => action.name.toString())).toEqual([ + "matchreserve", + "matchreserve" + ]) + expect(actions.map(action => action.authorization.map(String))).toEqual([ + ["alice@active"], + ["alice@active"] + ]) + }) + + test("rejects an empty atomic reserve match", async () => { + const { client, pushTransaction } = clientFixture() + + await expect(client.pushMatchReserves({ matches: [] })).rejects.toThrow( + "At least one reserve match is required." + ) + expect(pushTransaction).not.toHaveBeenCalled() + }) + test("decodes read-only swapquote and rewards values", async () => { const { client } = clientFixture() From 56d972dbe207ce70483b07dbfbd03b78f580d2a7 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 7 Aug 2026 13:21:02 -0400 Subject: [PATCH 26/48] feat(sdk-outpost): add private reserve lifecycle --- packages/sdk-outpost/README.md | 59 +++- packages/sdk-outpost/package.json | 1 + .../clients/ethereum/EthereumOutpostClient.ts | 8 + .../clients/ethereum/EthereumReserveClient.ts | 208 ++++++++++++++ .../sdk-outpost/src/clients/ethereum/index.ts | 1 + .../src/clients/solana/SolanaOutpostClient.ts | 5 + .../clients/solana/SolanaReserveAddresses.ts | 75 ++++++ .../src/clients/solana/SolanaReserveClient.ts | 255 ++++++++++++++++++ .../clients/solana/SolanaReserveSwapClient.ts | 72 ++--- .../sdk-outpost/src/clients/solana/index.ts | 2 + packages/sdk-outpost/src/reserves/Types.ts | 117 ++++++++ .../sdk-outpost/src/reserves/Validation.ts | 79 +++++- .../ethereum/EthereumOutpostClient.test.ts | 2 + .../ethereum/EthereumReserveClient.test.ts | 202 ++++++++++++++ .../solana/SolanaOutpostClient.test.ts | 2 + .../solana/SolanaReserveAddresses.test.ts | 66 +++++ .../solana/SolanaReserveClient.test.ts | 185 +++++++++++++ .../tests/reserves/Validation.test.ts | 45 ++++ pnpm-lock.yaml | 3 + scripts/sdk-outpost/verify-package.mjs | 2 + 20 files changed, 1336 insertions(+), 53 deletions(-) create mode 100644 packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts create mode 100644 packages/sdk-outpost/src/clients/solana/SolanaReserveAddresses.ts create mode 100644 packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts create mode 100644 packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts create mode 100644 packages/sdk-outpost/tests/clients/solana/SolanaReserveAddresses.test.ts create mode 100644 packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index d89fc61..0e7b1a4 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -30,9 +30,9 @@ module entrypoints with TypeScript declarations. ## Supported surfaces | Family | Generated clients and workflows | -| -------- | ------------------------------------------------------------------------ | -| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager`, reserve swaps | -| Solana | `liqsol_core`, native SOL and classic SPL reserve swaps | +| -------- | ------------------------------------------------------------------------- | +| Ethereum | `OPP`, `OPPInbound`, `OperatorRegistry`, `ReserveManager`, reserve lifecycle and swaps | +| Solana | `liqsol_core`, configured reserve lifecycle, native SOL and classic SPL reserve swaps | Client creation verifies all four boundaries before returning: @@ -134,6 +134,56 @@ Ethereum also exposes `requestErc20WithApproval`, `nativeBalance`, and `erc20Balance`. Solana exposes `requestNative`, `requestSpl`, `nativeBalance`, and `splBalance` through the same `client.swaps` ownership boundary. +## Reserve lifecycle + +Wallet-connected clients expose the external half of the post-bootstrap +reserve lifecycle. The external create escrows reserve capital and emits the +attestation that creates a pending `sysio.reserv` row. A signed +`@wireio/sdk-core` `ReserveClient` then supplies the exact requested WIRE amount +and activates that row. + +```ts +const ethereumSubmission = await ethereum.reserves.createNative({ + tokenCode, + reserveCode, + externalTokenAmount, + requestedWireAmount, + connectorWeightBps: 5_000, + name: "Private ETH reserve", + description: "", + isPrivate: true, + creatorPubKey +}) + +const configuredTokens = await solana.reserves.getConfiguredTokens() +const splToken = configuredTokens.find(token => !token.isNative) +if (splToken == null) throw new Error("No configured SPL reserve token.") + +const solanaSubmission = await solana.reserves.create({ + tokenCode: splToken.tokenCode, + reserveCode, + externalTokenAmount: splAmount, + requestedWireAmount, + connectorWeightBps: 5_000, + name: "Private SPL reserve", + description: "", + isPrivate: true, + mint: splToken.mint +}) +``` + +Ethereum supports native creation, ERC-20 approval or permit creation, pending +cancellation, and local reserve reads. Solana supports deployment-configured +token discovery, instruction assembly, creation, pending cancellation, address +derivation, and local reserve reads. `cancel` is valid only while creation is +pending and drives the protocol refund path. + +Private is a routing constraint, not access control or confidentiality. Private +reserves cannot use WIRE as a swap endpoint; when either external route leg is +private, Wire requires both active reserves to have the same non-empty owner. +The current protocol exposes no creator withdrawal, close, or redemption after +activation. This SDK intentionally does not invent an active-reserve exit API. + Solana uses the same facade and returns the precise Anchor program type at the runtime program address: @@ -170,7 +220,8 @@ are never maintained by hand in this repository. ## Consumer boundaries - Use this package for typed external `ReserveManager`, `OperatorRegistry`, - `OPP`, `OPPInbound`, `liqsol_core`, and source reserve-swap execution. + `OPP`, `OPPInbound`, `liqsol_core`, reserve lifecycle, and source reserve-swap + execution. - Use `@wireio/sdk-core` for Wire transaction construction, reserve and token registries, underwriting state, and settlement correlation. - Recreate external clients whenever the selected deployment profile changes. diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 45075f6..8b190a9 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -52,6 +52,7 @@ "prepack": "pnpm run verify:release" }, "dependencies": { + "@wireio/sdk-core": "workspace:*", "@coral-xyz/anchor": "^0.32.1", "@ethersproject/abi": "^5.8.0", "@ethersproject/providers": "^5.8.0", diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 2f5aa0d..59c6652 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -13,6 +13,7 @@ import { } from "../../deployments/index.js" import { OutpostDeploymentVerifier } from "../../verification/index.js" import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" +import { EthereumReserveClient } from "./EthereumReserveClient.js" import { EthereumReserveSwapClient } from "./EthereumReserveSwapClient.js" function resolveProvider( @@ -47,12 +48,19 @@ export class EthereumOutpostClient { /** Provider verified against the configured Ethereum chain. */ readonly provider: providers.Provider ) { + this.reserves = new EthereumReserveClient( + this.contract(EthereumContractName.ReserveManager), + options.connection + ) this.swaps = new EthereumReserveSwapClient( this.contract(EthereumContractName.ReserveManager), options.connection ) } + /** Reserve creation, cancellation, and reads for this verified outpost. */ + readonly reserves: EthereumReserveClient + /** Reserve-swap writes and balance reads for this verified outpost. */ readonly swaps: EthereumReserveSwapClient diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts new file mode 100644 index 0000000..cbec80b --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts @@ -0,0 +1,208 @@ +import { + constants as ethersConstants, + Contract, + Signer, + type providers +} from "ethers" +import { match } from "ts-pattern" + +import type { ReserveManager } from "../../contracts/ethereum/index.js" +import type { ReserveManagerLib } from "../../contracts/ethereum/generated/ReserveManager.js" +import { + assertEthereumReserveCreateRequest, + assertReserveUnsigned64, + OutpostReserveStatus, + type EthereumReserveCreateRequest, + type EthereumReservePermitSignature, + type EthereumReserveRecord, + type OutpostReserveIdentity, + type OutpostReserveSubmission +} from "../../reserves/index.js" + +const ConfirmationCount = 1, + EthereumLocalReserveStatus = { + pending: 0, + active: 1, + cancelled: 2 + } as const, + Erc20Interface = [ + "function allowance(address owner,address spender) view returns (uint256)", + "function approve(address spender,uint256 amount) returns (bool)" + ] + +/** Reserve creation, cancellation, and reads for one verified Ethereum outpost. */ +export class EthereumReserveClient { + /** Bind reserve lifecycle operations to a generated ReserveManager client. */ + constructor( + private readonly reserveManager: ReserveManager, + private readonly connection: providers.Provider | Signer + ) {} + + /** Create a pending native-token reserve. */ + async createNative( + request: EthereumReserveCreateRequest + ): Promise { + assertEthereumReserveCreateRequest(request) + this.assertSigner() + const parameters = this.nativeParameters(request), + overrides = { value: request.externalTokenAmount } + + await this.reserveManager.callStatic.create_reserve( + ...parameters, + overrides + ) + const transaction = await this.reserveManager.create_reserve( + ...parameters, + overrides + ) + await transaction.wait(ConfirmationCount) + return { transactionId: transaction.hash } + } + + /** Approve and create a pending ERC-20 reserve. */ + async createErc20WithApproval( + request: EthereumReserveCreateRequest, + tokenAddress?: string + ): Promise { + assertEthereumReserveCreateRequest(request) + const signer = this.assertSigner(), + owner = await signer.getAddress(), + resolvedTokenAddress = + tokenAddress ?? + (await this.reserveManager.tokenAddressesByCode(request.tokenCode)) + + if (resolvedTokenAddress === ethersConstants.AddressZero) { + throw new Error( + `No ERC-20 address is configured for tokenCode ${request.tokenCode.toString()}.` + ) + } + + const token = new Contract(resolvedTokenAddress, Erc20Interface, signer), + allowance = await token.allowance(owner, this.reserveManager.address) + if (allowance.lt(request.externalTokenAmount)) { + const approval = await token.approve( + this.reserveManager.address, + request.externalTokenAmount + ) + await approval.wait(ConfirmationCount) + } + + const arguments_ = this.createArguments(request) + await this.reserveManager.callStatic.requestReserveCreateErc20WithApproval( + arguments_ + ) + const transaction = + await this.reserveManager.requestReserveCreateErc20WithApproval(arguments_) + await transaction.wait(ConfirmationCount) + return { transactionId: transaction.hash } + } + + /** Create a pending ERC-20 reserve using an EIP-2612 permit. */ + async createErc20WithPermit( + request: EthereumReserveCreateRequest, + permitSignature: EthereumReservePermitSignature + ): Promise { + assertEthereumReserveCreateRequest(request) + this.assertSigner() + const arguments_ = this.createArguments(request) + + await this.reserveManager.callStatic.requestReserveCreateErc20WithPermit( + arguments_, + permitSignature + ) + const transaction = + await this.reserveManager.requestReserveCreateErc20WithPermit( + arguments_, + permitSignature + ) + await transaction.wait(ConfirmationCount) + return { transactionId: transaction.hash } + } + + /** Request cancellation and refund of a pending reserve. */ + async cancel( + identity: OutpostReserveIdentity + ): Promise { + this.assertSigner() + assertReserveUnsigned64(identity.tokenCode, "tokenCode") + assertReserveUnsigned64(identity.reserveCode, "reserveCode") + const transaction = await this.reserveManager.cancel_create_reserve( + identity.tokenCode, + identity.reserveCode + ) + await transaction.wait(ConfirmationCount) + return { transactionId: transaction.hash } + } + + /** Read and normalize one local ReserveManager record. */ + async get(identity: OutpostReserveIdentity): Promise { + assertReserveUnsigned64(identity.tokenCode, "tokenCode") + assertReserveUnsigned64(identity.reserveCode, "reserveCode") + const reserve = await this.reserveManager.getReserve( + identity.tokenCode, + identity.reserveCode + ) + return { + tokenCode: reserve.tokenCode.toBigInt(), + reserveCode: reserve.reserveCode.toBigInt(), + externalTokenAmount: reserve.externalTokenAmount.toBigInt(), + requestedWireAmount: reserve.requestedWireAmount.toBigInt(), + connectorWeightBps: reserve.connectorWeightBps, + status: match(reserve.status) + .with( + EthereumLocalReserveStatus.pending, + () => OutpostReserveStatus.pending + ) + .with( + EthereumLocalReserveStatus.active, + () => OutpostReserveStatus.active + ) + .with( + EthereumLocalReserveStatus.cancelled, + () => OutpostReserveStatus.cancelled + ) + .otherwise(value => { + throw new Error(`Unsupported Ethereum reserve status ${value}.`) + }), + creator: reserve.creator, + exists: reserve.exists + } + } + + private assertSigner(): Signer { + if (!Signer.isSigner(this.connection)) { + throw new Error("Ethereum reserve operation requires a connected signer.") + } + return this.connection + } + + private createArguments( + request: EthereumReserveCreateRequest + ): ReserveManagerLib.ReserveCreateArgsStruct { + return { + tokenCode: request.tokenCode, + reserveCode: request.reserveCode, + externalTokenAmount: request.externalTokenAmount, + requestedWireAmount: request.requestedWireAmount, + connectorWeightBps: request.connectorWeightBps, + name: request.name, + description: request.description, + isPrivate: request.isPrivate, + creatorPubKey: request.creatorPubKey + } + } + + private nativeParameters(request: EthereumReserveCreateRequest) { + return [ + request.tokenCode, + request.reserveCode, + request.externalTokenAmount, + request.requestedWireAmount, + request.connectorWeightBps, + request.name, + request.description, + request.isPrivate, + request.creatorPubKey + ] as const + } +} diff --git a/packages/sdk-outpost/src/clients/ethereum/index.ts b/packages/sdk-outpost/src/clients/ethereum/index.ts index b828c96..7b4caa6 100644 --- a/packages/sdk-outpost/src/clients/ethereum/index.ts +++ b/packages/sdk-outpost/src/clients/ethereum/index.ts @@ -1,3 +1,4 @@ export * from "./EthereumReserveSwapClient.js" +export * from "./EthereumReserveClient.js" export * from "./EthereumOutpostClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 2d27d7f..010dc23 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -8,6 +8,7 @@ import { import { LiqsolCore, liqsolCoreIdl } from "../../programs/solana/index.js" import { OutpostDeploymentVerifier } from "../../verification/index.js" import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" +import { SolanaReserveClient } from "./SolanaReserveClient.js" import { SolanaReserveSwapClient } from "./SolanaReserveSwapClient.js" /** Strictly typed access to one verified Solana outpost deployment. */ @@ -36,9 +37,13 @@ export class SolanaOutpostClient { { ...liqsolCoreIdl, address }, options.provider ) + this.reserves = new SolanaReserveClient(options.provider, this.liqsolCore) this.swaps = new SolanaReserveSwapClient(options.provider, this.liqsolCore) } + /** Reserve creation, cancellation, and reads for this verified outpost. */ + readonly reserves: SolanaReserveClient + /** Reserve-swap writes and balance reads for this verified outpost. */ readonly swaps: SolanaReserveSwapClient diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveAddresses.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveAddresses.ts new file mode 100644 index 0000000..464e2ad --- /dev/null +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveAddresses.ts @@ -0,0 +1,75 @@ +import { BN } from "@coral-xyz/anchor" +import { PublicKey } from "@solana/web3.js" + +import { + assertReserveUnsigned64, + type OutpostReserveIdentity +} from "../../reserves/index.js" + +const SolanaReserveSeed = { + outpostConfig: Buffer.from("outpost_config"), + outboundMessageBuffer: Buffer.from("outbound_message_buffer"), + reserve: Buffer.from("reserve"), + reserveVault: Buffer.from("reserve_vault") + } as const, + Unsigned64ByteLength = 8 + +/** Canonical PDA derivation for Solana reserve lifecycle and swap clients. */ +export class SolanaReserveAddresses { + /** Bind reserve address derivation to one verified program deployment. */ + constructor(private readonly programId: PublicKey) {} + + /** Derive the singleton outpost configuration PDA. */ + outpostConfig(): PublicKey { + return this.derive([SolanaReserveSeed.outpostConfig]) + } + + /** Derive the singleton outbound message-buffer PDA. */ + outboundMessageBuffer(): PublicKey { + return this.derive([SolanaReserveSeed.outboundMessageBuffer]) + } + + /** Derive a reserve account PDA. */ + reserve(identity: OutpostReserveIdentity): PublicKey { + return this.reserveAddress(SolanaReserveSeed.reserve, identity) + } + + /** Derive a reserve custody-vault PDA. */ + reserveVault(identity: OutpostReserveIdentity): PublicKey { + return this.reserveAddress(SolanaReserveSeed.reserveVault, identity) + } + + /** Convert an SDK reserve integer to Anchor's u64 representation. */ + unsigned64( + value: OutpostReserveIdentity["tokenCode"], + field: string + ): BN { + return new BN(assertReserveUnsigned64(value, field).toString()) + } + + private derive(seeds: Buffer[]): PublicKey { + return PublicKey.findProgramAddressSync(seeds, this.programId)[0] + } + + private reserveAddress( + seed: Buffer, + identity: OutpostReserveIdentity + ): PublicKey { + return this.derive([ + seed, + this.unsigned64Seed(identity.tokenCode, "tokenCode"), + this.unsigned64Seed(identity.reserveCode, "reserveCode") + ]) + } + + private unsigned64Seed( + value: OutpostReserveIdentity["tokenCode"], + field: string + ): Buffer { + return this.unsigned64(value, field).toArrayLike( + Buffer, + "le", + Unsigned64ByteLength + ) + } +} diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts new file mode 100644 index 0000000..d8e9fa9 --- /dev/null +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts @@ -0,0 +1,255 @@ +import { + type AnchorProvider, + type IdlAccounts, + type Program +} from "@coral-xyz/anchor" +import { + createAssociatedTokenAccountIdempotentInstruction, + getAssociatedTokenAddressSync, + TOKEN_PROGRAM_ID +} from "@solana/spl-token" +import { + PublicKey, + SYSVAR_RENT_PUBKEY, + SystemProgram, + Transaction, + type TransactionInstruction +} from "@solana/web3.js" +import { match } from "ts-pattern" + +import type { LiqsolCore } from "../../programs/solana/index.js" +import { + assertReserveCreateDefinition, + assertReserveUnsigned64, + OutpostReserveStatus, + type OutpostReserveIdentity, + type OutpostReserveSubmission, + type SolanaConfiguredReserveToken, + type SolanaReserveCreateRequest, + type SolanaReserveRecord +} from "../../reserves/index.js" +import { SolanaReserveAddresses } from "./SolanaReserveAddresses.js" + +const PublicKeyByteLength = 32, + NativeSolanaDecimals = 9 + +type LiqsolCoreAccounts = IdlAccounts + +/** Reserve creation, cancellation, and reads for one verified Solana outpost. */ +export class SolanaReserveClient { + private readonly addresses: SolanaReserveAddresses + + /** Bind reserve lifecycle operations to a generated Anchor program client. */ + constructor( + private readonly provider: AnchorProvider, + private readonly program: Program + ) { + this.addresses = new SolanaReserveAddresses(program.programId) + } + + /** List token routes configured by the deployed outpost. */ + async getConfiguredTokens(): Promise { + const account = await this.provider.connection.getAccountInfo( + this.addresses.outpostConfig() + ) + if (account == null) { + throw new Error("Solana outpost configuration is unavailable.") + } + const config = this.program.coder.accounts.decode< + LiqsolCoreAccounts["outpostConfig"] + >("outpostConfig", account.data), + precisionByTokenCode = new Map( + config.precisionByTokenCode.map(entry => [ + entry.tokenCode.toString(), + entry.decimals + ]) + ), + nativeTokenMarker = new PublicKey( + new Uint8Array(PublicKeyByteLength) + ) + + return config.tokenAddressesByCode.map(entry => { + const tokenCode = entry.tokenCode.toString(), + isNative = entry.mint.equals(nativeTokenMarker), + configuredDecimals = precisionByTokenCode.get(tokenCode) + if (!isNative && configuredDecimals == null) { + throw new Error( + `Solana reserve token ${tokenCode} has no configured precision.` + ) + } + return { + tokenCode: BigInt(tokenCode), + mint: entry.mint, + isNative, + decimals: isNative ? NativeSolanaDecimals : configuredDecimals + } + }) + } + + /** Derive the local outpost account for one reserve identity. */ + deriveAddress(identity: OutpostReserveIdentity): PublicKey { + return this.addresses.reserve(identity) + } + + /** Build reserve-creation instructions without signing or submitting. */ + async createInstructions( + request: SolanaReserveCreateRequest + ): Promise { + assertReserveCreateDefinition(request) + assertReserveUnsigned64(request.externalTokenAmount, "externalTokenAmount") + const creator = this.assertWallet(), + { + creatorTokenAccount = getAssociatedTokenAddressSync( + request.mint, + creator, + false, + TOKEN_PROGRAM_ID + ) + } = request, + createReserve = await this.program.methods + .createReserve( + this.addresses.unsigned64(request.tokenCode, "tokenCode"), + this.addresses.unsigned64(request.reserveCode, "reserveCode"), + this.addresses.unsigned64( + request.externalTokenAmount, + "externalTokenAmount" + ), + this.addresses.unsigned64( + request.requestedWireAmount, + "requestedWireAmount" + ), + request.connectorWeightBps, + request.name, + request.description, + request.isPrivate + ) + .accounts({ + creator, + config: this.addresses.outpostConfig(), + reserve: this.addresses.reserve(request), + reserveVault: this.addresses.reserveVault(request), + mint: request.mint, + creatorAta: creatorTokenAccount, + outboundMessageBuffer: this.addresses.outboundMessageBuffer(), + tokenProgram: TOKEN_PROGRAM_ID, + systemProgram: SystemProgram.programId, + rent: SYSVAR_RENT_PUBKEY + }) + .instruction() + + if ( + request.ensureCreatorTokenAccount === false || + request.creatorTokenAccount != null + ) { + return [createReserve] + } + + return [ + createAssociatedTokenAccountIdempotentInstruction( + creator, + creatorTokenAccount, + creator, + request.mint, + TOKEN_PROGRAM_ID + ), + createReserve + ] + } + + /** Create a pending external reserve. */ + async create( + request: SolanaReserveCreateRequest + ): Promise { + const transactionId = await this.provider.sendAndConfirm( + new Transaction().add(...(await this.createInstructions(request))) + ) + return { transactionId } + } + + /** Build a creator-authorized pending-reserve cancellation instruction. */ + async cancelInstruction( + identity: OutpostReserveIdentity + ): Promise { + const creator = this.assertWallet() + return this.program.methods + .cancelCreateReserve( + this.addresses.unsigned64(identity.tokenCode, "tokenCode"), + this.addresses.unsigned64(identity.reserveCode, "reserveCode") + ) + .accounts({ + creator, + config: this.addresses.outpostConfig(), + reserve: this.addresses.reserve(identity), + outboundMessageBuffer: this.addresses.outboundMessageBuffer() + }) + .instruction() + } + + /** Request cancellation and refund of a pending reserve. */ + async cancel( + identity: OutpostReserveIdentity + ): Promise { + const transactionId = await this.provider.sendAndConfirm( + new Transaction().add(await this.cancelInstruction(identity)) + ) + return { transactionId } + } + + /** Read and normalize one local reserve account. */ + async get( + identity: OutpostReserveIdentity + ): Promise { + const address = this.addresses.reserve(identity), + account = await this.provider.connection.getAccountInfo(address) + if (account == null) return null + const reserve = this.program.coder.accounts.decode< + LiqsolCoreAccounts["reserve"] + >("reserve", account.data) + + return { + address, + vaultAddress: this.addresses.reserveVault(identity), + tokenCode: BigInt(reserve.tokenCode.toString()), + reserveCode: BigInt(reserve.reserveCode.toString()), + externalTokenAmount: BigInt(reserve.externalTokenAmount.toString()), + requestedWireAmount: BigInt(reserve.requestedWireAmount.toString()), + connectorWeightBps: reserve.connectorWeightBps, + status: match(reserve.status) + .when( + status => "pending" in status, + () => OutpostReserveStatus.pending + ) + .when( + status => "active" in status, + () => OutpostReserveStatus.active + ) + .when( + status => "cancelled" in status, + () => OutpostReserveStatus.cancelled + ) + .otherwise(() => { + throw new Error("Unsupported Solana reserve status.") + }), + creator: reserve.creator, + name: this.decodeFixedUtf8(reserve.nameBytes, reserve.nameLen), + description: this.decodeFixedUtf8( + reserve.descriptionBytes, + reserve.descriptionLen + ) + } + } + + private assertWallet(): PublicKey { + const publicKey = this.provider.wallet.publicKey + if (publicKey == null) { + throw new Error("Solana reserve operation requires a connected wallet.") + } + return publicKey + } + + private decodeFixedUtf8(value: ArrayLike, length: number): string { + return new TextDecoder().decode( + Uint8Array.from(value).slice(0, Number(length)) + ) + } +} diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts index 6a66b31..537a65d 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts @@ -1,4 +1,4 @@ -import { BN, type AnchorProvider, type Program } from "@coral-xyz/anchor" +import { type AnchorProvider, type Program } from "@coral-xyz/anchor" import { getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID @@ -15,11 +15,11 @@ import { utils as ethersUtils } from "ethers" import type { LiqsolCore } from "../../programs/solana/index.js" import { assertReserveSwapRequest, - assertReserveUnsigned64, type ReserveSwapRequest, type ReserveSwapSubmission, type SolanaSplReserveSwapRequest } from "../../reserves/index.js" +import { SolanaReserveAddresses } from "./SolanaReserveAddresses.js" const ConfirmationCommitment = "confirmed", ConfirmationPollIntervalMs = 1_500, @@ -27,20 +27,19 @@ const ConfirmationCommitment = "confirmed", confirmed: "confirmed", finalized: "finalized" } as const, - OutpostConfigSeed = Buffer.from("outpost_config"), - ReserveSeed = Buffer.from("reserve"), - ReserveVaultSeed = Buffer.from("reserve_vault"), - OutboundMessageBufferSeed = Buffer.from("outbound_message_buffer"), - Unsigned64ByteLength = 8, SwapDepositLog = /opp_outpost: SwapDeposit id=(\d+)\b/ /** Reserve-swap writes and balance reads for one verified Solana outpost. */ export class SolanaReserveSwapClient { + private readonly addresses: SolanaReserveAddresses + /** Create a Solana reserve-swap workflow bound to a verified deployment. */ constructor( private readonly provider: AnchorProvider, private readonly program: Program - ) {} + ) { + this.addresses = new SolanaReserveAddresses(program.programId) + } /** Build a native-SOL reserve-swap instruction without signing it. */ async createNativeInstruction( @@ -52,11 +51,12 @@ export class SolanaReserveSwapClient { .requestSwap(...this.instructionArguments(request)) .accounts({ user, - config: this.deriveAddress([OutpostConfigSeed]), - reserve: this.deriveReserveAddress(ReserveSeed, request), - outboundMessageBuffer: this.deriveAddress([ - OutboundMessageBufferSeed - ]), + config: this.addresses.outpostConfig(), + reserve: this.addresses.reserve({ + tokenCode: request.sourceTokenCode, + reserveCode: request.sourceReserveCode + }), + outboundMessageBuffer: this.addresses.outboundMessageBuffer(), systemProgram: SystemProgram.programId }) .instruction() @@ -88,14 +88,18 @@ export class SolanaReserveSwapClient { .requestSwapSpl(...this.instructionArguments(request)) .accounts({ user, - config: this.deriveAddress([OutpostConfigSeed]), - reserve: this.deriveReserveAddress(ReserveSeed, request), - reserveVault: this.deriveReserveAddress(ReserveVaultSeed, request), + config: this.addresses.outpostConfig(), + reserve: this.addresses.reserve({ + tokenCode: request.sourceTokenCode, + reserveCode: request.sourceReserveCode + }), + reserveVault: this.addresses.reserveVault({ + tokenCode: request.sourceTokenCode, + reserveCode: request.sourceReserveCode + }), mint: request.mint, userAta: userTokenAccount, - outboundMessageBuffer: this.deriveAddress([ - OutboundMessageBufferSeed - ]), + outboundMessageBuffer: this.addresses.outboundMessageBuffer(), tokenProgram: TOKEN_PROGRAM_ID }) .instruction() @@ -149,32 +153,6 @@ export class SolanaReserveSwapClient { return publicKey } - private deriveAddress(seeds: Buffer[]): PublicKey { - return PublicKey.findProgramAddressSync(seeds, this.program.programId)[0] - } - - private deriveReserveAddress( - seed: Buffer, - request: ReserveSwapRequest - ): PublicKey { - return this.deriveAddress([ - seed, - this.unsigned64Seed(request.sourceTokenCode, "sourceTokenCode"), - this.unsigned64Seed(request.sourceReserveCode, "sourceReserveCode") - ]) - } - - private unsigned64Seed( - value: ReserveSwapRequest["sourceTokenCode"], - field: string - ): Buffer { - return new BN(assertReserveUnsigned64(value, field).toString()).toArrayLike( - Buffer, - "le", - Unsigned64ByteLength - ) - } - private instructionArguments(request: ReserveSwapRequest) { return [ this.unsigned64(request.sourceTokenCode, "sourceTokenCode"), @@ -192,8 +170,8 @@ export class SolanaReserveSwapClient { private unsigned64( value: ReserveSwapRequest["sourceTokenCode"], field: string - ): BN { - return new BN(assertReserveUnsigned64(value, field).toString()) + ) { + return this.addresses.unsigned64(value, field) } private async submit( diff --git a/packages/sdk-outpost/src/clients/solana/index.ts b/packages/sdk-outpost/src/clients/solana/index.ts index 531fbf0..f3f3db7 100644 --- a/packages/sdk-outpost/src/clients/solana/index.ts +++ b/packages/sdk-outpost/src/clients/solana/index.ts @@ -1,3 +1,5 @@ export * from "./SolanaReserveSwapClient.js" +export * from "./SolanaReserveAddresses.js" +export * from "./SolanaReserveClient.js" export * from "./SolanaOutpostClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/reserves/Types.ts b/packages/sdk-outpost/src/reserves/Types.ts index 7d9522b..3221cd9 100644 --- a/packages/sdk-outpost/src/reserves/Types.ts +++ b/packages/sdk-outpost/src/reserves/Types.ts @@ -1,5 +1,122 @@ import type { PublicKey } from "@solana/web3.js" import type { BigNumberish, BytesLike } from "ethers" +import type { ReserveManagerLib } from "../contracts/ethereum/generated/ReserveManager.js" + +/** Two-part identity shared by external-chain reserve custody clients. */ +export interface OutpostReserveIdentity { + /** Packed external token slug. */ + tokenCode: BigNumberish + /** Packed reserve discriminator slug. */ + reserveCode: BigNumberish +} + +/** Portable reserve fields validated before any external wallet prompt. */ +export interface ReserveCreateDefinition extends OutpostReserveIdentity { + /** External-chain amount escrowed by the creator. */ + externalTokenAmount: BigNumberish + /** Exact WIRE amount required to activate the reserve. */ + requestedWireAmount: BigNumberish + /** Bancor connector weight in basis points. */ + connectorWeightBps: number + /** User-facing reserve name. */ + name: string + /** User-facing reserve description. */ + description: string + /** Whether Wire restricts routing to a same-owner external counterpart. */ + isPrivate: boolean +} + +/** Ethereum reserve-creation request with the creator's AuthEx public key. */ +export interface EthereumReserveCreateRequest + extends ReserveCreateDefinition { + /** Compressed secp256k1 public key that derives to the connected signer. */ + creatorPubKey: BytesLike +} + +/** Confirmed external reserve lifecycle submission. */ +export interface OutpostReserveSubmission { + /** External-chain transaction hash or signature. */ + transactionId: string +} + +/** Chain-neutral lifecycle states exposed by external reserve clients. */ +export enum OutpostReserveStatus { + pending = "pending", + active = "active", + cancelled = "cancelled" +} + +/** Normalized Ethereum ReserveManager record. */ +export interface EthereumReserveRecord { + /** Packed external token slug. */ + tokenCode: bigint + /** Packed reserve discriminator slug. */ + reserveCode: bigint + /** Raw external amount committed at creation. */ + externalTokenAmount: bigint + /** Exact WIRE amount requested from the matcher. */ + requestedWireAmount: bigint + /** Connector weight in basis points. */ + connectorWeightBps: number + /** Local outpost lifecycle state. */ + status: OutpostReserveStatus + /** Ethereum creator address. */ + creator: string + /** Whether the record exists. */ + exists: boolean +} + +/** Solana reserve-creation request for the permissionless outpost path. */ +export interface SolanaReserveCreateRequest extends ReserveCreateDefinition { + /** Custody mint for SPL reserves, or a valid placeholder mint for native SOL. */ + mint: PublicKey + /** Creator token-account override. Defaults to the canonical ATA. */ + creatorTokenAccount?: PublicKey + /** Add an idempotent ATA instruction when no override is supplied. */ + ensureCreatorTokenAccount?: boolean +} + +/** Normalized Solana outpost reserve account. */ +export interface SolanaReserveRecord { + /** Reserve account PDA. */ + address: PublicKey + /** Reserve vault PDA. */ + vaultAddress: PublicKey + /** Packed external token slug. */ + tokenCode: bigint + /** Packed reserve discriminator slug. */ + reserveCode: bigint + /** Raw external amount committed at creation. */ + externalTokenAmount: bigint + /** Exact WIRE amount requested from the matcher. */ + requestedWireAmount: bigint + /** Connector weight in basis points. */ + connectorWeightBps: number + /** Local outpost lifecycle state. */ + status: OutpostReserveStatus + /** Solana wallet that created and can cancel the reserve. */ + creator: PublicKey + /** UTF-8 reserve display name. */ + name: string + /** UTF-8 reserve description. */ + description: string +} + +/** Token route configured by the Solana outpost authority. */ +export interface SolanaConfiguredReserveToken { + /** Packed token slug used in reserve instructions. */ + tokenCode: bigint + /** Configured SPL mint, or the all-zero native marker. */ + mint: PublicKey + /** Whether the token route represents native SOL. */ + isNative: boolean + /** Chain-side decimal precision used at the depot boundary. */ + decimals: number +} + +/** Permit signature accepted by Ethereum ReserveManager. */ +export type EthereumReservePermitSignature = + ReserveManagerLib.PermitSigStruct /** Confirmed source-outpost submission used to correlate a swap with Wire. */ export interface ReserveSwapSubmission { diff --git a/packages/sdk-outpost/src/reserves/Validation.ts b/packages/sdk-outpost/src/reserves/Validation.ts index 7d4ec2c..7f59d37 100644 --- a/packages/sdk-outpost/src/reserves/Validation.ts +++ b/packages/sdk-outpost/src/reserves/Validation.ts @@ -1,11 +1,23 @@ import { BigNumber, utils as ethersUtils } from "ethers" -import type { ReserveSwapRequest } from "./Types.js" +import { + MAX_CONNECTOR_WEIGHT_BPS, + MIN_CONNECTOR_WEIGHT_BPS +} from "@wireio/sdk-core/contracts/sysio/reserv/Constants" + +import type { + EthereumReserveCreateRequest, + ReserveCreateDefinition, + ReserveSwapRequest +} from "./Types.js" const MaximumUnsigned64 = BigNumber.from("18446744073709551615"), MinimumReserveValue = BigNumber.from(1), MinimumToleranceBps = 0, - MaximumToleranceBps = 10_000 + MaximumToleranceBps = 10_000, + MaximumReserveNameBytes = 64, + MaximumReserveDescriptionBytes = 256, + CompressedSecp256k1PublicKeyBytes = 33 /** Validate one value against the positive unsigned 64-bit protocol boundary. */ export function assertReserveUnsigned64( @@ -24,6 +36,69 @@ export function assertReserveUnsigned64( return parsed } +/** Validate portable reserve-creation fields before opening a wallet prompt. */ +export function assertReserveCreateDefinition( + definition: ReserveCreateDefinition +): void { + assertReserveUnsigned64(definition.tokenCode, "tokenCode") + assertReserveUnsigned64(definition.reserveCode, "reserveCode") + + let externalTokenAmount: BigNumber + try { + externalTokenAmount = BigNumber.from(definition.externalTokenAmount) + } catch (error: unknown) { + throw new Error("externalTokenAmount must be an integer.", { cause: error }) + } + if (externalTokenAmount.lt(MinimumReserveValue)) { + throw new Error("externalTokenAmount must be greater than zero.") + } + + assertReserveUnsigned64( + definition.requestedWireAmount, + "requestedWireAmount" + ) + if ( + !Number.isInteger(definition.connectorWeightBps) || + definition.connectorWeightBps < MIN_CONNECTOR_WEIGHT_BPS || + definition.connectorWeightBps > MAX_CONNECTOR_WEIGHT_BPS + ) { + throw new Error( + `connectorWeightBps must be an integer from ${MIN_CONNECTOR_WEIGHT_BPS} to ${MAX_CONNECTOR_WEIGHT_BPS}.` + ) + } + + const nameBytes = ethersUtils.toUtf8Bytes(definition.name).length + if (nameBytes === 0 || nameBytes > MaximumReserveNameBytes) { + throw new Error( + `name must contain 1 to ${MaximumReserveNameBytes} UTF-8 bytes.` + ) + } + + const descriptionBytes = ethersUtils.toUtf8Bytes( + definition.description + ).length + if (descriptionBytes > MaximumReserveDescriptionBytes) { + throw new Error( + `description must contain at most ${MaximumReserveDescriptionBytes} UTF-8 bytes.` + ) + } +} + +/** Validate Ethereum-specific reserve creation fields. */ +export function assertEthereumReserveCreateRequest( + request: EthereumReserveCreateRequest +): void { + assertReserveCreateDefinition(request) + if ( + ethersUtils.arrayify(request.creatorPubKey).length !== + CompressedSecp256k1PublicKeyBytes + ) { + throw new Error( + "creatorPubKey must be a 33-byte compressed secp256k1 public key." + ) + } +} + /** Validate portable reserve-swap fields before opening a wallet prompt. */ export function assertReserveSwapRequest(request: ReserveSwapRequest): void { assertReserveUnsigned64(request.sourceTokenCode, "sourceTokenCode") diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index cb13c2b..8f6a45a 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -3,6 +3,7 @@ import { BigNumber, utils as ethersUtils, Wallet } from "ethers" import { EthereumContractName, EthereumOutpostClient, + EthereumReserveClient, EthereumReserveSwapClient, type ReserveSwapRequest } from "@wireio/sdk-outpost" @@ -99,6 +100,7 @@ describe("EthereumOutpostClient", () => { expect(reserveManager.address).toBe( profile.ethereum.contracts[EthereumContractName.ReserveManager].address ) + expect(client.reserves).toBeInstanceOf(EthereumReserveClient) expect(client.swaps).toBeInstanceOf(EthereumReserveSwapClient) expect(provider.getCode).toHaveBeenCalledTimes( Object.values(EthereumContractName).length * 2 diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts new file mode 100644 index 0000000..a6b8b5b --- /dev/null +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts @@ -0,0 +1,202 @@ +import { + BigNumber, + Signer, + Wallet, + constants as ethersConstants, + providers, + utils as ethersUtils +} from "ethers" + +import { + EthereumReserveClient, + OutpostReserveStatus, + type EthereumReserveCreateRequest, + type ReserveManager +} from "@wireio/sdk-outpost" + +const ReserveTransactionHash = `0x${"11".repeat(32)}`, + ApprovalTransactionHash = `0x${"22".repeat(32)}`, + TokenAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + CreatorAddress = "0x7412BC256355ABD22dD53De3a38E8995b5d4c1D1", + TransactionReceipt = { + logs: [], + status: 1 + } as unknown as providers.TransactionReceipt + +const request: EthereumReserveCreateRequest = { + tokenCode: 1, + reserveCode: 2, + externalTokenAmount: 3, + requestedWireAmount: 4, + connectorWeightBps: 5_000, + name: "Private ETH reserve", + description: "Same-owner external routing", + isPrivate: true, + creatorPubKey: `0x02${"11".repeat(32)}` +} + +function transactionFixture( + hash = ReserveTransactionHash, + wait: providers.TransactionResponse["wait"] = jest.fn( + async (): Promise => TransactionReceipt + ) +) { + return { + hash, + wait + } as unknown as providers.TransactionResponse +} + +function reserveManagerFixture() { + const transaction = transactionFixture(), + reserveManager = { + address: "0x18E317A7D70d8fBf8e6E893616b52390EbBdb629", + callStatic: { + create_reserve: jest.fn(async (): Promise => undefined), + requestReserveCreateErc20WithApproval: jest.fn( + async (): Promise => undefined + ), + requestReserveCreateErc20WithPermit: jest.fn( + async (): Promise => undefined + ) + }, + create_reserve: jest.fn(async () => transaction), + requestReserveCreateErc20WithApproval: jest.fn(async () => transaction), + requestReserveCreateErc20WithPermit: jest.fn(async () => transaction), + cancel_create_reserve: jest.fn(async () => transaction), + tokenAddressesByCode: jest.fn(async () => TokenAddress), + getReserve: jest.fn(async () => ({ + tokenCode: BigNumber.from(1), + reserveCode: BigNumber.from(2), + externalTokenAmount: BigNumber.from(3), + requestedWireAmount: BigNumber.from(4), + connectorWeightBps: 5_000, + status: 1, + creator: CreatorAddress, + exists: true + })) + } as unknown as ReserveManager + + return { reserveManager, transaction } +} + +class Erc20Signer extends Signer { + readonly provider = new providers.JsonRpcProvider() + readonly approvalWait = jest.fn( + async (): Promise => TransactionReceipt + ) + readonly approval = transactionFixture( + ApprovalTransactionHash, + this.approvalWait + ) + + async getAddress(): Promise { + return CreatorAddress + } + + async signMessage(): Promise { + return "0x" + } + + async signTransaction(): Promise { + return "0x" + } + + connect(): Signer { + return this + } + + async call(): Promise { + return ethersUtils.defaultAbiCoder.encode(["uint256"], [0]) + } + + async sendTransaction(): Promise { + return this.approval + } +} + +describe("EthereumReserveClient", () => { + it("creates a native pending reserve after static preflight", async () => { + const { reserveManager, transaction } = reserveManagerFixture(), + client = new EthereumReserveClient(reserveManager, Wallet.createRandom()) + + await expect(client.createNative(request)).resolves.toEqual({ + transactionId: ReserveTransactionHash + }) + expect(reserveManager.callStatic.create_reserve).toHaveBeenCalledTimes(1) + expect(reserveManager.create_reserve).toHaveBeenCalledTimes(1) + expect(transaction.wait).toHaveBeenCalledWith(1) + }) + + it("approves an ERC-20 before creating its pending reserve", async () => { + const { reserveManager } = reserveManagerFixture(), + signer = new Erc20Signer(), + client = new EthereumReserveClient(reserveManager, signer) + + const submission = await client.createErc20WithApproval( + request, + TokenAddress + ) + expect(submission).toEqual({ transactionId: ReserveTransactionHash }) + expect(signer.approvalWait).toHaveBeenCalledWith(1) + expect( + reserveManager.requestReserveCreateErc20WithApproval + ).toHaveBeenCalledTimes(1) + }) + + it("creates an ERC-20 reserve with a supplied permit", async () => { + const { reserveManager } = reserveManagerFixture(), + client = new EthereumReserveClient(reserveManager, Wallet.createRandom()) + + await expect( + client.createErc20WithPermit(request, { + deadline: 100, + v: 27, + r: ethersConstants.HashZero, + s: ethersConstants.HashZero + }) + ).resolves.toEqual({ transactionId: ReserveTransactionHash }) + expect( + reserveManager.callStatic.requestReserveCreateErc20WithPermit + ).toHaveBeenCalledTimes(1) + }) + + it("cancels a pending reserve and normalizes active local state", async () => { + const { reserveManager } = reserveManagerFixture(), + client = new EthereumReserveClient(reserveManager, Wallet.createRandom()) + + await expect( + client.cancel({ tokenCode: 1, reserveCode: 2 }) + ).resolves.toEqual({ transactionId: ReserveTransactionHash }) + await expect(client.get({ tokenCode: 1, reserveCode: 2 })).resolves.toEqual( + expect.objectContaining({ + tokenCode: 1n, + reserveCode: 2n, + status: OutpostReserveStatus.active, + creator: CreatorAddress, + exists: true + }) + ) + }) + + it("requires a signer and a configured ERC-20 route", async () => { + const { reserveManager } = reserveManagerFixture(), + provider = new providers.JsonRpcProvider(), + providerClient = new EthereumReserveClient(reserveManager, provider) + + await expect(providerClient.createNative(request)).rejects.toThrow( + "requires a connected signer" + ) + + reserveManager.tokenAddressesByCode = jest.fn( + async () => ethersConstants.AddressZero + ) + const signerClient = new EthereumReserveClient( + reserveManager, + new Erc20Signer() + ) + await expect(signerClient.createErc20WithApproval(request)).rejects.toThrow( + "No ERC-20 address is configured" + ) + }) +}) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index b9d504b..df135bb 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -5,6 +5,7 @@ import { type ReserveSwapRequest, SolanaOutpostClient, SolanaProgramName, + SolanaReserveClient, SolanaReserveSwapClient, SolanaUpgradeableLoaderProgramId } from "@wireio/sdk-outpost" @@ -47,6 +48,7 @@ describe("SolanaOutpostClient", () => { expect(program.programId.toBase58()).toBe( profile.solana.programs[SolanaProgramName.liqsolCore].address ) + expect(client.reserves).toBeInstanceOf(SolanaReserveClient) expect(client.swaps).toBeInstanceOf(SolanaReserveSwapClient) }) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaReserveAddresses.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaReserveAddresses.test.ts new file mode 100644 index 0000000..83d0a95 --- /dev/null +++ b/packages/sdk-outpost/tests/clients/solana/SolanaReserveAddresses.test.ts @@ -0,0 +1,66 @@ +import { Keypair, PublicKey } from "@solana/web3.js" + +import { SolanaReserveAddresses } from "@wireio/sdk-outpost" + +const Unsigned64ByteLength = 8 + +function unsigned64Seed(value: bigint): Buffer { + const seed = Buffer.alloc(Unsigned64ByteLength) + seed.writeBigUInt64LE(value) + return seed +} + +describe("SolanaReserveAddresses", () => { + it("derives every reserve lifecycle PDA from the deployed program", () => { + const programId = Keypair.generate().publicKey, + addresses = new SolanaReserveAddresses(programId), + identity = { tokenCode: 1n, reserveCode: 2n }, + expectedReserve = PublicKey.findProgramAddressSync( + [ + Buffer.from("reserve"), + unsigned64Seed(1n), + unsigned64Seed(2n) + ], + programId + )[0], + expectedVault = PublicKey.findProgramAddressSync( + [ + Buffer.from("reserve_vault"), + unsigned64Seed(1n), + unsigned64Seed(2n) + ], + programId + )[0] + + expect(addresses.reserve(identity).equals(expectedReserve)).toBe(true) + expect(addresses.reserveVault(identity).equals(expectedVault)).toBe(true) + expect( + addresses + .outpostConfig() + .equals( + PublicKey.findProgramAddressSync( + [Buffer.from("outpost_config")], + programId + )[0] + ) + ).toBe(true) + expect( + addresses + .outboundMessageBuffer() + .equals( + PublicKey.findProgramAddressSync( + [Buffer.from("outbound_message_buffer")], + programId + )[0] + ) + ).toBe(true) + }) + + it("rejects reserve identity values outside the protocol u64 range", () => { + const addresses = new SolanaReserveAddresses(Keypair.generate().publicKey) + + expect(() => addresses.unsigned64(0, "tokenCode")).toThrow( + "tokenCode must be between 1 and uint64 max." + ) + }) +}) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts new file mode 100644 index 0000000..579c8c7 --- /dev/null +++ b/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts @@ -0,0 +1,185 @@ +import { BN, Program } from "@coral-xyz/anchor" +import { ASSOCIATED_TOKEN_PROGRAM_ID } from "@solana/spl-token" +import { Keypair, PublicKey } from "@solana/web3.js" + +import { + type LiqsolCore, + OutpostReserveStatus, + type SolanaReserveCreateRequest, + SolanaReserveClient, + liqsolCoreIdl +} from "@wireio/sdk-outpost" +import { + createOutpostDeploymentProfileFixture, + createSolanaProviderFixture +} from "../../Fixtures.js" + +const SubmittedSignature = "4".repeat(64), + AccountData = Buffer.alloc(8), + NativeTokenMarker = new PublicKey(new Uint8Array(32)) + +const request: SolanaReserveCreateRequest = { + tokenCode: 1, + reserveCode: 2, + externalTokenAmount: 3, + requestedWireAmount: 4, + connectorWeightBps: 5_000, + name: "Private USDC reserve", + description: "Same-owner external routing", + isPrivate: true, + mint: Keypair.generate().publicKey +} + +function clientFixture() { + const profile = createOutpostDeploymentProfileFixture(), + provider = createSolanaProviderFixture(profile), + address = profile.solana.programs.liqsolCore.address, + program = new Program( + { ...liqsolCoreIdl, address }, + provider + ), + client = new SolanaReserveClient(provider, program) + + return { client, program, provider } +} + +describe("SolanaReserveClient", () => { + it("builds permissionless reserve creation with an idempotent creator ATA", async () => { + const { client, program, provider } = clientFixture(), + instructions = await client.createInstructions(request) + + expect(instructions).toHaveLength(2) + expect( + instructions[0].programId.equals(ASSOCIATED_TOKEN_PROGRAM_ID) + ).toBe(true) + expect(instructions[1].programId.equals(program.programId)).toBe(true) + expect( + instructions[1].keys.some(key => + key.pubkey.equals(provider.wallet.publicKey) + ) + ).toBe(true) + }) + + it("uses an explicit creator token account without adding an ATA instruction", async () => { + const { client } = clientFixture(), + instructions = await client.createInstructions({ + ...request, + creatorTokenAccount: Keypair.generate().publicKey + }) + + expect(instructions).toHaveLength(1) + }) + + it("submits reserve creation and pending cancellation through the provider", async () => { + const { client, provider } = clientFixture(), + sendAndConfirm = jest + .spyOn(provider, "sendAndConfirm") + .mockResolvedValue(SubmittedSignature) + + await expect(client.create(request)).resolves.toEqual({ + transactionId: SubmittedSignature + }) + await expect( + client.cancel({ tokenCode: 1, reserveCode: 2 }) + ).resolves.toEqual({ transactionId: SubmittedSignature }) + expect(sendAndConfirm).toHaveBeenCalledTimes(2) + }) + + it("normalizes configured token routes and a local reserve record", async () => { + const { client, program, provider } = clientFixture(), + splMint = Keypair.generate().publicKey, + creator = Keypair.generate().publicKey + + jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue({ + data: AccountData, + executable: false, + lamports: 1, + owner: program.programId, + rentEpoch: 0 + }) + jest + .spyOn(program.coder.accounts, "decode") + .mockImplementation(accountName => + (accountName === "outpostConfig" + ? { + tokenAddressesByCode: [ + { tokenCode: new BN(1), mint: NativeTokenMarker }, + { tokenCode: new BN(2), mint: splMint } + ], + precisionByTokenCode: [ + { tokenCode: new BN(2), decimals: 6 } + ] + } + : { + tokenCode: new BN(2), + reserveCode: new BN(3), + externalTokenAmount: new BN(4), + requestedWireAmount: new BN(5), + connectorWeightBps: 5_000, + status: { active: {} }, + creator, + nameLen: 4, + nameBytes: [...Buffer.from("USDC"), ...new Uint8Array(60)], + descriptionLen: 7, + descriptionBytes: [ + ...Buffer.from("Private"), + ...new Uint8Array(249) + ] + }) as never + ) + + await expect(client.getConfiguredTokens()).resolves.toEqual([ + { + tokenCode: 1n, + mint: NativeTokenMarker, + isNative: true, + decimals: 9 + }, + { tokenCode: 2n, mint: splMint, isNative: false, decimals: 6 } + ]) + await expect( + client.get({ tokenCode: 2, reserveCode: 3 }) + ).resolves.toEqual( + expect.objectContaining({ + tokenCode: 2n, + reserveCode: 3n, + status: OutpostReserveStatus.active, + creator, + name: "USDC", + description: "Private" + }) + ) + }) + + it("returns null for an absent account and rejects invalid creation values", async () => { + const { client, provider } = clientFixture() + jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue(null) + + await expect( + client.get({ tokenCode: 1, reserveCode: 2 }) + ).resolves.toBeNull() + await expect( + client.createInstructions({ ...request, externalTokenAmount: 0 }) + ).rejects.toThrow("externalTokenAmount must be greater than zero.") + }) + + it("rejects a configured SPL reserve route without chain precision", async () => { + const { client, program, provider } = clientFixture(), + splMint = Keypair.generate().publicKey + jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue({ + data: AccountData, + executable: false, + lamports: 1, + owner: program.programId, + rentEpoch: 0 + }) + jest.spyOn(program.coder.accounts, "decode").mockReturnValue({ + tokenAddressesByCode: [{ tokenCode: new BN(2), mint: splMint }], + precisionByTokenCode: [] + } as never) + + await expect(client.getConfiguredTokens()).rejects.toThrow( + "Solana reserve token 2 has no configured precision." + ) + }) +}) diff --git a/packages/sdk-outpost/tests/reserves/Validation.test.ts b/packages/sdk-outpost/tests/reserves/Validation.test.ts index 61914c4..61088b9 100644 --- a/packages/sdk-outpost/tests/reserves/Validation.test.ts +++ b/packages/sdk-outpost/tests/reserves/Validation.test.ts @@ -1,9 +1,29 @@ import { + assertEthereumReserveCreateRequest, + assertReserveCreateDefinition, assertReserveSwapRequest, assertReserveUnsigned64, + type EthereumReserveCreateRequest, + type ReserveCreateDefinition, type ReserveSwapRequest } from "@wireio/sdk-outpost" +const reserveDefinition: ReserveCreateDefinition = { + tokenCode: 1, + reserveCode: 2, + externalTokenAmount: 3, + requestedWireAmount: 4, + connectorWeightBps: 5_000, + name: "Private ETH reserve", + description: "Same-owner external routing", + isPrivate: true +} + +const ethereumRequest: EthereumReserveCreateRequest = { + ...reserveDefinition, + creatorPubKey: `0x02${"11".repeat(32)}` +} + const request: ReserveSwapRequest = { sourceTokenCode: 1, sourceReserveCode: 2, @@ -17,6 +37,31 @@ const request: ReserveSwapRequest = { } describe("reserve swap validation", () => { + it("accepts portable and Ethereum reserve creation requests", () => { + expect(() => assertReserveCreateDefinition(reserveDefinition)).not.toThrow() + expect(() => + assertEthereumReserveCreateRequest(ethereumRequest) + ).not.toThrow() + }) + + it("rejects invalid reserve creation metadata and creator keys", () => { + expect(() => + assertReserveCreateDefinition({ + ...reserveDefinition, + connectorWeightBps: 10_000 + }) + ).toThrow("connectorWeightBps") + expect(() => + assertReserveCreateDefinition({ ...reserveDefinition, name: "" }) + ).toThrow("name must contain") + expect(() => + assertEthereumReserveCreateRequest({ + ...ethereumRequest, + creatorPubKey: "0x02" + }) + ).toThrow("33-byte compressed") + }) + it("accepts a portable positive request", () => { expect(() => assertReserveSwapRequest(request)).not.toThrow() expect(assertReserveUnsigned64(8, "value").toNumber()).toBe(8) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7ab43e..32fb95f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -212,6 +212,9 @@ importers: '@solana/web3.js': specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + '@wireio/sdk-core': + specifier: workspace:* + version: link:../sdk-core ethers: specifier: ^5.8.0 version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs index 3f2b0e3..e4fd026 100644 --- a/scripts/sdk-outpost/verify-package.mjs +++ b/scripts/sdk-outpost/verify-package.mjs @@ -13,10 +13,12 @@ const packageJson = await readJson(path.join(PackagePath, "package.json")), ExpectedPublishedFiles = ["lib/cjs", "lib/esm", "README.md"], ExpectedExports = [ "EthereumOutpostClient", + "EthereumReserveClient", "OutpostArtifactManifests", "OutpostClient", "OutpostDeploymentVerifier", "SolanaOutpostClient", + "SolanaReserveClient", "assertOutpostArtifactCompatibility", "parseOutpostDeploymentProfile" ] From 3da08a72c832cd330d40bf0d737d68eb3aea8bb6 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 7 Aug 2026 14:12:57 -0400 Subject: [PATCH 27/48] fix(sdk-outpost): harden reserve creation preflight --- packages/sdk-outpost/README.md | 6 ++++++ .../clients/ethereum/EthereumReserveClient.ts | 20 +++++++++++++----- .../src/clients/solana/SolanaReserveClient.ts | 13 +++++++----- packages/sdk-outpost/src/reserves/Types.ts | 2 +- .../sdk-outpost/src/reserves/Validation.ts | 21 +++++++++++++------ .../ethereum/EthereumReserveClient.test.ts | 12 +++++++++++ .../solana/SolanaReserveClient.test.ts | 3 +++ .../tests/reserves/Validation.test.ts | 12 +++++++++++ 8 files changed, 72 insertions(+), 17 deletions(-) diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 0e7b1a4..9600a5f 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -178,6 +178,12 @@ token discovery, instruction assembly, creation, pending cancellation, address derivation, and local reserve reads. `cancel` is valid only while creation is pending and drives the protocol refund path. +The all-zero mint returned for a configured native SOL route is protocol +metadata, not an Anchor account. The current `create_reserve` account context +still requires a real placeholder SPL mint and the creator's token account for +native SOL creation. Consumers that have not provisioned those accounts should +select a configured non-native SPL route, as in the example above. + Private is a routing constraint, not access control or confidentiality. Private reserves cannot use WIRE as a swap endpoint; when either external route leg is private, Wire requires both active reserves to have the same non-empty owner. diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts index cbec80b..80d4076 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts @@ -2,6 +2,7 @@ import { constants as ethersConstants, Contract, Signer, + utils as ethersUtils, type providers } from "ethers" import { match } from "ts-pattern" @@ -67,17 +68,26 @@ export class EthereumReserveClient { assertEthereumReserveCreateRequest(request) const signer = this.assertSigner(), owner = await signer.getAddress(), - resolvedTokenAddress = - tokenAddress ?? - (await this.reserveManager.tokenAddressesByCode(request.tokenCode)) + configuredTokenAddress = await this.reserveManager.tokenAddressesByCode( + request.tokenCode + ) - if (resolvedTokenAddress === ethersConstants.AddressZero) { + if (configuredTokenAddress === ethersConstants.AddressZero) { throw new Error( `No ERC-20 address is configured for tokenCode ${request.tokenCode.toString()}.` ) } + if ( + tokenAddress != null && + ethersUtils.getAddress(tokenAddress) !== + ethersUtils.getAddress(configuredTokenAddress) + ) { + throw new Error( + `ERC-20 address ${tokenAddress} does not match the configured route ${configuredTokenAddress}.` + ) + } - const token = new Contract(resolvedTokenAddress, Erc20Interface, signer), + const token = new Contract(configuredTokenAddress, Erc20Interface, signer), allowance = await token.allowance(owner, this.reserveManager.address) if (allowance.lt(request.externalTokenAmount)) { const approval = await token.approve( diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts index d8e9fa9..da10905 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts @@ -31,7 +31,8 @@ import { import { SolanaReserveAddresses } from "./SolanaReserveAddresses.js" const PublicKeyByteLength = 32, - NativeSolanaDecimals = 9 + NativeSolanaDecimals = 9, + NativeTokenMarker = new PublicKey(new Uint8Array(PublicKeyByteLength)) type LiqsolCoreAccounts = IdlAccounts @@ -63,14 +64,11 @@ export class SolanaReserveClient { entry.tokenCode.toString(), entry.decimals ]) - ), - nativeTokenMarker = new PublicKey( - new Uint8Array(PublicKeyByteLength) ) return config.tokenAddressesByCode.map(entry => { const tokenCode = entry.tokenCode.toString(), - isNative = entry.mint.equals(nativeTokenMarker), + isNative = entry.mint.equals(NativeTokenMarker), configuredDecimals = precisionByTokenCode.get(tokenCode) if (!isNative && configuredDecimals == null) { throw new Error( @@ -97,6 +95,11 @@ export class SolanaReserveClient { ): Promise { assertReserveCreateDefinition(request) assertReserveUnsigned64(request.externalTokenAmount, "externalTokenAmount") + if (request.mint.equals(NativeTokenMarker)) { + throw new Error( + "Native SOL reserve creation requires a real placeholder SPL mint and creator token account; the all-zero native marker is configuration metadata only." + ) + } const creator = this.assertWallet(), { creatorTokenAccount = getAssociatedTokenAddressSync( diff --git a/packages/sdk-outpost/src/reserves/Types.ts b/packages/sdk-outpost/src/reserves/Types.ts index 3221cd9..9aa28c2 100644 --- a/packages/sdk-outpost/src/reserves/Types.ts +++ b/packages/sdk-outpost/src/reserves/Types.ts @@ -68,7 +68,7 @@ export interface EthereumReserveRecord { /** Solana reserve-creation request for the permissionless outpost path. */ export interface SolanaReserveCreateRequest extends ReserveCreateDefinition { - /** Custody mint for SPL reserves, or a valid placeholder mint for native SOL. */ + /** Custody mint for SPL reserves, or a real placeholder SPL mint for native SOL. */ mint: PublicKey /** Creator token-account override. Defaults to the canonical ATA. */ creatorTokenAccount?: PublicKey diff --git a/packages/sdk-outpost/src/reserves/Validation.ts b/packages/sdk-outpost/src/reserves/Validation.ts index 7f59d37..55bb2c8 100644 --- a/packages/sdk-outpost/src/reserves/Validation.ts +++ b/packages/sdk-outpost/src/reserves/Validation.ts @@ -17,7 +17,13 @@ const MaximumUnsigned64 = BigNumber.from("18446744073709551615"), MaximumToleranceBps = 10_000, MaximumReserveNameBytes = 64, MaximumReserveDescriptionBytes = 256, - CompressedSecp256k1PublicKeyBytes = 33 + CompressedSecp256k1PublicKeyBytes = 33, + CompressedSecp256k1PublicKeyPrefix = { + even: 2, + odd: 3 + } as const, + InvalidCompressedSecp256k1PublicKeyMessage = + "creatorPubKey must be a 33-byte compressed secp256k1 public key." /** Validate one value against the positive unsigned 64-bit protocol boundary. */ export function assertReserveUnsigned64( @@ -89,13 +95,16 @@ export function assertEthereumReserveCreateRequest( request: EthereumReserveCreateRequest ): void { assertReserveCreateDefinition(request) + if (!ethersUtils.isBytesLike(request.creatorPubKey)) { + throw new Error(InvalidCompressedSecp256k1PublicKeyMessage) + } + const creatorPublicKey = ethersUtils.arrayify(request.creatorPubKey) if ( - ethersUtils.arrayify(request.creatorPubKey).length !== - CompressedSecp256k1PublicKeyBytes + creatorPublicKey.length !== CompressedSecp256k1PublicKeyBytes || + (creatorPublicKey[0] !== CompressedSecp256k1PublicKeyPrefix.even && + creatorPublicKey[0] !== CompressedSecp256k1PublicKeyPrefix.odd) ) { - throw new Error( - "creatorPubKey must be a 33-byte compressed secp256k1 public key." - ) + throw new Error(InvalidCompressedSecp256k1PublicKeyMessage) } } diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts index a6b8b5b..cac3fb7 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts @@ -199,4 +199,16 @@ describe("EthereumReserveClient", () => { "No ERC-20 address is configured" ) }) + + it("rejects an ERC-20 address that differs from the configured route", async () => { + const { reserveManager } = reserveManagerFixture(), + signer = new Erc20Signer(), + client = new EthereumReserveClient(reserveManager, signer), + differentTokenAddress = Wallet.createRandom().address + + await expect( + client.createErc20WithApproval(request, differentTokenAddress) + ).rejects.toThrow("does not match the configured route") + expect(signer.approvalWait).not.toHaveBeenCalled() + }) }) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts index 579c8c7..f8baccc 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts @@ -161,6 +161,9 @@ describe("SolanaReserveClient", () => { await expect( client.createInstructions({ ...request, externalTokenAmount: 0 }) ).rejects.toThrow("externalTokenAmount must be greater than zero.") + await expect( + client.createInstructions({ ...request, mint: NativeTokenMarker }) + ).rejects.toThrow("requires a real placeholder SPL mint") }) it("rejects a configured SPL reserve route without chain precision", async () => { diff --git a/packages/sdk-outpost/tests/reserves/Validation.test.ts b/packages/sdk-outpost/tests/reserves/Validation.test.ts index 61088b9..e2ce32e 100644 --- a/packages/sdk-outpost/tests/reserves/Validation.test.ts +++ b/packages/sdk-outpost/tests/reserves/Validation.test.ts @@ -60,6 +60,18 @@ describe("reserve swap validation", () => { creatorPubKey: "0x02" }) ).toThrow("33-byte compressed") + expect(() => + assertEthereumReserveCreateRequest({ + ...ethereumRequest, + creatorPubKey: `0x04${"11".repeat(32)}` + }) + ).toThrow("33-byte compressed") + expect(() => + assertEthereumReserveCreateRequest({ + ...ethereumRequest, + creatorPubKey: "not-hex" + }) + ).toThrow("33-byte compressed") }) it("accepts a portable positive request", () => { From 12b986c98b2fa5a4d7598c08186b5a0399dd34de Mon Sep 17 00:00:00 2001 From: joshglogau Date: Thu, 13 Aug 2026 12:00:07 -0400 Subject: [PATCH 28/48] feat(sdk-outpost): support exact deployment bundles --- CLAUDE.md | 1 + README.md | 7 + packages/sdk-outpost/README.md | 27 + packages/sdk-outpost/RELEASING.md | 3 + .../src/artifacts/Compatibility.ts | 130 ++-- packages/sdk-outpost/src/artifacts/Mode.ts | 7 + packages/sdk-outpost/src/artifacts/index.ts | 1 + .../tests/assets/Artifacts.test.ts | 86 +++ scripts/sdk-outpost/generate.mjs | 599 +++++++++++++----- scripts/sdk-outpost/verify-package.mjs | 5 + 10 files changed, 670 insertions(+), 196 deletions(-) create mode 100644 packages/sdk-outpost/src/artifacts/Mode.ts diff --git a/CLAUDE.md b/CLAUDE.md index 19b7af0..34263f1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -221,6 +221,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact producer packages owned by `wire-ethereum` and `wire-solana`; until their first publication, local sibling artifacts are testing inputs only. Generated clients are ignored build outputs and must not be copied or edited here. - `scripts/sdk-outpost/generate.mjs` must preserve literal Solana IDL account names in `LiqsolCore`; widening the generated type to base `Idl` erases precise `Program["account"]` members. +- `scripts/sdk-outpost/generate.mjs --deployment-artifacts-path ` is a local integration mode for exact infra bundles. It must verify bundled ABI/IDL hashes and bind executable verification to the profile's exact implementation/ProgramData hashes. `verify:package` must reject this mode; release builds always regenerate from producer packages. - `packages/sdk-outpost` owns external reserve-swap instruction assembly, allowance handling, source submission, balance reads, and canonical `sourceRequestId` extraction. Staking remains outside this package until its diff --git a/README.md b/README.md index 09f9450..5372698 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,13 @@ names, so Anchor consumers retain precise `Program["account"]` members after regeneration. Generated clients remain build outputs and must not be edited by hand. +For local cluster integration, the same generator accepts an infra deployment +artifact directory or tarball through `--deployment-artifacts-path`. That mode +compiles the bundle's exact ABI/IDL and binds runtime verification to its exact +implementation and ProgramData hashes. It is deliberately rejected by the +package release verifier; published builds always regenerate from canonical +producer packages. + `@wireio/sdk-outpost` and its two producer artifact packages are not yet available from npm. Local sibling links are valid for integration testing but do not prove a frozen registry install and must not be committed as the final diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 9600a5f..93e9d18 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -14,6 +14,25 @@ Ethereum and Solana producer artifact packages are also unpublished. Sibling checkouts may be used for local integration testing, but they are not release evidence. +### Local deployment-bundle generation + +When a cluster deployment predates the current producer packages, generate a +local-only SDK directly from the exact infra artifact directory or tarball: + +```sh +pnpm --dir packages/sdk-outpost run clean +pnpm --dir packages/sdk-outpost run generate -- \ + --deployment-artifacts-path /path/to/sim2-artifacts.tar.gz +pnpm --dir packages/sdk-outpost run compile +pnpm --dir packages/sdk-outpost run fix:hybrid:exports +``` + +This mode verifies every bundled ABI and IDL against the deployment profile, +generates the exact TypeChain/Anchor clients, and binds live executable checks +to the profile's implementation-code and ProgramData hashes. It is for local +integration only: `verify:package` rejects the result, while `verify:release` +and `prepack` first regenerate canonical producer-package output. + ## Install after the first release ```sh @@ -45,6 +64,11 @@ Client creation verifies all four boundaries before returning: - every Solana program resolves through the upgradeable loader to the configured ProgramData account, exact ProgramData hash, and producer program binary. +Local deployment-bundle builds replace the final producer-template/binary +comparison with the bundle profile's exact full implementation-code and +ProgramData hashes. Interface digests, chain identity, proxy/ProgramData +addresses, and exact live hashes remain mandatory. + These checks prove deployment compatibility, not end-to-end feature readiness. Applications must still gate swaps, staking, settlement, retry, funding, and underwriting using platform capability evidence. @@ -245,6 +269,9 @@ pnpm --dir packages/sdk-outpost run verify:release pnpm --dir packages/sdk-outpost pack --dry-run ``` +The release commands always use ordinary producer-package generation. Never +publish or pack output generated with `--deployment-artifacts-path`. + Release versions are managed by the monorepo-wide patch workflow. See [`RELEASING.md`](RELEASING.md) for artifact prerequisites and the verification checklist. diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index ee7c4f4..0a10121 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -38,6 +38,9 @@ pnpm-compatible install. - Keep the lockfile unchanged after a frozen install. - Generate clients only through `scripts/sdk-outpost/generate.mjs`; never edit generated TypeChain, Anchor, or artifact-manifest sources by hand. +- Do not release output generated with `--deployment-artifacts-path`. That mode + is limited to exact local integration bundles and the package verifier must + reject it. - Confirm the package contains no secrets, RPC credentials, private keys, deployment addresses, or mutable environment configuration. - Confirm deployment profiles are distributed through the authenticated diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index 03075a9..772bb97 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -8,6 +8,7 @@ import { SolanaProgramName } from "../deployments/index.js" import { OutpostArtifactManifests } from "./generated/index.js" +import { OutpostArtifactMode } from "./Mode.js" const SolanaProgramDataMetadataByteLength = 45 @@ -53,23 +54,36 @@ export function assertEthereumRuntimeArtifactCompatibility( contractName: EthereumContractName, code: string ): void { - const artifact = OutpostArtifactManifests.ethereum.contracts[contractName], - normalizedCode = normalizeEthereumRuntimeCode( - code, - artifact.runtimeLinkReferences - ) + const artifact = OutpostArtifactManifests.ethereum.contracts[contractName] - if (normalizedCode.length !== artifact.runtimeBytecodeLength) { - throw new Error( - `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` - ) - } - const digest = sha256(normalizedCode) - if (digest !== artifact.runtimeBytecodeSha256) { - throw new Error( - `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` - ) - } + match(OutpostArtifactManifests.mode) + .with(OutpostArtifactMode.sourcePackage, () => { + const normalizedCode = normalizeEthereumRuntimeCode( + code, + artifact.runtimeLinkReferences + ) + + if (normalizedCode.length !== artifact.runtimeBytecodeLength) { + throw new Error( + `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` + ) + } + const digest = sha256(normalizedCode) + if (digest !== artifact.runtimeBytecodeSha256) { + throw new Error( + `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` + ) + } + }) + .with(OutpostArtifactMode.deploymentBundle, () => { + const digest = sha256(ethersUtils.arrayify(code)) + if (digest !== artifact.implementationCodeSha256) { + throw new Error( + `Ethereum ${contractName} deployment runtime mismatch: expected ${artifact.implementationCodeSha256}, received ${digest}` + ) + } + }) + .exhaustive() } /** Verify live Solana executable bytes against the source-owned program binary. */ @@ -77,23 +91,39 @@ export function assertSolanaProgramArtifactCompatibility( programName: SolanaProgramName, programData: Uint8Array ): void { - const artifact = OutpostArtifactManifests.solana.programs[programName], - programBinaryEnd = - SolanaProgramDataMetadataByteLength + artifact.programBinaryLength + const artifact = OutpostArtifactManifests.solana.programs[programName] - if (programData.length < programBinaryEnd) { - throw new Error( - `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` - ) - } - const digest = sha256( - programData.subarray(SolanaProgramDataMetadataByteLength, programBinaryEnd) - ) - if (digest !== artifact.programBinarySha256) { - throw new Error( - `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` - ) - } + match(OutpostArtifactManifests.mode) + .with(OutpostArtifactMode.sourcePackage, () => { + const programBinaryEnd = + SolanaProgramDataMetadataByteLength + artifact.programBinaryLength + + if (programData.length < programBinaryEnd) { + throw new Error( + `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` + ) + } + const digest = sha256( + programData.subarray( + SolanaProgramDataMetadataByteLength, + programBinaryEnd + ) + ) + if (digest !== artifact.programBinarySha256) { + throw new Error( + `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` + ) + } + }) + .with(OutpostArtifactMode.deploymentBundle, () => { + const digest = sha256(programData) + if (digest !== artifact.programDataSha256) { + throw new Error( + `Solana ${programName} deployment ProgramData mismatch: expected ${artifact.programDataSha256}, received ${digest}` + ) + } + }) + .exhaustive() } /** Assert that one profile digest matches the interface compiled into the SDK. */ @@ -115,23 +145,43 @@ export function assertOutpostArtifactCompatibility( family: OutpostChainFamily ): void { match(family) - .with(OutpostChainFamily.ethereum, () => - Object.values(EthereumContractName).forEach(contractName => + .with(OutpostChainFamily.ethereum, () => { + Object.values(EthereumContractName).forEach(contractName => { assertInterfaceDigest( profile.ethereum.contracts[contractName].abiSha256, OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, `Ethereum ${contractName} ABI` ) - ) - ) - .with(OutpostChainFamily.solana, () => - Object.values(SolanaProgramName).forEach(programName => + if ( + OutpostArtifactManifests.mode === OutpostArtifactMode.deploymentBundle + ) { + assertInterfaceDigest( + profile.ethereum.contracts[contractName].implementationCodeSha256, + OutpostArtifactManifests.ethereum.contracts[contractName] + .implementationCodeSha256, + `Ethereum ${contractName} deployment runtime` + ) + } + }) + }) + .with(OutpostChainFamily.solana, () => { + Object.values(SolanaProgramName).forEach(programName => { assertInterfaceDigest( profile.solana.programs[programName].idlSha256, OutpostArtifactManifests.solana.programs[programName].idlSha256, `Solana ${programName} IDL` ) - ) - ) + if ( + OutpostArtifactManifests.mode === OutpostArtifactMode.deploymentBundle + ) { + assertInterfaceDigest( + profile.solana.programs[programName].programDataSha256, + OutpostArtifactManifests.solana.programs[programName] + .programDataSha256, + `Solana ${programName} deployment ProgramData` + ) + } + }) + }) .exhaustive() } diff --git a/packages/sdk-outpost/src/artifacts/Mode.ts b/packages/sdk-outpost/src/artifacts/Mode.ts new file mode 100644 index 0000000..d5ba972 --- /dev/null +++ b/packages/sdk-outpost/src/artifacts/Mode.ts @@ -0,0 +1,7 @@ +/** Build-time origin of the executable interfaces compiled into sdk-outpost. */ +export enum OutpostArtifactMode { + /** Publishable SDK generated from canonical producer artifact packages. */ + sourcePackage = "sourcePackage", + /** Local-only SDK generated from one exact deployment artifact bundle. */ + deploymentBundle = "deploymentBundle" +} diff --git a/packages/sdk-outpost/src/artifacts/index.ts b/packages/sdk-outpost/src/artifacts/index.ts index 24b24c3..9ffad2f 100644 --- a/packages/sdk-outpost/src/artifacts/index.ts +++ b/packages/sdk-outpost/src/artifacts/index.ts @@ -1,2 +1,3 @@ export * from "./Compatibility.js" +export * from "./Mode.js" export * from "./generated/index.js" diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index ec423ab..3e58c51 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -1,22 +1,32 @@ import type { Program } from "@coral-xyz/anchor" +import { utils as ethersUtils } from "ethers" import { EthereumContractName, OPP__factory, OperatorRegistry__factory, + OutpostArtifactMode, OutpostArtifactManifests, OutpostChainFamily, ReserveManager__factory, SolanaProgramName, type LiqsolCore, + assertEthereumRuntimeArtifactCompatibility, assertOutpostArtifactCompatibility, + assertSolanaProgramArtifactCompatibility, liqsolCoreIdl } from "@wireio/sdk-outpost" import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" describe("source-owned outpost artifacts", () => { + afterEach(() => jest.restoreAllMocks()) + it("records exact producer package identity", () => { + expect(OutpostArtifactManifests.mode).toBe( + OutpostArtifactMode.sourcePackage + ) + expect(OutpostArtifactManifests.deploymentProfileId).toBe("") expect(OutpostArtifactManifests.ethereum.package.name).toBe( "@wireio/outpost-ethereum-artifacts" ) @@ -57,6 +67,82 @@ describe("source-owned outpost artifacts", () => { ).toThrow("Solana liqsolCore IDL interface mismatch") }) + it("binds deployment-bundle compatibility to exact deployment hashes", () => { + const profile = createOutpostDeploymentProfileFixture() + jest.replaceProperty( + OutpostArtifactManifests, + "mode", + OutpostArtifactMode.deploymentBundle + ) + Object.values(EthereumContractName).forEach(contractName => + jest.replaceProperty( + OutpostArtifactManifests.ethereum.contracts[contractName], + "implementationCodeSha256", + profile.ethereum.contracts[contractName].implementationCodeSha256 + ) + ) + jest.replaceProperty( + OutpostArtifactManifests.solana.programs[SolanaProgramName.liqsolCore], + "programDataSha256", + profile.solana.programs[SolanaProgramName.liqsolCore].programDataSha256 + ) + + expect(() => + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) + ).not.toThrow() + expect(() => + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.solana) + ).not.toThrow() + + profile.ethereum.contracts[ + EthereumContractName.ReserveManager + ].implementationCodeSha256 = "f".repeat(64) + expect(() => + assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) + ).toThrow("Ethereum ReserveManager deployment runtime interface mismatch") + }) + + it("verifies exact deployment-bundle executable hashes", () => { + const ethereumCode = "0x1234", + solanaProgramData = Uint8Array.from([1, 2, 3]) + jest.replaceProperty( + OutpostArtifactManifests, + "mode", + OutpostArtifactMode.deploymentBundle + ) + jest.replaceProperty( + OutpostArtifactManifests.ethereum.contracts[ + EthereumContractName.ReserveManager + ], + "implementationCodeSha256", + ethersUtils.sha256(ethereumCode).slice(2) + ) + jest.replaceProperty( + OutpostArtifactManifests.solana.programs[SolanaProgramName.liqsolCore], + "programDataSha256", + ethersUtils.sha256(solanaProgramData).slice(2) + ) + + expect(() => + assertEthereumRuntimeArtifactCompatibility( + EthereumContractName.ReserveManager, + ethereumCode + ) + ).not.toThrow() + expect(() => + assertSolanaProgramArtifactCompatibility( + SolanaProgramName.liqsolCore, + solanaProgramData + ) + ).not.toThrow() + expect(() => + assertEthereumRuntimeArtifactCompatibility( + EthereumContractName.ReserveManager, + "0x5678" + ) + ).toThrow("Ethereum ReserveManager deployment runtime mismatch") + }) + it("generates the callable swap and collateral surfaces", () => { const accountNames: Array["account"]> = [ "outpostConfig", diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs index 741d2d6..9b08a86 100644 --- a/scripts/sdk-outpost/generate.mjs +++ b/scripts/sdk-outpost/generate.mjs @@ -1,10 +1,11 @@ #!/usr/bin/env zx import Crypto from "node:crypto" +import Os from "node:os" import { createRequire } from "node:module" import { format } from "prettier" -import { $, fs, path } from "zx" +import { $, argv, fs, path } from "zx" import { EthereumArtifactPackageName, @@ -16,12 +17,6 @@ import { } from "./config.mjs" const PackageRequire = createRequire(PackageManifestPath), - EthereumManifestPath = PackageRequire.resolve( - `${EthereumArtifactPackageName}/manifest.json` - ), - SolanaManifestPath = PackageRequire.resolve( - `${SolanaArtifactPackageName}/manifest.json` - ), EthereumOutputPath = path.join( PackagePath, "src/contracts/ethereum/generated" @@ -35,7 +30,23 @@ const PackageRequire = createRequire(PackageManifestPath), "ReserveManager" ], SolanaProgramName = "liqsolCore", - TypechainPath = path.join(PackagePath, "node_modules/.bin/typechain") + TypechainPath = path.join(PackagePath, "node_modules/.bin/typechain"), + DeploymentProfileFilename = "outpost-deployment-profile.json", + ClusterManifestFilename = "cluster-manifest.json", + DeploymentBundleDirectoryName = "sim2-artifacts", + DeploymentArtifactsPath = argv["deployment-artifacts-path"], + DevelopmentPackageVersion = "0.0.0-development", + EmptyArtifactPath = "", + EmptyArtifactDigest = "", + EmptyArtifactLength = 0, + Sha256Pattern = /^[0-9a-f]{64}$/, + EmptyRuntimeLinkReferencesJson = '"runtimeLinkReferences": []', + TypedEmptyRuntimeLinkReferencesSource = + '"runtimeLinkReferences": [] as never[]', + ArtifactMode = { + sourcePackage: "sourcePackage", + deploymentBundle: "deploymentBundle" + } /** Resolve one exported file from a source-owned artifact package. */ function resolveArtifact(packageName, artifactPath) { @@ -57,6 +68,14 @@ function assertArtifactDigest(actual, expected, label) { assert(actual === expected, `${label} checksum mismatch`) } +/** Verify that a deployment profile contains one lowercase SHA-256 digest. */ +function assertSha256(value, label) { + assert( + typeof value === "string" && Sha256Pattern.test(value), + `${label} must be a lowercase SHA-256 digest` + ) +} + /** Format generated TypeScript according to repository rules. */ async function formatTypescript(source) { return format(source, { @@ -67,170 +86,438 @@ async function formatTypescript(source) { }) } -const [packageManifest, ethereumManifest, solanaManifest] = await Promise.all([ - readJson(PackageManifestPath), - readJson(EthereumManifestPath), - readJson(SolanaManifestPath) -]) - -assert( - ethereumManifest.package.name === EthereumArtifactPackageName, - `Unexpected Ethereum artifact package ${ethereumManifest.package.name}` -) -assert( - solanaManifest.package.name === SolanaArtifactPackageName, - `Unexpected Solana artifact package ${solanaManifest.package.name}` -) -assert( - packageManifest.devDependencies[EthereumArtifactPackageName] === - ethereumManifest.package.version, - `Ethereum artifact version ${ethereumManifest.package.version} does not match sdk-outpost` -) -assert( - packageManifest.devDependencies[SolanaArtifactPackageName] === - solanaManifest.package.version, - `Solana artifact version ${solanaManifest.package.version} does not match sdk-outpost` -) -assert( - EthereumContractNames.every(name => ethereumManifest.contracts[name] != null), - "Ethereum artifact package does not cover the sdk-outpost contract surface" -) -assert( - solanaManifest.programs[SolanaProgramName] != null, - "Solana artifact package does not cover liqsol_core" -) - -await Promise.all( - [EthereumOutputPath, SolanaOutputPath, ArtifactOutputPath].map(outputPath => - fs.rm(outputPath, { force: true, recursive: true }) +/** Add deployment-only hash slots to one canonical Ethereum manifest. */ +function createSourceEthereumManifest(manifest) { + return { + ...manifest, + contracts: Object.fromEntries( + Object.entries(manifest.contracts).map(([name, contract]) => [ + name, + { ...contract, implementationCodeSha256: EmptyArtifactDigest } + ]) + ) + } +} + +/** Add deployment-only hash slots to one canonical Solana manifest. */ +function createSourceSolanaManifest(manifest) { + return { + ...manifest, + programs: Object.fromEntries( + Object.entries(manifest.programs).map(([name, program]) => [ + name, + { ...program, programDataSha256: EmptyArtifactDigest } + ]) + ) + } +} + +/** Resolve and verify the canonical producer-package generation inputs. */ +async function resolveSourceGenerationInput() { + const EthereumManifestPath = PackageRequire.resolve( + `${EthereumArtifactPackageName}/manifest.json` + ), + SolanaManifestPath = PackageRequire.resolve( + `${SolanaArtifactPackageName}/manifest.json` + ), + [packageManifest, ethereumManifest, solanaManifest] = await Promise.all([ + readJson(PackageManifestPath), + readJson(EthereumManifestPath), + readJson(SolanaManifestPath) + ]) + + assert( + ethereumManifest.package.name === EthereumArtifactPackageName, + `Unexpected Ethereum artifact package ${ethereumManifest.package.name}` ) -) -await Promise.all( - [SolanaOutputPath, ArtifactOutputPath].map(outputPath => - fs.mkdir(outputPath, { recursive: true }) + assert( + solanaManifest.package.name === SolanaArtifactPackageName, + `Unexpected Solana artifact package ${solanaManifest.package.name}` ) -) - -const ethereumInputs = await Promise.all( - EthereumContractNames.map(async name => { - const contract = ethereumManifest.contracts[name], - abiPath = resolveArtifact(EthereumArtifactPackageName, contract.path), - runtimeBytecodePath = resolveArtifact( - EthereumArtifactPackageName, - contract.runtimeBytecodePath - ), - [artifact, runtimeBytecode] = await Promise.all([ - readJson(abiPath), - fs.readFile(runtimeBytecodePath) + assert( + packageManifest.devDependencies[EthereumArtifactPackageName] === + ethereumManifest.package.version, + `Ethereum artifact version ${ethereumManifest.package.version} does not match sdk-outpost` + ) + assert( + packageManifest.devDependencies[SolanaArtifactPackageName] === + solanaManifest.package.version, + `Solana artifact version ${solanaManifest.package.version} does not match sdk-outpost` + ) + assert( + EthereumContractNames.every( + name => ethereumManifest.contracts[name] != null + ), + "Ethereum artifact package does not cover the sdk-outpost contract surface" + ) + assert( + solanaManifest.programs[SolanaProgramName] != null, + "Solana artifact package does not cover liqsol_core" + ) + + const ethereumAbiPaths = await Promise.all( + EthereumContractNames.map(async name => { + const contract = ethereumManifest.contracts[name], + abiPath = resolveArtifact(EthereumArtifactPackageName, contract.path), + runtimeBytecodePath = resolveArtifact( + EthereumArtifactPackageName, + contract.runtimeBytecodePath + ), + [artifact, runtimeBytecode] = await Promise.all([ + readJson(abiPath), + fs.readFile(runtimeBytecodePath) + ]) + + assertArtifactDigest( + sha256(formatJson(artifact.abi)), + contract.abiSha256, + `Ethereum ${name} ABI` + ) + assert( + runtimeBytecode.length === contract.runtimeBytecodeLength, + `Ethereum ${name} runtime bytecode length mismatch` + ) + assertArtifactDigest( + sha256(runtimeBytecode), + contract.runtimeBytecodeSha256, + `Ethereum ${name} runtime bytecode` + ) + return abiPath + }) + ), + solanaProgram = solanaManifest.programs[SolanaProgramName], + solanaIdlPath = resolveArtifact( + SolanaArtifactPackageName, + solanaProgram.idlPath + ), + solanaProgramBinaryPath = resolveArtifact( + SolanaArtifactPackageName, + solanaProgram.programBinaryPath + ), + [rawIdlSource, solanaProgramBinary] = await Promise.all([ + fs.readFile(solanaIdlPath), + fs.readFile(solanaProgramBinaryPath) + ]) + + assertArtifactDigest( + sha256(rawIdlSource), + solanaProgram.idlSha256, + "Solana liqsolCore IDL" + ) + assert( + solanaProgramBinary.length === solanaProgram.programBinaryLength, + "Solana liqsolCore program binary length mismatch" + ) + assertArtifactDigest( + sha256(solanaProgramBinary), + solanaProgram.programBinarySha256, + "Solana liqsolCore program binary" + ) + + return { + mode: ArtifactMode.sourcePackage, + deploymentProfileId: EmptyArtifactDigest, + ethereumManifest: createSourceEthereumManifest(ethereumManifest), + solanaManifest: createSourceSolanaManifest(solanaManifest), + ethereumAbiPaths, + solanaIdlPath, + cleanupPath: null + } +} + +/** Locate an extracted deployment bundle beneath one candidate directory. */ +function findDeploymentBundleRoot(candidatePath) { + return [ + candidatePath, + path.join(candidatePath, DeploymentBundleDirectoryName) + ].find(bundlePath => + fs.existsSync(path.join(bundlePath, DeploymentProfileFilename)) + ) +} + +/** Resolve a deployment directory or extract a supplied tar.gz archive. */ +async function resolveDeploymentBundleRoot(inputPath) { + const resolvedPath = path.resolve(String(inputPath)), + inputStat = await fs.stat(resolvedPath) + + if (inputStat.isDirectory()) { + const bundlePath = findDeploymentBundleRoot(resolvedPath) + assert( + bundlePath != null, + `Deployment bundle is missing beneath ${resolvedPath}` + ) + return { bundlePath, cleanupPath: null } + } + + const cleanupPath = await fs.mkdtemp( + path.join(Os.tmpdir(), "wire-sdk-outpost-deployment-") + ) + try { + await $`tar -xzf ${resolvedPath} -C ${cleanupPath}` + const bundlePath = findDeploymentBundleRoot(cleanupPath) + assert( + bundlePath != null, + `Archive ${resolvedPath} is not a deployment bundle` + ) + return { bundlePath, cleanupPath } + } catch (error) { + await fs.rm(cleanupPath, { force: true, recursive: true }) + throw error + } +} + +/** Resolve and verify one exact deployment-bundle generation input. */ +async function resolveDeploymentGenerationInput(inputPath) { + const { bundlePath, cleanupPath } = + await resolveDeploymentBundleRoot(inputPath) + + try { + const profilePath = path.join(bundlePath, DeploymentProfileFilename), + clusterManifestPath = path.join(bundlePath, ClusterManifestFilename), + [profile, clusterManifest] = await Promise.all([ + readJson(profilePath), + readJson(clusterManifestPath) ]) - assertArtifactDigest( - sha256(formatJson(artifact.abi)), - contract.abiSha256, - `Ethereum ${name} ABI` + assert(profile.schemaVersion === 1, "Unsupported deployment profile schema") + assertSha256(profile.deploymentChecksum, "Deployment profile checksum") + assert( + profile.id === + `${profile.wire?.chainId}-${profile.deploymentChecksum.slice(0, 12)}`, + "Deployment profile id does not match its Wire chain and checksum" ) assert( - runtimeBytecode.length === contract.runtimeBytecodeLength, - `Ethereum ${name} runtime bytecode length mismatch` + profile.wire.chainId === clusterManifest.identity?.chains?.wire?.chain_id, + "Deployment bundle Wire chain identity mismatch" ) - assertArtifactDigest( - sha256(runtimeBytecode), - contract.runtimeBytecodeSha256, - `Ethereum ${name} runtime bytecode` + assert( + profile.ethereum?.chainId === + clusterManifest.identity?.chains?.evm?.chain_id, + "Deployment bundle Ethereum chain identity mismatch" + ) + assert( + profile.solana?.genesisHash === + clusterManifest.identity?.chains?.svm?.genesis, + "Deployment bundle Solana chain identity mismatch" ) - return abiPath - }) -) -await $({ - cwd: PackagePath -})`${TypechainPath} --target ethers-v5 --node16-modules --out-dir ${EthereumOutputPath} ${ethereumInputs}` + const ethereumAbiPaths = await Promise.all( + EthereumContractNames.map(async name => { + const abiPath = path.join( + bundlePath, + "ethereum", + "runtime-abis", + `${name}.json` + ), + artifact = await readJson(abiPath), + contract = profile.ethereum?.contracts?.[name] -const { convertIdlToCamelCase } = PackageRequire( - "@coral-xyz/anchor/dist/cjs/idl.js" - ), - solanaProgram = solanaManifest.programs[SolanaProgramName], - solanaIdlPath = resolveArtifact( - SolanaArtifactPackageName, - solanaProgram.idlPath - ), - solanaProgramBinaryPath = resolveArtifact( - SolanaArtifactPackageName, - solanaProgram.programBinaryPath - ), - [rawIdlSource, solanaProgramBinary] = await Promise.all([ - fs.readFile(solanaIdlPath), - fs.readFile(solanaProgramBinaryPath) - ]) + assert( + contract != null, + `Deployment profile is missing Ethereum ${name}` + ) + assertSha256(contract.abiSha256, `Ethereum ${name} ABI hash`) + assertSha256( + contract.implementationCodeSha256, + `Ethereum ${name} implementation hash` + ) + assert( + artifact.contractName === name && Array.isArray(artifact.abi), + `Deployment bundle has an invalid Ethereum ${name} ABI` + ) + assertArtifactDigest( + sha256(formatJson(artifact.abi)), + contract.abiSha256, + `Ethereum ${name} ABI` + ) + return abiPath + }) + ), + solanaIdlPath = path.join( + bundlePath, + "solana", + "runtime-idls", + "liqsol_core.json" + ), + rawIdlSource = await fs.readFile(solanaIdlPath), + solanaProgram = profile.solana?.programs?.[SolanaProgramName] + + assert(solanaProgram != null, "Deployment profile is missing liqsolCore") + assertSha256(solanaProgram.idlSha256, "Solana liqsolCore IDL hash") + assertSha256( + solanaProgram.programDataSha256, + "Solana liqsolCore ProgramData hash" + ) + assertArtifactDigest( + sha256(rawIdlSource), + solanaProgram.idlSha256, + "Solana liqsolCore IDL" + ) -assertArtifactDigest( - sha256(rawIdlSource), - solanaProgram.idlSha256, - "Solana liqsolCore IDL" -) -assert( - solanaProgramBinary.length === solanaProgram.programBinaryLength, - "Solana liqsolCore program binary length mismatch" -) -assertArtifactDigest( - sha256(solanaProgramBinary), - solanaProgram.programBinarySha256, - "Solana liqsolCore program binary" -) - -const rawIdl = JSON.parse(rawIdlSource.toString("utf8")), - idl = convertIdlToCamelCase(rawIdl), - solanaSource = await formatTypescript(` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ - import type { Idl } from "@coral-xyz/anchor" - - /** Remove readonly modifiers while preserving the generated IDL's literal names. */ - type MutableIdl = T extends object - ? { -readonly [Key in keyof T]: MutableIdl } - : T - - /** Capture a precise mutable IDL type for Anchor's generated namespaces. */ - function mutableIdl(value: T): MutableIdl { - return value as MutableIdl + const ethereumManifest = { + schemaVersion: 1, + package: { + name: EthereumArtifactPackageName, + version: DevelopmentPackageVersion + }, + source: { + repository: "Wire-Network/wire-ethereum", + revision: clusterManifest.identity.sources["wire-ethereum"] + }, + contracts: Object.fromEntries( + EthereumContractNames.map(name => { + const contract = profile.ethereum.contracts[name] + return [ + name, + { + path: `ethereum/runtime-abis/${name}.json`, + abiSha256: contract.abiSha256, + runtimeBytecodePath: EmptyArtifactPath, + runtimeBytecodeLength: EmptyArtifactLength, + runtimeBytecodeSha256: EmptyArtifactDigest, + runtimeLinkReferences: [], + implementationCodeSha256: contract.implementationCodeSha256 + } + ] + }) + ) + }, + solanaManifest = { + schemaVersion: 1, + package: { + name: SolanaArtifactPackageName, + version: DevelopmentPackageVersion + }, + source: { + repository: "Wire-Network/wire-solana", + revision: clusterManifest.identity.sources["wire-solana"] + }, + toolchain: clusterManifest.identity.chains.svm.version, + programs: { + [SolanaProgramName]: { + idlPath: "solana/runtime-idls/liqsol_core.json", + idlSha256: solanaProgram.idlSha256, + programBinaryPath: EmptyArtifactPath, + programBinaryLength: EmptyArtifactLength, + programBinarySha256: EmptyArtifactDigest, + programDataSha256: solanaProgram.programDataSha256 + } + } + } + + return { + mode: ArtifactMode.deploymentBundle, + deploymentProfileId: profile.id, + ethereumManifest, + solanaManifest, + ethereumAbiPaths, + solanaIdlPath, + cleanupPath + } + } catch (error) { + if (cleanupPath != null) { + await fs.rm(cleanupPath, { force: true, recursive: true }) } + throw error + } +} - const liqsolCoreIdlValue = mutableIdl(${JSON.stringify(idl, null, 2)}) +/** Resolve the selected canonical or local deployment generation input. */ +async function resolveGenerationInput() { + if (DeploymentArtifactsPath == null) return resolveSourceGenerationInput() + return resolveDeploymentGenerationInput(DeploymentArtifactsPath) +} - /** Strict Anchor IDL type generated from the wire-solana artifact package. */ - export type LiqsolCore = typeof liqsolCoreIdlValue +const generationInput = await resolveGenerationInput() - /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ - export const liqsolCoreIdl = liqsolCoreIdlValue - `), - artifactSource = await formatTypescript(` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ +try { + await Promise.all( + [EthereumOutputPath, SolanaOutputPath, ArtifactOutputPath].map(outputPath => + fs.rm(outputPath, { force: true, recursive: true }) + ) + ) + await Promise.all( + [SolanaOutputPath, ArtifactOutputPath].map(outputPath => + fs.mkdir(outputPath, { recursive: true }) + ) + ) - /** Exact source-owned artifact manifests compiled into this SDK build. */ - export const OutpostArtifactManifests = ${JSON.stringify( - { - ethereum: ethereumManifest, - solana: solanaManifest - }, + await $({ + cwd: PackagePath + })`${TypechainPath} --target ethers-v5 --node16-modules --out-dir ${EthereumOutputPath} ${generationInput.ethereumAbiPaths}` + + const { convertIdlToCamelCase } = PackageRequire( + "@coral-xyz/anchor/dist/cjs/idl.js" + ), + rawIdlSource = await fs.readFile(generationInput.solanaIdlPath), + rawIdl = JSON.parse(rawIdlSource.toString("utf8")), + idl = convertIdlToCamelCase(rawIdl), + ethereumManifestSource = JSON.stringify( + generationInput.ethereumManifest, null, 2 - )} as const - `) - -await Promise.all([ - fs.writeFile(path.join(SolanaOutputPath, "LiqsolCore.ts"), solanaSource), - fs.writeFile( - path.join(SolanaOutputPath, "index.ts"), - 'export * from "./LiqsolCore.js"\n' - ), - fs.writeFile(path.join(ArtifactOutputPath, "Manifests.ts"), artifactSource), - fs.writeFile( - path.join(ArtifactOutputPath, "index.ts"), - 'export * from "./Manifests.js"\n' - ) -]) + ).replaceAll( + EmptyRuntimeLinkReferencesJson, + TypedEmptyRuntimeLinkReferencesSource + ), + solanaSource = await formatTypescript(` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + import type { Idl } from "@coral-xyz/anchor" + + /** Remove readonly modifiers while preserving the generated IDL's literal names. */ + type MutableIdl = T extends object + ? { -readonly [Key in keyof T]: MutableIdl } + : T + + /** Capture a precise mutable IDL type for Anchor's generated namespaces. */ + function mutableIdl(value: T): MutableIdl { + return value as MutableIdl + } -process.stdout.write( - `Generated sdk-outpost clients from ${ethereumManifest.package.name}@${ethereumManifest.package.version} and ${solanaManifest.package.name}@${solanaManifest.package.version}\n` -) + const liqsolCoreIdlValue = mutableIdl(${JSON.stringify(idl, null, 2)}) + + /** Strict Anchor IDL type generated from the selected artifact input. */ + export type LiqsolCore = typeof liqsolCoreIdlValue + + /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ + export const liqsolCoreIdl = liqsolCoreIdlValue + `), + artifactSource = await formatTypescript(` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + + import { OutpostArtifactMode } from "../Mode.js" + + /** Exact artifact input compiled into this SDK build. */ + export const OutpostArtifactManifests = { + mode: OutpostArtifactMode.${generationInput.mode}, + deploymentProfileId: ${JSON.stringify( + generationInput.deploymentProfileId + )}, + ethereum: ${ethereumManifestSource}, + solana: ${JSON.stringify(generationInput.solanaManifest, null, 2)} + } + `) + + await Promise.all([ + fs.writeFile(path.join(SolanaOutputPath, "LiqsolCore.ts"), solanaSource), + fs.writeFile( + path.join(SolanaOutputPath, "index.ts"), + 'export * from "./LiqsolCore.js"\n' + ), + fs.writeFile(path.join(ArtifactOutputPath, "Manifests.ts"), artifactSource), + fs.writeFile( + path.join(ArtifactOutputPath, "index.ts"), + 'export * from "./Manifests.js"\n' + ) + ]) + + process.stdout.write( + `Generated sdk-outpost clients in ${generationInput.mode} mode from ${generationInput.ethereumManifest.source.revision} and ${generationInput.solanaManifest.source.revision}\n` + ) +} finally { + if (generationInput.cleanupPath != null) { + await fs.rm(generationInput.cleanupPath, { force: true, recursive: true }) + } +} diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs index e4fd026..2dd9325 100644 --- a/scripts/sdk-outpost/verify-package.mjs +++ b/scripts/sdk-outpost/verify-package.mjs @@ -90,6 +90,11 @@ ExpectedExports.forEach(name => { assert(name in cjs, `CommonJS entrypoint is missing ${name}`) assert(name in esm, `ES module entrypoint is missing ${name}`) }) +assert( + cjs.OutpostArtifactManifests.mode === cjs.OutpostArtifactMode.sourcePackage && + esm.OutpostArtifactManifests.mode === esm.OutpostArtifactMode.sourcePackage, + "Publishable sdk-outpost output must use canonical source-package artifacts" +) process.stdout.write( "Verified sdk-outpost package boundaries and entrypoints\n" From a83df189a81b3282006dc6f52ace7e106a685335 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Thu, 13 Aug 2026 12:11:31 -0400 Subject: [PATCH 29/48] build(sdk-outpost): preserve local producer linking --- .pnpmfile.cjs | 49 ++++++++++--------------------------------------- CLAUDE.md | 4 ++-- README.md | 9 +++++++-- pnpm-lock.yaml | 2 +- 4 files changed, 20 insertions(+), 44 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 74d3802..803e3b7 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -4,9 +4,9 @@ * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. * * Usage: - * 1. Add packages you want to link to the `localOverrides` map below. - * 2. Run `pnpm install` — pnpm will use these local paths instead of the registry. - * 3. Comment out or remove entries to revert to registry versions. + * 1. Build the wire-sysio and outpost producer outputs in the sibling repos. + * 2. Run `pnpm install --lockfile=false` to consume those local outputs. + * 3. Remove the sibling outputs to exercise registry-only release resolution. * * Docs: https://pnpm.io/pnpmfile */ @@ -14,8 +14,6 @@ const Path = require("path") const Fs = require("node:fs") -const linkLocalOppModelsEnv = "WIRE_LINK_LOCAL_OPP_MODELS" -const linkLocalOutpostArtifactsEnv = "WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS" const localOppModelTargets = ["typescript", "solidity"] const localOutpostArtifactPackages = [ [ @@ -61,52 +59,25 @@ function isDirectory(dirPath) { const localOverrides = {} /** - * Links local OPP model outputs for platform builds that already built wire-sysio. - * Normal package installs keep registry resolution so pnpm-lock.yaml is portable. + * Appends every locally available source-owned producer package. + * + * Platform builds consume sibling outputs automatically after their producers + * run. Registry-only release verification runs without those sibling outputs. */ -function appendLocalOppModelOverrides() { - const shouldLinkLocalOppModels = - process.env[linkLocalOppModelsEnv] === "1" || - process.env[linkLocalOppModelsEnv] === "true" - - if (!shouldLinkLocalOppModels) { - return - } - +function appendLocalProducerOverrides() { localOppModelTargets .map(target => [ `@wireio/opp-${target}-models`, Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) ]) + .concat(localOutpostArtifactPackages) .filter(([, path]) => isDirectory(path)) .forEach(([pkgName, path]) => { localOverrides[pkgName] = path }) } -/** - * Links source-owned outpost packages generated by sibling chain repositories. - * Standalone and release installs keep registry resolution so their lockfile - * remains portable and exact published versions stay authoritative. - */ -function appendLocalOutpostArtifactOverrides() { - const shouldLinkLocalOutpostArtifacts = - process.env[linkLocalOutpostArtifactsEnv] === "1" || - process.env[linkLocalOutpostArtifactsEnv] === "true" - - if (!shouldLinkLocalOutpostArtifacts) { - return - } - - localOutpostArtifactPackages - .filter(([, path]) => isDirectory(path)) - .forEach(([pkgName, path]) => { - localOverrides[pkgName] = path - }) -} - -appendLocalOppModelOverrides() -appendLocalOutpostArtifactOverrides() +appendLocalProducerOverrides() /** * `readPackage` hook, which links locally available versions of diff --git a/CLAUDE.md b/CLAUDE.md index 34263f1..7ba9866 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,8 +6,8 @@ ```bash pnpm install # Install registry deps (pnpm 10.34.5, Node >=22) -# Link local OPP models from wire-sysio: -WIRE_LINK_LOCAL_OPP_MODELS=1 pnpm install --lockfile=false +# Link available sibling producer outputs: +pnpm install --lockfile=false pnpm build # Build all packages via tsc -b pnpm build:dev # Watch mode (incremental) pnpm test # Build + jest (all packages) diff --git a/README.md b/README.md index 5372698..230773e 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,11 @@ available from npm. Local sibling links are valid for integration testing but do not prove a frozen registry install and must not be committed as the final consumer dependency. +In the manifest workspace, `pnpm install --lockfile=false` automatically links +producer outputs that exist under the sibling sysio, Ethereum, and Solana build +directories. Remove those outputs when exercising the registry-only release +gate. + ## Examples | Example | Description | @@ -48,8 +53,8 @@ consumer dependency. # Install dependencies pnpm install -# Install with locally generated OPP models from wire-sysio -WIRE_LINK_LOCAL_OPP_MODELS=1 pnpm install --lockfile=false +# Install with available sibling producer outputs +pnpm install --lockfile=false # Build all packages pnpm build diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32fb95f..c216634 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-l5MT63RFu2+KTSHDSf/PtK5iN6T6YIAeV3ky+GtQlBk= +pnpmfileChecksum: sha256-uSx+WmIL/VwwGy+UhtMMAEPNy0OCCSd9SN1949okJSo= importers: From 2bb981db3462a87cdee8a0c6bd42f0723cc2592e Mon Sep 17 00:00:00 2001 From: joshglogau Date: Thu, 13 Aug 2026 12:21:44 -0400 Subject: [PATCH 30/48] fix(sdk-core): preserve root type resolution --- packages/sdk-core/README.md | 3 +++ packages/sdk-core/package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/sdk-core/README.md b/packages/sdk-core/README.md index 1016b50..05497a5 100644 --- a/packages/sdk-core/README.md +++ b/packages/sdk-core/README.md @@ -7,6 +7,9 @@ optional `created` timestamp. Available on npm: +Published type declarations support both package-root and subpath imports, +including consumers that still use TypeScript's classic Node resolution. + ## Multisig `contracts.sysio.msig` provides UI-neutral helpers for `sysio.msig` proposal workflows, including action builders, proposal reads, transaction decoding, hash verification, and legacy/chunked contract compatibility. diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index 7d88a39..a923cc6 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -32,6 +32,7 @@ }, "typesVersions": { "*": { + "lib/esm/*": ["lib/esm/*"], "*": ["lib/esm/*"] } }, From 5939c1d3db5701a01edca26ca30df0ea363afbe1 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 14 Aug 2026 15:12:56 -0400 Subject: [PATCH 31/48] build(sdk-outpost): consume published artifacts --- .github/workflows/ci.yaml | 3 +- .gitignore | 1 + .pnpmfile.cjs | 45 +++++++++-------------------- CLAUDE.md | 25 ++++++++++------ package.json | 2 +- packages/sdk-outpost/README.md | 20 +++++++------ packages/sdk-outpost/RELEASING.md | 47 +++++++++++++++++++------------ pnpm-lock.yaml | 18 +++++++++++- 8 files changed, 89 insertions(+), 72 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0264906..c25bbda 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,8 +33,7 @@ jobs: cache: pnpm - name: Install dependencies - # --frozen-lockfile removed for the moment - run: pnpm install --ignore-scripts --no-frozen-lockfile + run: pnpm install --ignore-scripts --frozen-lockfile - name: Test env: diff --git a/.gitignore b/.gitignore index c43a8bb..1890c88 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ yarn-error.log* # JUnit test-result output (CI artifact) /reports/ +/junit.xml # oh-my-claudecode runtime state (operational artifacts, never committed) .omc/ diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 803e3b7..10e25d0 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -1,12 +1,14 @@ // noinspection JSUnresolvedReference /** - * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. + * pnpm hook to resolve OPP model packages from a local wire-sysio build. * * Usage: - * 1. Build the wire-sysio and outpost producer outputs in the sibling repos. - * 2. Run `pnpm install --lockfile=false` to consume those local outputs. - * 3. Remove the sibling outputs to exercise registry-only release resolution. + * 1. Build the wire-sysio OPP model outputs in the sibling repo. + * 2. Run `WIRE_USE_LOCAL_OPP_MODELS=true pnpm install --lockfile=false`. + * + * Registry resolution is the default. Outpost artifact packages always resolve + * from their exact registry versions. * * Docs: https://pnpm.io/pnpmfile */ @@ -14,29 +16,8 @@ const Path = require("path") const Fs = require("node:fs") +const LOCAL_OPP_MODELS_ENABLED = "true" const localOppModelTargets = ["typescript", "solidity"] -const localOutpostArtifactPackages = [ - [ - "@wireio/outpost-ethereum-artifacts", - Path.resolve( - __dirname, - "..", - "wire-ethereum", - "build", - "sdk-artifacts" - ) - ], - [ - "@wireio/outpost-solana-artifacts", - Path.resolve( - __dirname, - "..", - "wire-solana", - "build", - "sdk-artifacts" - ) - ] -] /** * Checks whether a path exists and is a directory, without throwing. @@ -59,25 +40,25 @@ function isDirectory(dirPath) { const localOverrides = {} /** - * Appends every locally available source-owned producer package. + * Appends every locally available OPP model package. * - * Platform builds consume sibling outputs automatically after their producers - * run. Registry-only release verification runs without those sibling outputs. + * Platform builds may consume wire-sysio model output after its producer runs. */ -function appendLocalProducerOverrides() { +function appendLocalOppModelOverrides() { localOppModelTargets .map(target => [ `@wireio/opp-${target}-models`, Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) ]) - .concat(localOutpostArtifactPackages) .filter(([, path]) => isDirectory(path)) .forEach(([pkgName, path]) => { localOverrides[pkgName] = path }) } -appendLocalProducerOverrides() +if (process.env.WIRE_USE_LOCAL_OPP_MODELS === LOCAL_OPP_MODELS_ENABLED) { + appendLocalOppModelOverrides() +} /** * `readPackage` hook, which links locally available versions of diff --git a/CLAUDE.md b/CLAUDE.md index 7ba9866..bcac9e6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,8 +6,8 @@ ```bash pnpm install # Install registry deps (pnpm 10.34.5, Node >=22) -# Link available sibling producer outputs: -pnpm install --lockfile=false +# Link available sibling wire-sysio OPP model outputs: +WIRE_USE_LOCAL_OPP_MODELS=true pnpm install --lockfile=false pnpm build # Build all packages via tsc -b pnpm build:dev # Watch mode (incremental) pnpm test # Build + jest (all packages) @@ -194,12 +194,19 @@ Every new/modified symbol ships unit tests in the same change. Tests never assum ## CI/CD -GitHub Actions (`.github/workflows/publish-npm.yaml`): -- Triggers on push to `master` (skips if `[skip release]` in commit message) -- Bumps all packages patch version (`pnpm -r exec -- pnpm version patch`) -- Auto-commits `chore(release): bump patch [skip release]` -- Publishes all non-private packages to npm with provenance (`pnpm -r publish --access public --provenance`) -- Published package manifests must keep `repository.url` set to `https://github.com/Wire-Network/wire-libraries-ts` so npm provenance matches GitHub Actions source metadata. +GitHub Actions uses a two-gate release flow: +- `prepare-release.yaml` is manually dispatched with a bump type. It bumps each + package on its own version track and opens a release-preparation PR; it never + pushes directly to `master` or publishes. +- After that PR is reviewed and merged, `tag-release.yaml` is manually + dispatched and pauses for approval in the `release` environment. +- The approved job installs the workspace, builds and tests, publishes all + non-private packages in dependency order, creates the annotated tag, and + creates the GitHub release. +- `workspace:*` dependencies become concrete current workspace versions at + publish time. Published package manifests must keep `repository.url` set to + `https://github.com/Wire-Network/wire-libraries-ts` so npm provenance matches + GitHub Actions source metadata. ## Documentation Comments @@ -219,7 +226,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs and IDLs come from exact producer packages owned by `wire-ethereum` and `wire-solana`; until their first publication, local sibling artifacts are testing inputs only. Generated clients are ignored build outputs and must not be copied or edited here. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, and program binaries come from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never replace them with sibling artifact links. Generated clients are ignored build outputs and must not be copied or edited here. - `scripts/sdk-outpost/generate.mjs` must preserve literal Solana IDL account names in `LiqsolCore`; widening the generated type to base `Idl` erases precise `Program["account"]` members. - `scripts/sdk-outpost/generate.mjs --deployment-artifacts-path ` is a local integration mode for exact infra bundles. It must verify bundled ABI/IDL hashes and bind executable verification to the profile's exact implementation/ProgramData hashes. `verify:package` must reject this mode; release builds always regenerate from producer packages. - `packages/sdk-outpost` owns external reserve-swap instruction assembly, diff --git a/package.json b/package.json index 92c17f1..54a9c21 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", "test": "pnpm run build && jest --selectProjects shared shared-node shared-web @wireio/sdk-core wallet-browser-ext wallet-ext-sdk && pnpm --filter @wireio/sdk-outpost run test", - "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit", + "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --selectProjects shared shared-node shared-web @wireio/sdk-core wallet-browser-ext wallet-ext-sdk --reporters=default --reporters=jest-junit && pnpm --filter @wireio/sdk-outpost run test", "clean": "./scripts/clean.sh && pnpm -r run clean", "prepare": "husky" }, diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 93e9d18..5c6ef1a 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,11 +8,10 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Publication status as of August 10, 2026: the first npm release is pending. -`@wireio/sdk-outpost@0.0.0` is a workspace development version, and the exact -Ethereum and Solana producer artifact packages are also unpublished. Sibling -checkouts may be used for local integration testing, but they are not release -evidence. +Publication status as of August 14, 2026: the exact Ethereum and Solana producer +artifact packages are publicly available as `0.1.0`, while the first +`@wireio/sdk-outpost` npm release is pending. The workspace version remains +`0.0.0` until the repository-wide release workflow performs its patch bump. ### Local deployment-bundle generation @@ -33,15 +32,18 @@ to the profile's implementation-code and ProgramData hashes. It is for local integration only: `verify:package` rejects the result, while `verify:release` and `prepack` first regenerate canonical producer-package output. -## Install after the first release +## Install after the first SDK release ```sh npm install @wireio/sdk-outpost ``` -Before using the registry command, verify that both producer artifact versions -and `@wireio/sdk-outpost` resolve through `npm view`. Do not replace that check -with a committed machine-local link or a weakened frozen install. +Before using the registry command, verify that `@wireio/sdk-outpost` resolves +through `npm view`. The generator consumes exact registry versions of +[`@wireio/outpost-ethereum-artifacts`](https://www.npmjs.com/package/@wireio/outpost-ethereum-artifacts) +and +[`@wireio/outpost-solana-artifacts`](https://www.npmjs.com/package/@wireio/outpost-solana-artifacts); +do not replace them with committed machine-local links. Node.js 22 or newer is supported. The package publishes CommonJS and native ES module entrypoints with TypeScript declarations. diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index 0a10121..46ee53e 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -6,11 +6,11 @@ directory outside this process. ## Current first-release state -As of August 10, 2026, neither exact producer artifact package nor -`@wireio/sdk-outpost` is listed on npm. The producer branches may be tested as -siblings, but the SDK lockfile and frozen-install gate must remain blocked until -the real registry packages exist. Do not generate lockfile entries from local -paths or advertise the package as installable before the registry checks pass. +As of August 14, 2026, both exact producer artifact packages are public on npm +at `0.1.0`. The first `@wireio/sdk-outpost` release is still pending. Its +workspace version remains `0.0.0` until the existing repository-wide patch +workflow bumps and publishes it; do not create a one-off version or publish the +workspace directory manually. ## Artifact prerequisites @@ -27,10 +27,12 @@ endpoint rotation does not require either package to be republished; emit a new immutable deployment profile for a respin and update the separate endpoint catalog for mutable endpoints. -Before updating either dependency, verify its npm provenance, source revision, -artifact checksums, and immutable version. Keep both versions exact in -`packages/sdk-outpost/package.json` and update `pnpm-lock.yaml` through a frozen -pnpm-compatible install. +Before updating either dependency, verify its registry integrity/signature, +source revision, artifact checksums, and immutable version. The producer repos +are non-public, so their current npm releases do not carry public provenance. +Keep both versions exact in `packages/sdk-outpost/package.json`, update +`pnpm-lock.yaml` with the repository-pinned pnpm version, and then prove the +result with a frozen install. ## Release requirements @@ -71,20 +73,29 @@ not be published by `sdk-outpost`. ## First npm listing -The first successful publish creates the npm package page. Before merging: +The first successful publish creates the npm package page. Release sequence: -1. Confirm both exact producer artifact versions are publicly installable. +1. Confirm both exact `0.1.0` producer artifact versions are publicly + installable. 2. Confirm the `wireio` organization exists on npm and the release owner can publish public packages in that scope. 3. Confirm npm two-factor authentication is enabled for the release owner. 4. Confirm the GitHub repository secret `NPM_TOKEN` can publish to the `wireio` organization under its required authentication policy. -5. Merge the reviewed pull request into `master`. - -The `publish-npm.yaml` workflow installs the frozen workspace, generates clients -from the producer packages, builds and tests every package, verifies the public -entrypoints, increments the workspace patch versions, and publishes with npm -provenance. +5. Confirm the GitHub `release` environment exists with required reviewers; the + environment approval is the second release gate. +6. Merge the reviewed feature pull request into `master`. +7. Dispatch **Prepare Release** with the intended bump, approve its checks, and + merge the generated version-bump pull request. +8. Dispatch **Tag Release** and approve the `release` environment gate. + +The preparation gate keeps each package on its existing version track. A patch +bump therefore makes the first SDK release `@wireio/sdk-outpost@0.0.1`, while +`@wireio/sdk-core` advances by one patch on its independent track. `workspace:*` +is rewritten to that concrete `sdk-core` version in the published SDK manifest. +The Tag Release gate must install the frozen workspace, generate clients from +the producer packages, build and test every package, verify public entrypoints, +and publish with npm provenance. Do not create the first `sdk-outpost` version manually. A failed publish must be corrected in source and released as the next patch; published npm versions are @@ -99,7 +110,7 @@ npm view @wireio/sdk-outpost version dist-tags repository --json npm install @wireio/sdk-outpost ``` -Then configure npm trusted publishing for `publish-npm.yaml`. After a trusted +Then configure npm trusted publishing for `tag-release.yaml`. After a trusted publish succeeds, remove the long-lived write token from the publish step and restrict token-based publishing in npm package settings. Keep `id-token: write` so npm can generate provenance. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c216634..a20c8c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-uSx+WmIL/VwwGy+UhtMMAEPNy0OCCSd9SN1949okJSo= +pnpmfileChecksum: sha256-Gl0c7XVg8cIwDrX6fNVtOwqQlawXgg1Ges5mY3w2B98= importers: @@ -228,6 +228,12 @@ importers: '@typechain/ethers-v5': specifier: ^11.1.2 version: 11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2) + '@wireio/outpost-ethereum-artifacts': + specifier: 0.1.0 + version: 0.1.0 + '@wireio/outpost-solana-artifacts': + specifier: 0.1.0 + version: 0.1.0 prettier: specifier: 3.8.1 version: 3.8.1 @@ -1720,6 +1726,12 @@ packages: '@wireio/opp-typescript-models@1.0.30': resolution: {integrity: sha512-g6DSdq5KULRhp604sYkT0u+0TgjORoc+26FIUdepIeFJpEm9YlBKkJshXTUnDdUKz8fB6LUhW2NRQp/shIgrUg==} + '@wireio/outpost-ethereum-artifacts@0.1.0': + resolution: {integrity: sha512-q7QqsPErrDpW5Js+hKyHMwWackY9ut7F7fSf8DaiY1jB7ABT1bGgLGFzS7zqvnZz+lYCThy50adRkMmqq/EP0w==} + + '@wireio/outpost-solana-artifacts@0.1.0': + resolution: {integrity: sha512-mqS3wxZbG6BH3KC5Op8RW8yQr+SD/dPxFW8Qd7WHGpsx0Jvd9FeBz8Nkz3z2R0lEyNKCIfer33DZSiNLI/pS5w==} + '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -6263,6 +6275,10 @@ snapshots: dependencies: '@protobuf-ts/runtime': 2.11.1 + '@wireio/outpost-ethereum-artifacts@0.1.0': {} + + '@wireio/outpost-solana-artifacts@0.1.0': {} + '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} From 21b358b694aee66bafa6f701e2d8ff1f74a7448f Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 14 Aug 2026 15:17:05 -0400 Subject: [PATCH 32/48] ci(release): enforce frozen publish inputs --- .github/workflows/noop/publish-npm.yaml | 6 ------ .github/workflows/prepare-release.yaml | 4 ++-- .github/workflows/tag-release.yaml | 13 +++++++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/noop/publish-npm.yaml b/.github/workflows/noop/publish-npm.yaml index 82868dd..867927a 100644 --- a/.github/workflows/noop/publish-npm.yaml +++ b/.github/workflows/noop/publish-npm.yaml @@ -54,12 +54,6 @@ jobs: JEST_JUNIT_OUTPUT_NAME: jest-junit.xml run: pnpm run test:ci - - name: Verify sdk-outpost release - run: pnpm --dir packages/sdk-outpost run verify:release - - - name: Inspect sdk-outpost package - run: pnpm --dir packages/sdk-outpost pack --dry-run - - name: Upload test results (JUnit XML) if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml index 4aa07d1..823714d 100644 --- a/.github/workflows/prepare-release.yaml +++ b/.github/workflows/prepare-release.yaml @@ -110,8 +110,8 @@ jobs: channel="stable" fi - # Refresh the lockfile so it reflects the bumped versions (hygiene; - # CI installs with --no-frozen-lockfile, so it is not a hard gate). + # This gate deliberately changes package versions. Refresh the lockfile + # in the reviewed bump PR so CI and Tag Release can install it frozen. pnpm install --lockfile-only --ignore-scripts { diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 127a57f..7487b25 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -96,13 +96,18 @@ jobs: JEST_JUNIT_OUTPUT_DIR: reports/junit JEST_JUNIT_OUTPUT_NAME: jest-junit.xml run: | - # --no-frozen-lockfile to match ci.yaml / publish-npm.yaml: the OPP - # models are resolved via .pnpmfile.cjs, not locked, so a frozen install - # fails on the resulting lockfile drift. - pnpm install --ignore-scripts --no-frozen-lockfile + # Release inputs are registry-backed and fully represented in the + # reviewed lockfile. Refuse dependency drift at the publishing gate. + pnpm install --ignore-scripts --frozen-lockfile pnpm run build pnpm run test:ci + - name: Verify sdk-outpost release + run: pnpm --dir packages/sdk-outpost run verify:release + + - name: Inspect sdk-outpost package + run: pnpm --dir packages/sdk-outpost pack --dry-run + # npm is the irreversible step -- do it once the gate is green, BEFORE # tagging, so a failed publish leaves no dangling tag to trip the # "tag already exists" guard on the retry. From 6887c70f48900fce0a6f1511ed391fd13862103b Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 14 Aug 2026 15:57:11 -0400 Subject: [PATCH 33/48] chore(sdk-outpost): align package boundaries with platform rules --- .pnpmfile.cjs | 2 +- CLAUDE.md | 1 + etc/tsconfig/tsconfig.base.json | 3 ++ packages/sdk-core/README.md | 4 ++ packages/sdk-core/package.json | 8 ++++ packages/sdk-outpost/README.md | 5 +++ packages/sdk-outpost/package.json | 11 ++---- .../sdk-outpost/src/clients/OutpostClient.ts | 8 ++-- packages/sdk-outpost/src/clients/Types.ts | 18 +++++---- .../clients/ethereum/EthereumOutpostClient.ts | 4 +- .../sdk-outpost/src/clients/ethereum/index.ts | 1 - .../src/clients/solana/SolanaOutpostClient.ts | 4 +- .../sdk-outpost/src/clients/solana/index.ts | 1 - .../sdk-outpost/src/reserves/Validation.ts | 2 +- .../tests/clients/OutpostClient.test.ts | 16 +++++--- .../ethereum/EthereumOutpostClient.test.ts | 27 ++++++++++---- .../solana/SolanaOutpostClient.test.ts | 37 +++++++++++++------ pnpm-lock.yaml | 2 +- scripts/sdk-outpost/clean.mjs | 19 +++++++++- scripts/sdk-outpost/generate.mjs | 19 +++++++++- scripts/sdk-outpost/verify-package.mjs | 30 +++++++++++++-- 21 files changed, 162 insertions(+), 60 deletions(-) mode change 100644 => 100755 scripts/sdk-outpost/clean.mjs mode change 100644 => 100755 scripts/sdk-outpost/generate.mjs mode change 100644 => 100755 scripts/sdk-outpost/verify-package.mjs diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 10e25d0..75e7a33 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -17,7 +17,7 @@ const Path = require("path") const Fs = require("node:fs") const LOCAL_OPP_MODELS_ENABLED = "true" -const localOppModelTargets = ["typescript", "solidity"] +const localOppModelTargets = ["typescript"] /** * Checks whether a path exists and is a directory, without throwing. diff --git a/CLAUDE.md b/CLAUDE.md index bcac9e6..c6e44cb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -227,6 +227,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, and program binaries come from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never replace them with sibling artifact links. Generated clients are ignored build outputs and must not be copied or edited here. +- `OutpostClient.create` is sdk-outpost's only published client-construction facade. Concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. - `scripts/sdk-outpost/generate.mjs` must preserve literal Solana IDL account names in `LiqsolCore`; widening the generated type to base `Idl` erases precise `Program["account"]` members. - `scripts/sdk-outpost/generate.mjs --deployment-artifacts-path ` is a local integration mode for exact infra bundles. It must verify bundled ABI/IDL hashes and bind executable verification to the profile's exact implementation/ProgramData hashes. `verify:package` must reject this mode; release builds always regenerate from producer packages. - `packages/sdk-outpost` owns external reserve-swap instruction assembly, diff --git a/etc/tsconfig/tsconfig.base.json b/etc/tsconfig/tsconfig.base.json index a79aea6..d18a6b4 100755 --- a/etc/tsconfig/tsconfig.base.json +++ b/etc/tsconfig/tsconfig.base.json @@ -56,6 +56,9 @@ "@wireio/sdk-core": [ "./packages/sdk-core/src" ], + "@wireio/sdk-core/contracts/sysio/reserv/constants": [ + "./packages/sdk-core/src/contracts/sysio/reserv/Constants.ts" + ], "@wireio/sdk-core/*": [ "./packages/sdk-core/src/*" ], diff --git a/packages/sdk-core/README.md b/packages/sdk-core/README.md index 05497a5..f9a8620 100644 --- a/packages/sdk-core/README.md +++ b/packages/sdk-core/README.md @@ -112,6 +112,10 @@ chain/token and status filters, exact reserve lookup, WIRE-side activation, and read-only swap quotes. External-chain reserve creation and cancellation remain in the chain SDK that owns the deployed ABI or IDL. +External-chain SDKs that only need reserve validation bounds use the supported +`@wireio/sdk-core/contracts/sysio/reserv/constants` entrypoint without loading +the complete Wire client graph. + ```ts const reserves = new contracts.sysio.reserv.ReserveClient({ client: api }) const pending = await reserves.listReserves({ diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index a923cc6..9ccf352 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -24,6 +24,11 @@ "require": "./lib/cjs/index.js", "types": "./lib/esm/index.d.ts" }, + "./contracts/sysio/reserv/constants": { + "import": "./lib/esm/contracts/sysio/reserv/Constants.js", + "require": "./lib/cjs/contracts/sysio/reserv/Constants.js", + "types": "./lib/esm/contracts/sysio/reserv/Constants.d.ts" + }, "./*": { "import": "./lib/esm/*.js", "require": "./lib/cjs/*.js", @@ -32,6 +37,9 @@ }, "typesVersions": { "*": { + "contracts/sysio/reserv/constants": [ + "lib/esm/contracts/sysio/reserv/Constants.d.ts" + ], "lib/esm/*": ["lib/esm/*"], "*": ["lib/esm/*"] } diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 5c6ef1a..cad2274 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -66,6 +66,11 @@ Client creation verifies all four boundaries before returning: - every Solana program resolves through the upgradeable loader to the configured ProgramData account, exact ProgramData hash, and producer program binary. +`OutpostClient.create` is the single public construction facade. Its family +discriminator preserves the precise `EthereumOutpostClient` or +`SolanaOutpostClient` instance type without publishing separate chain-specific +factory entrypoints or internal module paths. + Local deployment-bundle builds replace the final producer-template/binary comparison with the bundle profile's exact full implementation-code and ProgramData hashes. Interface digests, chain identity, proxy/ProgramData diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 8b190a9..4c4544d 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -29,11 +29,6 @@ "import": "./lib/esm/index.js", "require": "./lib/cjs/index.js", "types": "./lib/esm/index.d.ts" - }, - "./*": { - "import": "./lib/esm/*.js", - "require": "./lib/cjs/*.js", - "types": "./lib/esm/*.d.ts" } }, "access": "public", @@ -41,13 +36,13 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w", - "clean": "zx ../../scripts/sdk-outpost/clean.mjs", - "generate": "zx ../../scripts/sdk-outpost/generate.mjs", + "clean": "../../scripts/sdk-outpost/clean.mjs", + "generate": "../../scripts/sdk-outpost/generate.mjs", "prepare:compile": "pnpm run clean && pnpm run generate", "build": "pnpm run prepare:compile && pnpm run compile && pnpm run fix:hybrid:exports", "test": "pnpm run generate && NODE_OPTIONS=--experimental-vm-modules jest", "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", - "verify:package": "zx ../../scripts/sdk-outpost/verify-package.mjs", + "verify:package": "../../scripts/sdk-outpost/verify-package.mjs", "verify:release": "pnpm run build && pnpm run verify:package", "prepack": "pnpm run verify:release" }, diff --git a/packages/sdk-outpost/src/clients/OutpostClient.ts b/packages/sdk-outpost/src/clients/OutpostClient.ts index 4282d3d..7dd360e 100644 --- a/packages/sdk-outpost/src/clients/OutpostClient.ts +++ b/packages/sdk-outpost/src/clients/OutpostClient.ts @@ -1,8 +1,8 @@ import { match } from "ts-pattern" import { OutpostChainFamily } from "../deployments/index.js" -import { EthereumOutpostClient } from "./ethereum/index.js" -import { SolanaOutpostClient } from "./solana/index.js" +import { EthereumOutpostClient } from "./ethereum/EthereumOutpostClient.js" +import { SolanaOutpostClient } from "./solana/SolanaOutpostClient.js" import { OutpostClientFor, OutpostClientInput } from "./Types.js" /** Cross-chain facade for creating a verified, family-specific outpost client. */ @@ -13,10 +13,10 @@ export namespace OutpostClient { ): Promise> { const client = await match(input as OutpostClientInput) .with({ family: OutpostChainFamily.ethereum }, ({ options }) => - EthereumOutpostClient.create(options) + EthereumOutpostClient.createEthereum(options) ) .with({ family: OutpostChainFamily.solana }, ({ options }) => - SolanaOutpostClient.create(options) + SolanaOutpostClient.createSolana(options) ) .exhaustive() diff --git a/packages/sdk-outpost/src/clients/Types.ts b/packages/sdk-outpost/src/clients/Types.ts index 6dbd60e..68713c3 100644 --- a/packages/sdk-outpost/src/clients/Types.ts +++ b/packages/sdk-outpost/src/clients/Types.ts @@ -1,13 +1,15 @@ -import type { - EthereumOutpostClient, - EthereumOutpostClientOptions -} from "./ethereum/index.js" -import type { - SolanaOutpostClient, - SolanaOutpostClientOptions -} from "./solana/index.js" +import type { EthereumOutpostClientOptions } from "./ethereum/index.js" +import type { EthereumOutpostClient as EthereumOutpostClientImplementation } from "./ethereum/EthereumOutpostClient.js" +import type { SolanaOutpostClientOptions } from "./solana/index.js" +import type { SolanaOutpostClient as SolanaOutpostClientImplementation } from "./solana/SolanaOutpostClient.js" import { OutpostChainFamily } from "../deployments/index.js" +/** Verified Ethereum outpost client instance returned by `OutpostClient.create`. */ +export type EthereumOutpostClient = EthereumOutpostClientImplementation + +/** Verified Solana outpost client instance returned by `OutpostClient.create`. */ +export type SolanaOutpostClient = SolanaOutpostClientImplementation + /** Request for an Ethereum outpost client. */ export interface EthereumOutpostClientInput { /** External-chain family discriminator. */ diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 59c6652..050c002 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -28,8 +28,8 @@ function resolveProvider( /** Strictly typed access to one verified Ethereum outpost deployment. */ export class EthereumOutpostClient { - /** Create a client after verifying its interface and exact live implementation. */ - static async create( + /** Create the Ethereum backend for the package-level outpost client facade. */ + static async createEthereum( options: EthereumOutpostClientOptions ): Promise { const { connection, profile } = options, diff --git a/packages/sdk-outpost/src/clients/ethereum/index.ts b/packages/sdk-outpost/src/clients/ethereum/index.ts index 7b4caa6..c3df2d2 100644 --- a/packages/sdk-outpost/src/clients/ethereum/index.ts +++ b/packages/sdk-outpost/src/clients/ethereum/index.ts @@ -1,4 +1,3 @@ export * from "./EthereumReserveSwapClient.js" export * from "./EthereumReserveClient.js" -export * from "./EthereumOutpostClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 010dc23..1a0034d 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -13,8 +13,8 @@ import { SolanaReserveSwapClient } from "./SolanaReserveSwapClient.js" /** Strictly typed access to one verified Solana outpost deployment. */ export class SolanaOutpostClient { - /** Create a client after verifying its interface and exact live program data. */ - static async create( + /** Create the Solana backend for the package-level outpost client facade. */ + static async createSolana( options: SolanaOutpostClientOptions ): Promise { const { profile, provider } = options diff --git a/packages/sdk-outpost/src/clients/solana/index.ts b/packages/sdk-outpost/src/clients/solana/index.ts index f3f3db7..3bd9d25 100644 --- a/packages/sdk-outpost/src/clients/solana/index.ts +++ b/packages/sdk-outpost/src/clients/solana/index.ts @@ -1,5 +1,4 @@ export * from "./SolanaReserveSwapClient.js" export * from "./SolanaReserveAddresses.js" export * from "./SolanaReserveClient.js" -export * from "./SolanaOutpostClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/reserves/Validation.ts b/packages/sdk-outpost/src/reserves/Validation.ts index 55bb2c8..1feb83f 100644 --- a/packages/sdk-outpost/src/reserves/Validation.ts +++ b/packages/sdk-outpost/src/reserves/Validation.ts @@ -3,7 +3,7 @@ import { BigNumber, utils as ethersUtils } from "ethers" import { MAX_CONNECTOR_WEIGHT_BPS, MIN_CONNECTOR_WEIGHT_BPS -} from "@wireio/sdk-core/contracts/sysio/reserv/Constants" +} from "@wireio/sdk-core/contracts/sysio/reserv/constants" import type { EthereumReserveCreateRequest, diff --git a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts index 6340cee..7c73b14 100644 --- a/packages/sdk-outpost/tests/clients/OutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/OutpostClient.test.ts @@ -1,8 +1,8 @@ import { - EthereumOutpostClient, OutpostChainFamily, OutpostClient, - SolanaOutpostClient + type EthereumOutpostClient, + type SolanaOutpostClient } from "@wireio/sdk-outpost" import { createEthereumProviderFixture, @@ -19,9 +19,11 @@ describe("OutpostClient", () => { profile, connection: createEthereumProviderFixture(profile) } - }) + }), + typedClient: EthereumOutpostClient = client - expect(client).toBeInstanceOf(EthereumOutpostClient) + expect(typedClient.profile).toBe(profile) + expect(typedClient.reserves).toBeDefined() }) it("preserves the precise Solana client type", async () => { @@ -32,8 +34,10 @@ describe("OutpostClient", () => { profile, provider: createSolanaProviderFixture(profile) } - }) + }), + typedClient: SolanaOutpostClient = client - expect(client).toBeInstanceOf(SolanaOutpostClient) + expect(typedClient.profile).toBe(profile) + expect(typedClient.reserves).toBeDefined() }) }) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 8f6a45a..babeaef 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -2,9 +2,12 @@ import { BigNumber, utils as ethersUtils, Wallet } from "ethers" import { EthereumContractName, - EthereumOutpostClient, EthereumReserveClient, EthereumReserveSwapClient, + OutpostChainFamily, + OutpostClient, + type EthereumOutpostClient, + type EthereumOutpostClientOptions, type ReserveSwapRequest } from "@wireio/sdk-outpost" import { @@ -13,6 +16,16 @@ import { createOutpostDeploymentProfileFixture } from "../../Fixtures.js" +/** Create the Ethereum client through the package's only public facade. */ +function createEthereumClient( + options: EthereumOutpostClientOptions +): Promise { + return OutpostClient.create({ + family: OutpostChainFamily.ethereum, + options + }) +} + describe("EthereumOutpostClient", () => { it("submits native reserve swaps with estimated gas headroom", async () => { const request: ReserveSwapRequest = { @@ -91,7 +104,7 @@ describe("EthereumOutpostClient", () => { it("verifies a profile and returns a generated contract type", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createEthereumProviderFixture(profile), - client = await EthereumOutpostClient.create({ + client = await createEthereumClient({ profile, connection: provider }), @@ -128,7 +141,7 @@ describe("EthereumOutpostClient", () => { }) await expect( - EthereumOutpostClient.create({ profile, connection: provider }) + createEthereumClient({ profile, connection: provider }) ).rejects.toThrow("Ethereum chain mismatch") }) @@ -138,7 +151,7 @@ describe("EthereumOutpostClient", () => { jest.spyOn(provider, "getCode").mockResolvedValue("0x") await expect( - EthereumOutpostClient.create({ profile, connection: provider }) + createEthereumClient({ profile, connection: provider }) ).rejects.toThrow("is not deployed") }) @@ -150,7 +163,7 @@ describe("EthereumOutpostClient", () => { .mockResolvedValue(ethersUtils.hexZeroPad("0x01", 32)) await expect( - EthereumOutpostClient.create({ profile, connection: provider }) + createEthereumClient({ profile, connection: provider }) ).rejects.toThrow("implementation mismatch") }) @@ -162,7 +175,7 @@ describe("EthereumOutpostClient", () => { ].implementationCodeSha256 = "f".repeat(64) await expect( - EthereumOutpostClient.create({ profile, connection: provider }) + createEthereumClient({ profile, connection: provider }) ).rejects.toThrow("implementation code mismatch") }) @@ -185,7 +198,7 @@ describe("EthereumOutpostClient", () => { ) await expect( - EthereumOutpostClient.create({ profile, connection: provider }) + createEthereumClient({ profile, connection: provider }) ).rejects.toThrow("artifact runtime") }) }) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index df135bb..36529bf 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -2,12 +2,15 @@ import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js" import { utils as ethersUtils } from "ethers" import { + OutpostChainFamily, + OutpostClient, type ReserveSwapRequest, - SolanaOutpostClient, SolanaProgramName, SolanaReserveClient, SolanaReserveSwapClient, - SolanaUpgradeableLoaderProgramId + SolanaUpgradeableLoaderProgramId, + type SolanaOutpostClient, + type SolanaOutpostClientOptions } from "@wireio/sdk-outpost" import { createOutpostDeploymentProfileFixture, @@ -20,6 +23,16 @@ const WrongProgramDataAddress = "SysvarRent111111111111111111111111111111111" const SubmittedSignature = "3".repeat(64) const SolanaProgramDataMetadataByteLength = 45 +/** Create the Solana client through the package's only public facade. */ +function createSolanaClient( + options: SolanaOutpostClientOptions +): Promise { + return OutpostClient.create({ + family: OutpostChainFamily.solana, + options + }) +} + const reserveSwapRequest: ReserveSwapRequest = { sourceTokenCode: 1, sourceReserveCode: 2, @@ -42,7 +55,7 @@ describe("SolanaOutpostClient", () => { it("verifies a profile and returns its runtime program address", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createSolanaProviderFixture(profile), - client = await SolanaOutpostClient.create({ profile, provider }), + client = await createSolanaClient({ profile, provider }), program = client.program(SolanaProgramName.liqsolCore) expect(program.programId.toBase58()).toBe( @@ -66,7 +79,7 @@ describe("SolanaOutpostClient", () => { it("derives native reserve accounts from the deployed program seeds", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createSolanaProviderFixture(profile), - client = await SolanaOutpostClient.create({ profile, provider }), + client = await createSolanaClient({ profile, provider }), instruction = await client.swaps.createNativeInstruction( reserveSwapRequest ), @@ -88,7 +101,7 @@ describe("SolanaOutpostClient", () => { it("derives SPL reserve vaults from the deployed program seeds", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createSolanaProviderFixture(profile), - client = await SolanaOutpostClient.create({ profile, provider }), + client = await createSolanaClient({ profile, provider }), instruction = await client.swaps.createSplInstruction({ ...reserveSwapRequest, mint: Keypair.generate().publicKey @@ -111,7 +124,7 @@ describe("SolanaOutpostClient", () => { it("polls a submitted reserve swap until Solana confirms it", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createSolanaProviderFixture(profile), - client = await SolanaOutpostClient.create({ profile, provider }), + client = await createSolanaClient({ profile, provider }), instruction = SystemProgram.transfer({ fromPubkey: provider.wallet.publicKey, toPubkey: provider.wallet.publicKey, @@ -141,7 +154,7 @@ describe("SolanaOutpostClient", () => { it("reports an explicit on-chain reserve swap failure", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createSolanaProviderFixture(profile), - client = await SolanaOutpostClient.create({ profile, provider }), + client = await createSolanaClient({ profile, provider }), instruction = SystemProgram.transfer({ fromPubkey: provider.wallet.publicKey, toPubkey: provider.wallet.publicKey, @@ -172,7 +185,7 @@ describe("SolanaOutpostClient", () => { .mockResolvedValue("9".repeat(32)) await expect( - SolanaOutpostClient.create({ profile, provider }) + createSolanaClient({ profile, provider }) ).rejects.toThrow("Solana genesis mismatch") }) @@ -182,7 +195,7 @@ describe("SolanaOutpostClient", () => { jest.spyOn(provider.connection, "getAccountInfo").mockResolvedValue(null) await expect( - SolanaOutpostClient.create({ profile, provider }) + createSolanaClient({ profile, provider }) ).rejects.toThrow("is not executable") }) @@ -198,7 +211,7 @@ describe("SolanaOutpostClient", () => { }) await expect( - SolanaOutpostClient.create({ profile, provider }) + createSolanaClient({ profile, provider }) ).rejects.toThrow("ProgramData mismatch") }) @@ -228,7 +241,7 @@ describe("SolanaOutpostClient", () => { ) await expect( - SolanaOutpostClient.create({ profile, provider }) + createSolanaClient({ profile, provider }) ).rejects.toThrow("ProgramData mismatch") }) @@ -262,7 +275,7 @@ describe("SolanaOutpostClient", () => { ) await expect( - SolanaOutpostClient.create({ profile, provider }) + createSolanaClient({ profile, provider }) ).rejects.toThrow("artifact program mismatch") }) }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a20c8c7..c4395f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-Gl0c7XVg8cIwDrX6fNVtOwqQlawXgg1Ges5mY3w2B98= +pnpmfileChecksum: sha256-wf2UTl5Xse1huyLJq/7F4GeoQKmg339nWnP5uif4Tp0= importers: diff --git a/scripts/sdk-outpost/clean.mjs b/scripts/sdk-outpost/clean.mjs old mode 100644 new mode 100755 index 8129996..48a392e --- a/scripts/sdk-outpost/clean.mjs +++ b/scripts/sdk-outpost/clean.mjs @@ -1,8 +1,23 @@ -#!/usr/bin/env zx +#!/usr/bin/env node + +/** + * Remove compiled sdk-outpost package outputs. + * + * Usage: + * ./scripts/sdk-outpost/clean.mjs + * + * Options: + * None. + * + * Examples: + * ./scripts/sdk-outpost/clean.mjs + * + * Exit codes: + * 0 on success; nonzero when an output cannot be removed. + */ import { fs, path } from "zx" import { PackagePath } from "./config.mjs" -/** Remove compiled sdk-outpost package outputs. */ await fs.rm(path.join(PackagePath, "lib"), { force: true, recursive: true }) diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs old mode 100644 new mode 100755 index 9b08a86..0badf1f --- a/scripts/sdk-outpost/generate.mjs +++ b/scripts/sdk-outpost/generate.mjs @@ -1,4 +1,21 @@ -#!/usr/bin/env zx +#!/usr/bin/env node + +/** + * Generate sdk-outpost clients and manifests from canonical producer artifacts. + * + * Usage: + * ./scripts/sdk-outpost/generate.mjs [options] + * + * Options: + * --deployment-artifacts-path Generate a local-only build from an exact deployment directory or tarball. + * + * Examples: + * ./scripts/sdk-outpost/generate.mjs + * ./scripts/sdk-outpost/generate.mjs --deployment-artifacts-path /path/to/sim2-artifacts.tar.gz + * + * Exit codes: + * 0 on success; nonzero when artifact validation or generation fails. + */ import Crypto from "node:crypto" import Os from "node:os" diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs old mode 100644 new mode 100755 index 2dd9325..77c08f6 --- a/scripts/sdk-outpost/verify-package.mjs +++ b/scripts/sdk-outpost/verify-package.mjs @@ -1,4 +1,20 @@ -#!/usr/bin/env zx +#!/usr/bin/env node + +/** + * Verify sdk-outpost's publishable files and CommonJS/ESM entrypoints. + * + * Usage: + * ./scripts/sdk-outpost/verify-package.mjs + * + * Options: + * None. + * + * Examples: + * ./scripts/sdk-outpost/verify-package.mjs + * + * Exit codes: + * 0 when the package is publishable; nonzero when an invariant fails. + */ import { createRequire } from "node:module" import { pathToFileURL } from "node:url" @@ -11,13 +27,12 @@ const packageJson = await readJson(path.join(PackagePath, "package.json")), readme = await fs.readFile(path.join(PackagePath, "README.md"), "utf8"), ExpectedRepository = "https://github.com/Wire-Network/wire-libraries-ts", ExpectedPublishedFiles = ["lib/cjs", "lib/esm", "README.md"], + InternalExports = ["EthereumOutpostClient", "SolanaOutpostClient"], ExpectedExports = [ - "EthereumOutpostClient", "EthereumReserveClient", "OutpostArtifactManifests", "OutpostClient", "OutpostDeploymentVerifier", - "SolanaOutpostClient", "SolanaReserveClient", "assertOutpostArtifactCompatibility", "parseOutpostDeploymentProfile" @@ -41,6 +56,10 @@ assert( packageJson.license === "FSL-1.1-Apache-2.0", "Package license is missing" ) +assert( + JSON.stringify(Object.keys(packageJson.exports)) === JSON.stringify(["."]), + "Only the package-root entrypoint may be published" +) assert( JSON.stringify(packageJson.files) === JSON.stringify(ExpectedPublishedFiles), "Published files must stay limited to built outputs and README" @@ -90,6 +109,11 @@ ExpectedExports.forEach(name => { assert(name in cjs, `CommonJS entrypoint is missing ${name}`) assert(name in esm, `ES module entrypoint is missing ${name}`) }) + +InternalExports.forEach(name => { + assert(!(name in cjs), `CommonJS entrypoint exposes internal ${name}`) + assert(!(name in esm), `ES module entrypoint exposes internal ${name}`) +}) assert( cjs.OutpostArtifactManifests.mode === cjs.OutpostArtifactMode.sourcePackage && esm.OutpostArtifactManifests.mode === esm.OutpostArtifactMode.sourcePackage, From 8a3111f44217c378fbef0011ba6b17f5be9da74a Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 14 Aug 2026 16:27:27 -0400 Subject: [PATCH 34/48] refactor(sdk-outpost): use npm artifacts exclusively --- CLAUDE.md | 7 +- README.md | 27 +- jest.config.ts | 1 - package.json | 4 +- packages/sdk-core/package.json | 4 +- packages/sdk-outpost/README.md | 27 -- packages/sdk-outpost/RELEASING.md | 3 - .../src/artifacts/Compatibility.ts | 117 ++--- packages/sdk-outpost/src/artifacts/Mode.ts | 7 - packages/sdk-outpost/src/artifacts/index.ts | 1 - .../tests/assets/Artifacts.test.ts | 86 ---- scripts/sdk-outpost/generate.mjs | 426 ++++-------------- scripts/sdk-outpost/verify-package.mjs | 5 - 13 files changed, 124 insertions(+), 591 deletions(-) delete mode 100644 packages/sdk-outpost/src/artifacts/Mode.ts diff --git a/CLAUDE.md b/CLAUDE.md index c6e44cb..036e4ae 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -228,12 +228,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, and program binaries come from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never replace them with sibling artifact links. Generated clients are ignored build outputs and must not be copied or edited here. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. Concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. -- `scripts/sdk-outpost/generate.mjs` must preserve literal Solana IDL account names in `LiqsolCore`; widening the generated type to base `Idl` erases precise `Program["account"]` members. -- `scripts/sdk-outpost/generate.mjs --deployment-artifacts-path ` is a local integration mode for exact infra bundles. It must verify bundled ABI/IDL hashes and bind executable verification to the profile's exact implementation/ProgramData hashes. `verify:package` must reject this mode; release builds always regenerate from producer packages. -- `packages/sdk-outpost` owns external reserve-swap instruction assembly, - allowance handling, source submission, balance reads, and canonical - `sourceRequestId` extraction. Staking remains outside this package until its - dedicated migration. +- `packages/sdk-outpost` owns external reserve lifecycle and swap execution. Staking remains outside this package until its dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. diff --git a/README.md b/README.md index 230773e..8d3e98f 100644 --- a/README.md +++ b/README.md @@ -14,27 +14,9 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi | [`@wireio/wallet-ext-sdk`](packages/wallet-ext-sdk/) | Client SDK for the Wire Wallet browser extension | [![npm](https://img.shields.io/npm/v/@wireio/wallet-ext-sdk)](https://www.npmjs.com/package/@wireio/wallet-ext-sdk) | | [`@wireio/wallet-browser-ext`](packages/wallet-browser-ext/) | Chrome extension developer wallet for Wire | *private* | -The `sdk-outpost` generator preserves the source Solana IDL's literal account -names, so Anchor consumers retain precise `Program["account"]` -members after regeneration. Generated clients remain build outputs and must not -be edited by hand. - -For local cluster integration, the same generator accepts an infra deployment -artifact directory or tarball through `--deployment-artifacts-path`. That mode -compiles the bundle's exact ABI/IDL and binds runtime verification to its exact -implementation and ProgramData hashes. It is deliberately rejected by the -package release verifier; published builds always regenerate from canonical -producer packages. - -`@wireio/sdk-outpost` and its two producer artifact packages are not yet -available from npm. Local sibling links are valid for integration testing but -do not prove a frozen registry install and must not be committed as the final -consumer dependency. - -In the manifest workspace, `pnpm install --lockfile=false` automatically links -producer outputs that exist under the sibling sysio, Ethereum, and Solana build -directories. Remove those outputs when exercising the registry-only release -gate. +The sdk-outpost build consumes exact published versions of the Ethereum and +Solana artifact packages. Generated TypeChain and Anchor clients are ignored +build outputs and must not be edited or committed. ## Examples @@ -53,9 +35,6 @@ gate. # Install dependencies pnpm install -# Install with available sibling producer outputs -pnpm install --lockfile=false - # Build all packages pnpm build diff --git a/jest.config.ts b/jest.config.ts index 69d99f0..0679654 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -6,7 +6,6 @@ const config: Config = { "packages/shared-node", "packages/shared-web", "packages/sdk-core", - "packages/sdk-outpost", "packages/wallet-browser-ext", "packages/wallet-ext-sdk" ] diff --git a/package.json b/package.json index 54a9c21..39c4e42 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", - "test": "pnpm run build && jest --selectProjects shared shared-node shared-web @wireio/sdk-core wallet-browser-ext wallet-ext-sdk && pnpm --filter @wireio/sdk-outpost run test", - "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --selectProjects shared shared-node shared-web @wireio/sdk-core wallet-browser-ext wallet-ext-sdk --reporters=default --reporters=jest-junit && pnpm --filter @wireio/sdk-outpost run test", + "test": "pnpm run build && jest && pnpm --filter @wireio/sdk-outpost run test", + "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit && pnpm --filter @wireio/sdk-outpost run test", "clean": "./scripts/clean.sh && pnpm -r run clean", "prepare": "husky" }, diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index 9ccf352..cea85ee 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -39,9 +39,7 @@ "*": { "contracts/sysio/reserv/constants": [ "lib/esm/contracts/sysio/reserv/Constants.d.ts" - ], - "lib/esm/*": ["lib/esm/*"], - "*": ["lib/esm/*"] + ] } }, "access": "public", diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index cad2274..c1f3ff8 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -13,25 +13,6 @@ artifact packages are publicly available as `0.1.0`, while the first `@wireio/sdk-outpost` npm release is pending. The workspace version remains `0.0.0` until the repository-wide release workflow performs its patch bump. -### Local deployment-bundle generation - -When a cluster deployment predates the current producer packages, generate a -local-only SDK directly from the exact infra artifact directory or tarball: - -```sh -pnpm --dir packages/sdk-outpost run clean -pnpm --dir packages/sdk-outpost run generate -- \ - --deployment-artifacts-path /path/to/sim2-artifacts.tar.gz -pnpm --dir packages/sdk-outpost run compile -pnpm --dir packages/sdk-outpost run fix:hybrid:exports -``` - -This mode verifies every bundled ABI and IDL against the deployment profile, -generates the exact TypeChain/Anchor clients, and binds live executable checks -to the profile's implementation-code and ProgramData hashes. It is for local -integration only: `verify:package` rejects the result, while `verify:release` -and `prepack` first regenerate canonical producer-package output. - ## Install after the first SDK release ```sh @@ -71,11 +52,6 @@ discriminator preserves the precise `EthereumOutpostClient` or `SolanaOutpostClient` instance type without publishing separate chain-specific factory entrypoints or internal module paths. -Local deployment-bundle builds replace the final producer-template/binary -comparison with the bundle profile's exact full implementation-code and -ProgramData hashes. Interface digests, chain identity, proxy/ProgramData -addresses, and exact live hashes remain mandatory. - These checks prove deployment compatibility, not end-to-end feature readiness. Applications must still gate swaps, staking, settlement, retry, funding, and underwriting using platform capability evidence. @@ -276,9 +252,6 @@ pnpm --dir packages/sdk-outpost run verify:release pnpm --dir packages/sdk-outpost pack --dry-run ``` -The release commands always use ordinary producer-package generation. Never -publish or pack output generated with `--deployment-artifacts-path`. - Release versions are managed by the monorepo-wide patch workflow. See [`RELEASING.md`](RELEASING.md) for artifact prerequisites and the verification checklist. diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index 46ee53e..f854628 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -40,9 +40,6 @@ result with a frozen install. - Keep the lockfile unchanged after a frozen install. - Generate clients only through `scripts/sdk-outpost/generate.mjs`; never edit generated TypeChain, Anchor, or artifact-manifest sources by hand. -- Do not release output generated with `--deployment-artifacts-path`. That mode - is limited to exact local integration bundles and the package verifier must - reject it. - Confirm the package contains no secrets, RPC credentials, private keys, deployment addresses, or mutable environment configuration. - Confirm deployment profiles are distributed through the authenticated diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index 772bb97..eff24fb 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -8,7 +8,6 @@ import { SolanaProgramName } from "../deployments/index.js" import { OutpostArtifactManifests } from "./generated/index.js" -import { OutpostArtifactMode } from "./Mode.js" const SolanaProgramDataMetadataByteLength = 45 @@ -54,36 +53,23 @@ export function assertEthereumRuntimeArtifactCompatibility( contractName: EthereumContractName, code: string ): void { - const artifact = OutpostArtifactManifests.ethereum.contracts[contractName] - - match(OutpostArtifactManifests.mode) - .with(OutpostArtifactMode.sourcePackage, () => { - const normalizedCode = normalizeEthereumRuntimeCode( - code, - artifact.runtimeLinkReferences - ) + const artifact = OutpostArtifactManifests.ethereum.contracts[contractName], + normalizedCode = normalizeEthereumRuntimeCode( + code, + artifact.runtimeLinkReferences + ) - if (normalizedCode.length !== artifact.runtimeBytecodeLength) { - throw new Error( - `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` - ) - } - const digest = sha256(normalizedCode) - if (digest !== artifact.runtimeBytecodeSha256) { - throw new Error( - `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` - ) - } - }) - .with(OutpostArtifactMode.deploymentBundle, () => { - const digest = sha256(ethersUtils.arrayify(code)) - if (digest !== artifact.implementationCodeSha256) { - throw new Error( - `Ethereum ${contractName} deployment runtime mismatch: expected ${artifact.implementationCodeSha256}, received ${digest}` - ) - } - }) - .exhaustive() + if (normalizedCode.length !== artifact.runtimeBytecodeLength) { + throw new Error( + `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` + ) + } + const digest = sha256(normalizedCode) + if (digest !== artifact.runtimeBytecodeSha256) { + throw new Error( + `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` + ) + } } /** Verify live Solana executable bytes against the source-owned program binary. */ @@ -91,39 +77,26 @@ export function assertSolanaProgramArtifactCompatibility( programName: SolanaProgramName, programData: Uint8Array ): void { - const artifact = OutpostArtifactManifests.solana.programs[programName] - - match(OutpostArtifactManifests.mode) - .with(OutpostArtifactMode.sourcePackage, () => { - const programBinaryEnd = - SolanaProgramDataMetadataByteLength + artifact.programBinaryLength + const artifact = OutpostArtifactManifests.solana.programs[programName], + programBinaryEnd = + SolanaProgramDataMetadataByteLength + artifact.programBinaryLength - if (programData.length < programBinaryEnd) { - throw new Error( - `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` - ) - } - const digest = sha256( - programData.subarray( - SolanaProgramDataMetadataByteLength, - programBinaryEnd - ) - ) - if (digest !== artifact.programBinarySha256) { - throw new Error( - `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` - ) - } - }) - .with(OutpostArtifactMode.deploymentBundle, () => { - const digest = sha256(programData) - if (digest !== artifact.programDataSha256) { - throw new Error( - `Solana ${programName} deployment ProgramData mismatch: expected ${artifact.programDataSha256}, received ${digest}` - ) - } - }) - .exhaustive() + if (programData.length < programBinaryEnd) { + throw new Error( + `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` + ) + } + const digest = sha256( + programData.subarray( + SolanaProgramDataMetadataByteLength, + programBinaryEnd + ) + ) + if (digest !== artifact.programBinarySha256) { + throw new Error( + `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` + ) + } } /** Assert that one profile digest matches the interface compiled into the SDK. */ @@ -152,16 +125,6 @@ export function assertOutpostArtifactCompatibility( OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, `Ethereum ${contractName} ABI` ) - if ( - OutpostArtifactManifests.mode === OutpostArtifactMode.deploymentBundle - ) { - assertInterfaceDigest( - profile.ethereum.contracts[contractName].implementationCodeSha256, - OutpostArtifactManifests.ethereum.contracts[contractName] - .implementationCodeSha256, - `Ethereum ${contractName} deployment runtime` - ) - } }) }) .with(OutpostChainFamily.solana, () => { @@ -171,16 +134,6 @@ export function assertOutpostArtifactCompatibility( OutpostArtifactManifests.solana.programs[programName].idlSha256, `Solana ${programName} IDL` ) - if ( - OutpostArtifactManifests.mode === OutpostArtifactMode.deploymentBundle - ) { - assertInterfaceDigest( - profile.solana.programs[programName].programDataSha256, - OutpostArtifactManifests.solana.programs[programName] - .programDataSha256, - `Solana ${programName} deployment ProgramData` - ) - } }) }) .exhaustive() diff --git a/packages/sdk-outpost/src/artifacts/Mode.ts b/packages/sdk-outpost/src/artifacts/Mode.ts deleted file mode 100644 index d5ba972..0000000 --- a/packages/sdk-outpost/src/artifacts/Mode.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Build-time origin of the executable interfaces compiled into sdk-outpost. */ -export enum OutpostArtifactMode { - /** Publishable SDK generated from canonical producer artifact packages. */ - sourcePackage = "sourcePackage", - /** Local-only SDK generated from one exact deployment artifact bundle. */ - deploymentBundle = "deploymentBundle" -} diff --git a/packages/sdk-outpost/src/artifacts/index.ts b/packages/sdk-outpost/src/artifacts/index.ts index 9ffad2f..24b24c3 100644 --- a/packages/sdk-outpost/src/artifacts/index.ts +++ b/packages/sdk-outpost/src/artifacts/index.ts @@ -1,3 +1,2 @@ export * from "./Compatibility.js" -export * from "./Mode.js" export * from "./generated/index.js" diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index 3e58c51..ec423ab 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -1,32 +1,22 @@ import type { Program } from "@coral-xyz/anchor" -import { utils as ethersUtils } from "ethers" import { EthereumContractName, OPP__factory, OperatorRegistry__factory, - OutpostArtifactMode, OutpostArtifactManifests, OutpostChainFamily, ReserveManager__factory, SolanaProgramName, type LiqsolCore, - assertEthereumRuntimeArtifactCompatibility, assertOutpostArtifactCompatibility, - assertSolanaProgramArtifactCompatibility, liqsolCoreIdl } from "@wireio/sdk-outpost" import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" describe("source-owned outpost artifacts", () => { - afterEach(() => jest.restoreAllMocks()) - it("records exact producer package identity", () => { - expect(OutpostArtifactManifests.mode).toBe( - OutpostArtifactMode.sourcePackage - ) - expect(OutpostArtifactManifests.deploymentProfileId).toBe("") expect(OutpostArtifactManifests.ethereum.package.name).toBe( "@wireio/outpost-ethereum-artifacts" ) @@ -67,82 +57,6 @@ describe("source-owned outpost artifacts", () => { ).toThrow("Solana liqsolCore IDL interface mismatch") }) - it("binds deployment-bundle compatibility to exact deployment hashes", () => { - const profile = createOutpostDeploymentProfileFixture() - jest.replaceProperty( - OutpostArtifactManifests, - "mode", - OutpostArtifactMode.deploymentBundle - ) - Object.values(EthereumContractName).forEach(contractName => - jest.replaceProperty( - OutpostArtifactManifests.ethereum.contracts[contractName], - "implementationCodeSha256", - profile.ethereum.contracts[contractName].implementationCodeSha256 - ) - ) - jest.replaceProperty( - OutpostArtifactManifests.solana.programs[SolanaProgramName.liqsolCore], - "programDataSha256", - profile.solana.programs[SolanaProgramName.liqsolCore].programDataSha256 - ) - - expect(() => - assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) - ).not.toThrow() - expect(() => - assertOutpostArtifactCompatibility(profile, OutpostChainFamily.solana) - ).not.toThrow() - - profile.ethereum.contracts[ - EthereumContractName.ReserveManager - ].implementationCodeSha256 = "f".repeat(64) - expect(() => - assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) - ).toThrow("Ethereum ReserveManager deployment runtime interface mismatch") - }) - - it("verifies exact deployment-bundle executable hashes", () => { - const ethereumCode = "0x1234", - solanaProgramData = Uint8Array.from([1, 2, 3]) - jest.replaceProperty( - OutpostArtifactManifests, - "mode", - OutpostArtifactMode.deploymentBundle - ) - jest.replaceProperty( - OutpostArtifactManifests.ethereum.contracts[ - EthereumContractName.ReserveManager - ], - "implementationCodeSha256", - ethersUtils.sha256(ethereumCode).slice(2) - ) - jest.replaceProperty( - OutpostArtifactManifests.solana.programs[SolanaProgramName.liqsolCore], - "programDataSha256", - ethersUtils.sha256(solanaProgramData).slice(2) - ) - - expect(() => - assertEthereumRuntimeArtifactCompatibility( - EthereumContractName.ReserveManager, - ethereumCode - ) - ).not.toThrow() - expect(() => - assertSolanaProgramArtifactCompatibility( - SolanaProgramName.liqsolCore, - solanaProgramData - ) - ).not.toThrow() - expect(() => - assertEthereumRuntimeArtifactCompatibility( - EthereumContractName.ReserveManager, - "0x5678" - ) - ).toThrow("Ethereum ReserveManager deployment runtime mismatch") - }) - it("generates the callable swap and collateral surfaces", () => { const accountNames: Array["account"]> = [ "outpostConfig", diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs index 0badf1f..d9b9f61 100755 --- a/scripts/sdk-outpost/generate.mjs +++ b/scripts/sdk-outpost/generate.mjs @@ -4,25 +4,23 @@ * Generate sdk-outpost clients and manifests from canonical producer artifacts. * * Usage: - * ./scripts/sdk-outpost/generate.mjs [options] + * ./scripts/sdk-outpost/generate.mjs * * Options: - * --deployment-artifacts-path Generate a local-only build from an exact deployment directory or tarball. + * None. * * Examples: * ./scripts/sdk-outpost/generate.mjs - * ./scripts/sdk-outpost/generate.mjs --deployment-artifacts-path /path/to/sim2-artifacts.tar.gz * * Exit codes: * 0 on success; nonzero when artifact validation or generation fails. */ import Crypto from "node:crypto" -import Os from "node:os" import { createRequire } from "node:module" import { format } from "prettier" -import { $, argv, fs, path } from "zx" +import { $, fs, path } from "zx" import { EthereumArtifactPackageName, @@ -48,22 +46,14 @@ const PackageRequire = createRequire(PackageManifestPath), ], SolanaProgramName = "liqsolCore", TypechainPath = path.join(PackagePath, "node_modules/.bin/typechain"), - DeploymentProfileFilename = "outpost-deployment-profile.json", - ClusterManifestFilename = "cluster-manifest.json", - DeploymentBundleDirectoryName = "sim2-artifacts", - DeploymentArtifactsPath = argv["deployment-artifacts-path"], - DevelopmentPackageVersion = "0.0.0-development", - EmptyArtifactPath = "", - EmptyArtifactDigest = "", - EmptyArtifactLength = 0, - Sha256Pattern = /^[0-9a-f]{64}$/, EmptyRuntimeLinkReferencesJson = '"runtimeLinkReferences": []', TypedEmptyRuntimeLinkReferencesSource = - '"runtimeLinkReferences": [] as never[]', - ArtifactMode = { - sourcePackage: "sourcePackage", - deploymentBundle: "deploymentBundle" - } + '"runtimeLinkReferences": [] as never[]' + +assert( + process.argv.length === 2, + "sdk-outpost generation does not accept command-line options" +) /** Resolve one exported file from a source-owned artifact package. */ function resolveArtifact(packageName, artifactPath) { @@ -85,14 +75,6 @@ function assertArtifactDigest(actual, expected, label) { assert(actual === expected, `${label} checksum mismatch`) } -/** Verify that a deployment profile contains one lowercase SHA-256 digest. */ -function assertSha256(value, label) { - assert( - typeof value === "string" && Sha256Pattern.test(value), - `${label} must be a lowercase SHA-256 digest` - ) -} - /** Format generated TypeScript according to repository rules. */ async function formatTypescript(source) { return format(source, { @@ -103,34 +85,8 @@ async function formatTypescript(source) { }) } -/** Add deployment-only hash slots to one canonical Ethereum manifest. */ -function createSourceEthereumManifest(manifest) { - return { - ...manifest, - contracts: Object.fromEntries( - Object.entries(manifest.contracts).map(([name, contract]) => [ - name, - { ...contract, implementationCodeSha256: EmptyArtifactDigest } - ]) - ) - } -} - -/** Add deployment-only hash slots to one canonical Solana manifest. */ -function createSourceSolanaManifest(manifest) { - return { - ...manifest, - programs: Object.fromEntries( - Object.entries(manifest.programs).map(([name, program]) => [ - name, - { ...program, programDataSha256: EmptyArtifactDigest } - ]) - ) - } -} - /** Resolve and verify the canonical producer-package generation inputs. */ -async function resolveSourceGenerationInput() { +async function resolveGenerationInput() { const EthereumManifestPath = PackageRequire.resolve( `${EthereumArtifactPackageName}/manifest.json` ), @@ -232,309 +188,91 @@ async function resolveSourceGenerationInput() { ) return { - mode: ArtifactMode.sourcePackage, - deploymentProfileId: EmptyArtifactDigest, - ethereumManifest: createSourceEthereumManifest(ethereumManifest), - solanaManifest: createSourceSolanaManifest(solanaManifest), + ethereumManifest, + solanaManifest, ethereumAbiPaths, - solanaIdlPath, - cleanupPath: null - } -} - -/** Locate an extracted deployment bundle beneath one candidate directory. */ -function findDeploymentBundleRoot(candidatePath) { - return [ - candidatePath, - path.join(candidatePath, DeploymentBundleDirectoryName) - ].find(bundlePath => - fs.existsSync(path.join(bundlePath, DeploymentProfileFilename)) - ) -} - -/** Resolve a deployment directory or extract a supplied tar.gz archive. */ -async function resolveDeploymentBundleRoot(inputPath) { - const resolvedPath = path.resolve(String(inputPath)), - inputStat = await fs.stat(resolvedPath) - - if (inputStat.isDirectory()) { - const bundlePath = findDeploymentBundleRoot(resolvedPath) - assert( - bundlePath != null, - `Deployment bundle is missing beneath ${resolvedPath}` - ) - return { bundlePath, cleanupPath: null } - } - - const cleanupPath = await fs.mkdtemp( - path.join(Os.tmpdir(), "wire-sdk-outpost-deployment-") - ) - try { - await $`tar -xzf ${resolvedPath} -C ${cleanupPath}` - const bundlePath = findDeploymentBundleRoot(cleanupPath) - assert( - bundlePath != null, - `Archive ${resolvedPath} is not a deployment bundle` - ) - return { bundlePath, cleanupPath } - } catch (error) { - await fs.rm(cleanupPath, { force: true, recursive: true }) - throw error + solanaIdlPath } } -/** Resolve and verify one exact deployment-bundle generation input. */ -async function resolveDeploymentGenerationInput(inputPath) { - const { bundlePath, cleanupPath } = - await resolveDeploymentBundleRoot(inputPath) - - try { - const profilePath = path.join(bundlePath, DeploymentProfileFilename), - clusterManifestPath = path.join(bundlePath, ClusterManifestFilename), - [profile, clusterManifest] = await Promise.all([ - readJson(profilePath), - readJson(clusterManifestPath) - ]) - - assert(profile.schemaVersion === 1, "Unsupported deployment profile schema") - assertSha256(profile.deploymentChecksum, "Deployment profile checksum") - assert( - profile.id === - `${profile.wire?.chainId}-${profile.deploymentChecksum.slice(0, 12)}`, - "Deployment profile id does not match its Wire chain and checksum" - ) - assert( - profile.wire.chainId === clusterManifest.identity?.chains?.wire?.chain_id, - "Deployment bundle Wire chain identity mismatch" - ) - assert( - profile.ethereum?.chainId === - clusterManifest.identity?.chains?.evm?.chain_id, - "Deployment bundle Ethereum chain identity mismatch" - ) - assert( - profile.solana?.genesisHash === - clusterManifest.identity?.chains?.svm?.genesis, - "Deployment bundle Solana chain identity mismatch" - ) - - const ethereumAbiPaths = await Promise.all( - EthereumContractNames.map(async name => { - const abiPath = path.join( - bundlePath, - "ethereum", - "runtime-abis", - `${name}.json` - ), - artifact = await readJson(abiPath), - contract = profile.ethereum?.contracts?.[name] - - assert( - contract != null, - `Deployment profile is missing Ethereum ${name}` - ) - assertSha256(contract.abiSha256, `Ethereum ${name} ABI hash`) - assertSha256( - contract.implementationCodeSha256, - `Ethereum ${name} implementation hash` - ) - assert( - artifact.contractName === name && Array.isArray(artifact.abi), - `Deployment bundle has an invalid Ethereum ${name} ABI` - ) - assertArtifactDigest( - sha256(formatJson(artifact.abi)), - contract.abiSha256, - `Ethereum ${name} ABI` - ) - return abiPath - }) - ), - solanaIdlPath = path.join( - bundlePath, - "solana", - "runtime-idls", - "liqsol_core.json" - ), - rawIdlSource = await fs.readFile(solanaIdlPath), - solanaProgram = profile.solana?.programs?.[SolanaProgramName] - - assert(solanaProgram != null, "Deployment profile is missing liqsolCore") - assertSha256(solanaProgram.idlSha256, "Solana liqsolCore IDL hash") - assertSha256( - solanaProgram.programDataSha256, - "Solana liqsolCore ProgramData hash" - ) - assertArtifactDigest( - sha256(rawIdlSource), - solanaProgram.idlSha256, - "Solana liqsolCore IDL" - ) - - const ethereumManifest = { - schemaVersion: 1, - package: { - name: EthereumArtifactPackageName, - version: DevelopmentPackageVersion - }, - source: { - repository: "Wire-Network/wire-ethereum", - revision: clusterManifest.identity.sources["wire-ethereum"] - }, - contracts: Object.fromEntries( - EthereumContractNames.map(name => { - const contract = profile.ethereum.contracts[name] - return [ - name, - { - path: `ethereum/runtime-abis/${name}.json`, - abiSha256: contract.abiSha256, - runtimeBytecodePath: EmptyArtifactPath, - runtimeBytecodeLength: EmptyArtifactLength, - runtimeBytecodeSha256: EmptyArtifactDigest, - runtimeLinkReferences: [], - implementationCodeSha256: contract.implementationCodeSha256 - } - ] - }) - ) - }, - solanaManifest = { - schemaVersion: 1, - package: { - name: SolanaArtifactPackageName, - version: DevelopmentPackageVersion - }, - source: { - repository: "Wire-Network/wire-solana", - revision: clusterManifest.identity.sources["wire-solana"] - }, - toolchain: clusterManifest.identity.chains.svm.version, - programs: { - [SolanaProgramName]: { - idlPath: "solana/runtime-idls/liqsol_core.json", - idlSha256: solanaProgram.idlSha256, - programBinaryPath: EmptyArtifactPath, - programBinaryLength: EmptyArtifactLength, - programBinarySha256: EmptyArtifactDigest, - programDataSha256: solanaProgram.programDataSha256 - } - } - } - - return { - mode: ArtifactMode.deploymentBundle, - deploymentProfileId: profile.id, - ethereumManifest, - solanaManifest, - ethereumAbiPaths, - solanaIdlPath, - cleanupPath - } - } catch (error) { - if (cleanupPath != null) { - await fs.rm(cleanupPath, { force: true, recursive: true }) - } - throw error - } -} - -/** Resolve the selected canonical or local deployment generation input. */ -async function resolveGenerationInput() { - if (DeploymentArtifactsPath == null) return resolveSourceGenerationInput() - return resolveDeploymentGenerationInput(DeploymentArtifactsPath) -} - const generationInput = await resolveGenerationInput() -try { - await Promise.all( - [EthereumOutputPath, SolanaOutputPath, ArtifactOutputPath].map(outputPath => - fs.rm(outputPath, { force: true, recursive: true }) - ) +await Promise.all( + [EthereumOutputPath, SolanaOutputPath, ArtifactOutputPath].map(outputPath => + fs.rm(outputPath, { force: true, recursive: true }) ) - await Promise.all( - [SolanaOutputPath, ArtifactOutputPath].map(outputPath => - fs.mkdir(outputPath, { recursive: true }) - ) +) +await Promise.all( + [SolanaOutputPath, ArtifactOutputPath].map(outputPath => + fs.mkdir(outputPath, { recursive: true }) ) +) - await $({ - cwd: PackagePath - })`${TypechainPath} --target ethers-v5 --node16-modules --out-dir ${EthereumOutputPath} ${generationInput.ethereumAbiPaths}` - - const { convertIdlToCamelCase } = PackageRequire( - "@coral-xyz/anchor/dist/cjs/idl.js" - ), - rawIdlSource = await fs.readFile(generationInput.solanaIdlPath), - rawIdl = JSON.parse(rawIdlSource.toString("utf8")), - idl = convertIdlToCamelCase(rawIdl), - ethereumManifestSource = JSON.stringify( - generationInput.ethereumManifest, - null, - 2 - ).replaceAll( - EmptyRuntimeLinkReferencesJson, - TypedEmptyRuntimeLinkReferencesSource - ), - solanaSource = await formatTypescript(` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ - import type { Idl } from "@coral-xyz/anchor" - - /** Remove readonly modifiers while preserving the generated IDL's literal names. */ - type MutableIdl = T extends object - ? { -readonly [Key in keyof T]: MutableIdl } - : T - - /** Capture a precise mutable IDL type for Anchor's generated namespaces. */ - function mutableIdl(value: T): MutableIdl { - return value as MutableIdl - } +await $({ + cwd: PackagePath +})`${TypechainPath} --target ethers-v5 --node16-modules --out-dir ${EthereumOutputPath} ${generationInput.ethereumAbiPaths}` - const liqsolCoreIdlValue = mutableIdl(${JSON.stringify(idl, null, 2)}) - - /** Strict Anchor IDL type generated from the selected artifact input. */ - export type LiqsolCore = typeof liqsolCoreIdlValue +const { convertIdlToCamelCase } = PackageRequire( + "@coral-xyz/anchor/dist/cjs/idl.js" + ), + rawIdlSource = await fs.readFile(generationInput.solanaIdlPath), + rawIdl = JSON.parse(rawIdlSource.toString("utf8")), + idl = convertIdlToCamelCase(rawIdl), + ethereumManifestSource = JSON.stringify( + generationInput.ethereumManifest, + null, + 2 + ).replaceAll( + EmptyRuntimeLinkReferencesJson, + TypedEmptyRuntimeLinkReferencesSource + ), + solanaSource = await formatTypescript(` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ + import type { Idl } from "@coral-xyz/anchor" + + /** Remove readonly modifiers while preserving the generated IDL's literal names. */ + type MutableIdl = T extends object + ? { -readonly [Key in keyof T]: MutableIdl } + : T + + /** Capture a precise mutable IDL type for Anchor's generated namespaces. */ + function mutableIdl(value: T): MutableIdl { + return value as MutableIdl + } - /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ - export const liqsolCoreIdl = liqsolCoreIdlValue - `), - artifactSource = await formatTypescript(` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ + const liqsolCoreIdlValue = mutableIdl(${JSON.stringify(idl, null, 2)}) - import { OutpostArtifactMode } from "../Mode.js" + /** Strict Anchor IDL type generated from the selected artifact input. */ + export type LiqsolCore = typeof liqsolCoreIdlValue - /** Exact artifact input compiled into this SDK build. */ - export const OutpostArtifactManifests = { - mode: OutpostArtifactMode.${generationInput.mode}, - deploymentProfileId: ${JSON.stringify( - generationInput.deploymentProfileId - )}, - ethereum: ${ethereumManifestSource}, - solana: ${JSON.stringify(generationInput.solanaManifest, null, 2)} - } - `) + /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ + export const liqsolCoreIdl = liqsolCoreIdlValue + `), + artifactSource = await formatTypescript(` + /* Autogenerated file. Do not edit manually. */ + /* eslint-disable */ - await Promise.all([ - fs.writeFile(path.join(SolanaOutputPath, "LiqsolCore.ts"), solanaSource), - fs.writeFile( - path.join(SolanaOutputPath, "index.ts"), - 'export * from "./LiqsolCore.js"\n' - ), - fs.writeFile(path.join(ArtifactOutputPath, "Manifests.ts"), artifactSource), - fs.writeFile( - path.join(ArtifactOutputPath, "index.ts"), - 'export * from "./Manifests.js"\n' - ) - ]) + /** Exact npm artifact inputs compiled into this SDK build. */ + export const OutpostArtifactManifests = { + ethereum: ${ethereumManifestSource}, + solana: ${JSON.stringify(generationInput.solanaManifest, null, 2)} + } + `) - process.stdout.write( - `Generated sdk-outpost clients in ${generationInput.mode} mode from ${generationInput.ethereumManifest.source.revision} and ${generationInput.solanaManifest.source.revision}\n` +await Promise.all([ + fs.writeFile(path.join(SolanaOutputPath, "LiqsolCore.ts"), solanaSource), + fs.writeFile( + path.join(SolanaOutputPath, "index.ts"), + 'export * from "./LiqsolCore.js"\n' + ), + fs.writeFile(path.join(ArtifactOutputPath, "Manifests.ts"), artifactSource), + fs.writeFile( + path.join(ArtifactOutputPath, "index.ts"), + 'export * from "./Manifests.js"\n' ) -} finally { - if (generationInput.cleanupPath != null) { - await fs.rm(generationInput.cleanupPath, { force: true, recursive: true }) - } -} +]) + +process.stdout.write( + `Generated sdk-outpost clients from npm artifacts ${generationInput.ethereumManifest.source.revision} and ${generationInput.solanaManifest.source.revision}\n` +) diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs index 77c08f6..b7e43fe 100755 --- a/scripts/sdk-outpost/verify-package.mjs +++ b/scripts/sdk-outpost/verify-package.mjs @@ -114,11 +114,6 @@ InternalExports.forEach(name => { assert(!(name in cjs), `CommonJS entrypoint exposes internal ${name}`) assert(!(name in esm), `ES module entrypoint exposes internal ${name}`) }) -assert( - cjs.OutpostArtifactManifests.mode === cjs.OutpostArtifactMode.sourcePackage && - esm.OutpostArtifactManifests.mode === esm.OutpostArtifactMode.sourcePackage, - "Publishable sdk-outpost output must use canonical source-package artifacts" -) process.stdout.write( "Verified sdk-outpost package boundaries and entrypoints\n" From 9b0990c2f59fd777b0ef3585bb3ec6b51e8341ee Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 18 Aug 2026 11:31:12 -0400 Subject: [PATCH 35/48] chore(sdk-outpost): consume current producer artifacts --- packages/sdk-outpost/README.md | 4 ++-- packages/sdk-outpost/RELEASING.md | 6 +++--- packages/sdk-outpost/package.json | 4 ++-- pnpm-lock.yaml | 20 ++++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index c1f3ff8..bb64b91 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,8 +8,8 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Publication status as of August 14, 2026: the exact Ethereum and Solana producer -artifact packages are publicly available as `0.1.0`, while the first +Publication status as of August 18, 2026: the exact Ethereum and Solana producer +artifact packages are publicly available as `0.1.1`, while the first `@wireio/sdk-outpost` npm release is pending. The workspace version remains `0.0.0` until the repository-wide release workflow performs its patch bump. diff --git a/packages/sdk-outpost/RELEASING.md b/packages/sdk-outpost/RELEASING.md index f854628..bdf77ee 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/packages/sdk-outpost/RELEASING.md @@ -6,8 +6,8 @@ directory outside this process. ## Current first-release state -As of August 14, 2026, both exact producer artifact packages are public on npm -at `0.1.0`. The first `@wireio/sdk-outpost` release is still pending. Its +As of August 18, 2026, both exact producer artifact packages are public on npm +at `0.1.1`. The first `@wireio/sdk-outpost` release is still pending. Its workspace version remains `0.0.0` until the existing repository-wide patch workflow bumps and publishes it; do not create a one-off version or publish the workspace directory manually. @@ -72,7 +72,7 @@ not be published by `sdk-outpost`. The first successful publish creates the npm package page. Release sequence: -1. Confirm both exact `0.1.0` producer artifact versions are publicly +1. Confirm both exact `0.1.1` producer artifact versions are publicly installable. 2. Confirm the `wireio` organization exists on npm and the release owner can publish public packages in that scope. diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 4c4544d..063c975 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -58,8 +58,8 @@ "zod": "^4.4.3" }, "devDependencies": { - "@wireio/outpost-ethereum-artifacts": "0.1.0", - "@wireio/outpost-solana-artifacts": "0.1.0", + "@wireio/outpost-ethereum-artifacts": "0.1.1", + "@wireio/outpost-solana-artifacts": "0.1.1", "@typechain/ethers-v5": "^11.1.2", "prettier": "3.8.1", "typechain": "^8.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95a5eaa..fe31704 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -229,11 +229,11 @@ importers: specifier: ^11.1.2 version: 11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2) '@wireio/outpost-ethereum-artifacts': - specifier: 0.1.0 - version: 0.1.0 + specifier: 0.1.1 + version: 0.1.1 '@wireio/outpost-solana-artifacts': - specifier: 0.1.0 - version: 0.1.0 + specifier: 0.1.1 + version: 0.1.1 prettier: specifier: 3.8.1 version: 3.8.1 @@ -1726,11 +1726,11 @@ packages: '@wireio/opp-typescript-models@1.0.48': resolution: {integrity: sha512-3HDC88AohYBBMuVdSqdI5tIRHPZWWTOaS+yQ/Xs1sCvhKuqlpF3KnYLcgIiXX3x6IC87dfo55xBfHPFcWpthmw==} - '@wireio/outpost-ethereum-artifacts@0.1.0': - resolution: {integrity: sha512-q7QqsPErrDpW5Js+hKyHMwWackY9ut7F7fSf8DaiY1jB7ABT1bGgLGFzS7zqvnZz+lYCThy50adRkMmqq/EP0w==} + '@wireio/outpost-ethereum-artifacts@0.1.1': + resolution: {integrity: sha512-nQ2JeEcMkv1AyEI6/MnTvQepRxr7PTG9ah34L775ami1tZLoaJv5+dAaaHjWh4+SreX0xKXxdKnBwrFvFkd0rQ==} - '@wireio/outpost-solana-artifacts@0.1.0': - resolution: {integrity: sha512-mqS3wxZbG6BH3KC5Op8RW8yQr+SD/dPxFW8Qd7WHGpsx0Jvd9FeBz8Nkz3z2R0lEyNKCIfer33DZSiNLI/pS5w==} + '@wireio/outpost-solana-artifacts@0.1.1': + resolution: {integrity: sha512-C7bygnrS/XmnIGz3Upnw0HbXsznLQV35hAjnHgGyhRkWINySSdVfj6l9SH4OXiUeyxn+ple4Yz6P0YVITnT8rg==} '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -6275,9 +6275,9 @@ snapshots: dependencies: '@protobuf-ts/runtime': 2.11.1 - '@wireio/outpost-ethereum-artifacts@0.1.0': {} + '@wireio/outpost-ethereum-artifacts@0.1.1': {} - '@wireio/outpost-solana-artifacts@0.1.0': {} + '@wireio/outpost-solana-artifacts@0.1.1': {} '@xtuc/ieee754@1.2.0': {} From ee5316450919efaccba5f247960a6116fbffbf83 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 18 Aug 2026 14:40:42 -0400 Subject: [PATCH 36/48] fix(sdk-outpost): address review feedback --- .pnpmfile.cjs | 45 +++++++------------ CLAUDE.md | 6 +-- .../sdk-outpost/RELEASING.md => RELEASING.md | 9 +++- packages/sdk-outpost/README.md | 6 +-- .../sdk-outpost/src/clients/OutpostClient.ts | 17 +------ .../src/clients/OutpostClientFactory.ts | 25 +++++++++++ .../clients/ethereum/EthereumOutpostClient.ts | 2 +- .../src/clients/solana/SolanaOutpostClient.ts | 2 +- pnpm-lock.yaml | 2 +- 9 files changed, 59 insertions(+), 55 deletions(-) rename packages/sdk-outpost/RELEASING.md => RELEASING.md (92%) create mode 100644 packages/sdk-outpost/src/clients/OutpostClientFactory.ts diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 75e7a33..b2bca3e 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -1,14 +1,12 @@ // noinspection JSUnresolvedReference /** - * pnpm hook to resolve OPP model packages from a local wire-sysio build. + * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. * * Usage: - * 1. Build the wire-sysio OPP model outputs in the sibling repo. - * 2. Run `WIRE_USE_LOCAL_OPP_MODELS=true pnpm install --lockfile=false`. - * - * Registry resolution is the default. Outpost artifact packages always resolve - * from their exact registry versions. + * 1. Add packages you want to link to the `localOverrides` map below. + * 2. Run `pnpm install` — pnpm will use these local paths instead of the registry. + * 3. Comment out or remove entries to revert to registry versions. * * Docs: https://pnpm.io/pnpmfile */ @@ -16,9 +14,6 @@ const Path = require("path") const Fs = require("node:fs") -const LOCAL_OPP_MODELS_ENABLED = "true" -const localOppModelTargets = ["typescript"] - /** * Checks whether a path exists and is a directory, without throwing. * @@ -39,26 +34,20 @@ function isDirectory(dirPath) { */ const localOverrides = {} -/** - * Appends every locally available OPP model package. - * - * Platform builds may consume wire-sysio model output after its producer runs. - */ -function appendLocalOppModelOverrides() { - localOppModelTargets - .map(target => [ - `@wireio/opp-${target}-models`, - Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) - ]) - .filter(([, path]) => isDirectory(path)) - .forEach(([pkgName, path]) => { - localOverrides[pkgName] = path - }) -} +// AS THE PROTOBUF LIBS HAVE BEEN RELOCATED TO SYSIO +// WE CAN NOW USE THE MODELS WITHOUT ISSUE. +// CIRCULAR DEP REMOVED -if (process.env.WIRE_USE_LOCAL_OPP_MODELS === LOCAL_OPP_MODELS_ENABLED) { - appendLocalOppModelOverrides() -} +const wireOPPPkgPaths = ["typescript", "solidity"].map(target => [ + `@wireio/opp-${target}-models`, + Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) +]) + +wireOPPPkgPaths + .filter(([, path]) => isDirectory(path)) + .forEach(([pkgName, path]) => { + localOverrides[pkgName] = path + }) /** * `readPackage` hook, which links locally available versions of diff --git a/CLAUDE.md b/CLAUDE.md index 036e4ae..691bb8c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,9 +5,7 @@ ## Build & Development ```bash -pnpm install # Install registry deps (pnpm 10.34.5, Node >=22) -# Link available sibling wire-sysio OPP model outputs: -WIRE_USE_LOCAL_OPP_MODELS=true pnpm install --lockfile=false +pnpm install # Install deps (pnpm 10.34.5, Node >=22); available sibling OPP models link automatically pnpm build # Build all packages via tsc -b pnpm build:dev # Watch mode (incremental) pnpm test # Build + jest (all packages) @@ -227,7 +225,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, and program binaries come from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never replace them with sibling artifact links. Generated clients are ignored build outputs and must not be copied or edited here. -- `OutpostClient.create` is sdk-outpost's only published client-construction facade. Concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. +- `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. - `packages/sdk-outpost` owns external reserve lifecycle and swap execution. Staking remains outside this package until its dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. diff --git a/packages/sdk-outpost/RELEASING.md b/RELEASING.md similarity index 92% rename from packages/sdk-outpost/RELEASING.md rename to RELEASING.md index bdf77ee..e6272a3 100644 --- a/packages/sdk-outpost/RELEASING.md +++ b/RELEASING.md @@ -38,8 +38,13 @@ result with a frozen install. - Use Node.js 24 and the repository-pinned pnpm version through Corepack. - Keep the lockfile unchanged after a frozen install. -- Generate clients only through `scripts/sdk-outpost/generate.mjs`; never edit - generated TypeChain, Anchor, or artifact-manifest sources by hand. +- Generate clients only through `scripts/sdk-outpost/generate.mjs`; this + consumer-side step validates the pinned producer packages and converts their + ABI/IDL into ignored TypeChain, Anchor, and artifact-manifest sources. Never + edit those generated sources by hand. +- Keep `scripts/sdk-outpost/verify-package.mjs` as the package boundary check; + it verifies the built CommonJS/ESM entrypoints and rejects raw producer or + generated sources from the npm payload. - Confirm the package contains no secrets, RPC credentials, private keys, deployment addresses, or mutable environment configuration. - Confirm deployment profiles are distributed through the authenticated diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index bb64b91..c858560 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -252,9 +252,9 @@ pnpm --dir packages/sdk-outpost run verify:release pnpm --dir packages/sdk-outpost pack --dry-run ``` -Release versions are managed by the monorepo-wide patch workflow. See -[`RELEASING.md`](RELEASING.md) for artifact prerequisites and the verification -checklist. +Release versions are managed by the monorepo-wide patch workflow. See the +[repository release guide](https://github.com/Wire-Network/wire-libraries-ts/blob/master/RELEASING.md) +for artifact prerequisites and the verification checklist. ## License diff --git a/packages/sdk-outpost/src/clients/OutpostClient.ts b/packages/sdk-outpost/src/clients/OutpostClient.ts index 7dd360e..b777e18 100644 --- a/packages/sdk-outpost/src/clients/OutpostClient.ts +++ b/packages/sdk-outpost/src/clients/OutpostClient.ts @@ -1,8 +1,4 @@ -import { match } from "ts-pattern" - -import { OutpostChainFamily } from "../deployments/index.js" -import { EthereumOutpostClient } from "./ethereum/EthereumOutpostClient.js" -import { SolanaOutpostClient } from "./solana/SolanaOutpostClient.js" +import { OutpostClientFactory } from "./OutpostClientFactory.js" import { OutpostClientFor, OutpostClientInput } from "./Types.js" /** Cross-chain facade for creating a verified, family-specific outpost client. */ @@ -11,15 +7,6 @@ export namespace OutpostClient { export async function create( input: T ): Promise> { - const client = await match(input as OutpostClientInput) - .with({ family: OutpostChainFamily.ethereum }, ({ options }) => - EthereumOutpostClient.createEthereum(options) - ) - .with({ family: OutpostChainFamily.solana }, ({ options }) => - SolanaOutpostClient.createSolana(options) - ) - .exhaustive() - - return client as OutpostClientFor + return OutpostClientFactory.create(input) } } diff --git a/packages/sdk-outpost/src/clients/OutpostClientFactory.ts b/packages/sdk-outpost/src/clients/OutpostClientFactory.ts new file mode 100644 index 0000000..3d70456 --- /dev/null +++ b/packages/sdk-outpost/src/clients/OutpostClientFactory.ts @@ -0,0 +1,25 @@ +import { match } from "ts-pattern" + +import { OutpostChainFamily } from "../deployments/index.js" +import { EthereumOutpostClient } from "./ethereum/EthereumOutpostClient.js" +import { SolanaOutpostClient } from "./solana/SolanaOutpostClient.js" +import { OutpostClientFor, OutpostClientInput } from "./Types.js" + +/** Internal factory that owns family-specific client construction. */ +export namespace OutpostClientFactory { + /** Create the precise client selected by an outpost-family request. */ + export async function create( + input: T + ): Promise> { + const client = await match(input as OutpostClientInput) + .with({ family: OutpostChainFamily.ethereum }, ({ options }) => + EthereumOutpostClient.create(options) + ) + .with({ family: OutpostChainFamily.solana }, ({ options }) => + SolanaOutpostClient.create(options) + ) + .exhaustive() + + return client as OutpostClientFor + } +} diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 050c002..0efb477 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -29,7 +29,7 @@ function resolveProvider( /** Strictly typed access to one verified Ethereum outpost deployment. */ export class EthereumOutpostClient { /** Create the Ethereum backend for the package-level outpost client facade. */ - static async createEthereum( + static async create( options: EthereumOutpostClientOptions ): Promise { const { connection, profile } = options, diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 1a0034d..25836bf 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -14,7 +14,7 @@ import { SolanaReserveSwapClient } from "./SolanaReserveSwapClient.js" /** Strictly typed access to one verified Solana outpost deployment. */ export class SolanaOutpostClient { /** Create the Solana backend for the package-level outpost client facade. */ - static async createSolana( + static async create( options: SolanaOutpostClientOptions ): Promise { const { profile, provider } = options diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe31704..6066207 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-wf2UTl5Xse1huyLJq/7F4GeoQKmg339nWnP5uif4Tp0= +pnpmfileChecksum: sha256-aSegbCvK5TyBUeMcgQLjFgZgcFmq1CMqHT+lQb93Qks= importers: From db20537b7514ebc17bc3c52a2e7f75533d700060 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Wed, 19 Aug 2026 09:48:20 -0400 Subject: [PATCH 37/48] fix(sdk-outpost): address release review feedback --- .github/workflows/ci.yaml | 9 +- .github/workflows/prepare-release.yaml | 4 +- .github/workflows/tag-release.yaml | 13 +- CLAUDE.md | 2 +- RELEASING.md | 19 +- etc/tsconfig/tsconfig.base.json | 3 - package.json | 17 +- packages/sdk-core/README.md | 7 - packages/sdk-core/package.json | 12 - packages/sdk-outpost/README.md | 1 - packages/sdk-outpost/package.json | 1 - .../sdk-outpost/src/reserves/Validation.ts | 18 +- .../tests/reserves/Validation.test.ts | 16 +- pnpm-lock.yaml | 206 +++++++----------- pnpm-workspace.yaml | 12 - 15 files changed, 122 insertions(+), 218 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c25bbda..e601abc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,8 @@ jobs: cache: pnpm - name: Install dependencies - run: pnpm install --ignore-scripts --frozen-lockfile + # --frozen-lockfile removed for the moment + run: pnpm install --ignore-scripts --no-frozen-lockfile - name: Test env: @@ -41,12 +42,6 @@ jobs: JEST_JUNIT_OUTPUT_NAME: jest-junit.xml run: pnpm run test:ci - - name: Verify sdk-outpost release - run: pnpm --dir packages/sdk-outpost run verify:release - - - name: Inspect sdk-outpost package - run: pnpm --dir packages/sdk-outpost pack --dry-run - - name: Upload test results (JUnit XML) if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml index 823714d..4aa07d1 100644 --- a/.github/workflows/prepare-release.yaml +++ b/.github/workflows/prepare-release.yaml @@ -110,8 +110,8 @@ jobs: channel="stable" fi - # This gate deliberately changes package versions. Refresh the lockfile - # in the reviewed bump PR so CI and Tag Release can install it frozen. + # Refresh the lockfile so it reflects the bumped versions (hygiene; + # CI installs with --no-frozen-lockfile, so it is not a hard gate). pnpm install --lockfile-only --ignore-scripts { diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 7487b25..127a57f 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -96,18 +96,13 @@ jobs: JEST_JUNIT_OUTPUT_DIR: reports/junit JEST_JUNIT_OUTPUT_NAME: jest-junit.xml run: | - # Release inputs are registry-backed and fully represented in the - # reviewed lockfile. Refuse dependency drift at the publishing gate. - pnpm install --ignore-scripts --frozen-lockfile + # --no-frozen-lockfile to match ci.yaml / publish-npm.yaml: the OPP + # models are resolved via .pnpmfile.cjs, not locked, so a frozen install + # fails on the resulting lockfile drift. + pnpm install --ignore-scripts --no-frozen-lockfile pnpm run build pnpm run test:ci - - name: Verify sdk-outpost release - run: pnpm --dir packages/sdk-outpost run verify:release - - - name: Inspect sdk-outpost package - run: pnpm --dir packages/sdk-outpost pack --dry-run - # npm is the irreversible step -- do it once the gate is green, BEFORE # tagging, so a failed publish leaves no dangling tag to trip the # "tag already exists" guard on the retry. diff --git a/CLAUDE.md b/CLAUDE.md index 691bb8c..0aec046 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -230,7 +230,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. -- Do not describe `sdk-outpost` as npm-available until `npm view` succeeds for both exact producer artifact versions and `@wireio/sdk-outpost`, and a clean frozen install passes without sibling links. +- Do not describe `sdk-outpost` as npm-available until `npm view` succeeds for both exact producer artifact versions and `@wireio/sdk-outpost`, and a clean platform-compatible install passes without sibling artifact links. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch - Node >=22 required (package.json says >=22, README says >=24 — actual CI uses v24) diff --git a/RELEASING.md b/RELEASING.md index e6272a3..0730833 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -31,13 +31,12 @@ Before updating either dependency, verify its registry integrity/signature, source revision, artifact checksums, and immutable version. The producer repos are non-public, so their current npm releases do not carry public provenance. Keep both versions exact in `packages/sdk-outpost/package.json`, update -`pnpm-lock.yaml` with the repository-pinned pnpm version, and then prove the -result with a frozen install. +`pnpm-lock.yaml` with the repository-pinned pnpm version, and then run the +repository's platform-compatible install and test flow. ## Release requirements - Use Node.js 24 and the repository-pinned pnpm version through Corepack. -- Keep the lockfile unchanged after a frozen install. - Generate clients only through `scripts/sdk-outpost/generate.mjs`; this consumer-side step validates the pinned producer packages and converts their ABI/IDL into ignored TypeChain, Anchor, and artifact-manifest sources. Never @@ -62,16 +61,15 @@ release. From the repository root: ```sh -corepack pnpm install --frozen-lockfile --ignore-scripts +corepack pnpm install --no-frozen-lockfile --ignore-scripts corepack pnpm run lint corepack pnpm run test:ci corepack pnpm --dir packages/sdk-outpost run verify:release -corepack pnpm --dir packages/sdk-outpost pack --dry-run ``` -Inspect the dry-run listing. It must contain only the README, package metadata, -and CJS/ESM build outputs. Raw producer packages and generated source trees must -not be published by `sdk-outpost`. +Package verification requires the publishable files to remain limited to the +README and CJS/ESM build outputs. Raw producer packages and generated source +trees must not be published by `sdk-outpost`. ## First npm listing @@ -93,9 +91,8 @@ The first successful publish creates the npm package page. Release sequence: The preparation gate keeps each package on its existing version track. A patch bump therefore makes the first SDK release `@wireio/sdk-outpost@0.0.1`, while -`@wireio/sdk-core` advances by one patch on its independent track. `workspace:*` -is rewritten to that concrete `sdk-core` version in the published SDK manifest. -The Tag Release gate must install the frozen workspace, generate clients from +`@wireio/sdk-core` advances by one patch on its independent track. +The Tag Release gate must install the workspace, generate clients from the producer packages, build and test every package, verify public entrypoints, and publish with npm provenance. diff --git a/etc/tsconfig/tsconfig.base.json b/etc/tsconfig/tsconfig.base.json index d18a6b4..a79aea6 100755 --- a/etc/tsconfig/tsconfig.base.json +++ b/etc/tsconfig/tsconfig.base.json @@ -56,9 +56,6 @@ "@wireio/sdk-core": [ "./packages/sdk-core/src" ], - "@wireio/sdk-core/contracts/sysio/reserv/constants": [ - "./packages/sdk-core/src/contracts/sysio/reserv/Constants.ts" - ], "@wireio/sdk-core/*": [ "./packages/sdk-core/src/*" ], diff --git a/package.json b/package.json index 39c4e42..b99dae8 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", - "test": "pnpm run build && jest && pnpm --filter @wireio/sdk-outpost run test", - "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit && pnpm --filter @wireio/sdk-outpost run test", + "test": "pnpm run build && jest && pnpm --filter @wireio/sdk-outpost run test && pnpm --filter @wireio/sdk-outpost run verify:package", + "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit && pnpm --filter @wireio/sdk-outpost run test && pnpm --filter @wireio/sdk-outpost run verify:package", "clean": "./scripts/clean.sh && pnpm -r run clean", "prepare": "husky" }, @@ -43,10 +43,21 @@ "@wireio/opp-typescript-models": "^1.0.26" }, "resolutions": { + "@3fv/prelude-ts": "^0.8.41", "@aws-sdk/client-firehose": "3.1102.0", "@aws-sdk/client-kms": "3.1102.0", "@aws-sdk/client-sns": "3.1102.0", "@aws-sdk/client-ssm": "3.1102.0", - "@aws-sdk/client-sts": "3.1102.0" + "@aws-sdk/client-sts": "3.1102.0", + "bluebird": "3.7.2", + "debug": "4.3.4", + "lodash": "4.18.1", + "prettier": "3.8.1", + "tracer": "1.3.0", + "typechain>prettier": "2.8.8", + "webpack": "5.104.1", + "webpack-cli": "6.0.1", + "webpack-dev-server": "6.0.0", + "ws": "8.21.0" } } diff --git a/packages/sdk-core/README.md b/packages/sdk-core/README.md index f9a8620..1016b50 100644 --- a/packages/sdk-core/README.md +++ b/packages/sdk-core/README.md @@ -7,9 +7,6 @@ optional `created` timestamp. Available on npm: -Published type declarations support both package-root and subpath imports, -including consumers that still use TypeScript's classic Node resolution. - ## Multisig `contracts.sysio.msig` provides UI-neutral helpers for `sysio.msig` proposal workflows, including action builders, proposal reads, transaction decoding, hash verification, and legacy/chunked contract compatibility. @@ -112,10 +109,6 @@ chain/token and status filters, exact reserve lookup, WIRE-side activation, and read-only swap quotes. External-chain reserve creation and cancellation remain in the chain SDK that owns the deployed ABI or IDL. -External-chain SDKs that only need reserve validation bounds use the supported -`@wireio/sdk-core/contracts/sysio/reserv/constants` entrypoint without loading -the complete Wire client graph. - ```ts const reserves = new contracts.sysio.reserv.ReserveClient({ client: api }) const pending = await reserves.listReserves({ diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index f7bdb0e..2d55b94 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -24,24 +24,12 @@ "require": "./lib/cjs/index.js", "types": "./lib/esm/index.d.ts" }, - "./contracts/sysio/reserv/constants": { - "import": "./lib/esm/contracts/sysio/reserv/Constants.js", - "require": "./lib/cjs/contracts/sysio/reserv/Constants.js", - "types": "./lib/esm/contracts/sysio/reserv/Constants.d.ts" - }, "./*": { "import": "./lib/esm/*.js", "require": "./lib/cjs/*.js", "types": "./lib/esm/*.d.ts" } }, - "typesVersions": { - "*": { - "contracts/sysio/reserv/constants": [ - "lib/esm/contracts/sysio/reserv/Constants.d.ts" - ] - } - }, "access": "public", "license": "FSL-1.1-Apache-2.0", "scripts": { diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index c858560..97fdb50 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -249,7 +249,6 @@ are never maintained by hand in this repository. pnpm --dir packages/sdk-outpost run generate pnpm --dir packages/sdk-outpost run test pnpm --dir packages/sdk-outpost run verify:release -pnpm --dir packages/sdk-outpost pack --dry-run ``` Release versions are managed by the monorepo-wide patch workflow. See the diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 063c975..87b1dba 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -47,7 +47,6 @@ "prepack": "pnpm run verify:release" }, "dependencies": { - "@wireio/sdk-core": "workspace:*", "@coral-xyz/anchor": "^0.32.1", "@ethersproject/abi": "^5.8.0", "@ethersproject/providers": "^5.8.0", diff --git a/packages/sdk-outpost/src/reserves/Validation.ts b/packages/sdk-outpost/src/reserves/Validation.ts index 1feb83f..6f5e84b 100644 --- a/packages/sdk-outpost/src/reserves/Validation.ts +++ b/packages/sdk-outpost/src/reserves/Validation.ts @@ -1,10 +1,5 @@ import { BigNumber, utils as ethersUtils } from "ethers" -import { - MAX_CONNECTOR_WEIGHT_BPS, - MIN_CONNECTOR_WEIGHT_BPS -} from "@wireio/sdk-core/contracts/sysio/reserv/constants" - import type { EthereumReserveCreateRequest, ReserveCreateDefinition, @@ -13,6 +8,8 @@ import type { const MaximumUnsigned64 = BigNumber.from("18446744073709551615"), MinimumReserveValue = BigNumber.from(1), + MinimumConnectorWeightBps = 1, + MaximumConnectorWeightBps = 9999, MinimumToleranceBps = 0, MaximumToleranceBps = 10_000, MaximumReserveNameBytes = 64, @@ -59,17 +56,14 @@ export function assertReserveCreateDefinition( throw new Error("externalTokenAmount must be greater than zero.") } - assertReserveUnsigned64( - definition.requestedWireAmount, - "requestedWireAmount" - ) + assertReserveUnsigned64(definition.requestedWireAmount, "requestedWireAmount") if ( !Number.isInteger(definition.connectorWeightBps) || - definition.connectorWeightBps < MIN_CONNECTOR_WEIGHT_BPS || - definition.connectorWeightBps > MAX_CONNECTOR_WEIGHT_BPS + definition.connectorWeightBps < MinimumConnectorWeightBps || + definition.connectorWeightBps > MaximumConnectorWeightBps ) { throw new Error( - `connectorWeightBps must be an integer from ${MIN_CONNECTOR_WEIGHT_BPS} to ${MAX_CONNECTOR_WEIGHT_BPS}.` + `connectorWeightBps must be an integer from ${MinimumConnectorWeightBps} to ${MaximumConnectorWeightBps}.` ) } diff --git a/packages/sdk-outpost/tests/reserves/Validation.test.ts b/packages/sdk-outpost/tests/reserves/Validation.test.ts index e2ce32e..eb28f0f 100644 --- a/packages/sdk-outpost/tests/reserves/Validation.test.ts +++ b/packages/sdk-outpost/tests/reserves/Validation.test.ts @@ -8,6 +8,8 @@ import { type ReserveSwapRequest } from "@wireio/sdk-outpost" +const InvalidConnectorWeights = [0, 10_000] + const reserveDefinition: ReserveCreateDefinition = { tokenCode: 1, reserveCode: 2, @@ -45,12 +47,14 @@ describe("reserve swap validation", () => { }) it("rejects invalid reserve creation metadata and creator keys", () => { - expect(() => - assertReserveCreateDefinition({ - ...reserveDefinition, - connectorWeightBps: 10_000 - }) - ).toThrow("connectorWeightBps") + InvalidConnectorWeights.forEach(connectorWeightBps => + expect(() => + assertReserveCreateDefinition({ + ...reserveDefinition, + connectorWeightBps + }) + ).toThrow("connectorWeightBps") + ) expect(() => assertReserveCreateDefinition({ ...reserveDefinition, name: "" }) ).toThrow("name must contain") diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6066207..3d2fef3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,11 +5,22 @@ settings: excludeLinksFromLockfile: true overrides: + '@3fv/prelude-ts': ^0.8.41 '@aws-sdk/client-firehose': 3.1102.0 '@aws-sdk/client-kms': 3.1102.0 '@aws-sdk/client-sns': 3.1102.0 '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 + bluebird: 3.7.2 + debug: 4.3.4 + lodash: 4.18.1 + prettier: 3.8.1 + tracer: 1.3.0 + typechain>prettier: 2.8.8 + webpack: 5.104.1 + webpack-cli: 6.0.1 + webpack-dev-server: 6.0.0 + ws: 8.21.0 pnpmfileChecksum: sha256-aSegbCvK5TyBUeMcgQLjFgZgcFmq1CMqHT+lQb93Qks= @@ -61,7 +72,7 @@ importers: specifier: ^17.0.0 version: 17.0.0 prettier: - specifier: ^3.8.1 + specifier: 3.8.1 version: 3.8.1 ts-jest: specifier: ^29.4.6 @@ -98,13 +109,13 @@ importers: specifier: ^6.0.2 version: 6.0.2 webpack: - specifier: ^5.104.1 + specifier: 5.104.1 version: 5.104.1(webpack-cli@6.0.1) webpack-cli: - specifier: ^6.0.1 + specifier: 6.0.1 version: 6.0.1(webpack-dev-server@6.0.0)(webpack@5.104.1) webpack-dev-server: - specifier: ^6.0.0 + specifier: 6.0.0 version: 6.0.0(bufferutil@4.1.0)(tslib@2.8.1)(utf-8-validate@6.0.6)(webpack-cli@6.0.1)(webpack@5.104.1) packages/sdk-core: @@ -164,7 +175,7 @@ importers: specifier: ^2.0.7 version: 2.2.0 lodash: - specifier: ^4.18.1 + specifier: 4.18.1 version: 4.18.1 pako: specifier: ^2.1.0 @@ -212,9 +223,6 @@ importers: '@solana/web3.js': specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) - '@wireio/sdk-core': - specifier: workspace:* - version: link:../sdk-core ethers: specifier: ^5.8.0 version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) @@ -259,16 +267,16 @@ importers: specifier: 3.7.2 version: 3.7.2 debug: - specifier: ^4.3.4 + specifier: 4.3.4 version: 4.3.4 eventemitter3: specifier: ^5.0.4 version: 5.0.4 lodash: - specifier: ^4.18.1 + specifier: 4.18.1 version: 4.18.1 tracer: - specifier: ^1.3.0 + specifier: 1.3.0 version: 1.3.0 devDependencies: '@types/lodash': @@ -368,10 +376,10 @@ importers: specifier: 6.0.2 version: 6.0.2 webpack: - specifier: ^5.104.1 + specifier: 5.104.1 version: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: - specifier: ^6.0.1 + specifier: 6.0.1 version: 6.0.1(webpack@5.104.1) packages/wallet-ext-sdk: @@ -1702,22 +1710,22 @@ packages: resolution: {integrity: sha512-u8d0pJ5YFgneF/GuvEiDA61Tf1VDomHHYMjv/wc9XzYj7nopltpG96nXN5dJRstxZhcNpV1g+nT6CydO7pHbjA==} engines: {node: '>=18.12.0'} peerDependencies: - webpack: ^5.82.0 - webpack-cli: 6.x.x + webpack: 5.104.1 + webpack-cli: 6.0.1 '@webpack-cli/info@3.0.1': resolution: {integrity: sha512-coEmDzc2u/ffMvuW9aCjoRzNSPDl/XLuhPdlFRpT9tZHmJ/039az33CE7uH+8s0uL1j5ZNtfdv0HkfaKRBGJsQ==} engines: {node: '>=18.12.0'} peerDependencies: - webpack: ^5.82.0 - webpack-cli: 6.x.x + webpack: 5.104.1 + webpack-cli: 6.0.1 '@webpack-cli/serve@3.0.1': resolution: {integrity: sha512-sbgw03xQaCLiT6gcY/6u3qBDn01CWw/nbaXl3gTdTFuJJ75Gffv3E3DBpgvY2fkkrdS1fpjaXNOmJlnbtKauKg==} engines: {node: '>=18.12.0'} peerDependencies: - webpack: ^5.82.0 - webpack-cli: 6.x.x + webpack: 5.104.1 + webpack-cli: 6.0.1 webpack-dev-server: '*' peerDependenciesMeta: webpack-dev-server: @@ -2159,7 +2167,7 @@ packages: resolution: {integrity: sha512-3JLW90aBGeaTLpM7mYQKpnVdgsUZRExY55giiZgLuX/xTQRUs1dOCwbBnWnvY6Q6rfZoXMNwzOQJCSZPppfqXA==} engines: {node: '>= 20.9.0'} peerDependencies: - webpack: ^5.1.0 + webpack: 5.104.1 create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -2176,7 +2184,7 @@ packages: engines: {node: '>= 18.12.0'} peerDependencies: '@rspack/core': 0.x || ^1.0.0 || ^2.0.0-0 - webpack: ^5.27.0 + webpack: 5.104.1 peerDependenciesMeta: '@rspack/core': optional: true @@ -2209,14 +2217,6 @@ packages: dateformat@4.5.1: resolution: {integrity: sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==} - debug@2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2226,15 +2226,6 @@ packages: supports-color: optional: true - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - decimal.js@10.6.0: resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} @@ -2706,7 +2697,7 @@ packages: engines: {node: '>=10.13.0'} peerDependencies: '@rspack/core': 0.x || 1.x - webpack: ^5.20.0 + webpack: 5.104.1 peerDependenciesMeta: '@rspack/core': optional: true @@ -2888,7 +2879,7 @@ packages: isomorphic-ws@4.0.1: resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} peerDependencies: - ws: '*' + ws: 8.21.0 istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} @@ -3228,7 +3219,7 @@ packages: resolution: {integrity: sha512-AOSS0IdEB95ayVkxn5oGzNQwqAi2J0Jb/kKm43t7H73s8+f5873g0yuj0PNvK4dO75mu5DHg4nlgp4k6Kga8eg==} engines: {node: '>= 12.13.0'} peerDependencies: - webpack: ^5.0.0 + webpack: 5.104.1 minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} @@ -3259,9 +3250,6 @@ packages: engines: {node: '>=10'} hasBin: true - ms@2.0.0: - resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -3821,7 +3809,7 @@ packages: resolution: {integrity: sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==} engines: {node: '>= 18.12.0'} peerDependencies: - webpack: ^5.27.0 + webpack: 5.104.1 superstruct@0.15.5: resolution: {integrity: sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==} @@ -3877,7 +3865,7 @@ packages: lightningcss: '*' postcss: '*' uglify-js: '*' - webpack: ^5.1.0 + webpack: 5.104.1 peerDependenciesMeta: '@minify-html/node': optional: true @@ -4027,7 +4015,7 @@ packages: peerDependencies: loader-utils: '*' typescript: '*' - webpack: ^4.0.0 || ^5.0.0 + webpack: 5.104.1 peerDependenciesMeta: loader-utils: optional: true @@ -4197,7 +4185,7 @@ packages: engines: {node: '>=18.12.0'} hasBin: true peerDependencies: - webpack: ^5.82.0 + webpack: 5.104.1 webpack-bundle-analyzer: '*' webpack-dev-server: '*' peerDependenciesMeta: @@ -4210,7 +4198,7 @@ packages: resolution: {integrity: sha512-zWrde9VZDiRaFuWsjHO40wm9LxxtXEk8DdzFXdU7eU5ZpiANnZZDBbZgN3guxbEoKqUHd9YupBmynyioz42nkA==} engines: {node: '>= 20.9.0'} peerDependencies: - webpack: ^5.101.0 + webpack: 5.104.1 peerDependenciesMeta: webpack: optional: true @@ -4220,7 +4208,7 @@ packages: engines: {node: '>= 22.15.0'} hasBin: true peerDependencies: - webpack: ^5.101.0 + webpack: 5.104.1 webpack-cli: '*' peerDependenciesMeta: webpack: @@ -4296,30 +4284,6 @@ packages: resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - ws@7.5.13: - resolution: {integrity: sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==} - engines: {node: '>=8.3.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - - ws@8.18.0: - resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.21.0: resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} engines: {node: '>=10.0.0'} @@ -4579,7 +4543,7 @@ snapshots: '@babel/types': 7.29.7 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.3 + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -4738,7 +4702,7 @@ snapshots: '@babel/parser': 7.29.7 '@babel/template': 7.29.7 '@babel/types': 7.29.7 - debug: 4.4.3 + debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -5012,7 +4976,7 @@ snapshots: '@ethersproject/transactions': 5.8.0 '@ethersproject/web': 5.8.0 bech32: 1.1.4 - ws: 8.18.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -5147,7 +5111,7 @@ snapshots: '@jest/console@30.4.1': dependencies: '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 chalk: 4.1.2 jest-message-util: 30.4.1 jest-util: 30.4.1 @@ -5224,7 +5188,7 @@ snapshots: dependencies: '@jest/types': 30.4.1 '@sinonjs/fake-timers': 15.4.0 - '@types/node': 25.5.0 + '@types/node': 22.20.0 jest-message-util: 30.4.1 jest-mock: 30.4.1 jest-util: 30.4.1 @@ -5242,7 +5206,7 @@ snapshots: '@jest/pattern@30.4.0': dependencies: - '@types/node': 25.5.0 + '@types/node': 22.20.0 jest-regex-util: 30.4.0 '@jest/reporters@30.4.1': @@ -5253,7 +5217,7 @@ snapshots: '@jest/transform': 30.4.1 '@jest/types': 30.4.1 '@jridgewell/trace-mapping': 0.3.31 - '@types/node': 25.5.0 + '@types/node': 22.20.0 chalk: 4.1.2 collect-v8-coverage: 1.0.3 exit-x: 0.2.2 @@ -5939,7 +5903,7 @@ snapshots: '@types/jsdom@21.1.7': dependencies: - '@types/node': 25.5.0 + '@types/node': 22.20.0 '@types/tough-cookie': 4.0.5 parse5: 7.3.0 @@ -6032,7 +5996,7 @@ snapshots: '@typescript-eslint/types': 8.64.0 '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.2) '@typescript-eslint/visitor-keys': 8.64.0 - debug: 4.4.3 + debug: 4.3.4 eslint: 10.7.0 typescript: 6.0.2 transitivePeerDependencies: @@ -6042,7 +6006,7 @@ snapshots: dependencies: '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.2) '@typescript-eslint/types': 8.64.0 - debug: 4.4.3 + debug: 4.3.4 typescript: 6.0.2 transitivePeerDependencies: - supports-color @@ -6061,7 +6025,7 @@ snapshots: '@typescript-eslint/types': 8.64.0 '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.2) '@typescript-eslint/utils': 8.64.0(eslint@10.7.0)(typescript@6.0.2) - debug: 4.4.3 + debug: 4.3.4 eslint: 10.7.0 ts-api-utils: 2.5.0(typescript@6.0.2) typescript: 6.0.2 @@ -6076,7 +6040,7 @@ snapshots: '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.2) '@typescript-eslint/types': 8.64.0 '@typescript-eslint/visitor-keys': 8.64.0 - debug: 4.4.3 + debug: 4.3.4 minimatch: 10.2.5 semver: 7.8.5 tinyglobby: 0.2.17 @@ -6469,7 +6433,7 @@ snapshots: dependencies: bytes: 3.1.2 content-type: 2.0.0 - debug: 4.4.3 + debug: 4.3.4 http-errors: 2.0.1 iconv-lite: 0.7.3 on-finished: 2.4.1 @@ -6669,7 +6633,7 @@ snapshots: dependencies: bytes: 3.1.2 compressible: 2.0.18 - debug: 2.6.9 + debug: 4.3.4 negotiator: 0.6.4 on-headers: 1.1.0 safe-buffer: 5.2.1 @@ -6764,18 +6728,10 @@ snapshots: dateformat@4.5.1: {} - debug@2.6.9: - dependencies: - ms: 2.0.0 - debug@4.3.4: dependencies: ms: 2.1.2 - debug@4.4.3: - dependencies: - ms: 2.1.3 - decimal.js@10.6.0: {} dedent@1.7.2: {} @@ -7059,7 +7015,7 @@ snapshots: content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.2.2 - debug: 4.4.3 + debug: 4.3.4 depd: 2.0.0 encodeurl: 2.0.0 escape-html: 1.0.3 @@ -7120,7 +7076,7 @@ snapshots: finalhandler@2.1.1: dependencies: - debug: 4.4.3 + debug: 4.3.4 encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 @@ -7327,13 +7283,13 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 - debug: 4.4.3 + debug: 4.3.4 transitivePeerDependencies: - supports-color http-proxy-middleware@4.2.0: dependencies: - debug: 4.4.3 + debug: 4.3.4 httpxy: 0.5.4 is-glob: 4.0.3 is-plain-obj: 4.1.0 @@ -7344,7 +7300,7 @@ snapshots: https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.4 - debug: 4.4.3 + debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -7448,9 +7404,9 @@ snapshots: isobject@3.0.1: {} - isomorphic-ws@4.0.1(ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6)): + isomorphic-ws@4.0.1(ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)): dependencies: - ws: 7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6) + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) istanbul-lib-coverage@3.2.2: {} @@ -7473,7 +7429,7 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: '@jridgewell/trace-mapping': 0.3.31 - debug: 4.4.3 + debug: 4.3.4 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -7498,11 +7454,11 @@ snapshots: delay: 5.0.0 es6-promisify: 5.0.0 eyes: 0.1.8 - isomorphic-ws: 4.0.1(ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + isomorphic-ws: 4.0.1(ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) json-stringify-safe: 5.0.1 stream-json: 1.9.1 uuid: 8.3.2 - ws: 7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6) + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -7519,7 +7475,7 @@ snapshots: '@jest/expect': 30.4.1 '@jest/test-result': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 chalk: 4.1.2 co: 4.6.0 dedent: 1.7.2 @@ -7624,7 +7580,7 @@ snapshots: '@jest/environment': 30.4.1 '@jest/fake-timers': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 jest-mock: 30.4.1 jest-util: 30.4.1 jest-validate: 30.4.1 @@ -7632,7 +7588,7 @@ snapshots: jest-haste-map@30.4.1: dependencies: '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -7679,7 +7635,7 @@ snapshots: jest-mock@30.4.1: dependencies: '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 jest-util: 30.4.1 jest-pnp-resolver@1.2.3(jest-resolve@30.4.1): @@ -7713,7 +7669,7 @@ snapshots: '@jest/test-result': 30.4.1 '@jest/transform': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 chalk: 4.1.2 emittery: 0.13.1 exit-x: 0.2.2 @@ -7742,7 +7698,7 @@ snapshots: '@jest/test-result': 30.4.1 '@jest/transform': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 chalk: 4.1.2 cjs-module-lexer: 2.2.0 collect-v8-coverage: 1.0.3 @@ -7789,7 +7745,7 @@ snapshots: jest-util@30.4.1: dependencies: '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 chalk: 4.1.2 ci-info: 4.4.0 graceful-fs: 4.2.11 @@ -7808,7 +7764,7 @@ snapshots: dependencies: '@jest/test-result': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -7823,7 +7779,7 @@ snapshots: jest-worker@30.4.1: dependencies: - '@types/node': 25.5.0 + '@types/node': 22.20.0 '@ungap/structured-clone': 1.3.2 jest-util: 30.4.1 merge-stream: 2.0.0 @@ -8030,8 +7986,6 @@ snapshots: mkdirp@1.0.4: {} - ms@2.0.0: {} - ms@2.1.2: {} ms@2.1.3: {} @@ -8352,7 +8306,7 @@ snapshots: router@2.2.0: dependencies: - debug: 4.4.3 + debug: 4.3.4 depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 @@ -8411,7 +8365,7 @@ snapshots: send@1.2.1: dependencies: - debug: 4.4.3 + debug: 4.3.4 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -8431,7 +8385,7 @@ snapshots: dependencies: accepts: 1.3.8 batch: 0.6.1 - debug: 2.6.9 + debug: 4.3.4 escape-html: 1.0.3 http-errors: 1.8.1 mime-types: 2.1.35 @@ -8777,7 +8731,7 @@ snapshots: typechain@8.3.2(typescript@6.0.2): dependencies: '@types/prettier': 2.7.3 - debug: 4.4.3 + debug: 4.3.4 fs-extra: 7.0.1 glob: 7.1.7 js-sha3: 0.8.0 @@ -9126,16 +9080,6 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.1.0 - ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6): - optionalDependencies: - bufferutil: 4.1.0 - utf-8-validate: 6.0.6 - - ws@8.18.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): - optionalDependencies: - bufferutil: 4.1.0 - utf-8-validate: 6.0.6 - ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): optionalDependencies: bufferutil: 4.1.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5eef171..253da11 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,15 +4,3 @@ packages: minimumReleaseAge: 1440 minimumReleaseAgeExclude: - "@wireio/*" -overrides: - '@3fv/prelude-ts': ^0.8.41 - bluebird: 3.7.2 - debug: 4.3.4 - lodash: 4.18.1 - prettier: 3.8.1 - "typechain>prettier": 2.8.8 - tracer: 1.3.0 - webpack: 5.104.1 - webpack-cli: 6.0.1 - webpack-dev-server: 6.0.0 - ws: 8.21.0 From 84c99dbdd278dd79e788711020185a3b955d1b7e Mon Sep 17 00:00:00 2001 From: joshglogau Date: Wed, 19 Aug 2026 11:33:38 -0400 Subject: [PATCH 38/48] refactor(sdk-outpost): consume producer libraries with ethers v6 --- CLAUDE.md | 6 +- README.md | 9 +- RELEASING.md | 33 +-- jest.config.ts | 1 + package.json | 6 +- .../src/contracts/sysio/reserv/Client.ts | 10 +- packages/sdk-outpost/README.md | 39 ++- packages/sdk-outpost/package.json | 23 +- .../src/artifacts/Compatibility.ts | 13 +- .../sdk-outpost/src/artifacts/Manifests.ts | 8 + packages/sdk-outpost/src/artifacts/index.ts | 2 +- .../src/clients/ethereum/Connection.ts | 31 ++ .../clients/ethereum/EthereumOutpostClient.ts | 23 +- .../clients/ethereum/EthereumReserveClient.ts | 63 ++-- .../ethereum/EthereumReserveSwapClient.ts | 89 +++--- .../sdk-outpost/src/clients/ethereum/Types.ts | 8 +- .../src/clients/solana/SolanaOutpostClient.ts | 5 +- .../src/clients/solana/SolanaReserveClient.ts | 2 +- .../clients/solana/SolanaReserveSwapClient.ts | 6 +- .../sdk-outpost/src/clients/solana/Types.ts | 2 +- .../src/contracts/ethereum/index.ts | 1 - packages/sdk-outpost/src/contracts/index.ts | 1 - .../sdk-outpost/src/deployments/Schema.ts | 4 +- packages/sdk-outpost/src/index.ts | 2 - packages/sdk-outpost/src/programs/index.ts | 1 - .../sdk-outpost/src/programs/solana/index.ts | 1 - packages/sdk-outpost/src/reserves/Types.ts | 8 +- .../sdk-outpost/src/reserves/Validation.ts | 32 +- .../verification/OutpostDeploymentVerifier.ts | 19 +- .../sdk-outpost/src/verification/Types.ts | 4 +- packages/sdk-outpost/tests/Fixtures.ts | 42 +-- .../tests/assets/Artifacts.test.ts | 16 +- .../ethereum/EthereumOutpostClient.test.ts | 81 ++--- .../ethereum/EthereumReserveClient.test.ts | 159 ++++++---- .../solana/SolanaOutpostClient.test.ts | 6 +- .../solana/SolanaReserveClient.test.ts | 8 +- .../tests/reserves/Validation.test.ts | 2 +- pnpm-workspace.yaml | 3 - scripts/sdk-outpost/clean.mjs | 23 -- scripts/sdk-outpost/config.mjs | 30 -- scripts/sdk-outpost/generate.mjs | 278 ------------------ scripts/sdk-outpost/verify-package.mjs | 120 -------- 42 files changed, 408 insertions(+), 812 deletions(-) create mode 100644 packages/sdk-outpost/src/artifacts/Manifests.ts create mode 100644 packages/sdk-outpost/src/clients/ethereum/Connection.ts delete mode 100644 packages/sdk-outpost/src/contracts/ethereum/index.ts delete mode 100644 packages/sdk-outpost/src/contracts/index.ts delete mode 100644 packages/sdk-outpost/src/programs/index.ts delete mode 100644 packages/sdk-outpost/src/programs/solana/index.ts delete mode 100755 scripts/sdk-outpost/clean.mjs delete mode 100644 scripts/sdk-outpost/config.mjs delete mode 100755 scripts/sdk-outpost/generate.mjs delete mode 100755 scripts/sdk-outpost/verify-package.mjs diff --git a/CLAUDE.md b/CLAUDE.md index 0aec046..fca5df6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -46,7 +46,7 @@ shared ──→ shared-web sdk-core ──→ wallet-ext-sdk ──→ wallet-browser-ext -sdk-outpost (source artifact packages ──→ generated external-chain clients) +source artifact libraries ──→ sdk-outpost external-chain clients ``` Protoc plugins and bundler are standalone (no internal deps). @@ -224,12 +224,12 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, and program binaries come from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never replace them with sibling artifact links. Generated clients are ignored build outputs and must not be copied or edited here. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come directly from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never regenerate them here or replace them with committed sibling links. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. - `packages/sdk-outpost` owns external reserve lifecycle and swap execution. Staking remains outside this package until its dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. -- Publish `sdk-outpost` only through the repository release workflow, with `prepack` and release verification passing. +- Publish `sdk-outpost` only through the repository release workflow after its normal build and tests pass. - Do not describe `sdk-outpost` as npm-available until `npm view` succeeds for both exact producer artifact versions and `@wireio/sdk-outpost`, and a clean platform-compatible install passes without sibling artifact links. - `wallet-browser-ext` uses a global shim to avoid `new Function()` restrictions in Chrome MV3 - Path aliases in tsconfig base resolve to `src/` for dev, but published packages use `lib/` — jest module name maps handle this mismatch diff --git a/README.md b/README.md index 8d3e98f..19f04aa 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,14 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi | [`@wireio/shared-web`](packages/shared-web/) | Web-specific utilities | *private* | | [`@wireio/shared-node`](packages/shared-node/) | Node.js-specific utilities | *private* | | [`@wireio/sdk-core`](packages/sdk-core/) | Wire blockchain SDK core types, primitives, signing helpers, generated `sysio` contract proxy, and domain workflows such as multisig and reserves | [![npm](https://img.shields.io/npm/v/@wireio/sdk-core)](https://www.npmjs.com/package/@wireio/sdk-core) | -| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed Ethereum and Solana outpost clients generated from source-owned artifact packages | *first release pending* | +| [`@wireio/sdk-outpost`](packages/sdk-outpost/) | Strictly typed Ethereum and Solana outpost clients consuming source-owned artifact libraries | *first release pending* | | [`@wireio/wallet-ext-sdk`](packages/wallet-ext-sdk/) | Client SDK for the Wire Wallet browser extension | [![npm](https://img.shields.io/npm/v/@wireio/wallet-ext-sdk)](https://www.npmjs.com/package/@wireio/wallet-ext-sdk) | | [`@wireio/wallet-browser-ext`](packages/wallet-browser-ext/) | Chrome extension developer wallet for Wire | *private* | -The sdk-outpost build consumes exact published versions of the Ethereum and -Solana artifact packages. Generated TypeChain and Anchor clients are ignored -build outputs and must not be edited or committed. +The sdk-outpost package consumes exact published versions of the Ethereum and +Solana artifact libraries, including their ethers v6 factories and Anchor +types. Chain bindings are generated and verified by those producer repos, not +inside this monorepo. ## Examples diff --git a/RELEASING.md b/RELEASING.md index 0730833..ec13984 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -6,15 +6,15 @@ directory outside this process. ## Current first-release state -As of August 18, 2026, both exact producer artifact packages are public on npm -at `0.1.1`. The first `@wireio/sdk-outpost` release is still pending. Its +Producer package `0.2.1` is the prerequisite release for directly importable +TypeScript libraries and ethers v6 bindings. The first `@wireio/sdk-outpost` +release remains pending until both producer packages publish that version. Its workspace version remains `0.0.0` until the existing repository-wide patch -workflow bumps and publishes it; do not create a one-off version or publish the -workspace directory manually. +workflow bumps and publishes it. ## Artifact prerequisites -The package consumes exact build-time versions of: +The package consumes exact runtime versions of: - `@wireio/outpost-ethereum-artifacts`, published from `wire-ethereum`; - `@wireio/outpost-solana-artifacts`, published from `wire-solana`. @@ -30,20 +30,16 @@ catalog for mutable endpoints. Before updating either dependency, verify its registry integrity/signature, source revision, artifact checksums, and immutable version. The producer repos are non-public, so their current npm releases do not carry public provenance. -Keep both versions exact in `packages/sdk-outpost/package.json`, update -`pnpm-lock.yaml` with the repository-pinned pnpm version, and then run the -repository's platform-compatible install and test flow. +Keep both versions exact in `packages/sdk-outpost/package.json`. Update +`pnpm-lock.yaml` with the repository-pinned pnpm version only after both exact +versions resolve from npm, then run the repository install and test flow. ## Release requirements - Use Node.js 24 and the repository-pinned pnpm version through Corepack. -- Generate clients only through `scripts/sdk-outpost/generate.mjs`; this - consumer-side step validates the pinned producer packages and converts their - ABI/IDL into ignored TypeChain, Anchor, and artifact-manifest sources. Never - edit those generated sources by hand. -- Keep `scripts/sdk-outpost/verify-package.mjs` as the package boundary check; - it verifies the built CommonJS/ESM entrypoints and rejects raw producer or - generated sources from the npm payload. +- Import ethers v6 factories, Anchor types, runtime artifacts, and manifests + directly from the exact producer packages; `sdk-outpost` must not regenerate + or duplicate them. - Confirm the package contains no secrets, RPC credentials, private keys, deployment addresses, or mutable environment configuration. - Confirm deployment profiles are distributed through the authenticated @@ -64,7 +60,7 @@ From the repository root: corepack pnpm install --no-frozen-lockfile --ignore-scripts corepack pnpm run lint corepack pnpm run test:ci -corepack pnpm --dir packages/sdk-outpost run verify:release +corepack pnpm --dir packages/sdk-outpost run build ``` Package verification requires the publishable files to remain limited to the @@ -75,7 +71,7 @@ trees must not be published by `sdk-outpost`. The first successful publish creates the npm package page. Release sequence: -1. Confirm both exact `0.1.1` producer artifact versions are publicly +1. Confirm both exact `0.2.1` producer artifact versions are publicly installable. 2. Confirm the `wireio` organization exists on npm and the release owner can publish public packages in that scope. @@ -92,8 +88,7 @@ The first successful publish creates the npm package page. Release sequence: The preparation gate keeps each package on its existing version track. A patch bump therefore makes the first SDK release `@wireio/sdk-outpost@0.0.1`, while `@wireio/sdk-core` advances by one patch on its independent track. -The Tag Release gate must install the workspace, generate clients from -the producer packages, build and test every package, verify public entrypoints, +The Tag Release gate must install the workspace, build and test every package, and publish with npm provenance. Do not create the first `sdk-outpost` version manually. A failed publish must be diff --git a/jest.config.ts b/jest.config.ts index 0679654..69d99f0 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -6,6 +6,7 @@ const config: Config = { "packages/shared-node", "packages/shared-web", "packages/sdk-core", + "packages/sdk-outpost", "packages/wallet-browser-ext", "packages/wallet-ext-sdk" ] diff --git a/package.json b/package.json index b99dae8..f2a42a3 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w --preserveWatchOutput", - "build": "pnpm --dir packages/sdk-outpost run prepare:compile && pnpm run compile && pnpm --dir packages/sdk-outpost run fix:hybrid:exports", + "build": "pnpm run compile", "typecheck:strict-null:sdk-core": "pnpm --dir packages/sdk-core run typecheck:strict-null", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "eslint .", - "test": "pnpm run build && jest && pnpm --filter @wireio/sdk-outpost run test && pnpm --filter @wireio/sdk-outpost run verify:package", - "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit && pnpm --filter @wireio/sdk-outpost run test && pnpm --filter @wireio/sdk-outpost run verify:package", + "test": "pnpm run build && jest", + "test:ci": "pnpm run build && pnpm run typecheck:strict-null:sdk-core && jest --reporters=default --reporters=jest-junit", "clean": "./scripts/clean.sh && pnpm -r run clean", "prepare": "husky" }, diff --git a/packages/sdk-core/src/contracts/sysio/reserv/Client.ts b/packages/sdk-core/src/contracts/sysio/reserv/Client.ts index 2d13a8b..a425e7f 100644 --- a/packages/sdk-core/src/contracts/sysio/reserv/Client.ts +++ b/packages/sdk-core/src/contracts/sysio/reserv/Client.ts @@ -39,6 +39,9 @@ import type { ReserveRewards } from "./Types.js" +/** Push-transaction response returned by the configured API client. */ +type APIClientPushTransactionResponse = ReturnType + function enumValue>( enumType: T, value: number | keyof T @@ -232,8 +235,7 @@ export class ReserveClient { limit: Number.MAX_SAFE_INTEGER }), row = rows.find( - candidate => - reserveRowSlugValue(candidate.reserve_code) === reserveCode + candidate => reserveRowSlugValue(candidate.reserve_code) === reserveCode ) return row ? normalizeReserveRow(row) : null @@ -261,7 +263,7 @@ export class ReserveClient { async pushMatchReserve( options: PushMatchReserveOptions, pushOptions: TransactionExtraOptions = options.pushOptions || {} - ): Promise>> { + ): APIClientPushTransactionResponse { return this.contractClient.actions.matchreserve.invoke( matchReserveActionData(options), { @@ -280,7 +282,7 @@ export class ReserveClient { async pushMatchReserves( options: PushMatchReservesOptions, pushOptions: TransactionExtraOptions = options.pushOptions || {} - ): Promise>> { + ): APIClientPushTransactionResponse { if (options.matches.length === 0) { throw new Error("At least one reserve match is required.") } diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 97fdb50..c7ff30a 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,10 +8,11 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Publication status as of August 18, 2026: the exact Ethereum and Solana producer -artifact packages are publicly available as `0.1.1`, while the first -`@wireio/sdk-outpost` npm release is pending. The workspace version remains -`0.0.0` until the repository-wide release workflow performs its patch bump. +Release target: producer package `0.2.1` adds directly importable TypeScript +libraries and ethers v6 bindings. The first `@wireio/sdk-outpost` npm release +remains pending until both producer releases are published. The workspace +version remains `0.0.0` until the repository release workflow performs its +patch bump. ## Install after the first SDK release @@ -20,14 +21,14 @@ npm install @wireio/sdk-outpost ``` Before using the registry command, verify that `@wireio/sdk-outpost` resolves -through `npm view`. The generator consumes exact registry versions of +through `npm view`. The SDK consumes exact registry versions of [`@wireio/outpost-ethereum-artifacts`](https://www.npmjs.com/package/@wireio/outpost-ethereum-artifacts) and [`@wireio/outpost-solana-artifacts`](https://www.npmjs.com/package/@wireio/outpost-solana-artifacts); do not replace them with committed machine-local links. -Node.js 22 or newer is supported. The package publishes CommonJS and native ES -module entrypoints with TypeScript declarations. +Node.js 22 or newer and ethers v6 are supported. The package publishes CommonJS +and native ES module entrypoints with TypeScript declarations. ## Supported surfaces @@ -96,7 +97,7 @@ Validate caller-owned deployment data and provide the matching external-chain provider: ```ts -import { providers } from "ethers" +import { JsonRpcProvider } from "ethers" import { EthereumContractName, @@ -110,7 +111,7 @@ const ethereum = await OutpostClient.create({ family: OutpostChainFamily.ethereum, options: { profile, - connection: new providers.JsonRpcProvider(ethereumRpcUrl) + connection: new JsonRpcProvider(ethereumRpcUrl) } }) const reserves = ethereum.contract(EthereumContractName.ReserveManager) @@ -214,21 +215,18 @@ const solana = await OutpostClient.create({ const liqsol = solana.program(SolanaProgramName.liqsolCore) ``` -The generated `LiqsolCore` type preserves the IDL's literal account namespace, +The producer-owned `LiqsolCore` type preserves the IDL's literal account namespace, including `Program["account"]["outpostConfig"]` and -`Program["account"]["reserve"]`. Regenerate from the source artifact -package; never widen the IDL to the base `Idl` type or edit generated Anchor -output by hand. +`Program["account"]["reserve"]`. Import it from +`@wireio/outpost-solana-artifacts`; never widen the IDL to the base `Idl` type. ## Artifact ownership `@wireio/outpost-ethereum-artifacts` and `@wireio/outpost-solana-artifacts` are -build-time inputs. Generation verifies every packaged ABI, IDL, normalized -runtime template, and program binary before compiling exact manifests into -`OutpostArtifactManifests`. Runtime verification then binds live executable -bytes to those producer artifacts. Generated TypeChain and Anchor sources are -ignored local build outputs; they are compiled into the published package and -are never maintained by hand in this repository. +normal runtime dependencies. Their producers verify and publish the ABIs, IDL, +runtime bytes, manifests, ethers v6 factories, and Anchor types together. +`sdk-outpost` imports those published libraries directly and only composes their +manifests for live deployment verification; it does not regenerate chain code. ## Consumer boundaries @@ -246,9 +244,8 @@ are never maintained by hand in this repository. ## Maintainer commands ```sh -pnpm --dir packages/sdk-outpost run generate +pnpm --dir packages/sdk-outpost run build pnpm --dir packages/sdk-outpost run test -pnpm --dir packages/sdk-outpost run verify:release ``` Release versions are managed by the monorepo-wide patch workflow. See the diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 87b1dba..bbe8798 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -36,32 +36,21 @@ "scripts": { "compile": "tsc -b tsconfig.json", "compile:watch": "tsc -b tsconfig.json -w", - "clean": "../../scripts/sdk-outpost/clean.mjs", - "generate": "../../scripts/sdk-outpost/generate.mjs", - "prepare:compile": "pnpm run clean && pnpm run generate", - "build": "pnpm run prepare:compile && pnpm run compile && pnpm run fix:hybrid:exports", - "test": "pnpm run generate && NODE_OPTIONS=--experimental-vm-modules jest", - "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs .", - "verify:package": "../../scripts/sdk-outpost/verify-package.mjs", - "verify:release": "pnpm run build && pnpm run verify:package", - "prepack": "pnpm run verify:release" + "build": "pnpm run compile && pnpm run fix:hybrid:exports", + "test": "NODE_OPTIONS=--experimental-vm-modules jest", + "fix:hybrid:exports": "node ../../scripts/fix-hybrid-output.mjs ." }, "dependencies": { "@coral-xyz/anchor": "^0.32.1", - "@ethersproject/abi": "^5.8.0", - "@ethersproject/providers": "^5.8.0", "@solana/spl-token": "^0.3.11", "@solana/web3.js": "^1.98.4", - "ethers": "^5.8.0", + "@wireio/outpost-ethereum-artifacts": "0.2.1", + "@wireio/outpost-solana-artifacts": "0.2.1", + "ethers": "^6.15.0", "ts-pattern": "^5.9.0", "zod": "^4.4.3" }, "devDependencies": { - "@wireio/outpost-ethereum-artifacts": "0.1.1", - "@wireio/outpost-solana-artifacts": "0.1.1", - "@typechain/ethers-v5": "^11.1.2", - "prettier": "3.8.1", - "typechain": "^8.3.2", "typescript": "6.0.2" } } diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index eff24fb..65cddf3 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -1,5 +1,5 @@ import { match } from "ts-pattern" -import { utils as ethersUtils } from "ethers" +import { getBytes, sha256 as ethersSha256 } from "ethers" import { EthereumContractName, @@ -7,7 +7,7 @@ import { OutpostDeploymentProfile, SolanaProgramName } from "../deployments/index.js" -import { OutpostArtifactManifests } from "./generated/index.js" +import { OutpostArtifactManifests } from "./Manifests.js" const SolanaProgramDataMetadataByteLength = 45 @@ -19,7 +19,7 @@ interface EthereumRuntimeLinkReference { /** Return the SHA-256 digest for chain runtime bytes. */ function sha256(value: Uint8Array): string { - return ethersUtils.sha256(value).slice(2) + return ethersSha256(value).slice(2) } /** Zero environment-specific linked-library addresses in live runtime code. */ @@ -27,7 +27,7 @@ function normalizeEthereumRuntimeCode( code: string, linkReferences: readonly EthereumRuntimeLinkReference[] ): Uint8Array { - const runtimeCode = Uint8Array.from(ethersUtils.arrayify(code)) + const runtimeCode = Uint8Array.from(getBytes(code)) let previousReferenceEnd = 0 linkReferences.forEach(({ start, length }) => { @@ -87,10 +87,7 @@ export function assertSolanaProgramArtifactCompatibility( ) } const digest = sha256( - programData.subarray( - SolanaProgramDataMetadataByteLength, - programBinaryEnd - ) + programData.subarray(SolanaProgramDataMetadataByteLength, programBinaryEnd) ) if (digest !== artifact.programBinarySha256) { throw new Error( diff --git a/packages/sdk-outpost/src/artifacts/Manifests.ts b/packages/sdk-outpost/src/artifacts/Manifests.ts new file mode 100644 index 0000000..7d3b109 --- /dev/null +++ b/packages/sdk-outpost/src/artifacts/Manifests.ts @@ -0,0 +1,8 @@ +import { EthereumOutpostArtifactManifest } from "@wireio/outpost-ethereum-artifacts" +import { SolanaOutpostArtifactManifest } from "@wireio/outpost-solana-artifacts" + +/** Exact producer manifests compiled into this SDK release. */ +export const OutpostArtifactManifests = { + ethereum: EthereumOutpostArtifactManifest, + solana: SolanaOutpostArtifactManifest +} as const diff --git a/packages/sdk-outpost/src/artifacts/index.ts b/packages/sdk-outpost/src/artifacts/index.ts index 24b24c3..2f22aed 100644 --- a/packages/sdk-outpost/src/artifacts/index.ts +++ b/packages/sdk-outpost/src/artifacts/index.ts @@ -1,2 +1,2 @@ export * from "./Compatibility.js" -export * from "./generated/index.js" +export * from "./Manifests.js" diff --git a/packages/sdk-outpost/src/clients/ethereum/Connection.ts b/packages/sdk-outpost/src/clients/ethereum/Connection.ts new file mode 100644 index 0000000..1f7537e --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/Connection.ts @@ -0,0 +1,31 @@ +import type { Provider, Signer } from "ethers" + +/** Narrow an ethers v6 connection to a signer without relying on a v5 static guard. */ +export function isEthereumSigner( + connection: Provider | Signer +): connection is Signer { + return ( + "sendTransaction" in connection && + typeof connection.sendTransaction === "function" + ) +} + +/** Return the provider owned directly or through a connected signer. */ +export function ethereumProvider(connection: Provider | Signer): Provider { + if (!isEthereumSigner(connection)) return connection + if (connection.provider == null) { + throw new Error("Ethereum signer must be connected to a provider") + } + return connection.provider +} + +/** Require a signer before an Ethereum operation can open a wallet prompt. */ +export function assertEthereumSigner( + connection: Provider | Signer, + operation: string +): Signer { + if (!isEthereumSigner(connection)) { + throw new Error(`${operation} requires a connected signer.`) + } + return connection +} diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 0efb477..7586c52 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -1,31 +1,22 @@ -import { providers, Signer } from "ethers" -import { match } from "ts-pattern" - import { OPPInbound__factory, OPP__factory, OperatorRegistry__factory, ReserveManager__factory -} from "../../contracts/ethereum/index.js" +} from "@wireio/outpost-ethereum-artifacts" +import type { Provider } from "ethers" +import { match } from "ts-pattern" + import { EthereumContractName, OutpostChainFamily } from "../../deployments/index.js" import { OutpostDeploymentVerifier } from "../../verification/index.js" +import { ethereumProvider } from "./Connection.js" import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" import { EthereumReserveClient } from "./EthereumReserveClient.js" import { EthereumReserveSwapClient } from "./EthereumReserveSwapClient.js" -function resolveProvider( - connection: providers.Provider | Signer -): providers.Provider { - if (!Signer.isSigner(connection)) return connection - if (connection.provider == null) { - throw new Error("Ethereum signer must be connected to a provider") - } - return connection.provider -} - /** Strictly typed access to one verified Ethereum outpost deployment. */ export class EthereumOutpostClient { /** Create the Ethereum backend for the package-level outpost client facade. */ @@ -33,7 +24,7 @@ export class EthereumOutpostClient { options: EthereumOutpostClientOptions ): Promise { const { connection, profile } = options, - provider = resolveProvider(connection) + provider = ethereumProvider(connection) await OutpostDeploymentVerifier.verify({ family: OutpostChainFamily.ethereum, @@ -46,7 +37,7 @@ export class EthereumOutpostClient { private constructor( private readonly options: EthereumOutpostClientOptions, /** Provider verified against the configured Ethereum chain. */ - readonly provider: providers.Provider + readonly provider: Provider ) { this.reserves = new EthereumReserveClient( this.contract(EthereumContractName.ReserveManager), diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts index 80d4076..32622ee 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveClient.ts @@ -1,14 +1,17 @@ +import type { + ReserveManager, + ReserveManagerLib +} from "@wireio/outpost-ethereum-artifacts" import { - constants as ethersConstants, Contract, - Signer, - utils as ethersUtils, - type providers + getAddress, + getBigInt, + ZeroAddress, + type Provider, + type Signer } from "ethers" import { match } from "ts-pattern" -import type { ReserveManager } from "../../contracts/ethereum/index.js" -import type { ReserveManagerLib } from "../../contracts/ethereum/generated/ReserveManager.js" import { assertEthereumReserveCreateRequest, assertReserveUnsigned64, @@ -19,12 +22,13 @@ import { type OutpostReserveIdentity, type OutpostReserveSubmission } from "../../reserves/index.js" +import { assertEthereumSigner } from "./Connection.js" const ConfirmationCount = 1, EthereumLocalReserveStatus = { - pending: 0, - active: 1, - cancelled: 2 + pending: 0n, + active: 1n, + cancelled: 2n } as const, Erc20Interface = [ "function allowance(address owner,address spender) view returns (uint256)", @@ -36,7 +40,7 @@ export class EthereumReserveClient { /** Bind reserve lifecycle operations to a generated ReserveManager client. */ constructor( private readonly reserveManager: ReserveManager, - private readonly connection: providers.Provider | Signer + private readonly connection: Provider | Signer ) {} /** Create a pending native-token reserve. */ @@ -48,7 +52,7 @@ export class EthereumReserveClient { const parameters = this.nativeParameters(request), overrides = { value: request.externalTokenAmount } - await this.reserveManager.callStatic.create_reserve( + await this.reserveManager.create_reserve.staticCall( ...parameters, overrides ) @@ -72,15 +76,14 @@ export class EthereumReserveClient { request.tokenCode ) - if (configuredTokenAddress === ethersConstants.AddressZero) { + if (configuredTokenAddress === ZeroAddress) { throw new Error( `No ERC-20 address is configured for tokenCode ${request.tokenCode.toString()}.` ) } if ( tokenAddress != null && - ethersUtils.getAddress(tokenAddress) !== - ethersUtils.getAddress(configuredTokenAddress) + getAddress(tokenAddress) !== getAddress(configuredTokenAddress) ) { throw new Error( `ERC-20 address ${tokenAddress} does not match the configured route ${configuredTokenAddress}.` @@ -88,21 +91,26 @@ export class EthereumReserveClient { } const token = new Contract(configuredTokenAddress, Erc20Interface, signer), - allowance = await token.allowance(owner, this.reserveManager.address) - if (allowance.lt(request.externalTokenAmount)) { + reserveManagerAddress = await this.reserveManager.getAddress(), + allowance = getBigInt( + await token.allowance(owner, reserveManagerAddress) + ) + if (allowance < getBigInt(request.externalTokenAmount)) { const approval = await token.approve( - this.reserveManager.address, + reserveManagerAddress, request.externalTokenAmount ) await approval.wait(ConfirmationCount) } const arguments_ = this.createArguments(request) - await this.reserveManager.callStatic.requestReserveCreateErc20WithApproval( + await this.reserveManager.requestReserveCreateErc20WithApproval.staticCall( arguments_ ) const transaction = - await this.reserveManager.requestReserveCreateErc20WithApproval(arguments_) + await this.reserveManager.requestReserveCreateErc20WithApproval( + arguments_ + ) await transaction.wait(ConfirmationCount) return { transactionId: transaction.hash } } @@ -116,7 +124,7 @@ export class EthereumReserveClient { this.assertSigner() const arguments_ = this.createArguments(request) - await this.reserveManager.callStatic.requestReserveCreateErc20WithPermit( + await this.reserveManager.requestReserveCreateErc20WithPermit.staticCall( arguments_, permitSignature ) @@ -153,11 +161,11 @@ export class EthereumReserveClient { identity.reserveCode ) return { - tokenCode: reserve.tokenCode.toBigInt(), - reserveCode: reserve.reserveCode.toBigInt(), - externalTokenAmount: reserve.externalTokenAmount.toBigInt(), - requestedWireAmount: reserve.requestedWireAmount.toBigInt(), - connectorWeightBps: reserve.connectorWeightBps, + tokenCode: reserve.tokenCode, + reserveCode: reserve.reserveCode, + externalTokenAmount: reserve.externalTokenAmount, + requestedWireAmount: reserve.requestedWireAmount, + connectorWeightBps: Number(reserve.connectorWeightBps), status: match(reserve.status) .with( EthereumLocalReserveStatus.pending, @@ -180,10 +188,7 @@ export class EthereumReserveClient { } private assertSigner(): Signer { - if (!Signer.isSigner(this.connection)) { - throw new Error("Ethereum reserve operation requires a connected signer.") - } - return this.connection + return assertEthereumSigner(this.connection, "Ethereum reserve operation") } private createArguments( diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts index f836e11..a712476 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumReserveSwapClient.ts @@ -1,18 +1,23 @@ +import type { + ReserveManager, + ReserveManagerLib +} from "@wireio/outpost-ethereum-artifacts" import { - BigNumber, Contract, - Signer, + getBigInt, type BigNumberish, - type providers + type EventLog, + type Log, + type Provider, + type Signer } from "ethers" -import type { ReserveManager } from "../../contracts/ethereum/index.js" -import type { ReserveManagerLib } from "../../contracts/ethereum/generated/ReserveManager.js" import { assertReserveSwapRequest, type ReserveSwapRequest, type ReserveSwapSubmission } from "../../reserves/index.js" +import { assertEthereumSigner, ethereumProvider } from "./Connection.js" const BasisPointDenominator = 10_000, ConfirmationCount = 1, @@ -23,18 +28,12 @@ const BasisPointDenominator = 10_000, ], SubmissionGasHeadroomBps = 2_500 -/** Event fields required to extract a ReserveManager deposit id. */ -interface EthereumReserveSwapEvent { - event?: string - args?: readonly BigNumberish[] -} - /** Reserve-swap writes and balance reads for one verified Ethereum outpost. */ export class EthereumReserveSwapClient { /** Create an Ethereum reserve-swap workflow bound to a verified deployment. */ constructor( private readonly reserveManager: ReserveManager, - private readonly connection: providers.Provider | Signer + private readonly connection: Provider | Signer ) {} /** Escrow native ETH and return the confirmed protocol deposit id. */ @@ -46,8 +45,8 @@ export class EthereumReserveSwapClient { const parameters = this.nativeParameters(request), overrides = { value: request.sourceAmount } - await this.reserveManager.callStatic.requestSwap(...parameters, overrides) - const estimatedGas = await this.reserveManager.estimateGas.requestSwap( + await this.reserveManager.requestSwap.staticCall(...parameters, overrides) + const estimatedGas = await this.reserveManager.requestSwap.estimateGas( ...parameters, overrides ), @@ -65,7 +64,7 @@ export class EthereumReserveSwapClient { return { transactionId: transaction.hash, sourceRequestId: EthereumReserveSwapClient.parseSourceRequestId( - receipt.events + receipt?.logs ) } } @@ -79,23 +78,24 @@ export class EthereumReserveSwapClient { const signer = this.assertSigner(), owner = await signer.getAddress(), token = new Contract(tokenAddress, Erc20Interface, signer), - allowance = await token.allowance(owner, this.reserveManager.address) + reserveManagerAddress = await this.reserveManager.getAddress(), + allowance = await token.allowance(owner, reserveManagerAddress) await EthereumReserveSwapClient.approvalAmounts( allowance, request.sourceAmount ).reduce>(async (previousApproval, amount) => { await previousApproval - const approval = await token.approve(this.reserveManager.address, amount) + const approval = await token.approve(reserveManagerAddress, amount) await approval.wait(ConfirmationCount) }, Promise.resolve()) const arguments_ = this.swapArguments(request) - await this.reserveManager.callStatic.requestSwapErc20WithApproval( + await this.reserveManager.requestSwapErc20WithApproval.staticCall( arguments_ ) const estimatedGas = - await this.reserveManager.estimateGas.requestSwapErc20WithApproval( + await this.reserveManager.requestSwapErc20WithApproval.estimateGas( arguments_ ), overrides = { @@ -110,33 +110,24 @@ export class EthereumReserveSwapClient { return { transactionId: transaction.hash, sourceRequestId: EthereumReserveSwapClient.parseSourceRequestId( - receipt.events + receipt?.logs ) } } /** Read the native balance of an Ethereum account. */ async nativeBalance(address: string): Promise { - const provider = Signer.isSigner(this.connection) - ? this.connection.provider - : this.connection - if (provider == null) { - throw new Error("Ethereum signer must be connected to a provider") - } - return (await provider.getBalance(address)).toBigInt() + return ethereumProvider(this.connection).getBalance(address) } /** Read the ERC-20 balance of an Ethereum account. */ async erc20Balance(tokenAddress: string, address: string): Promise { const token = new Contract(tokenAddress, Erc20Interface, this.connection) - return (await token.balanceOf(address)).toBigInt() + return getBigInt(await token.balanceOf(address)) } private assertSigner(): Signer { - if (!Signer.isSigner(this.connection)) { - throw new Error("Ethereum reserve swap requires a connected signer.") - } - return this.connection + return assertEthereumSigner(this.connection, "Ethereum reserve swap") } private nativeParameters(request: ReserveSwapRequest) { @@ -169,31 +160,37 @@ export class EthereumReserveSwapClient { } /** Add bounded headroom to estimates that traverse OPP delegate calls. */ - static addSubmissionGasHeadroom(estimatedGas: BigNumberish): BigNumber { - const gas = BigNumber.from(estimatedGas) - return gas - .mul(BasisPointDenominator + SubmissionGasHeadroomBps) - .add(BasisPointDenominator - 1) - .div(BasisPointDenominator) + static addSubmissionGasHeadroom(estimatedGas: BigNumberish): bigint { + const gas = getBigInt(estimatedGas), + denominator = BigInt(BasisPointDenominator) + return ( + (gas * BigInt(BasisPointDenominator + SubmissionGasHeadroomBps) + + denominator - + 1n) / + denominator + ) } /** Return the safe approval sequence for zero-first ERC-20 implementations. */ static approvalAmounts( currentAllowance: BigNumberish, requiredAllowance: BigNumberish - ): readonly BigNumber[] { - const current = BigNumber.from(currentAllowance), - required = BigNumber.from(requiredAllowance) - if (current.gte(required)) return [] - return current.isZero() ? [required] : [BigNumber.from(0), required] + ): readonly bigint[] { + const current = getBigInt(currentAllowance), + required = getBigInt(requiredAllowance) + if (current >= required) return [] + return current === 0n ? [required] : [0n, required] } /** Parse the canonical deposit id emitted by `requestSwap*`. */ static parseSourceRequestId( - events: readonly EthereumReserveSwapEvent[] | undefined + events: readonly (EventLog | Log)[] | undefined ): bigint { - const event = events?.find(candidate => candidate.event === "SwapDeposit"), - id = event?.args?.[0] + const event = events?.find( + candidate => + "eventName" in candidate && candidate.eventName === "SwapDeposit" + ), + id = event != null && "args" in event ? event.args[0] : null if (id == null) { throw new Error( "Confirmed Ethereum reserve swap did not emit SwapDeposit." diff --git a/packages/sdk-outpost/src/clients/ethereum/Types.ts b/packages/sdk-outpost/src/clients/ethereum/Types.ts index 0006b2c..2c29ef5 100644 --- a/packages/sdk-outpost/src/clients/ethereum/Types.ts +++ b/packages/sdk-outpost/src/clients/ethereum/Types.ts @@ -1,11 +1,11 @@ -import type { providers, Signer } from "ethers" - import type { OPP, OPPInbound, OperatorRegistry, ReserveManager -} from "../../contracts/ethereum/index.js" +} from "@wireio/outpost-ethereum-artifacts" +import type { Provider, Signer } from "ethers" + import type { OutpostDeploymentProfile } from "../../deployments/index.js" import { EthereumContractName } from "../../deployments/index.js" @@ -14,7 +14,7 @@ export interface EthereumOutpostClientOptions { /** Immutable deployment profile selected from the parent Wire chain. */ profile: OutpostDeploymentProfile /** Ethers provider or connected signer for the target Ethereum chain. */ - connection: providers.Provider | Signer + connection: Provider | Signer } /** Generated contract clients keyed by their deployment identity. */ diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 25836bf..592cab6 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -5,7 +5,10 @@ import { OutpostChainFamily, SolanaProgramName } from "../../deployments/index.js" -import { LiqsolCore, liqsolCoreIdl } from "../../programs/solana/index.js" +import { + liqsolCoreIdl, + type LiqsolCore +} from "@wireio/outpost-solana-artifacts" import { OutpostDeploymentVerifier } from "../../verification/index.js" import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" import { SolanaReserveClient } from "./SolanaReserveClient.js" diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts index da10905..d52f8bd 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveClient.ts @@ -17,7 +17,7 @@ import { } from "@solana/web3.js" import { match } from "ts-pattern" -import type { LiqsolCore } from "../../programs/solana/index.js" +import type { LiqsolCore } from "@wireio/outpost-solana-artifacts" import { assertReserveCreateDefinition, assertReserveUnsigned64, diff --git a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts index 537a65d..2622e6d 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaReserveSwapClient.ts @@ -10,9 +10,9 @@ import { type TransactionInstruction, type VersionedTransactionResponse } from "@solana/web3.js" -import { utils as ethersUtils } from "ethers" +import type { LiqsolCore } from "@wireio/outpost-solana-artifacts" +import { getBytes } from "ethers" -import type { LiqsolCore } from "../../programs/solana/index.js" import { assertReserveSwapRequest, type ReserveSwapRequest, @@ -161,7 +161,7 @@ export class SolanaReserveSwapClient { this.unsigned64(request.targetChainCode, "targetChainCode"), this.unsigned64(request.targetTokenCode, "targetTokenCode"), this.unsigned64(request.targetReserveCode, "targetReserveCode"), - Buffer.from(ethersUtils.arrayify(request.targetRecipient)), + Buffer.from(getBytes(request.targetRecipient)), this.unsigned64(request.targetAmount, "targetAmount"), request.targetToleranceBps ] as const diff --git a/packages/sdk-outpost/src/clients/solana/Types.ts b/packages/sdk-outpost/src/clients/solana/Types.ts index f9c02b6..00d258a 100644 --- a/packages/sdk-outpost/src/clients/solana/Types.ts +++ b/packages/sdk-outpost/src/clients/solana/Types.ts @@ -2,7 +2,7 @@ import type { AnchorProvider, Program } from "@coral-xyz/anchor" import type { OutpostDeploymentProfile } from "../../deployments/index.js" import { SolanaProgramName } from "../../deployments/index.js" -import type { LiqsolCore } from "../../programs/solana/index.js" +import type { LiqsolCore } from "@wireio/outpost-solana-artifacts" /** Inputs required to connect a Solana outpost client. */ export interface SolanaOutpostClientOptions { diff --git a/packages/sdk-outpost/src/contracts/ethereum/index.ts b/packages/sdk-outpost/src/contracts/ethereum/index.ts deleted file mode 100644 index 0f12c57..0000000 --- a/packages/sdk-outpost/src/contracts/ethereum/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./generated/index.js" diff --git a/packages/sdk-outpost/src/contracts/index.ts b/packages/sdk-outpost/src/contracts/index.ts deleted file mode 100644 index cca66fc..0000000 --- a/packages/sdk-outpost/src/contracts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ethereum/index.js" diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index 0a54442..f7260db 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -1,5 +1,5 @@ import { PublicKey } from "@solana/web3.js" -import { utils as ethersUtils } from "ethers" +import { getAddress } from "ethers" import { z } from "zod" import { EthereumContractName, SolanaProgramName } from "./Types.js" @@ -8,7 +8,7 @@ const Sha256Schema = z.string().regex(/^[0-9a-f]{64}$/), WireChainIdSchema = z.string().regex(/^[0-9a-f]{64}$/), EthereumAddressSchema = z.string().transform((value, context) => { try { - return ethersUtils.getAddress(value) + return getAddress(value) } catch (error: unknown) { const message = error instanceof Error ? error.message : String(error) context.addIssue({ diff --git a/packages/sdk-outpost/src/index.ts b/packages/sdk-outpost/src/index.ts index 0f6cffb..974408c 100644 --- a/packages/sdk-outpost/src/index.ts +++ b/packages/sdk-outpost/src/index.ts @@ -1,7 +1,5 @@ export * from "./clients/index.js" export * from "./artifacts/index.js" -export * from "./contracts/index.js" export * from "./deployments/index.js" -export * from "./programs/index.js" export * from "./reserves/index.js" export * from "./verification/index.js" diff --git a/packages/sdk-outpost/src/programs/index.ts b/packages/sdk-outpost/src/programs/index.ts deleted file mode 100644 index 813411c..0000000 --- a/packages/sdk-outpost/src/programs/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./solana/index.js" diff --git a/packages/sdk-outpost/src/programs/solana/index.ts b/packages/sdk-outpost/src/programs/solana/index.ts deleted file mode 100644 index 0f12c57..0000000 --- a/packages/sdk-outpost/src/programs/solana/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./generated/index.js" diff --git a/packages/sdk-outpost/src/reserves/Types.ts b/packages/sdk-outpost/src/reserves/Types.ts index 9aa28c2..1595565 100644 --- a/packages/sdk-outpost/src/reserves/Types.ts +++ b/packages/sdk-outpost/src/reserves/Types.ts @@ -1,6 +1,6 @@ import type { PublicKey } from "@solana/web3.js" +import type { ReserveManagerLib } from "@wireio/outpost-ethereum-artifacts" import type { BigNumberish, BytesLike } from "ethers" -import type { ReserveManagerLib } from "../contracts/ethereum/generated/ReserveManager.js" /** Two-part identity shared by external-chain reserve custody clients. */ export interface OutpostReserveIdentity { @@ -27,8 +27,7 @@ export interface ReserveCreateDefinition extends OutpostReserveIdentity { } /** Ethereum reserve-creation request with the creator's AuthEx public key. */ -export interface EthereumReserveCreateRequest - extends ReserveCreateDefinition { +export interface EthereumReserveCreateRequest extends ReserveCreateDefinition { /** Compressed secp256k1 public key that derives to the connected signer. */ creatorPubKey: BytesLike } @@ -115,8 +114,7 @@ export interface SolanaConfiguredReserveToken { } /** Permit signature accepted by Ethereum ReserveManager. */ -export type EthereumReservePermitSignature = - ReserveManagerLib.PermitSigStruct +export type EthereumReservePermitSignature = ReserveManagerLib.PermitSigStruct /** Confirmed source-outpost submission used to correlate a swap with Wire. */ export interface ReserveSwapSubmission { diff --git a/packages/sdk-outpost/src/reserves/Validation.ts b/packages/sdk-outpost/src/reserves/Validation.ts index 6f5e84b..a0c653f 100644 --- a/packages/sdk-outpost/src/reserves/Validation.ts +++ b/packages/sdk-outpost/src/reserves/Validation.ts @@ -1,4 +1,4 @@ -import { BigNumber, utils as ethersUtils } from "ethers" +import { getBigInt, getBytes, isBytesLike, toUtf8Bytes } from "ethers" import type { EthereumReserveCreateRequest, @@ -6,8 +6,8 @@ import type { ReserveSwapRequest } from "./Types.js" -const MaximumUnsigned64 = BigNumber.from("18446744073709551615"), - MinimumReserveValue = BigNumber.from(1), +const MaximumUnsigned64 = 18_446_744_073_709_551_615n, + MinimumReserveValue = 1n, MinimumConnectorWeightBps = 1, MaximumConnectorWeightBps = 9999, MinimumToleranceBps = 0, @@ -26,14 +26,14 @@ const MaximumUnsigned64 = BigNumber.from("18446744073709551615"), export function assertReserveUnsigned64( value: ReserveSwapRequest["sourceTokenCode"], field: string -): BigNumber { - let parsed: BigNumber +): bigint { + let parsed: bigint try { - parsed = BigNumber.from(value) + parsed = getBigInt(value) } catch (error: unknown) { throw new Error(`${field} must be an integer.`, { cause: error }) } - if (parsed.lt(MinimumReserveValue) || parsed.gt(MaximumUnsigned64)) { + if (parsed < MinimumReserveValue || parsed > MaximumUnsigned64) { throw new Error(`${field} must be between 1 and uint64 max.`) } return parsed @@ -46,13 +46,13 @@ export function assertReserveCreateDefinition( assertReserveUnsigned64(definition.tokenCode, "tokenCode") assertReserveUnsigned64(definition.reserveCode, "reserveCode") - let externalTokenAmount: BigNumber + let externalTokenAmount: bigint try { - externalTokenAmount = BigNumber.from(definition.externalTokenAmount) + externalTokenAmount = getBigInt(definition.externalTokenAmount) } catch (error: unknown) { throw new Error("externalTokenAmount must be an integer.", { cause: error }) } - if (externalTokenAmount.lt(MinimumReserveValue)) { + if (externalTokenAmount < MinimumReserveValue) { throw new Error("externalTokenAmount must be greater than zero.") } @@ -67,16 +67,14 @@ export function assertReserveCreateDefinition( ) } - const nameBytes = ethersUtils.toUtf8Bytes(definition.name).length + const nameBytes = toUtf8Bytes(definition.name).length if (nameBytes === 0 || nameBytes > MaximumReserveNameBytes) { throw new Error( `name must contain 1 to ${MaximumReserveNameBytes} UTF-8 bytes.` ) } - const descriptionBytes = ethersUtils.toUtf8Bytes( - definition.description - ).length + const descriptionBytes = toUtf8Bytes(definition.description).length if (descriptionBytes > MaximumReserveDescriptionBytes) { throw new Error( `description must contain at most ${MaximumReserveDescriptionBytes} UTF-8 bytes.` @@ -89,10 +87,10 @@ export function assertEthereumReserveCreateRequest( request: EthereumReserveCreateRequest ): void { assertReserveCreateDefinition(request) - if (!ethersUtils.isBytesLike(request.creatorPubKey)) { + if (!isBytesLike(request.creatorPubKey)) { throw new Error(InvalidCompressedSecp256k1PublicKeyMessage) } - const creatorPublicKey = ethersUtils.arrayify(request.creatorPubKey) + const creatorPublicKey = getBytes(request.creatorPubKey) if ( creatorPublicKey.length !== CompressedSecp256k1PublicKeyBytes || (creatorPublicKey[0] !== CompressedSecp256k1PublicKeyPrefix.even && @@ -121,7 +119,7 @@ export function assertReserveSwapRequest(request: ReserveSwapRequest): void { `targetToleranceBps must be between ${MinimumToleranceBps} and ${MaximumToleranceBps}.` ) } - if (ethersUtils.arrayify(request.targetRecipient).length === 0) { + if (getBytes(request.targetRecipient).length === 0) { throw new Error("targetRecipient is required.") } } diff --git a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts index 0c2dd65..43a7791 100644 --- a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts +++ b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts @@ -1,7 +1,7 @@ import { PublicKey } from "@solana/web3.js" import type { AccountInfo, Connection } from "@solana/web3.js" -import type { BytesLike, providers } from "ethers" -import { utils as ethersUtils } from "ethers" +import type { BytesLike, Provider } from "ethers" +import { dataSlice, getAddress, sha256 as ethersSha256 } from "ethers" import { match } from "ts-pattern" import { @@ -37,7 +37,7 @@ export const SolanaUpgradeableLoaderProgramId = new PublicKey( ) function sha256(value: BytesLike): string { - return ethersUtils.sha256(value).slice(2) + return ethersSha256(value).slice(2) } function upgradeableLoaderStateTag(data: Uint8Array): number { @@ -64,12 +64,12 @@ function assertSolanaUpgradeableLoaderAccount( async function verifyEthereum( profile: OutpostDeploymentProfile, - provider: providers.Provider + provider: Provider ): Promise { assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) const network = await provider.getNetwork() - if (network.chainId !== profile.ethereum.chainId) { + if (network.chainId !== BigInt(profile.ethereum.chainId)) { throw new Error( `Ethereum chain mismatch: expected ${profile.ethereum.chainId}, received ${network.chainId}` ) @@ -86,15 +86,12 @@ async function verifyEthereum( ) } - const implementationWord = await provider.getStorageAt( + const implementationWord = await provider.getStorage( contract.address, Eip1967ImplementationStorageSlot ), - implementationAddress = ethersUtils.getAddress( - ethersUtils.hexDataSlice( - implementationWord, - Eip1967ImplementationAddressOffset - ) + implementationAddress = getAddress( + dataSlice(implementationWord, Eip1967ImplementationAddressOffset) ) if (implementationAddress !== contract.implementationAddress) { diff --git a/packages/sdk-outpost/src/verification/Types.ts b/packages/sdk-outpost/src/verification/Types.ts index 001de4b..2ed775c 100644 --- a/packages/sdk-outpost/src/verification/Types.ts +++ b/packages/sdk-outpost/src/verification/Types.ts @@ -1,5 +1,5 @@ import type { Connection } from "@solana/web3.js" -import type { providers } from "ethers" +import type { Provider } from "ethers" import type { OutpostDeploymentProfile } from "../deployments/index.js" import { OutpostChainFamily } from "../deployments/index.js" @@ -11,7 +11,7 @@ export interface EthereumOutpostDeploymentVerificationInput { /** Immutable deployment profile to verify. */ profile: OutpostDeploymentProfile /** Ethereum provider connected to the deployed contracts. */ - provider: providers.Provider + provider: Provider } /** Solana verification request for an outpost deployment profile. */ diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts index e9fa292..88d0056 100644 --- a/packages/sdk-outpost/tests/Fixtures.ts +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -2,7 +2,15 @@ import { AnchorProvider, Wallet } from "@coral-xyz/anchor" import { Connection, Keypair, PublicKey } from "@solana/web3.js" import { readFileSync } from "node:fs" import { createRequire } from "node:module" -import { providers, utils as ethersUtils } from "ethers" +import { + getAddress, + hexlify, + JsonRpcProvider, + Network, + sha256, + toBeHex, + zeroPadValue +} from "ethers" import { EthereumContractName, @@ -41,9 +49,7 @@ const TestHash = "a".repeat(64), /** Create one deterministic Ethereum address for a fixture index. */ function createEthereumAddress(index: number): string { - return ethersUtils.getAddress( - ethersUtils.hexZeroPad(ethersUtils.hexlify(index), 20) - ) + return getAddress(zeroPadValue(toBeHex(index), 20)) } /** Create linked live implementation code from one producer runtime template. */ @@ -62,7 +68,7 @@ export function createEthereumImplementationCode( artifact.runtimeLinkReferences.forEach(({ start, length }) => runtimeCode.fill(1, start, start + length) ) - return ethersUtils.hexlify(runtimeCode) + return hexlify(runtimeCode) } /** Encode the upgradeable-loader Program account for one ProgramData address. */ @@ -102,9 +108,9 @@ export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfil ), abiSha256: OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, - implementationCodeSha256: ethersUtils - .sha256(createEthereumImplementationCode(contractName)) - .slice(2) + implementationCodeSha256: sha256( + createEthereumImplementationCode(contractName) + ).slice(2) } ]) ), @@ -128,7 +134,7 @@ export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfil OutpostArtifactManifests.solana.programs[ SolanaProgramName.liqsolCore ].idlSha256, - programDataSha256: ethersUtils.sha256(programData).slice(2) + programDataSha256: sha256(programData).slice(2) } } } @@ -140,12 +146,14 @@ export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfil /** Create an Ethereum provider aligned with one deployment profile. */ export function createEthereumProviderFixture( profile: OutpostDeploymentProfile -): providers.JsonRpcProvider { - const provider = new providers.JsonRpcProvider() - jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: profile.ethereum.chainId, - name: "wire-outpost" - }) +): JsonRpcProvider { + const provider = new JsonRpcProvider() + jest.spyOn(provider, "getNetwork").mockResolvedValue( + Network.from({ + chainId: profile.ethereum.chainId, + name: "wire-outpost" + }) + ) jest.spyOn(provider, "getCode").mockImplementation(async address => { const implementation = Object.entries(profile.ethereum.contracts).find( ([, deployment]) => deployment.implementationAddress === address @@ -161,11 +169,11 @@ export function createEthereumProviderFixture( ? TestEthereumProxyCode : "0x" }) - jest.spyOn(provider, "getStorageAt").mockImplementation(async address => { + jest.spyOn(provider, "getStorage").mockImplementation(async address => { const contract = Object.values(profile.ethereum.contracts).find( deployment => deployment.address === address ) - return ethersUtils.hexZeroPad( + return zeroPadValue( contract?.implementationAddress ?? profile.ethereum.contracts[EthereumContractName.OPP] .implementationAddress, diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index ec423ab..b13973c 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -1,16 +1,20 @@ import type { Program } from "@coral-xyz/anchor" - import { - EthereumContractName, OPP__factory, OperatorRegistry__factory, + ReserveManager__factory +} from "@wireio/outpost-ethereum-artifacts" +import { + liqsolCoreIdl, + type LiqsolCore +} from "@wireio/outpost-solana-artifacts" + +import { + EthereumContractName, OutpostArtifactManifests, OutpostChainFamily, - ReserveManager__factory, SolanaProgramName, - type LiqsolCore, - assertOutpostArtifactCompatibility, - liqsolCoreIdl + assertOutpostArtifactCompatibility } from "@wireio/sdk-outpost" import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index babeaef..74d027d 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -1,4 +1,12 @@ -import { BigNumber, utils as ethersUtils, Wallet } from "ethers" +import { + getBytes, + hexlify, + Network, + sha256, + Wallet, + zeroPadValue, + type EventLog +} from "ethers" import { EthereumContractName, @@ -40,14 +48,16 @@ describe("EthereumOutpostClient", () => { targetToleranceBps: 500 }, wait = jest.fn().mockResolvedValue({ - events: [{ event: "SwapDeposit", args: [BigNumber.from(42)] }] + logs: [{ eventName: "SwapDeposit", args: [42n] } as unknown as EventLog] }), - requestSwap = jest.fn().mockResolvedValue({ hash: "0xabc", wait }), + requestSwap = Object.assign( + jest.fn().mockResolvedValue({ hash: "0xabc", wait }), + { + staticCall: jest.fn().mockResolvedValue(null), + estimateGas: jest.fn().mockResolvedValue(100_000n) + } + ), reserveManager = { - callStatic: { requestSwap: jest.fn().mockResolvedValue(null) }, - estimateGas: { - requestSwap: jest.fn().mockResolvedValue(BigNumber.from(100_000)) - }, requestSwap } as unknown as ConstructorParameters< typeof EthereumReserveSwapClient @@ -72,7 +82,7 @@ describe("EthereumOutpostClient", () => { request.targetToleranceBps, { value: request.sourceAmount, - gasLimit: BigNumber.from(125_000) + gasLimit: 125_000n } ) expect(wait).toHaveBeenCalledWith(1) @@ -80,24 +90,14 @@ describe("EthereumOutpostClient", () => { it("adds 25% gas headroom to reserve swap submissions", () => { expect(EthereumReserveSwapClient.addSubmissionGasHeadroom(789_767)).toEqual( - BigNumber.from(987_209) - ) - expect(EthereumReserveSwapClient.addSubmissionGasHeadroom(1)).toEqual( - BigNumber.from(2) + 987_209n ) + expect(EthereumReserveSwapClient.addSubmissionGasHeadroom(1)).toEqual(2n) }) it("resets nonzero ERC-20 allowances before increasing them", () => { - expect( - EthereumReserveSwapClient.approvalAmounts(2, 3).map(amount => - amount.toNumber() - ) - ).toEqual([0, 3]) - expect( - EthereumReserveSwapClient.approvalAmounts(0, 3).map(amount => - amount.toNumber() - ) - ).toEqual([3]) + expect(EthereumReserveSwapClient.approvalAmounts(2, 3)).toEqual([0n, 3n]) + expect(EthereumReserveSwapClient.approvalAmounts(0, 3)).toEqual([3n]) expect(EthereumReserveSwapClient.approvalAmounts(3, 3)).toEqual([]) }) @@ -110,7 +110,7 @@ describe("EthereumOutpostClient", () => { }), reserveManager = client.contract(EthereumContractName.ReserveManager) - expect(reserveManager.address).toBe( + expect(reserveManager.target).toBe( profile.ethereum.contracts[EthereumContractName.ReserveManager].address ) expect(client.reserves).toBeInstanceOf(EthereumReserveClient) @@ -118,13 +118,15 @@ describe("EthereumOutpostClient", () => { expect(provider.getCode).toHaveBeenCalledTimes( Object.values(EthereumContractName).length * 2 ) - expect(provider.getStorageAt).toHaveBeenCalledTimes( + expect(provider.getStorage).toHaveBeenCalledTimes( Object.values(EthereumContractName).length ) }) it("parses the protocol deposit id from a confirmed receipt", () => { - const events = [{ event: "SwapDeposit", args: [BigNumber.from(42)] }] + const events = [ + { eventName: "SwapDeposit", args: [42n] } as unknown as EventLog + ] expect(EthereumReserveSwapClient.parseSourceRequestId(events)).toBe(42n) expect(() => EthereumReserveSwapClient.parseSourceRequestId([])).toThrow( @@ -135,10 +137,9 @@ describe("EthereumOutpostClient", () => { it("rejects the wrong Ethereum chain", async () => { const profile = createOutpostDeploymentProfileFixture(), provider = createEthereumProviderFixture(profile) - jest.spyOn(provider, "getNetwork").mockResolvedValue({ - chainId: 1, - name: "mainnet" - }) + jest + .spyOn(provider, "getNetwork") + .mockResolvedValue(Network.from({ chainId: 1, name: "mainnet" })) await expect( createEthereumClient({ profile, connection: provider }) @@ -159,8 +160,8 @@ describe("EthereumOutpostClient", () => { const profile = createOutpostDeploymentProfileFixture(), provider = createEthereumProviderFixture(profile) jest - .spyOn(provider, "getStorageAt") - .mockResolvedValue(ethersUtils.hexZeroPad("0x01", 32)) + .spyOn(provider, "getStorage") + .mockResolvedValue(zeroPadValue("0x01", 32)) await expect( createEthereumClient({ profile, connection: provider }) @@ -182,20 +183,22 @@ describe("EthereumOutpostClient", () => { it("rejects live code from another producer runtime", async () => { const profile = createOutpostDeploymentProfileFixture(), contract = profile.ethereum.contracts[EthereumContractName.OPP], - incompatibleCodeBytes = ethersUtils.arrayify( + incompatibleCodeBytes = getBytes( createEthereumImplementationCode(EthereumContractName.OPP) ) incompatibleCodeBytes[0] ^= 1 - const incompatibleCode = ethersUtils.hexlify(incompatibleCodeBytes), - incompatibleCodeSha256 = ethersUtils.sha256(incompatibleCode).slice(2) + const incompatibleCode = hexlify(incompatibleCodeBytes), + incompatibleCodeSha256 = sha256(incompatibleCode).slice(2) contract.implementationCodeSha256 = incompatibleCodeSha256 const provider = createEthereumProviderFixture(profile), getCode = (provider.getCode as jest.Mock).getMockImplementation() - jest.spyOn(provider, "getCode").mockImplementation(async address => - address === contract.implementationAddress - ? incompatibleCode - : getCode(address) - ) + jest + .spyOn(provider, "getCode") + .mockImplementation(async address => + address === contract.implementationAddress + ? incompatibleCode + : getCode(address) + ) await expect( createEthereumClient({ profile, connection: provider }) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts index cac3fb7..c63a11d 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumReserveClient.test.ts @@ -1,27 +1,34 @@ +import type { ReserveManager } from "@wireio/outpost-ethereum-artifacts" import { - BigNumber, - Signer, + AbiCoder, + AbstractSigner, + JsonRpcProvider, Wallet, - constants as ethersConstants, - providers, - utils as ethersUtils + ZeroAddress, + ZeroHash, + type Provider, + type TransactionReceipt, + type TransactionRequest, + type TransactionResponse, + type TypedDataDomain, + type TypedDataField } from "ethers" import { EthereumReserveClient, OutpostReserveStatus, - type EthereumReserveCreateRequest, - type ReserveManager + type EthereumReserveCreateRequest } from "@wireio/sdk-outpost" const ReserveTransactionHash = `0x${"11".repeat(32)}`, ApprovalTransactionHash = `0x${"22".repeat(32)}`, + ReserveManagerAddress = "0x18E317A7D70d8fBf8e6E893616b52390EbBdb629", TokenAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", CreatorAddress = "0x7412BC256355ABD22dD53De3a38E8995b5d4c1D1", - TransactionReceipt = { + TransactionReceiptFixture = { logs: [], status: 1 - } as unknown as providers.TransactionReceipt + } as unknown as TransactionReceipt const request: EthereumReserveCreateRequest = { tokenCode: 1, @@ -35,43 +42,47 @@ const request: EthereumReserveCreateRequest = { creatorPubKey: `0x02${"11".repeat(32)}` } +/** Create one v6 transaction response fixture. */ function transactionFixture( hash = ReserveTransactionHash, - wait: providers.TransactionResponse["wait"] = jest.fn( - async (): Promise => TransactionReceipt + wait: TransactionResponse["wait"] = jest.fn( + async (): Promise => TransactionReceiptFixture ) -) { - return { - hash, - wait - } as unknown as providers.TransactionResponse +): TransactionResponse { + return { hash, wait } as unknown as TransactionResponse } -function reserveManagerFixture() { +/** Create one callable v6 contract method with a static preflight. */ +function contractMethodFixture(transaction: TransactionResponse) { + return Object.assign( + jest.fn(async () => transaction), + { + staticCall: jest.fn(async (): Promise => undefined) + } + ) +} + +/** Create the ReserveManager contract surface exercised by this client. */ +function reserveManagerFixture(configuredTokenAddress = TokenAddress) { const transaction = transactionFixture(), + createReserve = contractMethodFixture(transaction), + createErc20WithApproval = contractMethodFixture(transaction), + createErc20WithPermit = contractMethodFixture(transaction), reserveManager = { - address: "0x18E317A7D70d8fBf8e6E893616b52390EbBdb629", - callStatic: { - create_reserve: jest.fn(async (): Promise => undefined), - requestReserveCreateErc20WithApproval: jest.fn( - async (): Promise => undefined - ), - requestReserveCreateErc20WithPermit: jest.fn( - async (): Promise => undefined - ) - }, - create_reserve: jest.fn(async () => transaction), - requestReserveCreateErc20WithApproval: jest.fn(async () => transaction), - requestReserveCreateErc20WithPermit: jest.fn(async () => transaction), + target: ReserveManagerAddress, + getAddress: jest.fn(async () => ReserveManagerAddress), + create_reserve: createReserve, + requestReserveCreateErc20WithApproval: createErc20WithApproval, + requestReserveCreateErc20WithPermit: createErc20WithPermit, cancel_create_reserve: jest.fn(async () => transaction), - tokenAddressesByCode: jest.fn(async () => TokenAddress), + tokenAddressesByCode: jest.fn(async () => configuredTokenAddress), getReserve: jest.fn(async () => ({ - tokenCode: BigNumber.from(1), - reserveCode: BigNumber.from(2), - externalTokenAmount: BigNumber.from(3), - requestedWireAmount: BigNumber.from(4), - connectorWeightBps: 5_000, - status: 1, + tokenCode: 1n, + reserveCode: 2n, + externalTokenAmount: 3n, + requestedWireAmount: 4n, + connectorWeightBps: 5_000n, + status: 1n, creator: CreatorAddress, exists: true })) @@ -80,15 +91,24 @@ function reserveManagerFixture() { return { reserveManager, transaction } } -class Erc20Signer extends Signer { - readonly provider = new providers.JsonRpcProvider() - readonly approvalWait = jest.fn( - async (): Promise => TransactionReceipt - ) - readonly approval = transactionFixture( - ApprovalTransactionHash, - this.approvalWait - ) +/** Create a static v6 provider that confirms the mocked ERC-20 transaction. */ +function erc20Provider(): JsonRpcProvider { + const provider = new JsonRpcProvider(undefined, 31_337, { + staticNetwork: true + }) + jest + .spyOn(provider, "getTransactionReceipt") + .mockResolvedValue(TransactionReceiptFixture) + return provider +} + +/** Minimal ethers v6 signer used to observe ERC-20 calls and submissions. */ +class Erc20Signer extends AbstractSigner { + readonly approval = transactionFixture(ApprovalTransactionHash) + + constructor(provider: Provider = erc20Provider()) { + super(provider) + } async getAddress(): Promise { return CreatorAddress @@ -102,15 +122,25 @@ class Erc20Signer extends Signer { return "0x" } - connect(): Signer { - return this + async signTypedData( + _domain: TypedDataDomain, + _types: Record>, + _value: Record + ): Promise { + return "0x" + } + + connect(provider: Provider): Erc20Signer { + return new Erc20Signer(provider) } async call(): Promise { - return ethersUtils.defaultAbiCoder.encode(["uint256"], [0]) + return AbiCoder.defaultAbiCoder().encode(["uint256"], [0]) } - async sendTransaction(): Promise { + async sendTransaction( + _transaction: TransactionRequest + ): Promise { return this.approval } } @@ -123,7 +153,7 @@ describe("EthereumReserveClient", () => { await expect(client.createNative(request)).resolves.toEqual({ transactionId: ReserveTransactionHash }) - expect(reserveManager.callStatic.create_reserve).toHaveBeenCalledTimes(1) + expect(reserveManager.create_reserve.staticCall).toHaveBeenCalledTimes(1) expect(reserveManager.create_reserve).toHaveBeenCalledTimes(1) expect(transaction.wait).toHaveBeenCalledWith(1) }) @@ -138,7 +168,9 @@ describe("EthereumReserveClient", () => { TokenAddress ) expect(submission).toEqual({ transactionId: ReserveTransactionHash }) - expect(signer.approvalWait).toHaveBeenCalledWith(1) + expect(signer.provider.getTransactionReceipt).toHaveBeenCalledWith( + ApprovalTransactionHash + ) expect( reserveManager.requestReserveCreateErc20WithApproval ).toHaveBeenCalledTimes(1) @@ -152,12 +184,12 @@ describe("EthereumReserveClient", () => { client.createErc20WithPermit(request, { deadline: 100, v: 27, - r: ethersConstants.HashZero, - s: ethersConstants.HashZero + r: ZeroHash, + s: ZeroHash }) ).resolves.toEqual({ transactionId: ReserveTransactionHash }) expect( - reserveManager.callStatic.requestReserveCreateErc20WithPermit + reserveManager.requestReserveCreateErc20WithPermit.staticCall ).toHaveBeenCalledTimes(1) }) @@ -181,20 +213,19 @@ describe("EthereumReserveClient", () => { it("requires a signer and a configured ERC-20 route", async () => { const { reserveManager } = reserveManagerFixture(), - provider = new providers.JsonRpcProvider(), + provider = new JsonRpcProvider(), providerClient = new EthereumReserveClient(reserveManager, provider) await expect(providerClient.createNative(request)).rejects.toThrow( "requires a connected signer" ) - reserveManager.tokenAddressesByCode = jest.fn( - async () => ethersConstants.AddressZero - ) - const signerClient = new EthereumReserveClient( - reserveManager, - new Erc20Signer() - ) + const { reserveManager: unconfiguredReserveManager } = + reserveManagerFixture(ZeroAddress), + signerClient = new EthereumReserveClient( + unconfiguredReserveManager, + new Erc20Signer() + ) await expect(signerClient.createErc20WithApproval(request)).rejects.toThrow( "No ERC-20 address is configured" ) @@ -209,6 +240,6 @@ describe("EthereumReserveClient", () => { await expect( client.createErc20WithApproval(request, differentTokenAddress) ).rejects.toThrow("does not match the configured route") - expect(signer.approvalWait).not.toHaveBeenCalled() + expect(signer.provider.getTransactionReceipt).not.toHaveBeenCalled() }) }) diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts index 36529bf..55319dd 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaOutpostClient.test.ts @@ -1,5 +1,5 @@ import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js" -import { utils as ethersUtils } from "ethers" +import { sha256 } from "ethers" import { OutpostChainFamily, @@ -250,9 +250,7 @@ describe("SolanaOutpostClient", () => { program = profile.solana.programs[SolanaProgramName.liqsolCore], incompatibleProgramData = createSolanaProgramDataAccountData() incompatibleProgramData[SolanaProgramDataMetadataByteLength] ^= 1 - program.programDataSha256 = ethersUtils - .sha256(incompatibleProgramData) - .slice(2) + program.programDataSha256 = sha256(incompatibleProgramData).slice(2) const provider = createSolanaProviderFixture(profile) jest .spyOn(provider.connection, "getAccountInfo") diff --git a/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts b/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts index f8baccc..fd11618 100644 --- a/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts +++ b/packages/sdk-outpost/tests/clients/solana/SolanaReserveClient.test.ts @@ -1,13 +1,15 @@ import { BN, Program } from "@coral-xyz/anchor" +import { + liqsolCoreIdl, + type LiqsolCore +} from "@wireio/outpost-solana-artifacts" import { ASSOCIATED_TOKEN_PROGRAM_ID } from "@solana/spl-token" import { Keypair, PublicKey } from "@solana/web3.js" import { - type LiqsolCore, OutpostReserveStatus, type SolanaReserveCreateRequest, - SolanaReserveClient, - liqsolCoreIdl + SolanaReserveClient } from "@wireio/sdk-outpost" import { createOutpostDeploymentProfileFixture, diff --git a/packages/sdk-outpost/tests/reserves/Validation.test.ts b/packages/sdk-outpost/tests/reserves/Validation.test.ts index eb28f0f..781fed4 100644 --- a/packages/sdk-outpost/tests/reserves/Validation.test.ts +++ b/packages/sdk-outpost/tests/reserves/Validation.test.ts @@ -80,7 +80,7 @@ describe("reserve swap validation", () => { it("accepts a portable positive request", () => { expect(() => assertReserveSwapRequest(request)).not.toThrow() - expect(assertReserveUnsigned64(8, "value").toNumber()).toBe(8) + expect(assertReserveUnsigned64(8, "value")).toBe(8n) }) it("rejects an empty recipient and values outside uint64", () => { diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 253da11..89723f9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,3 @@ packages: - "packages/*" - "examples/*" -minimumReleaseAge: 1440 -minimumReleaseAgeExclude: - - "@wireio/*" diff --git a/scripts/sdk-outpost/clean.mjs b/scripts/sdk-outpost/clean.mjs deleted file mode 100755 index 48a392e..0000000 --- a/scripts/sdk-outpost/clean.mjs +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node - -/** - * Remove compiled sdk-outpost package outputs. - * - * Usage: - * ./scripts/sdk-outpost/clean.mjs - * - * Options: - * None. - * - * Examples: - * ./scripts/sdk-outpost/clean.mjs - * - * Exit codes: - * 0 on success; nonzero when an output cannot be removed. - */ - -import { fs, path } from "zx" - -import { PackagePath } from "./config.mjs" - -await fs.rm(path.join(PackagePath, "lib"), { force: true, recursive: true }) diff --git a/scripts/sdk-outpost/config.mjs b/scripts/sdk-outpost/config.mjs deleted file mode 100644 index 3585fb3..0000000 --- a/scripts/sdk-outpost/config.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import { fileURLToPath } from "node:url" - -import { fs, path } from "zx" - -const ScriptPath = path.dirname(fileURLToPath(import.meta.url)) - -/** Absolute path to the wire-libraries-ts repository root. */ -export const RepositoryPath = path.resolve(ScriptPath, "../..") - -/** Absolute path to the sdk-outpost package. */ -export const PackagePath = path.join(RepositoryPath, "packages/sdk-outpost") - -/** sdk-outpost package manifest used as the dependency resolution root. */ -export const PackageManifestPath = path.join(PackagePath, "package.json") - -/** Source-owned Ethereum artifact package consumed at SDK build time. */ -export const EthereumArtifactPackageName = "@wireio/outpost-ethereum-artifacts" - -/** Source-owned Solana artifact package consumed at SDK build time. */ -export const SolanaArtifactPackageName = "@wireio/outpost-solana-artifacts" - -/** Parse one JSON file from disk. */ -export async function readJson(file) { - return JSON.parse(await fs.readFile(file, "utf8")) -} - -/** Fail a build-time invariant with a focused message. */ -export function assert(condition, message) { - if (!condition) throw new Error(message) -} diff --git a/scripts/sdk-outpost/generate.mjs b/scripts/sdk-outpost/generate.mjs deleted file mode 100755 index d9b9f61..0000000 --- a/scripts/sdk-outpost/generate.mjs +++ /dev/null @@ -1,278 +0,0 @@ -#!/usr/bin/env node - -/** - * Generate sdk-outpost clients and manifests from canonical producer artifacts. - * - * Usage: - * ./scripts/sdk-outpost/generate.mjs - * - * Options: - * None. - * - * Examples: - * ./scripts/sdk-outpost/generate.mjs - * - * Exit codes: - * 0 on success; nonzero when artifact validation or generation fails. - */ - -import Crypto from "node:crypto" -import { createRequire } from "node:module" - -import { format } from "prettier" -import { $, fs, path } from "zx" - -import { - EthereumArtifactPackageName, - PackageManifestPath, - PackagePath, - SolanaArtifactPackageName, - assert, - readJson -} from "./config.mjs" - -const PackageRequire = createRequire(PackageManifestPath), - EthereumOutputPath = path.join( - PackagePath, - "src/contracts/ethereum/generated" - ), - SolanaOutputPath = path.join(PackagePath, "src/programs/solana/generated"), - ArtifactOutputPath = path.join(PackagePath, "src/artifacts/generated"), - EthereumContractNames = [ - "OPP", - "OPPInbound", - "OperatorRegistry", - "ReserveManager" - ], - SolanaProgramName = "liqsolCore", - TypechainPath = path.join(PackagePath, "node_modules/.bin/typechain"), - EmptyRuntimeLinkReferencesJson = '"runtimeLinkReferences": []', - TypedEmptyRuntimeLinkReferencesSource = - '"runtimeLinkReferences": [] as never[]' - -assert( - process.argv.length === 2, - "sdk-outpost generation does not accept command-line options" -) - -/** Resolve one exported file from a source-owned artifact package. */ -function resolveArtifact(packageName, artifactPath) { - return PackageRequire.resolve(`${packageName}/${artifactPath}`) -} - -/** Return the SHA-256 digest for generated artifact bytes. */ -function sha256(value) { - return Crypto.createHash("sha256").update(value).digest("hex") -} - -/** Serialize one ABI exactly as its producer computes the interface digest. */ -function formatJson(value) { - return `${JSON.stringify(value, null, 2)}\n` -} - -/** Verify one package-owned artifact before it can generate SDK code. */ -function assertArtifactDigest(actual, expected, label) { - assert(actual === expected, `${label} checksum mismatch`) -} - -/** Format generated TypeScript according to repository rules. */ -async function formatTypescript(source) { - return format(source, { - parser: "typescript", - semi: false, - singleQuote: false, - trailingComma: "none" - }) -} - -/** Resolve and verify the canonical producer-package generation inputs. */ -async function resolveGenerationInput() { - const EthereumManifestPath = PackageRequire.resolve( - `${EthereumArtifactPackageName}/manifest.json` - ), - SolanaManifestPath = PackageRequire.resolve( - `${SolanaArtifactPackageName}/manifest.json` - ), - [packageManifest, ethereumManifest, solanaManifest] = await Promise.all([ - readJson(PackageManifestPath), - readJson(EthereumManifestPath), - readJson(SolanaManifestPath) - ]) - - assert( - ethereumManifest.package.name === EthereumArtifactPackageName, - `Unexpected Ethereum artifact package ${ethereumManifest.package.name}` - ) - assert( - solanaManifest.package.name === SolanaArtifactPackageName, - `Unexpected Solana artifact package ${solanaManifest.package.name}` - ) - assert( - packageManifest.devDependencies[EthereumArtifactPackageName] === - ethereumManifest.package.version, - `Ethereum artifact version ${ethereumManifest.package.version} does not match sdk-outpost` - ) - assert( - packageManifest.devDependencies[SolanaArtifactPackageName] === - solanaManifest.package.version, - `Solana artifact version ${solanaManifest.package.version} does not match sdk-outpost` - ) - assert( - EthereumContractNames.every( - name => ethereumManifest.contracts[name] != null - ), - "Ethereum artifact package does not cover the sdk-outpost contract surface" - ) - assert( - solanaManifest.programs[SolanaProgramName] != null, - "Solana artifact package does not cover liqsol_core" - ) - - const ethereumAbiPaths = await Promise.all( - EthereumContractNames.map(async name => { - const contract = ethereumManifest.contracts[name], - abiPath = resolveArtifact(EthereumArtifactPackageName, contract.path), - runtimeBytecodePath = resolveArtifact( - EthereumArtifactPackageName, - contract.runtimeBytecodePath - ), - [artifact, runtimeBytecode] = await Promise.all([ - readJson(abiPath), - fs.readFile(runtimeBytecodePath) - ]) - - assertArtifactDigest( - sha256(formatJson(artifact.abi)), - contract.abiSha256, - `Ethereum ${name} ABI` - ) - assert( - runtimeBytecode.length === contract.runtimeBytecodeLength, - `Ethereum ${name} runtime bytecode length mismatch` - ) - assertArtifactDigest( - sha256(runtimeBytecode), - contract.runtimeBytecodeSha256, - `Ethereum ${name} runtime bytecode` - ) - return abiPath - }) - ), - solanaProgram = solanaManifest.programs[SolanaProgramName], - solanaIdlPath = resolveArtifact( - SolanaArtifactPackageName, - solanaProgram.idlPath - ), - solanaProgramBinaryPath = resolveArtifact( - SolanaArtifactPackageName, - solanaProgram.programBinaryPath - ), - [rawIdlSource, solanaProgramBinary] = await Promise.all([ - fs.readFile(solanaIdlPath), - fs.readFile(solanaProgramBinaryPath) - ]) - - assertArtifactDigest( - sha256(rawIdlSource), - solanaProgram.idlSha256, - "Solana liqsolCore IDL" - ) - assert( - solanaProgramBinary.length === solanaProgram.programBinaryLength, - "Solana liqsolCore program binary length mismatch" - ) - assertArtifactDigest( - sha256(solanaProgramBinary), - solanaProgram.programBinarySha256, - "Solana liqsolCore program binary" - ) - - return { - ethereumManifest, - solanaManifest, - ethereumAbiPaths, - solanaIdlPath - } -} - -const generationInput = await resolveGenerationInput() - -await Promise.all( - [EthereumOutputPath, SolanaOutputPath, ArtifactOutputPath].map(outputPath => - fs.rm(outputPath, { force: true, recursive: true }) - ) -) -await Promise.all( - [SolanaOutputPath, ArtifactOutputPath].map(outputPath => - fs.mkdir(outputPath, { recursive: true }) - ) -) - -await $({ - cwd: PackagePath -})`${TypechainPath} --target ethers-v5 --node16-modules --out-dir ${EthereumOutputPath} ${generationInput.ethereumAbiPaths}` - -const { convertIdlToCamelCase } = PackageRequire( - "@coral-xyz/anchor/dist/cjs/idl.js" - ), - rawIdlSource = await fs.readFile(generationInput.solanaIdlPath), - rawIdl = JSON.parse(rawIdlSource.toString("utf8")), - idl = convertIdlToCamelCase(rawIdl), - ethereumManifestSource = JSON.stringify( - generationInput.ethereumManifest, - null, - 2 - ).replaceAll( - EmptyRuntimeLinkReferencesJson, - TypedEmptyRuntimeLinkReferencesSource - ), - solanaSource = await formatTypescript(` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ - import type { Idl } from "@coral-xyz/anchor" - - /** Remove readonly modifiers while preserving the generated IDL's literal names. */ - type MutableIdl = T extends object - ? { -readonly [Key in keyof T]: MutableIdl } - : T - - /** Capture a precise mutable IDL type for Anchor's generated namespaces. */ - function mutableIdl(value: T): MutableIdl { - return value as MutableIdl - } - - const liqsolCoreIdlValue = mutableIdl(${JSON.stringify(idl, null, 2)}) - - /** Strict Anchor IDL type generated from the selected artifact input. */ - export type LiqsolCore = typeof liqsolCoreIdlValue - - /** Camel-cased liqsol_core IDL consumed by Anchor's typed Program client. */ - export const liqsolCoreIdl = liqsolCoreIdlValue - `), - artifactSource = await formatTypescript(` - /* Autogenerated file. Do not edit manually. */ - /* eslint-disable */ - - /** Exact npm artifact inputs compiled into this SDK build. */ - export const OutpostArtifactManifests = { - ethereum: ${ethereumManifestSource}, - solana: ${JSON.stringify(generationInput.solanaManifest, null, 2)} - } - `) - -await Promise.all([ - fs.writeFile(path.join(SolanaOutputPath, "LiqsolCore.ts"), solanaSource), - fs.writeFile( - path.join(SolanaOutputPath, "index.ts"), - 'export * from "./LiqsolCore.js"\n' - ), - fs.writeFile(path.join(ArtifactOutputPath, "Manifests.ts"), artifactSource), - fs.writeFile( - path.join(ArtifactOutputPath, "index.ts"), - 'export * from "./Manifests.js"\n' - ) -]) - -process.stdout.write( - `Generated sdk-outpost clients from npm artifacts ${generationInput.ethereumManifest.source.revision} and ${generationInput.solanaManifest.source.revision}\n` -) diff --git a/scripts/sdk-outpost/verify-package.mjs b/scripts/sdk-outpost/verify-package.mjs deleted file mode 100755 index b7e43fe..0000000 --- a/scripts/sdk-outpost/verify-package.mjs +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env node - -/** - * Verify sdk-outpost's publishable files and CommonJS/ESM entrypoints. - * - * Usage: - * ./scripts/sdk-outpost/verify-package.mjs - * - * Options: - * None. - * - * Examples: - * ./scripts/sdk-outpost/verify-package.mjs - * - * Exit codes: - * 0 when the package is publishable; nonzero when an invariant fails. - */ - -import { createRequire } from "node:module" -import { pathToFileURL } from "node:url" - -import { fs, path } from "zx" - -import { PackagePath, assert, readJson } from "./config.mjs" - -const packageJson = await readJson(path.join(PackagePath, "package.json")), - readme = await fs.readFile(path.join(PackagePath, "README.md"), "utf8"), - ExpectedRepository = "https://github.com/Wire-Network/wire-libraries-ts", - ExpectedPublishedFiles = ["lib/cjs", "lib/esm", "README.md"], - InternalExports = ["EthereumOutpostClient", "SolanaOutpostClient"], - ExpectedExports = [ - "EthereumReserveClient", - "OutpostArtifactManifests", - "OutpostClient", - "OutpostDeploymentVerifier", - "SolanaReserveClient", - "assertOutpostArtifactCompatibility", - "parseOutpostDeploymentProfile" - ] - -assert(packageJson.name === "@wireio/sdk-outpost", "Unexpected package name") -assert(packageJson.private === false, "Package must be public") -assert( - packageJson.publishConfig?.access === "public", - "Package access must be public" -) -assert( - packageJson.repository?.url === ExpectedRepository, - "Repository URL must match provenance source" -) -assert( - packageJson.repository?.directory === "packages/sdk-outpost", - "Repository directory is incorrect" -) -assert( - packageJson.license === "FSL-1.1-Apache-2.0", - "Package license is missing" -) -assert( - JSON.stringify(Object.keys(packageJson.exports)) === JSON.stringify(["."]), - "Only the package-root entrypoint may be published" -) -assert( - JSON.stringify(packageJson.files) === JSON.stringify(ExpectedPublishedFiles), - "Published files must stay limited to built outputs and README" -) -assert( - !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(readme), - "Public README contains an environment-specific release label" -) - -await Promise.all( - [ - "lib/cjs/index.js", - "lib/cjs/index.d.ts", - "lib/cjs/package.json", - "lib/esm/index.js", - "lib/esm/index.d.ts", - "lib/esm/package.json" - ].map(outputPath => fs.access(path.join(PackagePath, outputPath))) -) - -/** Return every file beneath a package output directory. */ -async function filesUnder(directory) { - const entries = await fs.readdir(directory, { withFileTypes: true }), - paths = await Promise.all( - entries.map(entry => { - const child = path.join(directory, entry.name) - return entry.isDirectory() ? filesUnder(child) : [child] - }) - ) - - return paths.flat() -} - -const publishedOutputPaths = await filesUnder(path.join(PackagePath, "lib")) -assert( - publishedOutputPaths.every( - outputPath => !/\b(?:preview|sandbox|devnet|testnet)\b/i.test(outputPath) - ), - "Built output contains an environment-specific release label" -) - -const require = createRequire(import.meta.url), - cjs = require(path.join(PackagePath, packageJson.main)), - esm = await import(pathToFileURL(path.join(PackagePath, packageJson.module))) - -ExpectedExports.forEach(name => { - assert(name in cjs, `CommonJS entrypoint is missing ${name}`) - assert(name in esm, `ES module entrypoint is missing ${name}`) -}) - -InternalExports.forEach(name => { - assert(!(name in cjs), `CommonJS entrypoint exposes internal ${name}`) - assert(!(name in esm), `ES module entrypoint exposes internal ${name}`) -}) - -process.stdout.write( - "Verified sdk-outpost package boundaries and entrypoints\n" -) From 1c315330b937eca0ec63cad17f2ab1028ae673c2 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Thu, 20 Aug 2026 11:34:35 -0400 Subject: [PATCH 39/48] fix(sdk-outpost): normalize Ethereum runtime immutables --- .../sdk-outpost/src/artifacts/Compatibility.ts | 18 +++++++++++------- packages/sdk-outpost/tests/Fixtures.ts | 5 ++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index 65cddf3..156395d 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -11,8 +11,8 @@ import { OutpostArtifactManifests } from "./Manifests.js" const SolanaProgramDataMetadataByteLength = 45 -/** Byte range occupied by one linked Ethereum library address. */ -interface EthereumRuntimeLinkReference { +/** Deployment-specific byte range in one Ethereum runtime template. */ +interface EthereumRuntimeReference { readonly start: number readonly length: number } @@ -22,15 +22,15 @@ function sha256(value: Uint8Array): string { return ethersSha256(value).slice(2) } -/** Zero environment-specific linked-library addresses in live runtime code. */ +/** Zero environment-specific ranges in live Ethereum runtime code. */ function normalizeEthereumRuntimeCode( code: string, - linkReferences: readonly EthereumRuntimeLinkReference[] + runtimeReferences: readonly EthereumRuntimeReference[] ): Uint8Array { const runtimeCode = Uint8Array.from(getBytes(code)) let previousReferenceEnd = 0 - linkReferences.forEach(({ start, length }) => { + runtimeReferences.forEach(({ start, length }) => { const referenceEnd = start + length if ( !Number.isInteger(start) || @@ -39,7 +39,7 @@ function normalizeEthereumRuntimeCode( start < previousReferenceEnd || referenceEnd > runtimeCode.length ) { - throw new Error("Ethereum artifact has invalid runtime link references") + throw new Error("Ethereum artifact has invalid runtime references") } runtimeCode.fill(0, start, referenceEnd) previousReferenceEnd = referenceEnd @@ -54,9 +54,13 @@ export function assertEthereumRuntimeArtifactCompatibility( code: string ): void { const artifact = OutpostArtifactManifests.ethereum.contracts[contractName], + runtimeReferences = [ + ...artifact.runtimeLinkReferences, + ...artifact.runtimeImmutableReferences + ].sort((left, right) => left.start - right.start), normalizedCode = normalizeEthereumRuntimeCode( code, - artifact.runtimeLinkReferences + runtimeReferences ) if (normalizedCode.length !== artifact.runtimeBytecodeLength) { diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts index 88d0056..94e78ab 100644 --- a/packages/sdk-outpost/tests/Fixtures.ts +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -52,7 +52,7 @@ function createEthereumAddress(index: number): string { return getAddress(zeroPadValue(toBeHex(index), 20)) } -/** Create linked live implementation code from one producer runtime template. */ +/** Create deployment-substituted live code from one producer runtime template. */ export function createEthereumImplementationCode( contractName: EthereumContractName ): string { @@ -68,6 +68,9 @@ export function createEthereumImplementationCode( artifact.runtimeLinkReferences.forEach(({ start, length }) => runtimeCode.fill(1, start, start + length) ) + artifact.runtimeImmutableReferences.forEach(({ start, length }) => + runtimeCode.fill(2, start, start + length) + ) return hexlify(runtimeCode) } From 579e2132a4b6717d8a17536d38d0555ae745624d Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 21 Aug 2026 11:47:10 -0400 Subject: [PATCH 40/48] fix(sdk-outpost): align artifact dependencies --- package.json | 16 +- packages/sdk-outpost/README.md | 10 +- packages/sdk-outpost/package.json | 3 +- pnpm-lock.yaml | 758 ++++++++---------------------- pnpm-workspace.yaml | 14 + 5 files changed, 230 insertions(+), 571 deletions(-) diff --git a/package.json b/package.json index f2a42a3..8da1100 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,7 @@ "ts-jest": "^29.4.6", "ts-node": "^10.9.2", "typescript": "^6.0.2", - "typescript-eslint": "^8.64.0", - "zx": "^8.8.5" + "typescript-eslint": "^8.64.0" }, "packageManager": "pnpm@10.34.5", "engines": { @@ -43,21 +42,10 @@ "@wireio/opp-typescript-models": "^1.0.26" }, "resolutions": { - "@3fv/prelude-ts": "^0.8.41", "@aws-sdk/client-firehose": "3.1102.0", "@aws-sdk/client-kms": "3.1102.0", "@aws-sdk/client-sns": "3.1102.0", "@aws-sdk/client-ssm": "3.1102.0", - "@aws-sdk/client-sts": "3.1102.0", - "bluebird": "3.7.2", - "debug": "4.3.4", - "lodash": "4.18.1", - "prettier": "3.8.1", - "tracer": "1.3.0", - "typechain>prettier": "2.8.8", - "webpack": "5.104.1", - "webpack-cli": "6.0.1", - "webpack-dev-server": "6.0.0", - "ws": "8.21.0" + "@aws-sdk/client-sts": "3.1102.0" } } diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index c7ff30a..5b0e5d3 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,11 +8,11 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Release target: producer package `0.2.1` adds directly importable TypeScript -libraries and ethers v6 bindings. The first `@wireio/sdk-outpost` npm release -remains pending until both producer releases are published. The workspace -version remains `0.0.0` until the repository release workflow performs its -patch bump. +Release target: Ethereum artifacts `0.2.2` and Solana artifacts `0.2.1` provide +directly importable TypeScript libraries, including ethers v6 bindings. The +first `@wireio/sdk-outpost` release remains pending until their runtime manifests +pass deployment verification. The workspace version remains `0.0.0` until the +repository release workflow performs its patch bump. ## Install after the first SDK release diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index bbe8798..16666e1 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -44,13 +44,14 @@ "@coral-xyz/anchor": "^0.32.1", "@solana/spl-token": "^0.3.11", "@solana/web3.js": "^1.98.4", - "@wireio/outpost-ethereum-artifacts": "0.2.1", + "@wireio/outpost-ethereum-artifacts": "0.2.2", "@wireio/outpost-solana-artifacts": "0.2.1", "ethers": "^6.15.0", "ts-pattern": "^5.9.0", "zod": "^4.4.3" }, "devDependencies": { + "rpc-websockets": "9.3.8", "typescript": "6.0.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d2fef3..bec2e79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,32 +5,17 @@ settings: excludeLinksFromLockfile: true overrides: - '@3fv/prelude-ts': ^0.8.41 '@aws-sdk/client-firehose': 3.1102.0 '@aws-sdk/client-kms': 3.1102.0 '@aws-sdk/client-sns': 3.1102.0 '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 - bluebird: 3.7.2 - debug: 4.3.4 - lodash: 4.18.1 - prettier: 3.8.1 - tracer: 1.3.0 - typechain>prettier: 2.8.8 - webpack: 5.104.1 - webpack-cli: 6.0.1 - webpack-dev-server: 6.0.0 - ws: 8.21.0 pnpmfileChecksum: sha256-aSegbCvK5TyBUeMcgQLjFgZgcFmq1CMqHT+lQb93Qks= importers: .: - dependencies: - '@wireio/opp-typescript-models': - specifier: ^1.0.26 - version: 1.0.48 devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -72,7 +57,7 @@ importers: specifier: ^17.0.0 version: 17.0.0 prettier: - specifier: 3.8.1 + specifier: ^3.8.1 version: 3.8.1 ts-jest: specifier: ^29.4.6 @@ -86,9 +71,6 @@ importers: typescript-eslint: specifier: ^8.64.0 version: 8.64.0(eslint@10.7.0)(typescript@6.0.2) - zx: - specifier: ^8.8.5 - version: 8.8.5 examples/web-logging-example: dependencies: @@ -109,13 +91,13 @@ importers: specifier: ^6.0.2 version: 6.0.2 webpack: - specifier: 5.104.1 + specifier: ^5.104.1 version: 5.104.1(webpack-cli@6.0.1) webpack-cli: - specifier: 6.0.1 + specifier: ^6.0.1 version: 6.0.1(webpack-dev-server@6.0.0)(webpack@5.104.1) webpack-dev-server: - specifier: 6.0.0 + specifier: ^6.0.0 version: 6.0.0(bufferutil@4.1.0)(tslib@2.8.1)(utf-8-validate@6.0.6)(webpack-cli@6.0.1)(webpack@5.104.1) packages/sdk-core: @@ -153,9 +135,6 @@ importers: '@noble/curves': specifier: 1.9.7 version: 1.9.7 - '@wireio/opp-typescript-models': - specifier: ^1.0.26 - version: 1.0.48 '@wireio/shared': specifier: workspace:* version: link:../shared @@ -175,7 +154,7 @@ importers: specifier: ^2.0.7 version: 2.2.0 lodash: - specifier: 4.18.1 + specifier: ^4.18.1 version: 4.18.1 pako: specifier: ^2.1.0 @@ -211,21 +190,21 @@ importers: '@coral-xyz/anchor': specifier: ^0.32.1 version: 0.32.1(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) - '@ethersproject/abi': - specifier: ^5.8.0 - version: 5.8.0 - '@ethersproject/providers': - specifier: ^5.8.0 - version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) '@solana/spl-token': specifier: ^0.3.11 version: 0.3.11(@solana/web3.js@1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6))(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@6.0.2)(utf-8-validate@6.0.6) '@solana/web3.js': specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) + '@wireio/outpost-ethereum-artifacts': + specifier: 0.2.2 + version: 0.2.2(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + '@wireio/outpost-solana-artifacts': + specifier: 0.2.1 + version: 0.2.1 ethers: - specifier: ^5.8.0 - version: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + specifier: ^6.15.0 + version: 6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) ts-pattern: specifier: ^5.9.0 version: 5.9.0 @@ -233,21 +212,9 @@ importers: specifier: ^4.4.3 version: 4.4.3 devDependencies: - '@typechain/ethers-v5': - specifier: ^11.1.2 - version: 11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2) - '@wireio/outpost-ethereum-artifacts': - specifier: 0.1.1 - version: 0.1.1 - '@wireio/outpost-solana-artifacts': - specifier: 0.1.1 - version: 0.1.1 - prettier: - specifier: 3.8.1 - version: 3.8.1 - typechain: - specifier: ^8.3.2 - version: 8.3.2(typescript@6.0.2) + rpc-websockets: + specifier: 9.3.8 + version: 9.3.8 typescript: specifier: 6.0.2 version: 6.0.2 @@ -267,16 +234,16 @@ importers: specifier: 3.7.2 version: 3.7.2 debug: - specifier: 4.3.4 + specifier: ^4.3.4 version: 4.3.4 eventemitter3: specifier: ^5.0.4 version: 5.0.4 lodash: - specifier: 4.18.1 + specifier: ^4.18.1 version: 4.18.1 tracer: - specifier: 1.3.0 + specifier: ^1.3.0 version: 1.3.0 devDependencies: '@types/lodash': @@ -376,10 +343,10 @@ importers: specifier: 6.0.2 version: 6.0.2 webpack: - specifier: 5.104.1 + specifier: ^5.104.1 version: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: - specifier: 6.0.1 + specifier: ^6.0.1 version: 6.0.1(webpack@5.104.1) packages/wallet-ext-sdk: @@ -399,6 +366,9 @@ packages: '@3fv/prelude-ts@0.8.42': resolution: {integrity: sha512-a+d8lRjkUlzY7cyqYbClWKmEj1gAYa6ELeuXnhouJikIii9WUpI5aKIGsk19n3edNd5uzvGrf4FsI7uqNqFM+g==} + '@adraffy/ens-normalize@1.11.1': + resolution: {integrity: sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==} + '@asamuzakjp/css-color@3.2.0': resolution: {integrity: sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==} @@ -740,9 +710,6 @@ packages: resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@ethersproject/abi@5.8.0': - resolution: {integrity: sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==} - '@ethersproject/abstract-provider@5.8.0': resolution: {integrity: sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==} @@ -767,18 +734,12 @@ packages: '@ethersproject/constants@5.8.0': resolution: {integrity: sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==} - '@ethersproject/contracts@5.8.0': - resolution: {integrity: sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==} - '@ethersproject/hash@5.8.0': resolution: {integrity: sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==} '@ethersproject/hdnode@5.8.0': resolution: {integrity: sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==} - '@ethersproject/json-wallets@5.8.0': - resolution: {integrity: sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==} - '@ethersproject/keccak256@5.8.0': resolution: {integrity: sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==} @@ -794,12 +755,6 @@ packages: '@ethersproject/properties@5.8.0': resolution: {integrity: sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==} - '@ethersproject/providers@5.8.0': - resolution: {integrity: sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==} - - '@ethersproject/random@5.8.0': - resolution: {integrity: sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==} - '@ethersproject/rlp@5.8.0': resolution: {integrity: sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==} @@ -809,21 +764,12 @@ packages: '@ethersproject/signing-key@5.8.0': resolution: {integrity: sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==} - '@ethersproject/solidity@5.8.0': - resolution: {integrity: sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==} - '@ethersproject/strings@5.8.0': resolution: {integrity: sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==} '@ethersproject/transactions@5.8.0': resolution: {integrity: sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==} - '@ethersproject/units@5.8.0': - resolution: {integrity: sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==} - - '@ethersproject/wallet@5.8.0': - resolution: {integrity: sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==} - '@ethersproject/web@5.8.0': resolution: {integrity: sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==} @@ -1105,10 +1051,17 @@ packages: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.9.7': resolution: {integrity: sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==} engines: {node: ^14.21.3 || >=16} + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + '@noble/hashes@1.4.0': resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} @@ -1162,9 +1115,6 @@ packages: resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} engines: {node: ^14.18.0 || >=16.0.0} - '@protobuf-ts/runtime@2.11.1': - resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==} - '@reduxjs/toolkit@2.12.0': resolution: {integrity: sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==} peerDependencies: @@ -1312,15 +1262,6 @@ packages: '@tybys/wasm-util@0.10.3': resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} - '@typechain/ethers-v5@11.1.2': - resolution: {integrity: sha512-ID6pqWkao54EuUQa0P5RgjvfA3MYqxUQKpbGKERbsjBW5Ra7EIXvbMlPp2pcP5IAdUkyMCFYsP2SN5q7mPdLDQ==} - peerDependencies: - '@ethersproject/abi': ^5.0.0 - '@ethersproject/providers': ^5.0.0 - ethers: ^5.1.3 - typechain: ^8.3.2 - typescript: '>=4.3.0' - '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -1426,12 +1367,12 @@ packages: '@types/node@22.20.0': resolution: {integrity: sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==} + '@types/node@22.7.5': + resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + '@types/node@25.5.0': resolution: {integrity: sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==} - '@types/prettier@2.7.3': - resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} - '@types/qs@6.15.1': resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==} @@ -1710,35 +1651,34 @@ packages: resolution: {integrity: sha512-u8d0pJ5YFgneF/GuvEiDA61Tf1VDomHHYMjv/wc9XzYj7nopltpG96nXN5dJRstxZhcNpV1g+nT6CydO7pHbjA==} engines: {node: '>=18.12.0'} peerDependencies: - webpack: 5.104.1 - webpack-cli: 6.0.1 + webpack: ^5.82.0 + webpack-cli: 6.x.x '@webpack-cli/info@3.0.1': resolution: {integrity: sha512-coEmDzc2u/ffMvuW9aCjoRzNSPDl/XLuhPdlFRpT9tZHmJ/039az33CE7uH+8s0uL1j5ZNtfdv0HkfaKRBGJsQ==} engines: {node: '>=18.12.0'} peerDependencies: - webpack: 5.104.1 - webpack-cli: 6.0.1 + webpack: ^5.82.0 + webpack-cli: 6.x.x '@webpack-cli/serve@3.0.1': resolution: {integrity: sha512-sbgw03xQaCLiT6gcY/6u3qBDn01CWw/nbaXl3gTdTFuJJ75Gffv3E3DBpgvY2fkkrdS1fpjaXNOmJlnbtKauKg==} engines: {node: '>=18.12.0'} peerDependencies: - webpack: 5.104.1 - webpack-cli: 6.0.1 + webpack: ^5.82.0 + webpack-cli: 6.x.x webpack-dev-server: '*' peerDependenciesMeta: webpack-dev-server: optional: true - '@wireio/opp-typescript-models@1.0.48': - resolution: {integrity: sha512-3HDC88AohYBBMuVdSqdI5tIRHPZWWTOaS+yQ/Xs1sCvhKuqlpF3KnYLcgIiXX3x6IC87dfo55xBfHPFcWpthmw==} - - '@wireio/outpost-ethereum-artifacts@0.1.1': - resolution: {integrity: sha512-nQ2JeEcMkv1AyEI6/MnTvQepRxr7PTG9ah34L775ami1tZLoaJv5+dAaaHjWh4+SreX0xKXxdKnBwrFvFkd0rQ==} + '@wireio/outpost-ethereum-artifacts@0.2.2': + resolution: {integrity: sha512-Gt1X09byNuuTCVJuAsj27Co+0WHUFo1W+p8fNfDYpKUfGKJA+hWoJDMpIiuYO5CoEf2OtlBH1kmSufY5Ej50pg==} + peerDependencies: + ethers: ^6.15.0 - '@wireio/outpost-solana-artifacts@0.1.1': - resolution: {integrity: sha512-C7bygnrS/XmnIGz3Upnw0HbXsznLQV35hAjnHgGyhRkWINySSdVfj6l9SH4OXiUeyxn+ple4Yz6P0YVITnT8rg==} + '@wireio/outpost-solana-artifacts@0.2.1': + resolution: {integrity: sha512-Q6aeQxXiwoXDifDwubswTy/qg2hTpElzQihNV5OwTX9HpBm1Y6/yKbpN5wNjk4RRbeuhm6X2Tfcu2MPu0mo5Uw==} '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -1774,8 +1714,8 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - aes-js@3.0.0: - resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} + aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} @@ -1821,10 +1761,6 @@ packages: resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} - ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -1847,14 +1783,6 @@ packages: argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - array-back@3.1.0: - resolution: {integrity: sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==} - engines: {node: '>=6'} - - array-back@4.0.2: - resolution: {integrity: sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==} - engines: {node: '>=8'} - asn1js@3.0.10: resolution: {integrity: sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==} engines: {node: '>=12.0.0'} @@ -1905,9 +1833,6 @@ packages: batch@0.6.1: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} - bech32@1.1.4: - resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} - bigint-buffer@1.1.5: resolution: {integrity: sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==} engines: {node: '>= 10.0.0'} @@ -2027,10 +1952,6 @@ packages: caniuse-lite@1.0.30001803: resolution: {integrity: sha512-g/uHREV2ZpK9qMalCsWaxmA6ol+DX8GYhuf3T40RKoP+oL7vhRJh8LNt73PCjpnR6l14FzfPrB5Yux4PKm2meg==} - chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -2077,16 +1998,10 @@ packages: collect-v8-coverage@1.0.3: resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} - color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} - color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -2097,14 +2012,6 @@ packages: resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} engines: {node: '>=0.1.90'} - command-line-args@5.2.1: - resolution: {integrity: sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==} - engines: {node: '>=4.0.0'} - - command-line-usage@6.1.3: - resolution: {integrity: sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==} - engines: {node: '>=8.0.0'} - commander@12.1.0: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} @@ -2167,7 +2074,7 @@ packages: resolution: {integrity: sha512-3JLW90aBGeaTLpM7mYQKpnVdgsUZRExY55giiZgLuX/xTQRUs1dOCwbBnWnvY6Q6rfZoXMNwzOQJCSZPppfqXA==} engines: {node: '>= 20.9.0'} peerDependencies: - webpack: 5.104.1 + webpack: ^5.1.0 create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -2184,7 +2091,7 @@ packages: engines: {node: '>= 18.12.0'} peerDependencies: '@rspack/core': 0.x || ^1.0.0 || ^2.0.0-0 - webpack: 5.104.1 + webpack: ^5.27.0 peerDependenciesMeta: '@rspack/core': optional: true @@ -2217,6 +2124,14 @@ packages: dateformat@4.5.1: resolution: {integrity: sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==} + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2226,6 +2141,15 @@ packages: supports-color: optional: true + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decimal.js@10.6.0: resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} @@ -2237,10 +2161,6 @@ packages: babel-plugin-macros: optional: true - deep-extend@0.6.0: - resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} - engines: {node: '>=4.0.0'} - deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -2380,10 +2300,6 @@ packages: escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} @@ -2457,8 +2373,9 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} - ethers@5.8.0: - resolution: {integrity: sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==} + ethers@6.17.0: + resolution: {integrity: sha512-BpyrpIPJ3ydEVow8zGaz1DuPS7YU8DcWxuBnY9a0UA/lvAPwrMr+EPXsfrul628SRaekPNeIM4UFh/91GWZang==} + engines: {node: '>=14.0.0'} eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} @@ -2539,10 +2456,6 @@ packages: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} - find-replace@3.0.0: - resolution: {integrity: sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==} - engines: {node: '>=4.0.0'} - find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -2574,10 +2487,6 @@ packages: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} - fs-extra@7.0.1: - resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} - engines: {node: '>=6 <7 || >=8'} - fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -2631,10 +2540,6 @@ packages: deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true - glob@7.1.7: - resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} - deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me - glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me @@ -2654,10 +2559,6 @@ packages: engines: {node: '>=0.4.7'} hasBin: true - has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -2697,7 +2598,7 @@ packages: engines: {node: '>=10.13.0'} peerDependencies: '@rspack/core': 0.x || 1.x - webpack: 5.104.1 + webpack: ^5.20.0 peerDependenciesMeta: '@rspack/core': optional: true @@ -2879,7 +2780,7 @@ packages: isomorphic-ws@4.0.1: resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} peerDependencies: - ws: 8.21.0 + ws: '*' istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} @@ -3104,9 +3005,6 @@ packages: engines: {node: '>=6'} hasBin: true - jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -3143,9 +3041,6 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} - lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} - lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -3219,7 +3114,7 @@ packages: resolution: {integrity: sha512-AOSS0IdEB95ayVkxn5oGzNQwqAi2J0Jb/kKm43t7H73s8+f5873g0yuj0PNvK4dO75mu5DHg4nlgp4k6Kga8eg==} engines: {node: '>= 12.13.0'} peerDependencies: - webpack: 5.104.1 + webpack: ^5.0.0 minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} @@ -3250,6 +3145,9 @@ packages: engines: {node: '>=10'} hasBin: true + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -3487,11 +3385,6 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - prettier@3.8.1: resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} engines: {node: '>=14'} @@ -3569,10 +3462,6 @@ packages: resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} engines: {node: '>= 10.13.0'} - reduce-flatten@2.0.0: - resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} - engines: {node: '>=6'} - redux-thunk@3.1.0: resolution: {integrity: sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==} peerDependencies: @@ -3619,8 +3508,8 @@ packages: resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} engines: {node: '>= 18'} - rpc-websockets@9.3.9: - resolution: {integrity: sha512-2iQDaTB4g5fDB2ihrTFSJSibCEuxaRi1q7qTW7ZO9/M5/TC+ToHA4D9/ffNLEbAoHNNrcdeP05oATNk44SKZXA==} + rpc-websockets@9.3.8: + resolution: {integrity: sha512-7r+fm4tSJmLf9GvZfL1DJ1SJwpagpp6AazqM0FUaeV7CA+7+NYINSk1syWa4tU/6OF2CyBicLtzENGmXRJH6wQ==} rrweb-cssom@0.8.0: resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} @@ -3649,9 +3538,6 @@ packages: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} - scrypt-js@3.0.1: - resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} - selfsigned@5.5.0: resolution: {integrity: sha512-ftnu3TW4+3eBfLRFnDEkzGxSF/10BJBkaLJuBHZX0kiPS7bRdlpZGu6YGt4KngMkdTwJE6MbjavFpqHvqVt+Ew==} engines: {node: '>=18'} @@ -3770,9 +3656,6 @@ packages: stream-json@1.9.1: resolution: {integrity: sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==} - string-format@2.0.0: - resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} - string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} @@ -3809,7 +3692,7 @@ packages: resolution: {integrity: sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==} engines: {node: '>= 18.12.0'} peerDependencies: - webpack: 5.104.1 + webpack: ^5.27.0 superstruct@0.15.5: resolution: {integrity: sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==} @@ -3818,10 +3701,6 @@ packages: resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} engines: {node: '>=14.0.0'} - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -3841,10 +3720,6 @@ packages: resolution: {integrity: sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==} engines: {node: ^14.18.0 || >=16.0.0} - table-layout@1.0.2: - resolution: {integrity: sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==} - engines: {node: '>=8.0.0'} - tapable@2.3.3: resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} @@ -3865,7 +3740,7 @@ packages: lightningcss: '*' postcss: '*' uglify-js: '*' - webpack: 5.104.1 + webpack: ^5.1.0 peerDependenciesMeta: '@minify-html/node': optional: true @@ -3973,15 +3848,6 @@ packages: peerDependencies: typescript: '>=4.8.4' - ts-command-line-args@2.5.1: - resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} - hasBin: true - - ts-essentials@7.0.3: - resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} - peerDependencies: - typescript: '>=3.7.0' - ts-jest@29.4.11: resolution: {integrity: sha512-IrFl7l9AuB/qrNw5quqvAv/hmKMb8dhWOH4jQOGo0Oq8tCeo1O86/iTFG1FaRimgUkF13l4PcepO8ATFT6Ns4g==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -4015,7 +3881,7 @@ packages: peerDependencies: loader-utils: '*' typescript: '*' - webpack: 5.104.1 + webpack: ^4.0.0 || ^5.0.0 peerDependenciesMeta: loader-utils: optional: true @@ -4040,6 +3906,9 @@ packages: tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -4070,12 +3939,6 @@ packages: resolution: {integrity: sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==} engines: {node: '>= 18'} - typechain@8.3.2: - resolution: {integrity: sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==} - hasBin: true - peerDependencies: - typescript: '>=4.3.0' - typescript-eslint@8.64.0: resolution: {integrity: sha512-0qg+pDNMnqYzqH9AnNK+39tejHvsShUOUUoRUgtnTGE7QuMZhiFDnozq8nHJVq+Wae6NMLKNWLg5WmkcC/ndyQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -4088,29 +3951,20 @@ packages: engines: {node: '>=14.17'} hasBin: true - typical@4.0.0: - resolution: {integrity: sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==} - engines: {node: '>=8'} - - typical@5.2.0: - resolution: {integrity: sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==} - engines: {node: '>=8'} - uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} hasBin: true + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} undici-types@7.18.2: resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} - universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} - unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -4142,6 +3996,10 @@ packages: utila@0.4.0: resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==} + uuid@11.1.1: + resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==} + hasBin: true + uuid@14.0.1: resolution: {integrity: sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==} hasBin: true @@ -4185,7 +4043,7 @@ packages: engines: {node: '>=18.12.0'} hasBin: true peerDependencies: - webpack: 5.104.1 + webpack: ^5.82.0 webpack-bundle-analyzer: '*' webpack-dev-server: '*' peerDependenciesMeta: @@ -4198,7 +4056,7 @@ packages: resolution: {integrity: sha512-zWrde9VZDiRaFuWsjHO40wm9LxxtXEk8DdzFXdU7eU5ZpiANnZZDBbZgN3guxbEoKqUHd9YupBmynyioz42nkA==} engines: {node: '>= 20.9.0'} peerDependencies: - webpack: 5.104.1 + webpack: ^5.101.0 peerDependenciesMeta: webpack: optional: true @@ -4208,7 +4066,7 @@ packages: engines: {node: '>= 22.15.0'} hasBin: true peerDependencies: - webpack: 5.104.1 + webpack: ^5.101.0 webpack-cli: '*' peerDependenciesMeta: webpack: @@ -4265,10 +4123,6 @@ packages: wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - wordwrapjs@4.0.1: - resolution: {integrity: sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==} - engines: {node: '>=8.0.0'} - wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -4284,6 +4138,18 @@ packages: resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ws@7.5.13: + resolution: {integrity: sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.21.0: resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} engines: {node: '>=10.0.0'} @@ -4340,11 +4206,6 @@ packages: zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} - zx@8.8.5: - resolution: {integrity: sha512-SNgDF5L0gfN7FwVOdEFguY3orU5AkfFZm9B5YSHog/UDHv+lvmd82ZAsOenOkQixigwH2+yyH198AwNdKhj+RA==} - engines: {node: '>= 12.17.0'} - hasBin: true - snapshots: '@3fv/guard@1.4.39': @@ -4357,6 +4218,8 @@ snapshots: hamt_plus: 1.0.2 list: 2.0.19 + '@adraffy/ens-normalize@1.11.1': {} + '@asamuzakjp/css-color@3.2.0': dependencies: '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) @@ -4818,18 +4681,6 @@ snapshots: '@eslint/core': 1.2.1 levn: 0.4.1 - '@ethersproject/abi@5.8.0': - dependencies: - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/abstract-provider@5.8.0': dependencies: '@ethersproject/bignumber': 5.8.0 @@ -4879,19 +4730,6 @@ snapshots: dependencies: '@ethersproject/bignumber': 5.8.0 - '@ethersproject/contracts@5.8.0': - dependencies: - '@ethersproject/abi': 5.8.0 - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/hash@5.8.0': dependencies: '@ethersproject/abstract-signer': 5.8.0 @@ -4919,22 +4757,6 @@ snapshots: '@ethersproject/transactions': 5.8.0 '@ethersproject/wordlists': 5.8.0 - '@ethersproject/json-wallets@5.8.0': - dependencies: - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/hdnode': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/pbkdf2': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/random': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - aes-js: 3.0.0 - scrypt-js: 3.0.1 - '@ethersproject/keccak256@5.8.0': dependencies: '@ethersproject/bytes': 5.8.0 @@ -4955,37 +4777,6 @@ snapshots: dependencies: '@ethersproject/logger': 5.8.0 - '@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)': - dependencies: - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/base64': 5.8.0 - '@ethersproject/basex': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/networks': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/random': 5.8.0 - '@ethersproject/rlp': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/web': 5.8.0 - bech32: 1.1.4 - ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@ethersproject/random@5.8.0': - dependencies: - '@ethersproject/bytes': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/rlp@5.8.0': dependencies: '@ethersproject/bytes': 5.8.0 @@ -5006,15 +4797,6 @@ snapshots: elliptic: 6.6.1 hash.js: 1.1.7 - '@ethersproject/solidity@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/strings@5.8.0': dependencies: '@ethersproject/bytes': 5.8.0 @@ -5033,30 +4815,6 @@ snapshots: '@ethersproject/rlp': 5.8.0 '@ethersproject/signing-key': 5.8.0 - '@ethersproject/units@5.8.0': - dependencies: - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/logger': 5.8.0 - - '@ethersproject/wallet@5.8.0': - dependencies: - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/hdnode': 5.8.0 - '@ethersproject/json-wallets': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/random': 5.8.0 - '@ethersproject/signing-key': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/wordlists': 5.8.0 - '@ethersproject/web@5.8.0': dependencies: '@ethersproject/base64': 5.8.0 @@ -5125,7 +4883,7 @@ snapshots: '@jest/test-result': 30.4.1 '@jest/transform': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 4.4.0 @@ -5133,7 +4891,7 @@ snapshots: fast-json-stable-stringify: 2.1.0 graceful-fs: 4.2.11 jest-changed-files: 30.4.1 - jest-config: 30.4.2(@types/node@25.5.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)) + jest-config: 30.4.2(@types/node@22.20.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)) jest-haste-map: 30.4.1 jest-message-util: 30.4.1 jest-regex-util: 30.4.0 @@ -5161,7 +4919,7 @@ snapshots: '@jest/fake-timers': 30.4.1 '@jest/types': 30.4.1 '@types/jsdom': 21.1.7 - '@types/node': 25.5.0 + '@types/node': 22.20.0 jest-mock: 30.4.1 jest-util: 30.4.1 jsdom: 26.1.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) @@ -5170,7 +4928,7 @@ snapshots: dependencies: '@jest/fake-timers': 30.4.1 '@jest/types': 30.4.1 - '@types/node': 25.5.0 + '@types/node': 22.20.0 jest-mock: 30.4.1 '@jest/expect-utils@30.4.1': @@ -5293,7 +5051,7 @@ snapshots: '@jest/schemas': 30.4.1 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 25.5.0 + '@types/node': 22.20.0 '@types/yargs': 17.0.35 chalk: 4.1.2 @@ -5462,10 +5220,16 @@ snapshots: '@tybys/wasm-util': 0.10.3 optional: true + '@noble/curves@1.2.0': + dependencies: + '@noble/hashes': 1.3.2 + '@noble/curves@1.9.7': dependencies: '@noble/hashes': 1.8.0 + '@noble/hashes@1.3.2': {} + '@noble/hashes@1.4.0': {} '@noble/hashes@1.8.0': {} @@ -5569,8 +5333,6 @@ snapshots: '@pkgr/core@0.3.6': {} - '@protobuf-ts/runtime@2.11.1': {} - '@reduxjs/toolkit@2.12.0(react-redux@9.3.0(@types/react@19.2.17)(react@19.2.7)(redux@5.0.1))(react@19.2.7)': dependencies: '@standard-schema/spec': 1.1.0 @@ -5750,7 +5512,7 @@ snapshots: fast-stable-stringify: 1.0.0 jayson: 4.3.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) node-fetch: 2.7.0 - rpc-websockets: 9.3.9 + rpc-websockets: 9.3.8 superstruct: 2.0.2 transitivePeerDependencies: - bufferutil @@ -5779,16 +5541,6 @@ snapshots: tslib: 2.8.1 optional: true - '@typechain/ethers-v5@11.1.2(@ethersproject/abi@5.8.0)(@ethersproject/providers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(typechain@8.3.2(typescript@6.0.2))(typescript@6.0.2)': - dependencies: - '@ethersproject/abi': 5.8.0 - '@ethersproject/providers': 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - ethers: 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - lodash: 4.18.1 - ts-essentials: 7.0.3(typescript@6.0.2) - typechain: 8.3.2(typescript@6.0.2) - typescript: 6.0.2 - '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.29.7 @@ -5921,12 +5673,14 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/node@22.7.5': + dependencies: + undici-types: 6.19.8 + '@types/node@25.5.0': dependencies: undici-types: 7.18.2 - '@types/prettier@2.7.3': {} - '@types/qs@6.15.1': {} '@types/range-parser@1.2.7': {} @@ -5996,7 +5750,7 @@ snapshots: '@typescript-eslint/types': 8.64.0 '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.2) '@typescript-eslint/visitor-keys': 8.64.0 - debug: 4.3.4 + debug: 4.4.3 eslint: 10.7.0 typescript: 6.0.2 transitivePeerDependencies: @@ -6006,7 +5760,7 @@ snapshots: dependencies: '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.2) '@typescript-eslint/types': 8.64.0 - debug: 4.3.4 + debug: 4.4.3 typescript: 6.0.2 transitivePeerDependencies: - supports-color @@ -6025,7 +5779,7 @@ snapshots: '@typescript-eslint/types': 8.64.0 '@typescript-eslint/typescript-estree': 8.64.0(typescript@6.0.2) '@typescript-eslint/utils': 8.64.0(eslint@10.7.0)(typescript@6.0.2) - debug: 4.3.4 + debug: 4.4.3 eslint: 10.7.0 ts-api-utils: 2.5.0(typescript@6.0.2) typescript: 6.0.2 @@ -6040,7 +5794,7 @@ snapshots: '@typescript-eslint/tsconfig-utils': 8.64.0(typescript@6.0.2) '@typescript-eslint/types': 8.64.0 '@typescript-eslint/visitor-keys': 8.64.0 - debug: 4.3.4 + debug: 4.4.3 minimatch: 10.2.5 semver: 7.8.5 tinyglobby: 0.2.17 @@ -6235,13 +5989,11 @@ snapshots: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.104.1) - '@wireio/opp-typescript-models@1.0.48': + '@wireio/outpost-ethereum-artifacts@0.2.2(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': dependencies: - '@protobuf-ts/runtime': 2.11.1 - - '@wireio/outpost-ethereum-artifacts@0.1.1': {} + ethers: 6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - '@wireio/outpost-solana-artifacts@0.1.1': {} + '@wireio/outpost-solana-artifacts@0.2.1': {} '@xtuc/ieee754@1.2.0': {} @@ -6271,7 +6023,7 @@ snapshots: acorn@8.17.0: {} - aes-js@3.0.0: {} + aes-js@4.0.0-beta.5: {} agent-base@7.1.4: {} @@ -6312,10 +6064,6 @@ snapshots: ansi-regex@6.2.2: {} - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 - ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -6335,10 +6083,6 @@ snapshots: dependencies: sprintf-js: 1.0.3 - array-back@3.1.0: {} - - array-back@4.0.2: {} - asn1js@3.0.10: dependencies: pvtsutils: 1.3.6 @@ -6411,8 +6155,6 @@ snapshots: batch@0.6.1: {} - bech32@1.1.4: {} - bigint-buffer@1.1.5: dependencies: bindings: 1.5.0 @@ -6433,7 +6175,7 @@ snapshots: dependencies: bytes: 3.1.2 content-type: 2.0.0 - debug: 4.3.4 + debug: 4.4.3 http-errors: 2.0.1 iconv-lite: 0.7.3 on-finished: 2.4.1 @@ -6542,12 +6284,6 @@ snapshots: caniuse-lite@1.0.30001803: {} - chalk@2.4.2: - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -6587,36 +6323,16 @@ snapshots: collect-v8-coverage@1.0.3: {} - color-convert@1.9.3: - dependencies: - color-name: 1.1.3 - color-convert@2.0.1: dependencies: color-name: 1.1.4 - color-name@1.1.3: {} - color-name@1.1.4: {} colorette@2.0.20: {} colors@1.4.0: {} - command-line-args@5.2.1: - dependencies: - array-back: 3.1.0 - find-replace: 3.0.0 - lodash.camelcase: 4.3.0 - typical: 4.0.0 - - command-line-usage@6.1.3: - dependencies: - array-back: 4.0.2 - chalk: 2.4.2 - table-layout: 1.0.2 - typical: 5.2.0 - commander@12.1.0: {} commander@14.0.3: {} @@ -6633,7 +6349,7 @@ snapshots: dependencies: bytes: 3.1.2 compressible: 2.0.18 - debug: 4.3.4 + debug: 2.6.9 negotiator: 0.6.4 on-headers: 1.1.0 safe-buffer: 5.2.1 @@ -6728,16 +6444,22 @@ snapshots: dateformat@4.5.1: {} + debug@2.6.9: + dependencies: + ms: 2.0.0 + debug@4.3.4: dependencies: ms: 2.1.2 + debug@4.4.3: + dependencies: + ms: 2.1.3 + decimal.js@10.6.0: {} dedent@1.7.2: {} - deep-extend@0.6.0: {} - deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -6857,8 +6579,6 @@ snapshots: escape-html@1.0.3: {} - escape-string-regexp@1.0.5: {} - escape-string-regexp@2.0.0: {} escape-string-regexp@4.0.0: {} @@ -6942,38 +6662,15 @@ snapshots: etag@1.8.1: {} - ethers@5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): dependencies: - '@ethersproject/abi': 5.8.0 - '@ethersproject/abstract-provider': 5.8.0 - '@ethersproject/abstract-signer': 5.8.0 - '@ethersproject/address': 5.8.0 - '@ethersproject/base64': 5.8.0 - '@ethersproject/basex': 5.8.0 - '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.8.0 - '@ethersproject/constants': 5.8.0 - '@ethersproject/contracts': 5.8.0 - '@ethersproject/hash': 5.8.0 - '@ethersproject/hdnode': 5.8.0 - '@ethersproject/json-wallets': 5.8.0 - '@ethersproject/keccak256': 5.8.0 - '@ethersproject/logger': 5.8.0 - '@ethersproject/networks': 5.8.0 - '@ethersproject/pbkdf2': 5.8.0 - '@ethersproject/properties': 5.8.0 - '@ethersproject/providers': 5.8.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - '@ethersproject/random': 5.8.0 - '@ethersproject/rlp': 5.8.0 - '@ethersproject/sha2': 5.8.0 - '@ethersproject/signing-key': 5.8.0 - '@ethersproject/solidity': 5.8.0 - '@ethersproject/strings': 5.8.0 - '@ethersproject/transactions': 5.8.0 - '@ethersproject/units': 5.8.0 - '@ethersproject/wallet': 5.8.0 - '@ethersproject/web': 5.8.0 - '@ethersproject/wordlists': 5.8.0 + '@adraffy/ens-normalize': 1.11.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 22.7.5 + aes-js: 4.0.0-beta.5 + tslib: 2.7.0 + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -7015,7 +6712,7 @@ snapshots: content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.2.2 - debug: 4.3.4 + debug: 4.4.3 depd: 2.0.0 encodeurl: 2.0.0 escape-html: 1.0.3 @@ -7076,7 +6773,7 @@ snapshots: finalhandler@2.1.1: dependencies: - debug: 4.3.4 + debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 @@ -7085,10 +6782,6 @@ snapshots: transitivePeerDependencies: - supports-color - find-replace@3.0.0: - dependencies: - array-back: 3.1.0 - find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -7117,12 +6810,6 @@ snapshots: fresh@2.0.0: {} - fs-extra@7.0.1: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 4.0.0 - universalify: 0.1.2 - fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -7175,15 +6862,6 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 - glob@7.1.7: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.5 - once: 1.4.0 - path-is-absolute: 1.0.1 - glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -7208,8 +6886,6 @@ snapshots: optionalDependencies: uglify-js: 3.19.3 - has-flag@3.0.0: {} - has-flag@4.0.0: {} has-symbols@1.1.0: {} @@ -7289,7 +6965,7 @@ snapshots: http-proxy-middleware@4.2.0: dependencies: - debug: 4.3.4 + debug: 4.4.3 httpxy: 0.5.4 is-glob: 4.0.3 is-plain-obj: 4.1.0 @@ -7404,9 +7080,9 @@ snapshots: isobject@3.0.1: {} - isomorphic-ws@4.0.1(ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)): + isomorphic-ws@4.0.1(ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6)): dependencies: - ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + ws: 7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6) istanbul-lib-coverage@3.2.2: {} @@ -7454,11 +7130,11 @@ snapshots: delay: 5.0.0 es6-promisify: 5.0.0 eyes: 0.1.8 - isomorphic-ws: 4.0.1(ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + isomorphic-ws: 4.0.1(ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6)) json-stringify-safe: 5.0.1 stream-json: 1.9.1 uuid: 8.3.2 - ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + ws: 7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -7514,6 +7190,38 @@ snapshots: - supports-color - ts-node + jest-config@30.4.2(@types/node@22.20.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)): + dependencies: + '@babel/core': 7.29.7 + '@jest/get-type': 30.1.0 + '@jest/pattern': 30.4.0 + '@jest/test-sequencer': 30.4.1 + '@jest/types': 30.4.1 + babel-jest: 30.4.1(@babel/core@7.29.7) + chalk: 4.1.2 + ci-info: 4.4.0 + deepmerge: 4.3.1 + glob: 10.5.0 + graceful-fs: 4.2.11 + jest-circus: 30.4.2 + jest-docblock: 30.4.0 + jest-environment-node: 30.4.1 + jest-regex-util: 30.4.0 + jest-resolve: 30.4.1 + jest-runner: 30.4.2 + jest-util: 30.4.1 + jest-validate: 30.4.1 + parse-json: 5.2.0 + pretty-format: 30.4.1 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 22.20.0 + ts-node: 10.9.2(@types/node@25.5.0)(typescript@6.0.2) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-config@30.4.2(@types/node@25.5.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)): dependencies: '@babel/core': 7.29.7 @@ -7852,10 +7560,6 @@ snapshots: json5@2.2.3: {} - jsonfile@4.0.0: - optionalDependencies: - graceful-fs: 4.2.11 - keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -7888,8 +7592,6 @@ snapshots: dependencies: p-locate: 5.0.0 - lodash.camelcase@4.3.0: {} - lodash.memoize@4.1.2: {} lodash@4.18.1: {} @@ -7986,6 +7688,8 @@ snapshots: mkdirp@1.0.4: {} + ms@2.0.0: {} + ms@2.1.2: {} ms@2.1.3: {} @@ -8194,8 +7898,6 @@ snapshots: prelude-ls@1.2.1: {} - prettier@2.8.8: {} - prettier@3.8.1: {} pretty-error@4.0.0: @@ -8265,8 +7967,6 @@ snapshots: dependencies: resolve: 1.22.12 - reduce-flatten@2.0.0: {} - redux-thunk@3.1.0(redux@5.0.1): dependencies: redux: 5.0.1 @@ -8306,7 +8006,7 @@ snapshots: router@2.2.0: dependencies: - debug: 4.3.4 + debug: 4.4.3 depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 @@ -8314,14 +8014,14 @@ snapshots: transitivePeerDependencies: - supports-color - rpc-websockets@9.3.9: + rpc-websockets@9.3.8: dependencies: '@swc/helpers': 0.5.23 '@types/uuid': 10.0.0 '@types/ws': 8.18.1 buffer: 6.0.3 eventemitter3: 5.0.4 - uuid: 14.0.1 + uuid: 11.1.1 ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) optionalDependencies: bufferutil: 4.1.0 @@ -8352,8 +8052,6 @@ snapshots: ajv-formats: 2.1.1(ajv@8.20.0) ajv-keywords: 5.1.0(ajv@8.20.0) - scrypt-js@3.0.1: {} - selfsigned@5.5.0: dependencies: '@peculiar/x509': 1.14.3 @@ -8365,7 +8063,7 @@ snapshots: send@1.2.1: dependencies: - debug: 4.3.4 + debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -8385,7 +8083,7 @@ snapshots: dependencies: accepts: 1.3.8 batch: 0.6.1 - debug: 4.3.4 + debug: 2.6.9 escape-html: 1.0.3 http-errors: 1.8.1 mime-types: 2.1.35 @@ -8484,8 +8182,6 @@ snapshots: dependencies: stream-chain: 2.2.5 - string-format@2.0.0: {} - string-length@4.0.2: dependencies: char-regex: 1.0.2 @@ -8525,10 +8221,6 @@ snapshots: superstruct@2.0.2: {} - supports-color@5.5.0: - dependencies: - has-flag: 3.0.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -8545,13 +8237,6 @@ snapshots: dependencies: '@pkgr/core': 0.3.6 - table-layout@1.0.2: - dependencies: - array-back: 4.0.2 - deep-extend: 0.6.0 - typical: 5.2.0 - wordwrapjs: 4.0.1 - tapable@2.3.3: {} terser-webpack-plugin@5.6.1(postcss@8.5.16)(webpack@5.104.1): @@ -8643,17 +8328,6 @@ snapshots: dependencies: typescript: 6.0.2 - ts-command-line-args@2.5.1: - dependencies: - chalk: 4.1.2 - command-line-args: 5.2.1 - command-line-usage: 6.1.3 - string-format: 2.0.0 - - ts-essentials@7.0.3(typescript@6.0.2): - dependencies: - typescript: 6.0.2 - ts-jest@29.4.11(@babel/core@7.29.7)(@jest/transform@30.4.1)(@jest/types@30.4.1)(babel-jest@30.4.1(@babel/core@7.29.7))(jest-util@30.4.1)(jest@30.4.2(@types/node@25.5.0)(ts-node@10.9.2(@types/node@25.5.0)(typescript@6.0.2)))(typescript@6.0.2): dependencies: bs-logger: 0.2.6 @@ -8704,6 +8378,8 @@ snapshots: tslib@1.14.1: {} + tslib@2.7.0: {} + tslib@2.8.1: {} tsyringe@4.10.0: @@ -8728,22 +8404,6 @@ snapshots: media-typer: 1.1.0 mime-types: 3.0.2 - typechain@8.3.2(typescript@6.0.2): - dependencies: - '@types/prettier': 2.7.3 - debug: 4.3.4 - fs-extra: 7.0.1 - glob: 7.1.7 - js-sha3: 0.8.0 - lodash: 4.18.1 - mkdirp: 1.0.4 - prettier: 2.8.8 - ts-command-line-args: 2.5.1 - ts-essentials: 7.0.3(typescript@6.0.2) - typescript: 6.0.2 - transitivePeerDependencies: - - supports-color - typescript-eslint@8.64.0(eslint@10.7.0)(typescript@6.0.2): dependencies: '@typescript-eslint/eslint-plugin': 8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0)(typescript@6.0.2))(eslint@10.7.0)(typescript@6.0.2) @@ -8757,19 +8417,15 @@ snapshots: typescript@6.0.2: {} - typical@4.0.0: {} - - typical@5.2.0: {} - uglify-js@3.19.3: optional: true + undici-types@6.19.8: {} + undici-types@6.21.0: {} undici-types@7.18.2: {} - universalify@0.1.2: {} - unpipe@1.0.0: {} unrs-resolver@1.12.2: @@ -8822,6 +8478,8 @@ snapshots: utila@0.4.0: {} + uuid@11.1.1: {} + uuid@14.0.1: {} uuid@8.3.2: {} @@ -9056,11 +8714,6 @@ snapshots: wordwrap@1.0.0: {} - wordwrapjs@4.0.1: - dependencies: - reduce-flatten: 2.0.0 - typical: 5.2.0 - wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -9080,6 +8733,11 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.1.0 + ws@7.5.13(bufferutil@4.1.0)(utf-8-validate@6.0.6): + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 + ws@8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): optionalDependencies: bufferutil: 4.1.0 @@ -9127,5 +8785,3 @@ snapshots: yocto-queue@0.1.0: {} zod@4.4.3: {} - - zx@8.8.5: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 89723f9..8a8d855 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,17 @@ packages: - "packages/*" - "examples/*" +minimumReleaseAge: 1440 +minimumReleaseAgeExclude: + - "@wireio/*" +overrides: + '@3fv/prelude-ts': ^0.8.41 + bluebird: 3.7.2 + debug: 4.3.4 + lodash: 4.18.1 + prettier: 3.8.1 + tracer: 1.3.0 + webpack: 5.104.1 + webpack-cli: 6.0.1 + webpack-dev-server: 6.0.0 + ws: 8.21.0 From 7235f7a1204e98b518d0b29ab20d6c4ea95b4095 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 18 Aug 2026 14:58:15 -0400 Subject: [PATCH 41/48] feat(sdk-outpost): add Ethereum node owners --- .../ethereum/EthereumNodeOwnerClient.ts | 254 ++++++++++++++++++ .../clients/ethereum/EthereumOutpostClient.ts | 15 ++ .../sdk-outpost/src/clients/ethereum/Types.ts | 3 + .../sdk-outpost/src/clients/ethereum/index.ts | 1 + .../sdk-outpost/src/deployments/Schema.ts | 3 +- packages/sdk-outpost/src/deployments/Types.ts | 1 + packages/sdk-outpost/tests/Fixtures.ts | 2 +- .../ethereum/EthereumNodeOwnerClient.test.ts | 192 +++++++++++++ .../tests/deployments/Schema.test.ts | 9 + 9 files changed, 478 insertions(+), 2 deletions(-) create mode 100644 packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts create mode 100644 packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts new file mode 100644 index 0000000..39f009c --- /dev/null +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts @@ -0,0 +1,254 @@ +import { KeyType } from "@wireio/sdk-core/chain/KeyType" +import type { Name } from "@wireio/sdk-core/chain/Name" +import type { PublicKey } from "@wireio/sdk-core/chain/PublicKey" +import { + Signer, + constants as ethersConstants, + utils as ethersUtils, + type BigNumberish, + type BytesLike, + type Event, + type providers +} from "ethers" +import { match } from "ts-pattern" + +import { IERC1155__factory, type BAR } from "../../contracts/ethereum/index.js" +import type { WireKeyStruct } from "../../contracts/ethereum/generated/BAR.js" +import type { NodeCommittedEvent } from "../../contracts/ethereum/generated/BAR.js" + +const ConfirmationCount = 1, + NodeCommittedEventName = "NodeCommitted", + UncompressedPublicKeyByteLength = 65, + UncompressedPublicKeyPrefix = 4 + +/** BAR WireKey numeric variants accepted for node-owner account authority. */ +enum NodeOwnerWireKeyType { + K1 = 1, + R1 = 2, + EM = 4, + ED = 5 +} + +/** WireNodes ERC-1155 token ids accepted by BAR as node-owner tiers. */ +export enum EthereumNodeOwnerTier { + T1 = 1, + T2 = 2, + T3 = 3 +} + +const DefaultNodeOwnerTiers = [ + EthereumNodeOwnerTier.T1, + EthereumNodeOwnerTier.T2, + EthereumNodeOwnerTier.T3 +] as const + +/** One owned WireNodes tier returned from the canonical ERC-1155 contract. */ +export interface EthereumNodeOwnerSlotBalance { + /** WireNodes token id and node-owner tier. */ + tokenId: EthereumNodeOwnerTier + /** Number of units held by the queried owner. */ + balance: bigint + /** Canonical WireNodes contract configured by BAR. */ + tokenContractAddress: string +} + +/** Inputs required to escrow a WireNodes unit and register its owner. */ +export interface EthereumNodeOwnerCommitRequest { + /** WireNodes token id and node-owner tier to commit. */ + tokenId: EthereumNodeOwnerTier + /** Canonical Wire account name to create or register. */ + wireAccountName: Name + /** Wire account owner/active authority. */ + wirePublicKey: PublicKey + /** Uncompressed SEC1 secp256k1 public key belonging to the EVM signer. */ + depositorPublicKey: BytesLike +} + +/** Canonical `NodeCommitted` fields emitted by BAR. */ +export interface EthereumNodeCommittedEvent { + /** EVM owner that committed the token. */ + owner: string + /** WireNodes token id and node-owner tier. */ + tokenId: EthereumNodeOwnerTier + /** Canonical WireNodes contract from which BAR pulled custody. */ + tokenContractAddress: string + /** Wire account submitted for registration. */ + wireAccountName: string +} + +/** Confirmed node-owner registration submission. */ +export interface EthereumNodeOwnerCommitSubmission { + /** BAR commit transaction hash. */ + transactionId: string + /** ERC-1155 approval transaction hash when approval was required. */ + approvalTransactionId?: string + /** Confirmed BAR event proving the submitted registration. */ + committed: EthereumNodeCommittedEvent +} + +/** Node-owner slot reads, approval, and registration for one verified outpost. */ +export class EthereumNodeOwnerClient { + /** Bind node-owner operations to a generated BAR contract. */ + constructor( + private readonly bar: BAR, + private readonly connection: providers.Provider | Signer + ) {} + + /** Resolve the governance-configured canonical WireNodes contract. */ + async canonicalTokenContractAddress(): Promise { + const address = ethersUtils.getAddress(await this.bar.wireNodesContract()) + if (address === ethersConstants.AddressZero) { + throw new Error("BAR has no canonical WireNodes contract configured.") + } + return address + } + + /** Return non-zero WireNodes balances for the requested owner and tiers. */ + async ownedSlots( + owner: string, + tokenIds: readonly EthereumNodeOwnerTier[] = DefaultNodeOwnerTiers + ): Promise { + const normalizedOwner = ethersUtils.getAddress(owner), + tokenContractAddress = await this.canonicalTokenContractAddress(), + token = IERC1155__factory.connect(tokenContractAddress, this.connection), + balances = await Promise.all( + tokenIds.map(async tokenId => ({ + tokenId, + balance: (await token.balanceOf(normalizedOwner, tokenId)).toBigInt(), + tokenContractAddress + })) + ) + + return balances.filter(({ balance }) => balance > 0n) + } + + /** Approve BAR when needed, commit one WireNodes unit, and return its event. */ + async commit( + request: EthereumNodeOwnerCommitRequest + ): Promise { + const signer = this.assertSigner(), + owner = ethersUtils.getAddress(await signer.getAddress()), + depositorPublicKey = this.assertDepositorPublicKey( + request.depositorPublicKey, + owner + ), + wireAccountName = this.canonicalAccountName( + request.wireAccountName.toString() + ), + tokenContractAddress = await this.canonicalTokenContractAddress(), + token = IERC1155__factory.connect(tokenContractAddress, signer), + approved = await token.isApprovedForAll(owner, this.bar.address) + + let approvalTransactionId: string | undefined + if (!approved) { + const approval = await token.setApprovalForAll(this.bar.address, true) + approvalTransactionId = approval.hash + await approval.wait(ConfirmationCount) + } + + const transaction = await this.bar.commitNode( + request.tokenId, + wireAccountName, + this.wireKey(request.wirePublicKey), + depositorPublicKey + ), + receipt = await transaction.wait(ConfirmationCount) + + return { + transactionId: transaction.hash, + approvalTransactionId, + committed: EthereumNodeOwnerClient.committedEvent(receipt.events) + } + } + + /** Normalize the canonical `NodeCommitted` event from a BAR receipt. */ + static committedEvent( + events: readonly Event[] | undefined + ): EthereumNodeCommittedEvent { + const event = events?.find( + ({ event: name }) => name === NodeCommittedEventName + ), + committedEvent = event as NodeCommittedEvent | undefined, + { owner, tokenId, nftAddress, wireAccountName } = + committedEvent?.args ?? {} + + if ( + owner == null || + tokenId == null || + nftAddress == null || + wireAccountName == null + ) { + throw new Error("Confirmed BAR transaction did not emit NodeCommitted.") + } + return { + owner: ethersUtils.getAddress(owner), + tokenId: EthereumNodeOwnerClient.nodeOwnerTier(tokenId), + tokenContractAddress: ethersUtils.getAddress(nftAddress), + wireAccountName + } + } + + /** Require a connected EVM signer for node-owner writes. */ + private assertSigner(): Signer { + if (!Signer.isSigner(this.connection)) { + throw new Error("Ethereum node-owner commit requires a connected signer.") + } + return this.connection + } + + /** Validate the depositor key shape and its relationship to the signer. */ + private assertDepositorPublicKey( + value: BytesLike, + owner: string + ): Uint8Array { + const publicKey = ethersUtils.arrayify(value) + if ( + publicKey.length !== UncompressedPublicKeyByteLength || + publicKey[0] !== UncompressedPublicKeyPrefix + ) { + throw new Error( + "depositorPublicKey must be a 65-byte uncompressed SEC1 key." + ) + } + const derivedOwner = ethersUtils.getAddress( + ethersUtils.computeAddress(publicKey) + ) + if (derivedOwner !== owner) { + throw new Error("depositorPublicKey does not belong to the EVM signer.") + } + return publicKey + } + + /** Validate and canonicalize the non-empty Wire account name. */ + private canonicalAccountName(value: string): string { + if (value.length === 0) { + throw new Error("wireAccountName must not be empty.") + } + return value + } + + /** Convert an sdk-core public key into BAR's generated WireKey structure. */ + private wireKey(publicKey: PublicKey): WireKeyStruct { + const keyType = match(publicKey.type) + .with(KeyType.K1, () => NodeOwnerWireKeyType.K1) + .with(KeyType.R1, () => NodeOwnerWireKeyType.R1) + .with(KeyType.EM, () => NodeOwnerWireKeyType.EM) + .with(KeyType.ED, () => NodeOwnerWireKeyType.ED) + .otherwise(type => { + throw new Error(`${type} is not a node-owner authority key type.`) + }) + + return { keyType, key: publicKey.data.array } + } + + /** Normalize one emitted token id to BAR's supported node-owner tier. */ + private static nodeOwnerTier(value: BigNumberish): EthereumNodeOwnerTier { + return match(Number(value.toString())) + .with(EthereumNodeOwnerTier.T1, () => EthereumNodeOwnerTier.T1) + .with(EthereumNodeOwnerTier.T2, () => EthereumNodeOwnerTier.T2) + .with(EthereumNodeOwnerTier.T3, () => EthereumNodeOwnerTier.T3) + .otherwise(tokenId => { + throw new Error(`NodeCommitted emitted unsupported tier ${tokenId}.`) + }) + } +} diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 7586c52..9d02c29 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -1,4 +1,5 @@ import { + BAR__factory, OPPInbound__factory, OPP__factory, OperatorRegistry__factory, @@ -16,6 +17,7 @@ import { ethereumProvider } from "./Connection.js" import { EthereumContractMap, EthereumOutpostClientOptions } from "./Types.js" import { EthereumReserveClient } from "./EthereumReserveClient.js" import { EthereumReserveSwapClient } from "./EthereumReserveSwapClient.js" +import { EthereumNodeOwnerClient } from "./EthereumNodeOwnerClient.js" /** Strictly typed access to one verified Ethereum outpost deployment. */ export class EthereumOutpostClient { @@ -47,6 +49,10 @@ export class EthereumOutpostClient { this.contract(EthereumContractName.ReserveManager), options.connection ) + this.nodeOwners = new EthereumNodeOwnerClient( + this.contract(EthereumContractName.BAR), + options.connection + ) } /** Reserve creation, cancellation, and reads for this verified outpost. */ @@ -55,6 +61,9 @@ export class EthereumOutpostClient { /** Reserve-swap writes and balance reads for this verified outpost. */ readonly swaps: EthereumReserveSwapClient + /** Node-owner slot reads, approvals, and BAR registration. */ + readonly nodeOwners: EthereumNodeOwnerClient + /** Deployment profile used to verify and connect this client. */ get profile(): EthereumOutpostClientOptions["profile"] { return this.options.profile @@ -64,6 +73,12 @@ export class EthereumOutpostClient { contract(name: T): EthereumContractMap[T] { const { connection, profile } = this.options, contract = match(name as EthereumContractName) + .with(EthereumContractName.BAR, () => + BAR__factory.connect( + profile.ethereum.contracts[EthereumContractName.BAR].address, + connection + ) + ) .with(EthereumContractName.OPP, () => OPP__factory.connect( profile.ethereum.contracts[EthereumContractName.OPP].address, diff --git a/packages/sdk-outpost/src/clients/ethereum/Types.ts b/packages/sdk-outpost/src/clients/ethereum/Types.ts index 2c29ef5..001d764 100644 --- a/packages/sdk-outpost/src/clients/ethereum/Types.ts +++ b/packages/sdk-outpost/src/clients/ethereum/Types.ts @@ -1,4 +1,5 @@ import type { + BAR, OPP, OPPInbound, OperatorRegistry, @@ -19,6 +20,8 @@ export interface EthereumOutpostClientOptions { /** Generated contract clients keyed by their deployment identity. */ export interface EthereumContractMap { + /** Bond and node-owner registration contract. */ + [EthereumContractName.BAR]: BAR /** Outbound OPP endpoint. */ [EthereumContractName.OPP]: OPP /** Inbound OPP endpoint. */ diff --git a/packages/sdk-outpost/src/clients/ethereum/index.ts b/packages/sdk-outpost/src/clients/ethereum/index.ts index c3df2d2..7f8f194 100644 --- a/packages/sdk-outpost/src/clients/ethereum/index.ts +++ b/packages/sdk-outpost/src/clients/ethereum/index.ts @@ -1,3 +1,4 @@ export * from "./EthereumReserveSwapClient.js" export * from "./EthereumReserveClient.js" +export * from "./EthereumNodeOwnerClient.js" export * from "./Types.js" diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index f7260db..0078328 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -50,7 +50,7 @@ export const SolanaProgramDeploymentProfileSchema = z.object({ /** Immutable compatibility profile for one Wire outpost deployment. */ export const OutpostDeploymentProfileSchema = z .object({ - schemaVersion: z.literal(1), + schemaVersion: z.literal(2), id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), deploymentChecksum: Sha256Schema, wire: z.object({ @@ -59,6 +59,7 @@ export const OutpostDeploymentProfileSchema = z ethereum: z.object({ chainId: z.number().int().positive(), contracts: z.object({ + [EthereumContractName.BAR]: EthereumContractDeploymentProfileSchema, [EthereumContractName.OPP]: EthereumContractDeploymentProfileSchema, [EthereumContractName.OPPInbound]: EthereumContractDeploymentProfileSchema, diff --git a/packages/sdk-outpost/src/deployments/Types.ts b/packages/sdk-outpost/src/deployments/Types.ts index fe6a4ef..33abb78 100644 --- a/packages/sdk-outpost/src/deployments/Types.ts +++ b/packages/sdk-outpost/src/deployments/Types.ts @@ -6,6 +6,7 @@ export enum OutpostChainFamily { /** Ethereum contracts owned by the current outpost deployment. */ export enum EthereumContractName { + BAR = "BAR", OPP = "OPP", OPPInbound = "OPPInbound", OperatorRegistry = "OperatorRegistry", diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts index 94e78ab..aeb7d9b 100644 --- a/packages/sdk-outpost/tests/Fixtures.ts +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -119,7 +119,7 @@ export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfil ), programData = createSolanaProgramDataAccountData(), profile = { - schemaVersion: 1, + schemaVersion: 2, id: `${TestWireChainId}-${TestHash.slice(0, 12)}`, deploymentChecksum: TestHash, wire: { chainId: TestWireChainId }, diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts new file mode 100644 index 0000000..a62d0b6 --- /dev/null +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts @@ -0,0 +1,192 @@ +import { KeyType } from "@wireio/sdk-core/chain/KeyType" +import type { Name } from "@wireio/sdk-core/chain/Name" +import type { PublicKey } from "@wireio/sdk-core/chain/PublicKey" +import { + BigNumber, + Wallet, + constants as ethersConstants, + providers, + utils as ethersUtils, + type Event +} from "ethers" + +import { + EthereumNodeOwnerClient, + EthereumNodeOwnerTier, + IERC1155__factory, + type BAR, + type IERC1155 +} from "@wireio/sdk-outpost" + +const BarAddress = "0x18E317A7D70d8fBf8e6E893616b52390EbBdb629", + TokenContractAddress = "0x5c74c94173F05dA1720953407cbb920F3DF9f887", + CommitTransactionHash = `0x${"11".repeat(32)}`, + ApprovalTransactionHash = `0x${"22".repeat(32)}`, + TestPrivateKey = `0x${"33".repeat(32)}`, + WireAccountName = "nodeowner", + WireAccount = { + toString: () => WireAccountName + } as Name, + TransactionReceipt = { + blockNumber: 10, + logs: [], + status: 1 + } as unknown as providers.TransactionReceipt + +/** Create a confirmed transaction fixture with an optional parsed event. */ +function transactionFixture( + hash: string, + events: readonly Event[] = [] +): providers.TransactionResponse { + return { + hash, + wait: jest.fn(async () => ({ ...TransactionReceipt, events })) + } as unknown as providers.TransactionResponse +} + +/** Create generated BAR and IERC-1155 fixtures for one node-owner flow. */ +function contractFixtures(approved = true) { + const wallet = new Wallet(TestPrivateKey), + committedEvent = { + event: "NodeCommitted", + args: { + owner: wallet.address, + tokenId: BigNumber.from(EthereumNodeOwnerTier.T2), + nftAddress: TokenContractAddress, + wireAccountName: WireAccountName + } + }, + commitTransaction = transactionFixture(CommitTransactionHash, [ + committedEvent as never + ]), + approvalTransaction = transactionFixture(ApprovalTransactionHash), + bar = { + address: BarAddress, + wireNodesContract: jest.fn(async () => TokenContractAddress), + commitNode: jest.fn(async () => commitTransaction) + } as unknown as BAR, + token = { + balanceOf: jest.fn(async (_owner: string, tokenId: number) => + BigNumber.from(tokenId === EthereumNodeOwnerTier.T2 ? 1 : 0) + ), + isApprovedForAll: jest.fn(async () => approved), + setApprovalForAll: jest.fn(async () => approvalTransaction) + } as unknown as IERC1155 + + jest.spyOn(IERC1155__factory, "connect").mockReturnValue(token) + return { wallet, bar, token, commitTransaction, approvalTransaction } +} + +/** Return an sdk-core public-key input aligned with the EVM test signer. */ +function wirePublicKey(wallet: Wallet): PublicKey { + return { + type: KeyType.K1, + data: { + array: ethersUtils.arrayify(wallet._signingKey().compressedPublicKey) + } + } as PublicKey +} + +afterEach(() => jest.restoreAllMocks()) + +describe("EthereumNodeOwnerClient", () => { + it("reads only owned tiers from BAR's canonical WireNodes contract", async () => { + const { wallet, bar, token } = contractFixtures(), + client = new EthereumNodeOwnerClient(bar, wallet) + + await expect(client.ownedSlots(wallet.address)).resolves.toEqual([ + { + tokenId: EthereumNodeOwnerTier.T2, + balance: 1n, + tokenContractAddress: TokenContractAddress + } + ]) + expect(token.balanceOf).toHaveBeenCalledTimes(3) + }) + + it("commits through BAR without an unnecessary approval", async () => { + const { wallet, bar, token, commitTransaction } = contractFixtures(), + client = new EthereumNodeOwnerClient(bar, wallet), + submission = await client.commit({ + tokenId: EthereumNodeOwnerTier.T2, + wireAccountName: WireAccount, + wirePublicKey: wirePublicKey(wallet), + depositorPublicKey: wallet._signingKey().publicKey + }) + + expect(submission).toEqual({ + transactionId: CommitTransactionHash, + approvalTransactionId: undefined, + committed: { + owner: wallet.address, + tokenId: EthereumNodeOwnerTier.T2, + tokenContractAddress: TokenContractAddress, + wireAccountName: WireAccountName + } + }) + expect(token.setApprovalForAll).not.toHaveBeenCalled() + expect(bar.commitNode).toHaveBeenCalledWith( + EthereumNodeOwnerTier.T2, + WireAccountName, + expect.objectContaining({ keyType: 1 }), + ethersUtils.arrayify(wallet._signingKey().publicKey) + ) + expect(commitTransaction.wait).toHaveBeenCalledWith(1) + }) + + it("confirms ERC-1155 approval before committing when required", async () => { + const { wallet, bar, token, approvalTransaction } = contractFixtures(false), + client = new EthereumNodeOwnerClient(bar, wallet) + + await expect( + client.commit({ + tokenId: EthereumNodeOwnerTier.T2, + wireAccountName: WireAccount, + wirePublicKey: wirePublicKey(wallet), + depositorPublicKey: wallet._signingKey().publicKey + }) + ).resolves.toEqual( + expect.objectContaining({ + approvalTransactionId: ApprovalTransactionHash + }) + ) + expect(token.setApprovalForAll).toHaveBeenCalledWith(BarAddress, true) + expect(approvalTransaction.wait).toHaveBeenCalledWith(1) + }) + + it("rejects provider-only writes and depositor keys from another signer", async () => { + const { wallet, bar } = contractFixtures(), + providerClient = new EthereumNodeOwnerClient( + bar, + new providers.JsonRpcProvider() + ), + signerClient = new EthereumNodeOwnerClient(bar, wallet), + otherWallet = Wallet.createRandom(), + request = { + tokenId: EthereumNodeOwnerTier.T2, + wireAccountName: WireAccount, + wirePublicKey: wirePublicKey(wallet), + depositorPublicKey: wallet._signingKey().publicKey + } + + await expect(providerClient.commit(request)).rejects.toThrow( + "requires a connected signer" + ) + await expect( + signerClient.commit({ + ...request, + depositorPublicKey: otherWallet._signingKey().publicKey + }) + ).rejects.toThrow("does not belong to the EVM signer") + expect(bar.commitNode).not.toHaveBeenCalled() + }) + + it("fails closed when BAR has no canonical WireNodes contract", async () => { + const { wallet, bar } = contractFixtures() + bar.wireNodesContract = jest.fn(async () => ethersConstants.AddressZero) + + await expect( + new EthereumNodeOwnerClient(bar, wallet).canonicalTokenContractAddress() + ).rejects.toThrow("no canonical WireNodes contract") + }) +}) diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index 6148060..676b532 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -31,6 +31,15 @@ describe("OutpostDeploymentProfileSchema", () => { ) }) + it("rejects a pre-BAR deployment profile schema", () => { + const profile = { + ...createOutpostDeploymentProfileFixture(), + schemaVersion: 1 + } + + expect(() => parseOutpostDeploymentProfile(profile)).toThrow("expected 2") + }) + it("rejects an invalid Solana ProgramData address", () => { const fixture = createOutpostDeploymentProfileFixture() fixture.solana.programs.liqsolCore.programDataAddress = From 6cf288c34ca6d5683b4c93fa6466b5557440e66f Mon Sep 17 00:00:00 2001 From: joshglogau Date: Tue, 18 Aug 2026 15:16:51 -0400 Subject: [PATCH 42/48] fix(sdk-outpost): keep BAR capability optional --- CLAUDE.md | 2 +- packages/sdk-outpost/README.md | 27 +++++++++++++ .../src/artifacts/Compatibility.ts | 4 +- .../clients/ethereum/EthereumOutpostClient.ts | 38 +++++++++++++------ .../sdk-outpost/src/deployments/Schema.ts | 5 ++- .../verification/OutpostDeploymentVerifier.ts | 5 ++- packages/sdk-outpost/tests/Fixtures.ts | 8 ++-- .../ethereum/EthereumOutpostClient.test.ts | 17 +++++++++ .../tests/deployments/Schema.test.ts | 14 ++++--- 9 files changed, 92 insertions(+), 28 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index fca5df6..dc1f662 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -226,7 +226,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come directly from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never regenerate them here or replace them with committed sibling links. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. -- `packages/sdk-outpost` owns external reserve lifecycle and swap execution. Staking remains outside this package until its dedicated migration. +- `packages/sdk-outpost` owns external reserve lifecycle, swap execution, and BAR-backed Ethereum node-owner registration. BAR is an optional deployment capability: profiles without it preserve reserve and swap behavior, while node-owner access fails closed. Node-owner registration must use BAR's canonical WireNodes address and is not staking; staking remains outside this package until its dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. - A connected outpost client proves deployment compatibility, not swap or stake readiness. Wire-chain orchestration remains in `sdk-core`, and consumers must retain flow-specific capability gates. - Publish `sdk-outpost` only through the repository release workflow after its normal build and tests pass. diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index 5b0e5d3..c449a31 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -142,6 +142,33 @@ Ethereum also exposes `requestErc20WithApproval`, `nativeBalance`, and `erc20Balance`. Solana exposes `requestNative`, `requestSpl`, `nativeBalance`, and `splBalance` through the same `client.swaps` ownership boundary. +## Ethereum node owners + +The verified Ethereum client exposes `nodeOwners` for the external half of the +node-owner flow. It resolves the canonical WireNodes ERC-1155 contract from +BAR, reads owned tiers, obtains approval only when needed, and submits +`BAR.commitNode`. Wire account authority parsing reuses `@wireio/sdk-core`; the +SDK validates that the uncompressed depositor key belongs to the EVM signer. +BAR is an optional deployment capability: schema-v1 profiles without a BAR +identity continue to support the existing reserve and swap clients, while +accessing `nodeOwners` fails closed with an explicit availability error. + +```ts +const slots = await ethereum.nodeOwners.ownedSlots(ownerAddress) +const submission = await ethereum.nodeOwners.commit({ + tokenId: slots[0].tokenId, + wireAccountName: Name.from(wireAccountName), + wirePublicKey: PublicKey.from(wirePublicKey), + depositorPublicKey +}) +``` + +This surface does not mint test tokens, guess a fallback contract, create the +Wire account directly, or infer protocol completion from the EVM receipt. Hub +must keep the action disabled unless deployment and capability evidence both +advertise the complete node-owner flow, then follow the resulting Wire-side +registration state separately. + ## Reserve lifecycle Wallet-connected clients expose the external half of the post-bootstrap diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index 156395d..b398c1e 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -121,8 +121,10 @@ export function assertOutpostArtifactCompatibility( match(family) .with(OutpostChainFamily.ethereum, () => { Object.values(EthereumContractName).forEach(contractName => { + const contract = profile.ethereum.contracts[contractName] + if (contract == null) return assertInterfaceDigest( - profile.ethereum.contracts[contractName].abiSha256, + contract.abiSha256, OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, `Ethereum ${contractName} ABI` ) diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 9d02c29..9c5ed80 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -49,10 +49,12 @@ export class EthereumOutpostClient { this.contract(EthereumContractName.ReserveManager), options.connection ) - this.nodeOwners = new EthereumNodeOwnerClient( - this.contract(EthereumContractName.BAR), - options.connection - ) + if (options.profile.ethereum.contracts[EthereumContractName.BAR] != null) { + this.nodeOwnerClient = new EthereumNodeOwnerClient( + this.contract(EthereumContractName.BAR), + options.connection + ) + } } /** Reserve creation, cancellation, and reads for this verified outpost. */ @@ -61,8 +63,17 @@ export class EthereumOutpostClient { /** Reserve-swap writes and balance reads for this verified outpost. */ readonly swaps: EthereumReserveSwapClient - /** Node-owner slot reads, approvals, and BAR registration. */ - readonly nodeOwners: EthereumNodeOwnerClient + private readonly nodeOwnerClient?: EthereumNodeOwnerClient + + /** Node-owner slot reads, approvals, and BAR registration when deployed. */ + get nodeOwners(): EthereumNodeOwnerClient { + if (this.nodeOwnerClient == null) { + throw new Error( + "Ethereum node owners are unavailable because this deployment profile has no BAR identity." + ) + } + return this.nodeOwnerClient + } /** Deployment profile used to verify and connect this client. */ get profile(): EthereumOutpostClientOptions["profile"] { @@ -73,12 +84,15 @@ export class EthereumOutpostClient { contract(name: T): EthereumContractMap[T] { const { connection, profile } = this.options, contract = match(name as EthereumContractName) - .with(EthereumContractName.BAR, () => - BAR__factory.connect( - profile.ethereum.contracts[EthereumContractName.BAR].address, - connection - ) - ) + .with(EthereumContractName.BAR, () => { + const bar = profile.ethereum.contracts[EthereumContractName.BAR] + if (bar == null) { + throw new Error( + "Ethereum node owners are unavailable because this deployment profile has no BAR identity." + ) + } + return BAR__factory.connect(bar.address, connection) + }) .with(EthereumContractName.OPP, () => OPP__factory.connect( profile.ethereum.contracts[EthereumContractName.OPP].address, diff --git a/packages/sdk-outpost/src/deployments/Schema.ts b/packages/sdk-outpost/src/deployments/Schema.ts index 0078328..9a50a12 100644 --- a/packages/sdk-outpost/src/deployments/Schema.ts +++ b/packages/sdk-outpost/src/deployments/Schema.ts @@ -50,7 +50,7 @@ export const SolanaProgramDeploymentProfileSchema = z.object({ /** Immutable compatibility profile for one Wire outpost deployment. */ export const OutpostDeploymentProfileSchema = z .object({ - schemaVersion: z.literal(2), + schemaVersion: z.literal(1), id: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), deploymentChecksum: Sha256Schema, wire: z.object({ @@ -59,7 +59,8 @@ export const OutpostDeploymentProfileSchema = z ethereum: z.object({ chainId: z.number().int().positive(), contracts: z.object({ - [EthereumContractName.BAR]: EthereumContractDeploymentProfileSchema, + [EthereumContractName.BAR]: + EthereumContractDeploymentProfileSchema.optional(), [EthereumContractName.OPP]: EthereumContractDeploymentProfileSchema, [EthereumContractName.OPPInbound]: EthereumContractDeploymentProfileSchema, diff --git a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts index 43a7791..aefd2fb 100644 --- a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts +++ b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts @@ -77,8 +77,9 @@ async function verifyEthereum( await Promise.all( Object.values(EthereumContractName).map(async contractName => { - const contract = profile.ethereum.contracts[contractName], - proxyCode = await provider.getCode(contract.address) + const contract = profile.ethereum.contracts[contractName] + if (contract == null) return + const proxyCode = await provider.getCode(contract.address) if (proxyCode === EmptyEthereumCode) { throw new Error( diff --git a/packages/sdk-outpost/tests/Fixtures.ts b/packages/sdk-outpost/tests/Fixtures.ts index aeb7d9b..9e593dc 100644 --- a/packages/sdk-outpost/tests/Fixtures.ts +++ b/packages/sdk-outpost/tests/Fixtures.ts @@ -119,7 +119,7 @@ export function createOutpostDeploymentProfileFixture(): OutpostDeploymentProfil ), programData = createSolanaProgramDataAccountData(), profile = { - schemaVersion: 2, + schemaVersion: 1, id: `${TestWireChainId}-${TestHash.slice(0, 12)}`, deploymentChecksum: TestHash, wire: { chainId: TestWireChainId }, @@ -159,7 +159,7 @@ export function createEthereumProviderFixture( ) jest.spyOn(provider, "getCode").mockImplementation(async address => { const implementation = Object.entries(profile.ethereum.contracts).find( - ([, deployment]) => deployment.implementationAddress === address + ([, deployment]) => deployment?.implementationAddress === address ) if (implementation != null) { return createEthereumImplementationCode( @@ -167,14 +167,14 @@ export function createEthereumProviderFixture( ) } return Object.values(profile.ethereum.contracts).some( - deployment => deployment.address === address + deployment => deployment?.address === address ) ? TestEthereumProxyCode : "0x" }) jest.spyOn(provider, "getStorage").mockImplementation(async address => { const contract = Object.values(profile.ethereum.contracts).find( - deployment => deployment.address === address + deployment => deployment?.address === address ) return zeroPadValue( contract?.implementationAddress ?? diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts index 74d027d..7ee3a83 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumOutpostClient.test.ts @@ -123,6 +123,23 @@ describe("EthereumOutpostClient", () => { ) }) + it("keeps existing Ethereum clients usable when BAR is not deployed", async () => { + const profile = createOutpostDeploymentProfileFixture() + delete profile.ethereum.contracts[EthereumContractName.BAR] + const provider = createEthereumProviderFixture(profile), + client = await createEthereumClient({ + profile, + connection: provider + }) + + expect(client.reserves).toBeInstanceOf(EthereumReserveClient) + expect(client.swaps).toBeInstanceOf(EthereumReserveSwapClient) + expect(() => client.nodeOwners).toThrow("has no BAR identity") + expect(provider.getCode).toHaveBeenCalledTimes( + (Object.values(EthereumContractName).length - 1) * 2 + ) + }) + it("parses the protocol deposit id from a confirmed receipt", () => { const events = [ { eventName: "SwapDeposit", args: [42n] } as unknown as EventLog diff --git a/packages/sdk-outpost/tests/deployments/Schema.test.ts b/packages/sdk-outpost/tests/deployments/Schema.test.ts index 676b532..868ea69 100644 --- a/packages/sdk-outpost/tests/deployments/Schema.test.ts +++ b/packages/sdk-outpost/tests/deployments/Schema.test.ts @@ -31,13 +31,15 @@ describe("OutpostDeploymentProfileSchema", () => { ) }) - it("rejects a pre-BAR deployment profile schema", () => { - const profile = { - ...createOutpostDeploymentProfileFixture(), - schemaVersion: 1 - } + it("preserves schema-v1 profiles when BAR is not deployed", () => { + const profile = createOutpostDeploymentProfileFixture() + delete profile.ethereum.contracts[EthereumContractName.BAR] - expect(() => parseOutpostDeploymentProfile(profile)).toThrow("expected 2") + expect( + parseOutpostDeploymentProfile(profile).ethereum.contracts[ + EthereumContractName.BAR + ] + ).toBeUndefined() }) it("rejects an invalid Solana ProgramData address", () => { From f2cafe2488602d0d6391628fa91517ad4c00136b Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 21 Aug 2026 11:50:29 -0400 Subject: [PATCH 43/48] refactor(sdk-outpost): align node owners with ethers v6 --- packages/sdk-outpost/package.json | 1 + .../ethereum/EthereumNodeOwnerClient.ts | 78 +++++++-------- .../ethereum/EthereumNodeOwnerClient.test.ts | 94 +++++++++---------- pnpm-lock.yaml | 3 + 4 files changed, 89 insertions(+), 87 deletions(-) diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 16666e1..5e69cac 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -46,6 +46,7 @@ "@solana/web3.js": "^1.98.4", "@wireio/outpost-ethereum-artifacts": "0.2.2", "@wireio/outpost-solana-artifacts": "0.2.1", + "@wireio/sdk-core": "workspace:*", "ethers": "^6.15.0", "ts-pattern": "^5.9.0", "zod": "^4.4.3" diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts index 39f009c..eaeaf19 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumNodeOwnerClient.ts @@ -1,20 +1,23 @@ -import { KeyType } from "@wireio/sdk-core/chain/KeyType" -import type { Name } from "@wireio/sdk-core/chain/Name" -import type { PublicKey } from "@wireio/sdk-core/chain/PublicKey" +import type { BAR } from "@wireio/outpost-ethereum-artifacts" +import { IERC1155__factory } from "@wireio/outpost-ethereum-artifacts" +import { KeyType, type Name, type PublicKey } from "@wireio/sdk-core" import { - Signer, - constants as ethersConstants, - utils as ethersUtils, + ZeroAddress, + computeAddress, + getAddress, + getBigInt, + getBytes, + hexlify, type BigNumberish, type BytesLike, - type Event, - type providers + type EventLog, + type Log, + type Provider, + type Signer } from "ethers" import { match } from "ts-pattern" -import { IERC1155__factory, type BAR } from "../../contracts/ethereum/index.js" -import type { WireKeyStruct } from "../../contracts/ethereum/generated/BAR.js" -import type { NodeCommittedEvent } from "../../contracts/ethereum/generated/BAR.js" +import { assertEthereumSigner } from "./Connection.js" const ConfirmationCount = 1, NodeCommittedEventName = "NodeCommitted", @@ -91,13 +94,13 @@ export class EthereumNodeOwnerClient { /** Bind node-owner operations to a generated BAR contract. */ constructor( private readonly bar: BAR, - private readonly connection: providers.Provider | Signer + private readonly connection: Provider | Signer ) {} /** Resolve the governance-configured canonical WireNodes contract. */ async canonicalTokenContractAddress(): Promise { - const address = ethersUtils.getAddress(await this.bar.wireNodesContract()) - if (address === ethersConstants.AddressZero) { + const address = getAddress(await this.bar.wireNodesContract()) + if (address === ZeroAddress) { throw new Error("BAR has no canonical WireNodes contract configured.") } return address @@ -108,13 +111,13 @@ export class EthereumNodeOwnerClient { owner: string, tokenIds: readonly EthereumNodeOwnerTier[] = DefaultNodeOwnerTiers ): Promise { - const normalizedOwner = ethersUtils.getAddress(owner), + const normalizedOwner = getAddress(owner), tokenContractAddress = await this.canonicalTokenContractAddress(), token = IERC1155__factory.connect(tokenContractAddress, this.connection), balances = await Promise.all( tokenIds.map(async tokenId => ({ tokenId, - balance: (await token.balanceOf(normalizedOwner, tokenId)).toBigInt(), + balance: getBigInt(await token.balanceOf(normalizedOwner, tokenId)), tokenContractAddress })) ) @@ -127,7 +130,7 @@ export class EthereumNodeOwnerClient { request: EthereumNodeOwnerCommitRequest ): Promise { const signer = this.assertSigner(), - owner = ethersUtils.getAddress(await signer.getAddress()), + owner = getAddress(await signer.getAddress()), depositorPublicKey = this.assertDepositorPublicKey( request.depositorPublicKey, owner @@ -137,11 +140,12 @@ export class EthereumNodeOwnerClient { ), tokenContractAddress = await this.canonicalTokenContractAddress(), token = IERC1155__factory.connect(tokenContractAddress, signer), - approved = await token.isApprovedForAll(owner, this.bar.address) + barAddress = await this.bar.getAddress(), + approved = await token.isApprovedForAll(owner, barAddress) let approvalTransactionId: string | undefined if (!approved) { - const approval = await token.setApprovalForAll(this.bar.address, true) + const approval = await token.setApprovalForAll(barAddress, true) approvalTransactionId = approval.hash await approval.wait(ConfirmationCount) } @@ -157,43 +161,44 @@ export class EthereumNodeOwnerClient { return { transactionId: transaction.hash, approvalTransactionId, - committed: EthereumNodeOwnerClient.committedEvent(receipt.events) + committed: EthereumNodeOwnerClient.committedEvent(receipt?.logs) } } /** Normalize the canonical `NodeCommitted` event from a BAR receipt. */ static committedEvent( - events: readonly Event[] | undefined + events: readonly (EventLog | Log)[] | undefined ): EthereumNodeCommittedEvent { const event = events?.find( - ({ event: name }) => name === NodeCommittedEventName + candidate => + "eventName" in candidate && + candidate.eventName === NodeCommittedEventName ), - committedEvent = event as NodeCommittedEvent | undefined, - { owner, tokenId, nftAddress, wireAccountName } = - committedEvent?.args ?? {} + arguments_ = event != null && "args" in event ? event.args : undefined, + owner = arguments_?.[0], + tokenId = arguments_?.[1], + tokenContractAddress = arguments_?.[2], + wireAccountName = arguments_?.[3] if ( owner == null || tokenId == null || - nftAddress == null || + tokenContractAddress == null || wireAccountName == null ) { throw new Error("Confirmed BAR transaction did not emit NodeCommitted.") } return { - owner: ethersUtils.getAddress(owner), + owner: getAddress(owner), tokenId: EthereumNodeOwnerClient.nodeOwnerTier(tokenId), - tokenContractAddress: ethersUtils.getAddress(nftAddress), + tokenContractAddress: getAddress(tokenContractAddress), wireAccountName } } /** Require a connected EVM signer for node-owner writes. */ private assertSigner(): Signer { - if (!Signer.isSigner(this.connection)) { - throw new Error("Ethereum node-owner commit requires a connected signer.") - } - return this.connection + return assertEthereumSigner(this.connection, "Ethereum node-owner commit") } /** Validate the depositor key shape and its relationship to the signer. */ @@ -201,7 +206,7 @@ export class EthereumNodeOwnerClient { value: BytesLike, owner: string ): Uint8Array { - const publicKey = ethersUtils.arrayify(value) + const publicKey = getBytes(value) if ( publicKey.length !== UncompressedPublicKeyByteLength || publicKey[0] !== UncompressedPublicKeyPrefix @@ -210,10 +215,7 @@ export class EthereumNodeOwnerClient { "depositorPublicKey must be a 65-byte uncompressed SEC1 key." ) } - const derivedOwner = ethersUtils.getAddress( - ethersUtils.computeAddress(publicKey) - ) - if (derivedOwner !== owner) { + if (getAddress(computeAddress(hexlify(publicKey))) !== owner) { throw new Error("depositorPublicKey does not belong to the EVM signer.") } return publicKey @@ -228,7 +230,7 @@ export class EthereumNodeOwnerClient { } /** Convert an sdk-core public key into BAR's generated WireKey structure. */ - private wireKey(publicKey: PublicKey): WireKeyStruct { + private wireKey(publicKey: PublicKey) { const keyType = match(publicKey.type) .with(KeyType.K1, () => NodeOwnerWireKeyType.K1) .with(KeyType.R1, () => NodeOwnerWireKeyType.R1) diff --git a/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts b/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts index a62d0b6..7fa806c 100644 --- a/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts +++ b/packages/sdk-outpost/tests/clients/ethereum/EthereumNodeOwnerClient.test.ts @@ -1,21 +1,19 @@ -import { KeyType } from "@wireio/sdk-core/chain/KeyType" -import type { Name } from "@wireio/sdk-core/chain/Name" -import type { PublicKey } from "@wireio/sdk-core/chain/PublicKey" +import type { BAR, IERC1155 } from "@wireio/outpost-ethereum-artifacts" +import { IERC1155__factory } from "@wireio/outpost-ethereum-artifacts" +import { KeyType, Name, PublicKey } from "@wireio/sdk-core" import { - BigNumber, + JsonRpcProvider, Wallet, - constants as ethersConstants, - providers, - utils as ethersUtils, - type Event + ZeroAddress, + getBytes, + type EventLog, + type TransactionReceipt, + type TransactionResponse } from "ethers" import { EthereumNodeOwnerClient, - EthereumNodeOwnerTier, - IERC1155__factory, - type BAR, - type IERC1155 + EthereumNodeOwnerTier } from "@wireio/sdk-outpost" const BarAddress = "0x18E317A7D70d8fBf8e6E893616b52390EbBdb629", @@ -24,50 +22,51 @@ const BarAddress = "0x18E317A7D70d8fBf8e6E893616b52390EbBdb629", ApprovalTransactionHash = `0x${"22".repeat(32)}`, TestPrivateKey = `0x${"33".repeat(32)}`, WireAccountName = "nodeowner", - WireAccount = { - toString: () => WireAccountName - } as Name, - TransactionReceipt = { - blockNumber: 10, + WireAccount = Name.from(WireAccountName), + TransactionReceiptFixture = { logs: [], status: 1 - } as unknown as providers.TransactionReceipt + } as unknown as TransactionReceipt -/** Create a confirmed transaction fixture with an optional parsed event. */ +/** Create a confirmed transaction fixture with optional parsed logs. */ function transactionFixture( hash: string, - events: readonly Event[] = [] -): providers.TransactionResponse { + logs: readonly EventLog[] = [] +): TransactionResponse { return { hash, - wait: jest.fn(async () => ({ ...TransactionReceipt, events })) - } as unknown as providers.TransactionResponse + wait: jest.fn(async () => ({ ...TransactionReceiptFixture, logs })) + } as unknown as TransactionResponse } /** Create generated BAR and IERC-1155 fixtures for one node-owner flow. */ -function contractFixtures(approved = true) { +function contractFixtures( + approved = true, + tokenContractAddress = TokenContractAddress +) { const wallet = new Wallet(TestPrivateKey), committedEvent = { - event: "NodeCommitted", - args: { - owner: wallet.address, - tokenId: BigNumber.from(EthereumNodeOwnerTier.T2), - nftAddress: TokenContractAddress, - wireAccountName: WireAccountName - } - }, + eventName: "NodeCommitted", + args: [ + wallet.address, + BigInt(EthereumNodeOwnerTier.T2), + TokenContractAddress, + WireAccountName + ] + } as unknown as EventLog, commitTransaction = transactionFixture(CommitTransactionHash, [ - committedEvent as never + committedEvent ]), approvalTransaction = transactionFixture(ApprovalTransactionHash), bar = { - address: BarAddress, - wireNodesContract: jest.fn(async () => TokenContractAddress), + target: BarAddress, + getAddress: jest.fn(async () => BarAddress), + wireNodesContract: jest.fn(async () => tokenContractAddress), commitNode: jest.fn(async () => commitTransaction) } as unknown as BAR, token = { balanceOf: jest.fn(async (_owner: string, tokenId: number) => - BigNumber.from(tokenId === EthereumNodeOwnerTier.T2 ? 1 : 0) + BigInt(tokenId === EthereumNodeOwnerTier.T2 ? 1 : 0) ), isApprovedForAll: jest.fn(async () => approved), setApprovalForAll: jest.fn(async () => approvalTransaction) @@ -79,12 +78,10 @@ function contractFixtures(approved = true) { /** Return an sdk-core public-key input aligned with the EVM test signer. */ function wirePublicKey(wallet: Wallet): PublicKey { - return { + return PublicKey.from({ type: KeyType.K1, - data: { - array: ethersUtils.arrayify(wallet._signingKey().compressedPublicKey) - } - } as PublicKey + compressed: getBytes(wallet.signingKey.compressedPublicKey) + }) } afterEach(() => jest.restoreAllMocks()) @@ -111,7 +108,7 @@ describe("EthereumNodeOwnerClient", () => { tokenId: EthereumNodeOwnerTier.T2, wireAccountName: WireAccount, wirePublicKey: wirePublicKey(wallet), - depositorPublicKey: wallet._signingKey().publicKey + depositorPublicKey: wallet.signingKey.publicKey }) expect(submission).toEqual({ @@ -129,7 +126,7 @@ describe("EthereumNodeOwnerClient", () => { EthereumNodeOwnerTier.T2, WireAccountName, expect.objectContaining({ keyType: 1 }), - ethersUtils.arrayify(wallet._signingKey().publicKey) + getBytes(wallet.signingKey.publicKey) ) expect(commitTransaction.wait).toHaveBeenCalledWith(1) }) @@ -143,7 +140,7 @@ describe("EthereumNodeOwnerClient", () => { tokenId: EthereumNodeOwnerTier.T2, wireAccountName: WireAccount, wirePublicKey: wirePublicKey(wallet), - depositorPublicKey: wallet._signingKey().publicKey + depositorPublicKey: wallet.signingKey.publicKey }) ).resolves.toEqual( expect.objectContaining({ @@ -158,7 +155,7 @@ describe("EthereumNodeOwnerClient", () => { const { wallet, bar } = contractFixtures(), providerClient = new EthereumNodeOwnerClient( bar, - new providers.JsonRpcProvider() + new JsonRpcProvider() ), signerClient = new EthereumNodeOwnerClient(bar, wallet), otherWallet = Wallet.createRandom(), @@ -166,7 +163,7 @@ describe("EthereumNodeOwnerClient", () => { tokenId: EthereumNodeOwnerTier.T2, wireAccountName: WireAccount, wirePublicKey: wirePublicKey(wallet), - depositorPublicKey: wallet._signingKey().publicKey + depositorPublicKey: wallet.signingKey.publicKey } await expect(providerClient.commit(request)).rejects.toThrow( @@ -175,15 +172,14 @@ describe("EthereumNodeOwnerClient", () => { await expect( signerClient.commit({ ...request, - depositorPublicKey: otherWallet._signingKey().publicKey + depositorPublicKey: otherWallet.signingKey.publicKey }) ).rejects.toThrow("does not belong to the EVM signer") expect(bar.commitNode).not.toHaveBeenCalled() }) it("fails closed when BAR has no canonical WireNodes contract", async () => { - const { wallet, bar } = contractFixtures() - bar.wireNodesContract = jest.fn(async () => ethersConstants.AddressZero) + const { wallet, bar } = contractFixtures(true, ZeroAddress) await expect( new EthereumNodeOwnerClient(bar, wallet).canonicalTokenContractAddress() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bec2e79..421e7c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -202,6 +202,9 @@ importers: '@wireio/outpost-solana-artifacts': specifier: 0.2.1 version: 0.2.1 + '@wireio/sdk-core': + specifier: workspace:* + version: link:../sdk-core ethers: specifier: ^6.15.0 version: 6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) From 43ccc5d2c929c87265ce3c8f4995288f0aa168d2 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 21 Aug 2026 16:15:59 -0400 Subject: [PATCH 44/48] docs(sdk-outpost): align deployment artifact handoff --- CLAUDE.md | 1 + packages/sdk-outpost/README.md | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index dc1f662..cab5420 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -225,6 +225,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come directly from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never regenerate them here or replace them with committed sibling links. +- Producer repositories assemble those npm packages from checksummed deployment handoffs. `sdk-outpost` never downloads the handoff or owns producer publication inputs. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. - `packages/sdk-outpost` owns external reserve lifecycle, swap execution, and BAR-backed Ethereum node-owner registration. BAR is an optional deployment capability: profiles without it preserve reserve and swap behavior, while node-owner access fails closed. Node-owner registration must use BAR's canonical WireNodes address and is not staking; staking remains outside this package until its dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index c449a31..d8bbad1 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,11 +8,12 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Release target: Ethereum artifacts `0.2.2` and Solana artifacts `0.2.1` provide -directly importable TypeScript libraries, including ethers v6 bindings. The -first `@wireio/sdk-outpost` release remains pending until their runtime manifests -pass deployment verification. The workspace version remains `0.0.0` until the -repository release workflow performs its patch bump. +Release target: Ethereum and Solana artifacts `0.3.0` will provide directly +importable TypeScript libraries assembled from one verified deployment handoff, +including ethers v6 bindings. The dependency pins remain on the current public +versions until both `0.3.0` packages can be installed from npm and their runtime +manifests pass deployment verification. The workspace version remains `0.0.0` +until the repository release workflow performs its patch bump. ## Install after the first SDK release @@ -251,9 +252,10 @@ including `Program["account"]["outpostConfig"]` and `@wireio/outpost-ethereum-artifacts` and `@wireio/outpost-solana-artifacts` are normal runtime dependencies. Their producers verify and publish the ABIs, IDL, -runtime bytes, manifests, ethers v6 factories, and Anchor types together. -`sdk-outpost` imports those published libraries directly and only composes their -manifests for live deployment verification; it does not regenerate chain code. +runtime bytes, manifests, ethers v6 factories, and Anchor types together from a +checksummed deployment artifact handoff. `sdk-outpost` imports those published +libraries directly and only composes their manifests for live deployment +verification; it does not download handoffs or regenerate chain code. ## Consumer boundaries From 1eca214f4ead1f4982475e8713d588f33ac7937d Mon Sep 17 00:00:00 2001 From: joshglogau Date: Thu, 27 Aug 2026 14:33:01 -0400 Subject: [PATCH 45/48] feat(sdk-outpost): register verified artifact suite --- .gitignore | 3 - CLAUDE.md | 1 + README.md | 4 +- RELEASING.md | 13 +- eslint.config.mjs | 3 - packages/sdk-outpost/README.md | 41 ++-- packages/sdk-outpost/package.json | 4 +- .../src/artifacts/Compatibility.ts | 139 +++---------- .../sdk-outpost/src/artifacts/Manifests.ts | 7 +- .../sdk-outpost/src/artifacts/Registry.ts | 185 ++++++++++++++++++ .../src/artifacts/SuiteCompatibility.ts | 116 +++++++++++ .../clients/ethereum/EthereumOutpostClient.ts | 34 ++-- .../src/clients/solana/SolanaOutpostClient.ts | 24 ++- .../verification/OutpostDeploymentVerifier.ts | 94 +++++++-- .../tests/assets/Artifacts.test.ts | 67 +++++++ .../sdk-outpost/tests/assets/Registry.test.ts | 48 +++++ pnpm-lock.yaml | 20 +- 17 files changed, 605 insertions(+), 198 deletions(-) create mode 100644 packages/sdk-outpost/src/artifacts/Registry.ts create mode 100644 packages/sdk-outpost/src/artifacts/SuiteCompatibility.ts create mode 100644 packages/sdk-outpost/tests/assets/Registry.test.ts diff --git a/.gitignore b/.gitignore index 1890c88..ec50cb5 100644 --- a/.gitignore +++ b/.gitignore @@ -31,9 +31,6 @@ tsconfig.tsbuildinfo out/ build dist -/packages/sdk-outpost/src/artifacts/generated/ -/packages/sdk-outpost/src/contracts/ethereum/generated/ -/packages/sdk-outpost/src/programs/solana/generated/ # Debug diff --git a/CLAUDE.md b/CLAUDE.md index cab5420..02f6d0f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -226,6 +226,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. - `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come directly from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never regenerate them here or replace them with committed sibling links. - Producer repositories assemble those npm packages from checksummed deployment handoffs. `sdk-outpost` never downloads the handoff or owns producer publication inputs. +- `sdk-outpost` registers exact producer package pairs in an internal compile-time artifact-suite registry. Select suites from deployment-profile ABI/IDL identity and verify exact live runtime identity; never key suite selection by environment names or turn it into an endpoint catalog/runtime package loader. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. - `packages/sdk-outpost` owns external reserve lifecycle, swap execution, and BAR-backed Ethereum node-owner registration. BAR is an optional deployment capability: profiles without it preserve reserve and swap behavior, while node-owner access fails closed. Node-owner registration must use BAR's canonical WireNodes address and is not staking; staking remains outside this package until its dedicated migration. - `sdk-outpost` accepts caller-owned providers and deployment profiles, verifies exact Ethereum implementations and Solana ProgramData against source-owned runtime artifacts, and never owns mutable endpoint catalogs. A same-code cluster respin requires a new profile, not an artifact or SDK release; any deployable binary change requires both a producer artifact and SDK release. diff --git a/README.md b/README.md index 19f04aa..46d4ca2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ A monorepo containing shared TypeScript libraries for Wire applications, providi The sdk-outpost package consumes exact published versions of the Ethereum and Solana artifact libraries, including their ethers v6 factories and Anchor types. Chain bindings are generated and verified by those producer repos, not -inside this monorepo. +inside this monorepo. An internal compile-time artifact-suite registry selects +compatible producer bindings from caller-supplied deployment profiles without +owning endpoints or environment configuration. ## Examples diff --git a/RELEASING.md b/RELEASING.md index ec13984..8bb575b 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -6,11 +6,12 @@ directory outside this process. ## Current first-release state -Producer package `0.2.1` is the prerequisite release for directly importable -TypeScript libraries and ethers v6 bindings. The first `@wireio/sdk-outpost` -release remains pending until both producer packages publish that version. Its -workspace version remains `0.0.0` until the existing repository-wide patch -workflow bumps and publishes it. +Ethereum and Solana producer packages `0.3.0` are the exact prerequisites for +the first SDK release. Both are publicly installable and provide directly +importable TypeScript libraries, ethers v6 factories, Anchor types, manifests, +and runtime artifacts. The first `@wireio/sdk-outpost` release remains pending +platform review. Its workspace version remains `0.0.0` until the existing +repository-wide patch workflow bumps and publishes it. ## Artifact prerequisites @@ -71,7 +72,7 @@ trees must not be published by `sdk-outpost`. The first successful publish creates the npm package page. Release sequence: -1. Confirm both exact `0.2.1` producer artifact versions are publicly +1. Confirm both exact `0.3.0` producer artifact versions are publicly installable. 2. Confirm the `wireio` organization exists on npm and the release owner can publish public packages in that scope. diff --git a/eslint.config.mjs b/eslint.config.mjs index 70e59c2..99d692a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -424,9 +424,6 @@ export default tseslint.config( "**/node_modules/**", "**/coverage/**", "**/*.d.ts", - "packages/sdk-outpost/src/artifacts/generated/**", - "packages/sdk-outpost/src/contracts/ethereum/generated/**", - "packages/sdk-outpost/src/programs/solana/generated/**", // TypeScript is the enforcement target: the style laws + tsconfig // govern .ts/.tsx. Plain JS (configs, .pnpmfile.cjs, Node CLI scripts — // whose console IS their user interface per the use-logging-framework.md diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index d8bbad1..f455280 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -8,12 +8,11 @@ This package owns verified external-chain clients. Contract ABIs are published by `wire-ethereum`, the Solana IDL is published by `wire-solana`, and immutable deployment profiles remain caller-supplied. -Release target: Ethereum and Solana artifacts `0.3.0` will provide directly -importable TypeScript libraries assembled from one verified deployment handoff, -including ethers v6 bindings. The dependency pins remain on the current public -versions until both `0.3.0` packages can be installed from npm and their runtime -manifests pass deployment verification. The workspace version remains `0.0.0` -until the repository release workflow performs its patch bump. +The current source pins Ethereum and Solana artifacts `0.3.0`, directly +importable TypeScript libraries assembled from the same verified deployment +handoff. Their published manifests identify the exact producer commits, runtime +artifacts, and ethers v6/Anchor bindings used by the SDK. The workspace version +remains `0.0.0` until the repository release workflow performs its patch bump. ## Install after the first SDK release @@ -21,15 +20,15 @@ until the repository release workflow performs its patch bump. npm install @wireio/sdk-outpost ``` -Before using the registry command, verify that `@wireio/sdk-outpost` resolves -through `npm view`. The SDK consumes exact registry versions of +Before installing, verify that `@wireio/sdk-outpost` resolves through `npm view`. +The SDK consumes exact npm versions of [`@wireio/outpost-ethereum-artifacts`](https://www.npmjs.com/package/@wireio/outpost-ethereum-artifacts) and [`@wireio/outpost-solana-artifacts`](https://www.npmjs.com/package/@wireio/outpost-solana-artifacts); do not replace them with committed machine-local links. Node.js 22 or newer and ethers v6 are supported. The package publishes CommonJS -and native ES module entrypoints with TypeScript declarations. +and ES module entrypoints with TypeScript declarations. ## Supported surfaces @@ -92,6 +91,21 @@ new profile without requiring a producer-artifact or SDK release. | Asset/reserve onboarding without code/interface changes | No | No | Update operational configuration/evidence | | RPC or explorer rotation | No | No | Update endpoint catalog only | +## Artifact suite selection + +The SDK keeps an internal, compile-time registry of supported Ethereum and +Solana producer package pairs. Client creation selects compatible bindings from +the deployment profile's ABI or IDL digests, then verifies the selected +candidate against the exact live Ethereum runtime or Solana ProgramData before +returning a client. + +This registry is not a network, endpoint, or environment catalog. It contains no +RPC URLs, does not download code, and is not keyed by names such as sandbox or +devnet. A new deployment profile that uses an already-registered artifact suite +works without an SDK release. A deployable code or interface change requires a +producer artifact release, a corresponding internal suite entry, and an SDK +release; consumers continue to use the same `OutpostClient.create` facade. + ## Usage Validate caller-owned deployment data and provide the matching external-chain @@ -254,8 +268,9 @@ including `Program["account"]["outpostConfig"]` and normal runtime dependencies. Their producers verify and publish the ABIs, IDL, runtime bytes, manifests, ethers v6 factories, and Anchor types together from a checksummed deployment artifact handoff. `sdk-outpost` imports those published -libraries directly and only composes their manifests for live deployment -verification; it does not download handoffs or regenerate chain code. +libraries directly, registers their generated bindings as one internal artifact +suite, and uses their manifests for live deployment verification; it does not +download handoffs or regenerate chain code. ## Consumer boundaries @@ -277,6 +292,10 @@ pnpm --dir packages/sdk-outpost run build pnpm --dir packages/sdk-outpost run test ``` +The artifact tests read the installed producer-package payloads, verify their +published runtime checksums and required generated bindings, and assert that the +internal registry accepts only the exact paired Ethereum and Solana suite. + Release versions are managed by the monorepo-wide patch workflow. See the [repository release guide](https://github.com/Wire-Network/wire-libraries-ts/blob/master/RELEASING.md) for artifact prerequisites and the verification checklist. diff --git a/packages/sdk-outpost/package.json b/packages/sdk-outpost/package.json index 5e69cac..c3e42bb 100644 --- a/packages/sdk-outpost/package.json +++ b/packages/sdk-outpost/package.json @@ -44,8 +44,8 @@ "@coral-xyz/anchor": "^0.32.1", "@solana/spl-token": "^0.3.11", "@solana/web3.js": "^1.98.4", - "@wireio/outpost-ethereum-artifacts": "0.2.2", - "@wireio/outpost-solana-artifacts": "0.2.1", + "@wireio/outpost-ethereum-artifacts": "0.3.0", + "@wireio/outpost-solana-artifacts": "0.3.0", "@wireio/sdk-core": "workspace:*", "ethers": "^6.15.0", "ts-pattern": "^5.9.0", diff --git a/packages/sdk-outpost/src/artifacts/Compatibility.ts b/packages/sdk-outpost/src/artifacts/Compatibility.ts index b398c1e..8b76b6a 100644 --- a/packages/sdk-outpost/src/artifacts/Compatibility.ts +++ b/packages/sdk-outpost/src/artifacts/Compatibility.ts @@ -1,79 +1,26 @@ -import { match } from "ts-pattern" -import { getBytes, sha256 as ethersSha256 } from "ethers" - import { EthereumContractName, OutpostChainFamily, - OutpostDeploymentProfile, - SolanaProgramName + SolanaProgramName, + type OutpostDeploymentProfile } from "../deployments/index.js" -import { OutpostArtifactManifests } from "./Manifests.js" - -const SolanaProgramDataMetadataByteLength = 45 - -/** Deployment-specific byte range in one Ethereum runtime template. */ -interface EthereumRuntimeReference { - readonly start: number - readonly length: number -} - -/** Return the SHA-256 digest for chain runtime bytes. */ -function sha256(value: Uint8Array): string { - return ethersSha256(value).slice(2) -} - -/** Zero environment-specific ranges in live Ethereum runtime code. */ -function normalizeEthereumRuntimeCode( - code: string, - runtimeReferences: readonly EthereumRuntimeReference[] -): Uint8Array { - const runtimeCode = Uint8Array.from(getBytes(code)) - let previousReferenceEnd = 0 - - runtimeReferences.forEach(({ start, length }) => { - const referenceEnd = start + length - if ( - !Number.isInteger(start) || - !Number.isInteger(length) || - length <= 0 || - start < previousReferenceEnd || - referenceEnd > runtimeCode.length - ) { - throw new Error("Ethereum artifact has invalid runtime references") - } - runtimeCode.fill(0, start, referenceEnd) - previousReferenceEnd = referenceEnd - }) - - return runtimeCode -} +import { CurrentOutpostArtifactSuite } from "./Registry.js" +import { + assertEthereumRuntimeSuiteCompatibility, + assertOutpostArtifactSuiteCompatibility, + assertSolanaProgramSuiteCompatibility +} from "./SuiteCompatibility.js" /** Verify live Ethereum code against its source-owned runtime template. */ export function assertEthereumRuntimeArtifactCompatibility( contractName: EthereumContractName, code: string ): void { - const artifact = OutpostArtifactManifests.ethereum.contracts[contractName], - runtimeReferences = [ - ...artifact.runtimeLinkReferences, - ...artifact.runtimeImmutableReferences - ].sort((left, right) => left.start - right.start), - normalizedCode = normalizeEthereumRuntimeCode( - code, - runtimeReferences - ) - - if (normalizedCode.length !== artifact.runtimeBytecodeLength) { - throw new Error( - `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` - ) - } - const digest = sha256(normalizedCode) - if (digest !== artifact.runtimeBytecodeSha256) { - throw new Error( - `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` - ) - } + assertEthereumRuntimeSuiteCompatibility( + contractName, + code, + CurrentOutpostArtifactSuite + ) } /** Verify live Solana executable bytes against the source-owned program binary. */ @@ -81,36 +28,11 @@ export function assertSolanaProgramArtifactCompatibility( programName: SolanaProgramName, programData: Uint8Array ): void { - const artifact = OutpostArtifactManifests.solana.programs[programName], - programBinaryEnd = - SolanaProgramDataMetadataByteLength + artifact.programBinaryLength - - if (programData.length < programBinaryEnd) { - throw new Error( - `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` - ) - } - const digest = sha256( - programData.subarray(SolanaProgramDataMetadataByteLength, programBinaryEnd) + assertSolanaProgramSuiteCompatibility( + programName, + programData, + CurrentOutpostArtifactSuite ) - if (digest !== artifact.programBinarySha256) { - throw new Error( - `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` - ) - } -} - -/** Assert that one profile digest matches the interface compiled into the SDK. */ -function assertInterfaceDigest( - actual: string, - expected: string, - label: string -): void { - if (actual !== expected) { - throw new Error( - `${label} interface mismatch: expected ${expected}, received ${actual}` - ) - } } /** Verify that a deployment profile matches this SDK's source-owned interfaces. */ @@ -118,26 +40,9 @@ export function assertOutpostArtifactCompatibility( profile: OutpostDeploymentProfile, family: OutpostChainFamily ): void { - match(family) - .with(OutpostChainFamily.ethereum, () => { - Object.values(EthereumContractName).forEach(contractName => { - const contract = profile.ethereum.contracts[contractName] - if (contract == null) return - assertInterfaceDigest( - contract.abiSha256, - OutpostArtifactManifests.ethereum.contracts[contractName].abiSha256, - `Ethereum ${contractName} ABI` - ) - }) - }) - .with(OutpostChainFamily.solana, () => { - Object.values(SolanaProgramName).forEach(programName => { - assertInterfaceDigest( - profile.solana.programs[programName].idlSha256, - OutpostArtifactManifests.solana.programs[programName].idlSha256, - `Solana ${programName} IDL` - ) - }) - }) - .exhaustive() + assertOutpostArtifactSuiteCompatibility( + profile, + family, + CurrentOutpostArtifactSuite + ) } diff --git a/packages/sdk-outpost/src/artifacts/Manifests.ts b/packages/sdk-outpost/src/artifacts/Manifests.ts index 7d3b109..7254c38 100644 --- a/packages/sdk-outpost/src/artifacts/Manifests.ts +++ b/packages/sdk-outpost/src/artifacts/Manifests.ts @@ -1,8 +1,7 @@ -import { EthereumOutpostArtifactManifest } from "@wireio/outpost-ethereum-artifacts" -import { SolanaOutpostArtifactManifest } from "@wireio/outpost-solana-artifacts" +import { CurrentOutpostArtifactSuite } from "./Registry.js" /** Exact producer manifests compiled into this SDK release. */ export const OutpostArtifactManifests = { - ethereum: EthereumOutpostArtifactManifest, - solana: SolanaOutpostArtifactManifest + ethereum: CurrentOutpostArtifactSuite.ethereum.manifest, + solana: CurrentOutpostArtifactSuite.solana.manifest } as const diff --git a/packages/sdk-outpost/src/artifacts/Registry.ts b/packages/sdk-outpost/src/artifacts/Registry.ts new file mode 100644 index 0000000..2ce4fef --- /dev/null +++ b/packages/sdk-outpost/src/artifacts/Registry.ts @@ -0,0 +1,185 @@ +import { + BAR__factory, + EthereumOutpostArtifactManifest, + OPPInbound__factory, + OPP__factory, + OperatorRegistry__factory, + ReserveManager__factory +} from "@wireio/outpost-ethereum-artifacts" +import { + SolanaOutpostArtifactManifest, + liqsolCoreIdl +} from "@wireio/outpost-solana-artifacts" +import { match } from "ts-pattern" + +import { + EthereumContractName, + OutpostChainFamily, + SolanaProgramName, + type OutpostDeploymentProfile +} from "../deployments/index.js" + +/** Generated ethers v6 factories keyed by deployment identity. */ +export interface EthereumOutpostArtifactFactories { + readonly [EthereumContractName.BAR]: typeof BAR__factory + readonly [EthereumContractName.OPP]: typeof OPP__factory + readonly [EthereumContractName.OPPInbound]: typeof OPPInbound__factory + readonly [EthereumContractName.OperatorRegistry]: typeof OperatorRegistry__factory + readonly [EthereumContractName.ReserveManager]: typeof ReserveManager__factory +} + +/** Generated Anchor IDLs keyed by deployment identity. */ +export interface SolanaOutpostArtifactIdls { + readonly [SolanaProgramName.liqsolCore]: typeof liqsolCoreIdl +} + +/** Ethereum producer bindings and manifest owned by one artifact release. */ +export interface EthereumOutpostArtifactSuite { + /** Exact producer manifest used for compatibility verification. */ + readonly manifest: typeof EthereumOutpostArtifactManifest + /** Generated ethers v6 factories keyed by deployment identity. */ + readonly factories: EthereumOutpostArtifactFactories +} + +/** Solana producer bindings and manifest owned by one artifact release. */ +export interface SolanaOutpostArtifactSuite { + /** Exact producer manifest used for compatibility verification. */ + readonly manifest: typeof SolanaOutpostArtifactManifest + /** Generated Anchor IDLs keyed by deployment identity. */ + readonly idls: SolanaOutpostArtifactIdls +} + +/** Paired producer bindings accepted by one SDK Outpost release. */ +export interface OutpostArtifactSuite { + /** Ethereum half of the release suite. */ + readonly ethereum: EthereumOutpostArtifactSuite + /** Solana half of the release suite. */ + readonly solana: SolanaOutpostArtifactSuite +} + +/** One deployment-interface mismatch against a registered artifact suite. */ +export interface OutpostArtifactInterfaceMismatch { + /** Human-readable interface identity. */ + readonly label: string + /** Digest recorded by the deployment profile. */ + readonly actual: string + /** Digest published by the producer artifact package. */ + readonly expected: string +} + +/** Current producer package pair compiled into this SDK branch. */ +export const CurrentOutpostArtifactSuite: OutpostArtifactSuite = { + ethereum: { + manifest: EthereumOutpostArtifactManifest, + factories: { + [EthereumContractName.BAR]: BAR__factory, + [EthereumContractName.OPP]: OPP__factory, + [EthereumContractName.OPPInbound]: OPPInbound__factory, + [EthereumContractName.OperatorRegistry]: OperatorRegistry__factory, + [EthereumContractName.ReserveManager]: ReserveManager__factory + } + }, + solana: { + manifest: SolanaOutpostArtifactManifest, + idls: { + [SolanaProgramName.liqsolCore]: liqsolCoreIdl + } + } +} + +/** Artifact suites supported by this SDK release. */ +const RegisteredOutpostArtifactSuites: readonly OutpostArtifactSuite[] = [ + CurrentOutpostArtifactSuite +] + +/** Return Ethereum interface mismatches for one artifact suite. */ +function ethereumInterfaceMismatches( + profile: OutpostDeploymentProfile, + suite: OutpostArtifactSuite +): OutpostArtifactInterfaceMismatch[] { + return Object.values(EthereumContractName).flatMap(contractName => { + const deployment = profile.ethereum.contracts[contractName] + if (deployment == null) return [] + const expected = suite.ethereum.manifest.contracts[contractName].abiSha256 + return deployment.abiSha256 === expected + ? [] + : [ + { + label: `Ethereum ${contractName} ABI`, + actual: deployment.abiSha256, + expected + } + ] + }) +} + +/** Return Solana interface mismatches for one artifact suite. */ +function solanaInterfaceMismatches( + profile: OutpostDeploymentProfile, + suite: OutpostArtifactSuite +): OutpostArtifactInterfaceMismatch[] { + return Object.values(SolanaProgramName).flatMap(programName => { + const actual = profile.solana.programs[programName].idlSha256, + expected = suite.solana.manifest.programs[programName].idlSha256 + return actual === expected + ? [] + : [ + { + label: `Solana ${programName} IDL`, + actual, + expected + } + ] + }) +} + +/** Return all profile interface mismatches for one family and suite. */ +export function outpostArtifactInterfaceMismatches( + profile: OutpostDeploymentProfile, + family: OutpostChainFamily, + suite: OutpostArtifactSuite +): OutpostArtifactInterfaceMismatch[] { + return match(family) + .with(OutpostChainFamily.ethereum, () => + ethereumInterfaceMismatches(profile, suite) + ) + .with(OutpostChainFamily.solana, () => + solanaInterfaceMismatches(profile, suite) + ) + .exhaustive() +} + +/** Internal registry for producer package suites compiled into this SDK. */ +export namespace OutpostArtifactRegistry { + /** Return suites whose paired generated interfaces match one profile. */ + export function candidates( + profile: OutpostDeploymentProfile + ): readonly OutpostArtifactSuite[] { + return RegisteredOutpostArtifactSuites.filter( + suite => + outpostArtifactInterfaceMismatches( + profile, + OutpostChainFamily.ethereum, + suite + ).length === 0 && + outpostArtifactInterfaceMismatches( + profile, + OutpostChainFamily.solana, + suite + ).length === 0 + ) + } + + /** Resolve paired generated bindings for a compatible deployment profile. */ + export function resolve( + profile: OutpostDeploymentProfile + ): OutpostArtifactSuite { + const suite = candidates(profile)[0] + if (suite == null) { + throw new Error( + `No registered artifact suite matches deployment profile ${profile.id}` + ) + } + return suite + } +} diff --git a/packages/sdk-outpost/src/artifacts/SuiteCompatibility.ts b/packages/sdk-outpost/src/artifacts/SuiteCompatibility.ts new file mode 100644 index 0000000..25cbc21 --- /dev/null +++ b/packages/sdk-outpost/src/artifacts/SuiteCompatibility.ts @@ -0,0 +1,116 @@ +import { getBytes, sha256 as ethersSha256 } from "ethers" + +import { + EthereumContractName, + OutpostChainFamily, + SolanaProgramName, + type OutpostDeploymentProfile +} from "../deployments/index.js" +import { + outpostArtifactInterfaceMismatches, + type OutpostArtifactSuite +} from "./Registry.js" + +const SolanaProgramDataMetadataByteLength = 45 + +/** Deployment-specific byte range in one Ethereum runtime template. */ +interface EthereumRuntimeReference { + readonly start: number + readonly length: number +} + +/** Return the SHA-256 digest for chain runtime bytes. */ +function sha256(value: Uint8Array): string { + return ethersSha256(value).slice(2) +} + +/** Zero environment-specific ranges in live Ethereum runtime code. */ +function normalizeEthereumRuntimeCode( + code: string, + runtimeReferences: readonly EthereumRuntimeReference[] +): Uint8Array { + const runtimeCode = Uint8Array.from(getBytes(code)) + let previousReferenceEnd = 0 + + runtimeReferences.forEach(({ start, length }) => { + const referenceEnd = start + length + if ( + !Number.isInteger(start) || + !Number.isInteger(length) || + length <= 0 || + start < previousReferenceEnd || + referenceEnd > runtimeCode.length + ) { + throw new Error("Ethereum artifact has invalid runtime references") + } + runtimeCode.fill(0, start, referenceEnd) + previousReferenceEnd = referenceEnd + }) + + return runtimeCode +} + +/** Verify live Ethereum code against one producer runtime template. */ +export function assertEthereumRuntimeSuiteCompatibility( + contractName: EthereumContractName, + code: string, + suite: OutpostArtifactSuite +): void { + const artifact = suite.ethereum.manifest.contracts[contractName], + runtimeReferences = [ + ...artifact.runtimeLinkReferences, + ...artifact.runtimeImmutableReferences + ].sort((left, right) => left.start - right.start), + normalizedCode = normalizeEthereumRuntimeCode(code, runtimeReferences) + + if (normalizedCode.length !== artifact.runtimeBytecodeLength) { + throw new Error( + `Ethereum ${contractName} artifact runtime length mismatch: expected ${artifact.runtimeBytecodeLength}, received ${normalizedCode.length}` + ) + } + const digest = sha256(normalizedCode) + if (digest !== artifact.runtimeBytecodeSha256) { + throw new Error( + `Ethereum ${contractName} artifact runtime mismatch: expected ${artifact.runtimeBytecodeSha256}, received ${digest}` + ) + } +} + +/** Verify live Solana executable bytes against one producer program binary. */ +export function assertSolanaProgramSuiteCompatibility( + programName: SolanaProgramName, + programData: Uint8Array, + suite: OutpostArtifactSuite +): void { + const artifact = suite.solana.manifest.programs[programName], + programBinaryEnd = + SolanaProgramDataMetadataByteLength + artifact.programBinaryLength + + if (programData.length < programBinaryEnd) { + throw new Error( + `Solana ${programName} artifact program is truncated: expected ${artifact.programBinaryLength} executable bytes` + ) + } + const digest = sha256( + programData.subarray(SolanaProgramDataMetadataByteLength, programBinaryEnd) + ) + if (digest !== artifact.programBinarySha256) { + throw new Error( + `Solana ${programName} artifact program mismatch: expected ${artifact.programBinarySha256}, received ${digest}` + ) + } +} + +/** Verify profile interfaces against one producer artifact suite. */ +export function assertOutpostArtifactSuiteCompatibility( + profile: OutpostDeploymentProfile, + family: OutpostChainFamily, + suite: OutpostArtifactSuite +): void { + const mismatch = outpostArtifactInterfaceMismatches(profile, family, suite)[0] + if (mismatch != null) { + throw new Error( + `${mismatch.label} interface mismatch: expected ${mismatch.expected}, received ${mismatch.actual}` + ) + } +} diff --git a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts index 9c5ed80..418f421 100644 --- a/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/ethereum/EthereumOutpostClient.ts @@ -1,13 +1,10 @@ -import { - BAR__factory, - OPPInbound__factory, - OPP__factory, - OperatorRegistry__factory, - ReserveManager__factory -} from "@wireio/outpost-ethereum-artifacts" import type { Provider } from "ethers" import { match } from "ts-pattern" +import { + OutpostArtifactRegistry, + type OutpostArtifactSuite +} from "../../artifacts/Registry.js" import { EthereumContractName, OutpostChainFamily @@ -33,13 +30,18 @@ export class EthereumOutpostClient { profile, provider }) - return new EthereumOutpostClient(options, provider) + return new EthereumOutpostClient( + options, + provider, + OutpostArtifactRegistry.resolve(profile) + ) } private constructor( private readonly options: EthereumOutpostClientOptions, /** Provider verified against the configured Ethereum chain. */ - readonly provider: Provider + readonly provider: Provider, + private readonly artifactSuite: OutpostArtifactSuite ) { this.reserves = new EthereumReserveClient( this.contract(EthereumContractName.ReserveManager), @@ -83,6 +85,7 @@ export class EthereumOutpostClient { /** Connect a generated contract client by its typed deployment name. */ contract(name: T): EthereumContractMap[T] { const { connection, profile } = this.options, + factories = this.artifactSuite.ethereum.factories, contract = match(name as EthereumContractName) .with(EthereumContractName.BAR, () => { const bar = profile.ethereum.contracts[EthereumContractName.BAR] @@ -91,29 +94,32 @@ export class EthereumOutpostClient { "Ethereum node owners are unavailable because this deployment profile has no BAR identity." ) } - return BAR__factory.connect(bar.address, connection) + return factories[EthereumContractName.BAR].connect( + bar.address, + connection + ) }) .with(EthereumContractName.OPP, () => - OPP__factory.connect( + factories[EthereumContractName.OPP].connect( profile.ethereum.contracts[EthereumContractName.OPP].address, connection ) ) .with(EthereumContractName.OPPInbound, () => - OPPInbound__factory.connect( + factories[EthereumContractName.OPPInbound].connect( profile.ethereum.contracts[EthereumContractName.OPPInbound].address, connection ) ) .with(EthereumContractName.OperatorRegistry, () => - OperatorRegistry__factory.connect( + factories[EthereumContractName.OperatorRegistry].connect( profile.ethereum.contracts[EthereumContractName.OperatorRegistry] .address, connection ) ) .with(EthereumContractName.ReserveManager, () => - ReserveManager__factory.connect( + factories[EthereumContractName.ReserveManager].connect( profile.ethereum.contracts[EthereumContractName.ReserveManager] .address, connection diff --git a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts index 592cab6..01f0566 100644 --- a/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts +++ b/packages/sdk-outpost/src/clients/solana/SolanaOutpostClient.ts @@ -1,14 +1,15 @@ import { Program } from "@coral-xyz/anchor" +import type { LiqsolCore } from "@wireio/outpost-solana-artifacts" import { match } from "ts-pattern" +import { + OutpostArtifactRegistry, + type OutpostArtifactSuite +} from "../../artifacts/Registry.js" import { OutpostChainFamily, SolanaProgramName } from "../../deployments/index.js" -import { - liqsolCoreIdl, - type LiqsolCore -} from "@wireio/outpost-solana-artifacts" import { OutpostDeploymentVerifier } from "../../verification/index.js" import { SolanaOutpostClientOptions, SolanaProgramMap } from "./Types.js" import { SolanaReserveClient } from "./SolanaReserveClient.js" @@ -27,17 +28,26 @@ export class SolanaOutpostClient { profile, connection: provider.connection }) - return new SolanaOutpostClient(options) + return new SolanaOutpostClient( + options, + OutpostArtifactRegistry.resolve(profile) + ) } private readonly liqsolCore: Program - private constructor(private readonly options: SolanaOutpostClientOptions) { + private constructor( + private readonly options: SolanaOutpostClientOptions, + artifactSuite: OutpostArtifactSuite + ) { const address = options.profile.solana.programs[SolanaProgramName.liqsolCore].address this.liqsolCore = new Program( - { ...liqsolCoreIdl, address }, + { + ...artifactSuite.solana.idls[SolanaProgramName.liqsolCore], + address + }, options.provider ) this.reserves = new SolanaReserveClient(options.provider, this.liqsolCore) diff --git a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts index aefd2fb..bc0e941 100644 --- a/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts +++ b/packages/sdk-outpost/src/verification/OutpostDeploymentVerifier.ts @@ -5,10 +5,15 @@ import { dataSlice, getAddress, sha256 as ethersSha256 } from "ethers" import { match } from "ts-pattern" import { - assertEthereumRuntimeArtifactCompatibility, - assertOutpostArtifactCompatibility, - assertSolanaProgramArtifactCompatibility -} from "../artifacts/index.js" + CurrentOutpostArtifactSuite, + OutpostArtifactRegistry, + type OutpostArtifactSuite +} from "../artifacts/Registry.js" +import { + assertEthereumRuntimeSuiteCompatibility, + assertOutpostArtifactSuiteCompatibility, + assertSolanaProgramSuiteCompatibility +} from "../artifacts/SuiteCompatibility.js" import { EthereumContractName, OutpostChainFamily, @@ -64,9 +69,14 @@ function assertSolanaUpgradeableLoaderAccount( async function verifyEthereum( profile: OutpostDeploymentProfile, - provider: Provider + provider: Provider, + suite: OutpostArtifactSuite ): Promise { - assertOutpostArtifactCompatibility(profile, OutpostChainFamily.ethereum) + assertOutpostArtifactSuiteCompatibility( + profile, + OutpostChainFamily.ethereum, + suite + ) const network = await provider.getNetwork() if (network.chainId !== BigInt(profile.ethereum.chainId)) { @@ -114,9 +124,10 @@ async function verifyEthereum( `Ethereum ${contractName} implementation code mismatch: expected ${contract.implementationCodeSha256}, received ${implementationCodeSha256}` ) } - assertEthereumRuntimeArtifactCompatibility( + assertEthereumRuntimeSuiteCompatibility( contractName, - implementationCode + implementationCode, + suite ) }) ) @@ -124,9 +135,14 @@ async function verifyEthereum( async function verifySolana( profile: OutpostDeploymentProfile, - connection: Connection + connection: Connection, + suite: OutpostArtifactSuite ): Promise { - assertOutpostArtifactCompatibility(profile, OutpostChainFamily.solana) + assertOutpostArtifactSuiteCompatibility( + profile, + OutpostChainFamily.solana, + suite + ) const genesisHash = await connection.getGenesisHash() if (genesisHash !== profile.solana.genesisHash) { @@ -209,27 +225,65 @@ async function verifySolana( `Solana ${programName} ProgramData mismatch: expected ${program.programDataSha256}, received ${programDataSha256}` ) } - assertSolanaProgramArtifactCompatibility( + assertSolanaProgramSuiteCompatibility( programName, - programDataAccount.data + programDataAccount.data, + suite ) }) ) } +/** Verify one candidate artifact suite against its live external chain. */ +async function verifyOutpostArtifactSuite( + input: OutpostDeploymentVerificationInput, + suite: OutpostArtifactSuite +): Promise { + await match(input) + .with({ family: OutpostChainFamily.ethereum }, value => + verifyEthereum(value.profile, value.provider, suite) + ) + .with({ family: OutpostChainFamily.solana }, value => + verifySolana(value.profile, value.connection, suite) + ) + .exhaustive() +} + +/** Verify compatible suites in registration order until one matches live code. */ +async function verifyOutpostArtifactSuiteCandidates( + input: OutpostDeploymentVerificationInput, + suites: readonly OutpostArtifactSuite[], + index = 0 +): Promise { + const suite = suites[index] + if (suite == null) { + assertOutpostArtifactSuiteCompatibility( + input.profile, + input.family, + CurrentOutpostArtifactSuite + ) + throw new Error( + `No registered artifact suite matches deployment profile ${input.profile.id}` + ) + } + + try { + await verifyOutpostArtifactSuite(input, suite) + } catch (error: unknown) { + if (index + 1 >= suites.length) throw error + await verifyOutpostArtifactSuiteCandidates(input, suites, index + 1) + } +} + /** Cross-chain facade for exact outpost deployment-profile verification. */ export namespace OutpostDeploymentVerifier { /** Verify chain identity, interface compatibility, and exact live runtime identity. */ export async function verify( input: OutpostDeploymentVerificationInput ): Promise { - await match(input) - .with({ family: OutpostChainFamily.ethereum }, value => - verifyEthereum(value.profile, value.provider) - ) - .with({ family: OutpostChainFamily.solana }, value => - verifySolana(value.profile, value.connection) - ) - .exhaustive() + await verifyOutpostArtifactSuiteCandidates( + input, + OutpostArtifactRegistry.candidates(input.profile) + ) } } diff --git a/packages/sdk-outpost/tests/assets/Artifacts.test.ts b/packages/sdk-outpost/tests/assets/Artifacts.test.ts index b13973c..1b5ed69 100644 --- a/packages/sdk-outpost/tests/assets/Artifacts.test.ts +++ b/packages/sdk-outpost/tests/assets/Artifacts.test.ts @@ -1,5 +1,7 @@ import type { Program } from "@coral-xyz/anchor" import { + BAR__factory, + IERC1155__factory, OPP__factory, OperatorRegistry__factory, ReserveManager__factory @@ -8,6 +10,9 @@ import { liqsolCoreIdl, type LiqsolCore } from "@wireio/outpost-solana-artifacts" +import { createHash } from "node:crypto" +import { readFileSync } from "node:fs" +import { createRequire } from "node:module" import { EthereumContractName, @@ -19,6 +24,20 @@ import { import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" +const PackageRequire = createRequire(__filename) + +/** Return the SHA-256 digest for one installed producer-package file. */ +function installedPackageFileSha256( + packageName: string, + packagePath: string +): string { + return createHash("sha256") + .update( + readFileSync(PackageRequire.resolve(`${packageName}/${packagePath}`)) + ) + .digest("hex") +} + describe("source-owned outpost artifacts", () => { it("records exact producer package identity", () => { expect(OutpostArtifactManifests.ethereum.package.name).toBe( @@ -27,6 +46,42 @@ describe("source-owned outpost artifacts", () => { expect(OutpostArtifactManifests.solana.package.name).toBe( "@wireio/outpost-solana-artifacts" ) + expect(OutpostArtifactManifests.ethereum.package.version).toBe("0.3.0") + expect(OutpostArtifactManifests.solana.package.version).toBe("0.3.0") + expect(OutpostArtifactManifests.ethereum.source.revision).toBe( + "b90035b48414267d1b3ca183b88e2118a8c5b16e" + ) + expect(OutpostArtifactManifests.solana.source.revision).toBe( + "217c4d6909cb658cd1bf3bcda570400947ed2893" + ) + }) + + it("ships checksum-valid Ethereum runtimes and Solana program inputs", () => { + Object.values(OutpostArtifactManifests.ethereum.contracts).forEach( + artifact => { + expect( + installedPackageFileSha256( + OutpostArtifactManifests.ethereum.package.name, + artifact.runtimeBytecodePath + ) + ).toBe(artifact.runtimeBytecodeSha256) + } + ) + + const solanaProgram = + OutpostArtifactManifests.solana.programs[SolanaProgramName.liqsolCore] + expect( + installedPackageFileSha256( + OutpostArtifactManifests.solana.package.name, + solanaProgram.idlPath + ) + ).toBe(solanaProgram.idlSha256) + expect( + installedPackageFileSha256( + OutpostArtifactManifests.solana.package.name, + solanaProgram.programBinaryPath + ) + ).toBe(solanaProgram.programBinarySha256) }) it.each(Object.values(OutpostChainFamily))( @@ -84,6 +139,18 @@ describe("source-owned outpost artifacts", () => { expect( OperatorRegistry__factory.createInterface().getFunction("commit") ).toBeDefined() + expect( + BAR__factory.createInterface().getFunction("wireNodesContract") + ).toBeDefined() + expect( + BAR__factory.createInterface().getFunction("commitNode") + ).toBeDefined() + expect( + IERC1155__factory.createInterface().getFunction("balanceOf") + ).toBeDefined() + expect( + IERC1155__factory.createInterface().getFunction("setApprovalForAll") + ).toBeDefined() expect( liqsolCoreIdl.instructions.map(instruction => instruction.name) ).toEqual( diff --git a/packages/sdk-outpost/tests/assets/Registry.test.ts b/packages/sdk-outpost/tests/assets/Registry.test.ts new file mode 100644 index 0000000..b3f0024 --- /dev/null +++ b/packages/sdk-outpost/tests/assets/Registry.test.ts @@ -0,0 +1,48 @@ +import { ReserveManager__factory } from "@wireio/outpost-ethereum-artifacts" +import { liqsolCoreIdl } from "@wireio/outpost-solana-artifacts" + +import { + CurrentOutpostArtifactSuite, + OutpostArtifactRegistry +} from "@wireio/sdk-outpost/artifacts/Registry" +import { EthereumContractName, SolanaProgramName } from "@wireio/sdk-outpost" + +import { createOutpostDeploymentProfileFixture } from "../Fixtures.js" + +const MismatchedInterfaceDigest = "f".repeat(64) + +describe("OutpostArtifactRegistry", () => { + it("resolves the exact installed Ethereum and Solana package pair", () => { + const suite = OutpostArtifactRegistry.resolve( + createOutpostDeploymentProfileFixture() + ) + + expect(suite).toBe(CurrentOutpostArtifactSuite) + expect(suite.ethereum.factories[EthereumContractName.ReserveManager]).toBe( + ReserveManager__factory + ) + expect(suite.solana.idls[SolanaProgramName.liqsolCore]).toBe(liqsolCoreIdl) + }) + + it("rejects an unregistered Ethereum interface", () => { + const profile = createOutpostDeploymentProfileFixture() + profile.ethereum.contracts[EthereumContractName.ReserveManager].abiSha256 = + MismatchedInterfaceDigest + + expect(OutpostArtifactRegistry.candidates(profile)).toEqual([]) + expect(() => OutpostArtifactRegistry.resolve(profile)).toThrow( + "No registered artifact suite matches deployment profile" + ) + }) + + it("rejects an unregistered Solana interface", () => { + const profile = createOutpostDeploymentProfileFixture() + profile.solana.programs[SolanaProgramName.liqsolCore].idlSha256 = + MismatchedInterfaceDigest + + expect(OutpostArtifactRegistry.candidates(profile)).toEqual([]) + expect(() => OutpostArtifactRegistry.resolve(profile)).toThrow( + "No registered artifact suite matches deployment profile" + ) + }) +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 421e7c3..99f38fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -197,11 +197,11 @@ importers: specifier: ^1.98.4 version: 1.98.4(bufferutil@4.1.0)(typescript@6.0.2)(utf-8-validate@6.0.6) '@wireio/outpost-ethereum-artifacts': - specifier: 0.2.2 - version: 0.2.2(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + specifier: 0.3.0 + version: 0.3.0(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) '@wireio/outpost-solana-artifacts': - specifier: 0.2.1 - version: 0.2.1 + specifier: 0.3.0 + version: 0.3.0 '@wireio/sdk-core': specifier: workspace:* version: link:../sdk-core @@ -1675,13 +1675,13 @@ packages: webpack-dev-server: optional: true - '@wireio/outpost-ethereum-artifacts@0.2.2': - resolution: {integrity: sha512-Gt1X09byNuuTCVJuAsj27Co+0WHUFo1W+p8fNfDYpKUfGKJA+hWoJDMpIiuYO5CoEf2OtlBH1kmSufY5Ej50pg==} + '@wireio/outpost-ethereum-artifacts@0.3.0': + resolution: {integrity: sha512-z//qpsX/OLOBBl/TRP854WbhZy79P/PuP2gfME7tN1kwChIoytrniXyVJ3tMvuMb9rvtjb5JuYfejG0lp5cEWA==} peerDependencies: ethers: ^6.15.0 - '@wireio/outpost-solana-artifacts@0.2.1': - resolution: {integrity: sha512-Q6aeQxXiwoXDifDwubswTy/qg2hTpElzQihNV5OwTX9HpBm1Y6/yKbpN5wNjk4RRbeuhm6X2Tfcu2MPu0mo5Uw==} + '@wireio/outpost-solana-artifacts@0.3.0': + resolution: {integrity: sha512-zAiH9cI5pp2gSKFTsQp9qqjvlAGL49XK+oZjjOeQ41SW9gwXXWatMc10GuvmwpolfBeRyrIqiTfP7s0W9fNjjw==} '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -5992,11 +5992,11 @@ snapshots: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.104.1) - '@wireio/outpost-ethereum-artifacts@0.2.2(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': + '@wireio/outpost-ethereum-artifacts@0.3.0(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': dependencies: ethers: 6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - '@wireio/outpost-solana-artifacts@0.2.1': {} + '@wireio/outpost-solana-artifacts@0.3.0': {} '@xtuc/ieee754@1.2.0': {} From b4cb1ec339f38996add62e5e5e29c79f746bd993 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Thu, 27 Aug 2026 16:10:33 -0400 Subject: [PATCH 46/48] fix(sdk-outpost): restore platform artifact links --- .pnpmfile.cjs | 26 +++++++++++++++++--------- CLAUDE.md | 2 +- README.md | 7 +++++++ pnpm-lock.yaml | 21 ++++++++++++++++++++- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index b2bca3e..cd810ee 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -4,9 +4,9 @@ * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. * * Usage: - * 1. Add packages you want to link to the `localOverrides` map below. - * 2. Run `pnpm install` — pnpm will use these local paths instead of the registry. - * 3. Comment out or remove entries to revert to registry versions. + * 1. Build the wire-sysio and outpost producer outputs in the sibling repos. + * 2. Run `pnpm install --lockfile=false` to consume available local outputs. + * 3. Remove the sibling outputs to exercise registry-only release resolution. * * Docs: https://pnpm.io/pnpmfile */ @@ -28,10 +28,7 @@ function isDirectory(dirPath) { } } -/** - * Map of package names to their local directory in wire-libraries-ts. - * Uncomment the entries you want to link locally. - */ +/** Map of locally available producer packages keyed by package name. */ const localOverrides = {} // AS THE PROTOBUF LIBS HAVE BEEN RELOCATED TO SYSIO @@ -43,15 +40,26 @@ const wireOPPPkgPaths = ["typescript", "solidity"].map(target => [ Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) ]) +const outpostArtifactPkgPaths = [ + [ + "@wireio/outpost-ethereum-artifacts", + Path.resolve(__dirname, "..", "wire-ethereum", "build", "sdk-artifacts") + ], + [ + "@wireio/outpost-solana-artifacts", + Path.resolve(__dirname, "..", "wire-solana", "build", "sdk-artifacts") + ] +] + wireOPPPkgPaths + .concat(outpostArtifactPkgPaths) .filter(([, path]) => isDirectory(path)) .forEach(([pkgName, path]) => { localOverrides[pkgName] = path }) /** - * `readPackage` hook, which links locally available versions of - * shared libraries and models. + * `readPackage` hook, which links locally available producer packages. * * @param pkg * @param context diff --git a/CLAUDE.md b/CLAUDE.md index 02f6d0f..6c8cb23 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -224,7 +224,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come directly from exact npm package versions owned by `wire-ethereum` and `wire-solana`; never regenerate them here or replace them with committed sibling links. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come from exact packages owned by `wire-ethereum` and `wire-solana`. In `wire-platform`, `.pnpmfile.cjs` must automatically link either sibling `build/sdk-artifacts` output when it exists, exactly like local OPP models; never commit `file:`/`link:` specs to package manifests or the lockfile. - Producer repositories assemble those npm packages from checksummed deployment handoffs. `sdk-outpost` never downloads the handoff or owns producer publication inputs. - `sdk-outpost` registers exact producer package pairs in an internal compile-time artifact-suite registry. Select suites from deployment-profile ABI/IDL identity and verify exact live runtime identity; never key suite selection by environment names or turn it into an endpoint catalog/runtime package loader. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. diff --git a/README.md b/README.md index 46d4ca2..1b7bd17 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,13 @@ inside this monorepo. An internal compile-time artifact-suite registry selects compatible producer bindings from caller-supplied deployment profiles without owning endpoints or environment configuration. +Within `wire-platform`, `.pnpmfile.cjs` automatically links producer packages +that exist at `wire-ethereum/build/sdk-artifacts` and +`wire-solana/build/sdk-artifacts`, matching the existing local OPP-model flow. +Run `pnpm install --lockfile=false` after building those sibling outputs. When +the outputs are absent, installs continue to resolve the exact registry versions +declared by `sdk-outpost`. + ## Examples | Example | Description | diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99f38fa..42fd600 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,11 +11,15 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-aSegbCvK5TyBUeMcgQLjFgZgcFmq1CMqHT+lQb93Qks= +pnpmfileChecksum: sha256-mxrSjOwdT44EmRkEFTQTvpgDBBE8DdZDz9xj3BNyMGE= importers: .: + dependencies: + '@wireio/opp-typescript-models': + specifier: ^1.0.26 + version: 1.0.48 devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -135,6 +139,9 @@ importers: '@noble/curves': specifier: 1.9.7 version: 1.9.7 + '@wireio/opp-typescript-models': + specifier: ^1.0.26 + version: 1.0.48 '@wireio/shared': specifier: workspace:* version: link:../shared @@ -1118,6 +1125,9 @@ packages: resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} engines: {node: ^14.18.0 || >=16.0.0} + '@protobuf-ts/runtime@2.11.1': + resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==} + '@reduxjs/toolkit@2.12.0': resolution: {integrity: sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==} peerDependencies: @@ -1675,6 +1685,9 @@ packages: webpack-dev-server: optional: true + '@wireio/opp-typescript-models@1.0.48': + resolution: {integrity: sha512-3HDC88AohYBBMuVdSqdI5tIRHPZWWTOaS+yQ/Xs1sCvhKuqlpF3KnYLcgIiXX3x6IC87dfo55xBfHPFcWpthmw==} + '@wireio/outpost-ethereum-artifacts@0.3.0': resolution: {integrity: sha512-z//qpsX/OLOBBl/TRP854WbhZy79P/PuP2gfME7tN1kwChIoytrniXyVJ3tMvuMb9rvtjb5JuYfejG0lp5cEWA==} peerDependencies: @@ -5336,6 +5349,8 @@ snapshots: '@pkgr/core@0.3.6': {} + '@protobuf-ts/runtime@2.11.1': {} + '@reduxjs/toolkit@2.12.0(react-redux@9.3.0(@types/react@19.2.17)(react@19.2.7)(redux@5.0.1))(react@19.2.7)': dependencies: '@standard-schema/spec': 1.1.0 @@ -5992,6 +6007,10 @@ snapshots: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.104.1) + '@wireio/opp-typescript-models@1.0.48': + dependencies: + '@protobuf-ts/runtime': 2.11.1 + '@wireio/outpost-ethereum-artifacts@0.3.0(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': dependencies: ethers: 6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) From 8b8f461bc5e3a5f4eb1ad7d48efef807258ea7a5 Mon Sep 17 00:00:00 2001 From: joshglogau Date: Fri, 28 Aug 2026 10:34:35 -0400 Subject: [PATCH 47/48] docs(sdk-outpost): narrow local link guidance --- .pnpmfile.cjs | 10 +++++----- CLAUDE.md | 2 +- README.md | 7 ------- packages/sdk-outpost/README.md | 4 ++++ pnpm-lock.yaml | 21 +-------------------- 5 files changed, 11 insertions(+), 33 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index cd810ee..9a12875 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -4,9 +4,9 @@ * pnpm hook to resolve @wireio packages from the local wire-libraries-ts monorepo. * * Usage: - * 1. Build the wire-sysio and outpost producer outputs in the sibling repos. - * 2. Run `pnpm install --lockfile=false` to consume available local outputs. - * 3. Remove the sibling outputs to exercise registry-only release resolution. + * 1. Build any supported sibling package outputs you want to use locally. + * 2. Run `pnpm install --lockfile=false` to consume available local packages. + * 3. Remove those outputs to resolve packages from the registry again. * * Docs: https://pnpm.io/pnpmfile */ @@ -28,7 +28,7 @@ function isDirectory(dirPath) { } } -/** Map of locally available producer packages keyed by package name. */ +/** Map of locally available packages keyed by package name. */ const localOverrides = {} // AS THE PROTOBUF LIBS HAVE BEEN RELOCATED TO SYSIO @@ -59,7 +59,7 @@ wireOPPPkgPaths }) /** - * `readPackage` hook, which links locally available producer packages. + * `readPackage` hook, which links locally available packages. * * @param pkg * @param context diff --git a/CLAUDE.md b/CLAUDE.md index 6c8cb23..5aa5f5c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -224,7 +224,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c - System-contract `prepare` prefers synchronous ABI encoding but must retain a typed `AnyAction` fallback so `APIClient` can resolve the deployed ABI. Never invent a default write authorization in the public SDK. - `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK. - `packages/sdk-core/src/contracts/sysio/uwrit` preserves raw request bytes and exposes `sourceRequestId` for swap correlation. External outpost ids are big-endian; synthetic WIRE queue ids are little-endian and high-bit tagged. -- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come from exact packages owned by `wire-ethereum` and `wire-solana`. In `wire-platform`, `.pnpmfile.cjs` must automatically link either sibling `build/sdk-artifacts` output when it exists, exactly like local OPP models; never commit `file:`/`link:` specs to package manifests or the lockfile. +- `packages/sdk-outpost` owns typed Ethereum/Solana clients and validates caller-supplied immutable deployment profiles. Canonical ABIs, IDLs, runtime templates, program binaries, ethers v6 factories, and Anchor types come from exact packages owned by `wire-ethereum` and `wire-solana`. For local platform development, the root pnpm hook links available sibling artifact outputs; never commit `file:`/`link:` specs to package manifests or the lockfile. - Producer repositories assemble those npm packages from checksummed deployment handoffs. `sdk-outpost` never downloads the handoff or owns producer publication inputs. - `sdk-outpost` registers exact producer package pairs in an internal compile-time artifact-suite registry. Select suites from deployment-profile ABI/IDL identity and verify exact live runtime identity; never key suite selection by environment names or turn it into an endpoint catalog/runtime package loader. - `OutpostClient.create` is sdk-outpost's only published client-construction facade. It delegates family selection to an internal factory; concrete Ethereum/Solana instance types remain available for typing, but their backend factories and module paths are not package entrypoints. diff --git a/README.md b/README.md index 1b7bd17..46d4ca2 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,6 @@ inside this monorepo. An internal compile-time artifact-suite registry selects compatible producer bindings from caller-supplied deployment profiles without owning endpoints or environment configuration. -Within `wire-platform`, `.pnpmfile.cjs` automatically links producer packages -that exist at `wire-ethereum/build/sdk-artifacts` and -`wire-solana/build/sdk-artifacts`, matching the existing local OPP-model flow. -Run `pnpm install --lockfile=false` after building those sibling outputs. When -the outputs are absent, installs continue to resolve the exact registry versions -declared by `sdk-outpost`. - ## Examples | Example | Description | diff --git a/packages/sdk-outpost/README.md b/packages/sdk-outpost/README.md index f455280..810f0ca 100644 --- a/packages/sdk-outpost/README.md +++ b/packages/sdk-outpost/README.md @@ -30,6 +30,10 @@ do not replace them with committed machine-local links. Node.js 22 or newer and ethers v6 are supported. The package publishes CommonJS and ES module entrypoints with TypeScript declarations. +For local `wire-platform` development, the repository pnpm hook links available +sibling artifact-package outputs automatically. Run `pnpm install --lockfile=false` +after building those outputs; otherwise the exact registry versions remain in use. + ## Supported surfaces | Family | Generated clients and workflows | diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42fd600..43ed7c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,15 +11,11 @@ overrides: '@aws-sdk/client-ssm': 3.1102.0 '@aws-sdk/client-sts': 3.1102.0 -pnpmfileChecksum: sha256-mxrSjOwdT44EmRkEFTQTvpgDBBE8DdZDz9xj3BNyMGE= +pnpmfileChecksum: sha256-8SxVsi62NYbViQ0DPEJl+ttUXrF7HLpNiC5CJ8NzUT4= importers: .: - dependencies: - '@wireio/opp-typescript-models': - specifier: ^1.0.26 - version: 1.0.48 devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -139,9 +135,6 @@ importers: '@noble/curves': specifier: 1.9.7 version: 1.9.7 - '@wireio/opp-typescript-models': - specifier: ^1.0.26 - version: 1.0.48 '@wireio/shared': specifier: workspace:* version: link:../shared @@ -1125,9 +1118,6 @@ packages: resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} engines: {node: ^14.18.0 || >=16.0.0} - '@protobuf-ts/runtime@2.11.1': - resolution: {integrity: sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==} - '@reduxjs/toolkit@2.12.0': resolution: {integrity: sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==} peerDependencies: @@ -1685,9 +1675,6 @@ packages: webpack-dev-server: optional: true - '@wireio/opp-typescript-models@1.0.48': - resolution: {integrity: sha512-3HDC88AohYBBMuVdSqdI5tIRHPZWWTOaS+yQ/Xs1sCvhKuqlpF3KnYLcgIiXX3x6IC87dfo55xBfHPFcWpthmw==} - '@wireio/outpost-ethereum-artifacts@0.3.0': resolution: {integrity: sha512-z//qpsX/OLOBBl/TRP854WbhZy79P/PuP2gfME7tN1kwChIoytrniXyVJ3tMvuMb9rvtjb5JuYfejG0lp5cEWA==} peerDependencies: @@ -5349,8 +5336,6 @@ snapshots: '@pkgr/core@0.3.6': {} - '@protobuf-ts/runtime@2.11.1': {} - '@reduxjs/toolkit@2.12.0(react-redux@9.3.0(@types/react@19.2.17)(react@19.2.7)(redux@5.0.1))(react@19.2.7)': dependencies: '@standard-schema/spec': 1.1.0 @@ -6007,10 +5992,6 @@ snapshots: webpack: 5.104.1(postcss@8.5.16)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.104.1) - '@wireio/opp-typescript-models@1.0.48': - dependencies: - '@protobuf-ts/runtime': 2.11.1 - '@wireio/outpost-ethereum-artifacts@0.3.0(ethers@6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': dependencies: ethers: 6.17.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) From d08bf13d097df8f0522509157e01a4ebc1291890 Mon Sep 17 00:00:00 2001 From: Jonathan Glanz Date: Fri, 28 Aug 2026 10:59:06 -0400 Subject: [PATCH 48/48] Don't add duplicate code paths whenever possible --- .pnpmfile.cjs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 9a12875..da93c60 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -35,24 +35,18 @@ const localOverrides = {} // WE CAN NOW USE THE MODELS WITHOUT ISSUE. // CIRCULAR DEP REMOVED -const wireOPPPkgPaths = ["typescript", "solidity"].map(target => [ - `@wireio/opp-${target}-models`, - Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) -]) - -const outpostArtifactPkgPaths = [ - [ - "@wireio/outpost-ethereum-artifacts", - Path.resolve(__dirname, "..", "wire-ethereum", "build", "sdk-artifacts") - ], - [ - "@wireio/outpost-solana-artifacts", - Path.resolve(__dirname, "..", "wire-solana", "build", "sdk-artifacts") - ] +const wirePkgPaths = [ + ...["typescript", "solidity"].map(target => [ + `@wireio/opp-${target}-models`, + Path.resolve(__dirname, "..", "wire-sysio", "build", "opp", target) + ]), + ...["ethereum","solana"].map(target => [ + `@wireio/outpost-${target}-artifacts`, + Path.resolve(__dirname, "..", `wire-${target}`, "build", "sdk-artifacts") + ]) ] -wireOPPPkgPaths - .concat(outpostArtifactPkgPaths) +wirePkgPaths .filter(([, path]) => isDirectory(path)) .forEach(([pkgName, path]) => { localOverrides[pkgName] = path