@skate-org/amm-core-v2 2.0.0-beta.1 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/adapter/skate.d.ts +15 -0
- package/dist/adapter/skate.d.ts.map +1 -1
- package/dist/deployment/_notDeployed.d.ts +5 -0
- package/dist/deployment/_notDeployed.d.ts.map +1 -0
- package/dist/deployment/aggregated/_type_.d.ts +10 -2
- package/dist/deployment/aggregated/_type_.d.ts.map +1 -1
- package/dist/deployment/aggregated/dev.d.ts.map +1 -1
- package/dist/deployment/aggregated/retrieval.d.ts.map +1 -1
- package/dist/deployment/index.d.ts +1 -0
- package/dist/deployment/index.d.ts.map +1 -1
- package/dist/deployment/kernel.d.ts.map +1 -1
- package/dist/deployment/periphery.d.ts.map +1 -1
- package/dist/deployment/svm.d.ts +56 -0
- package/dist/deployment/svm.d.ts.map +1 -0
- package/dist/index.cjs +67 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +63 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @skate-org/amm-core-v2
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.3 — 2026-05-18
|
|
4
|
+
|
|
5
|
+
Internal refactor: per-pool SVM addresses consolidated into one file.
|
|
6
|
+
No public type changes, no runtime data changes — `POOL_INFO_Dev` resolves
|
|
7
|
+
to the same object shape it did in beta.2.
|
|
8
|
+
|
|
9
|
+
- **`deployment/svm.ts` — new `SVM_POOLS_DEV` export:** map keyed by
|
|
10
|
+
`[poolKey][SvmChain]` (e.g. `SVM_POOLS_DEV.USDC_USDT[CHAIN.SOLANA]`)
|
|
11
|
+
carrying per-pool PDAs, vaults, mints, and token programs. Validated
|
|
12
|
+
at the declaration site via `satisfies Record<string, Partial<Record<
|
|
13
|
+
SvmChain, SvmPeripheryInfo>>>`. Additive, non-breaking — public surface
|
|
14
|
+
gains the export.
|
|
15
|
+
- **`deployment/aggregated/dev.ts` — thin composition:**
|
|
16
|
+
`POOL_INFO_Dev.USDC_USDT.peripheryInfo` now spreads
|
|
17
|
+
`...SVM_POOLS_DEV.USDC_USDT` instead of inlining the SOLANA literal.
|
|
18
|
+
Adding a new SVM chain entry to an existing pool (e.g. Eclipse once it
|
|
19
|
+
deploys) is a one-file edit in `svm.ts`.
|
|
20
|
+
- **`manager` field on `SvmPeripheryInfo`:** unchanged — duplication
|
|
21
|
+
against `SVM_DEPLOYMENT_DEV[chain].manager` is intentional and deferred
|
|
22
|
+
to a future PR; dedup would be a public-type change.
|
|
23
|
+
|
|
24
|
+
## 2.0.0-beta.2 — 2026-05-17
|
|
25
|
+
|
|
26
|
+
SVM-side periphery wired into the deployment catalog. Solana mainnet
|
|
27
|
+
(chain_id 901) goes from "no deployment yet" to LIVE in DEV.
|
|
28
|
+
|
|
29
|
+
- **`deployment/svm.ts` (new):** `SVM_DEPLOYMENT_DEV` table per
|
|
30
|
+
`SvmChain` carrying deploy-wide pubkeys — `periphery_pool` program,
|
|
31
|
+
`action_box` program, `action_box state_v3` PDA, `task_ledger` PDA,
|
|
32
|
+
manager — plus a `SvmDeploymentFor(chain, mode)` accessor that
|
|
33
|
+
mirrors the kernel/periphery `…For(chain, mode)` pattern. Solana
|
|
34
|
+
mainnet (chain_id 901) is populated; Eclipse still empty.
|
|
35
|
+
STAGING / PRODUCTION throw `SdkError("not yet deployed")`.
|
|
36
|
+
- **`SvmPeripheryInfo` extended:** now carries the per-pool PDAs
|
|
37
|
+
(`peripheryPool`, `poolAuthority`, `dust`, `poolToken0Vault`,
|
|
38
|
+
`poolToken1Vault`) plus `manager` so builders can populate
|
|
39
|
+
`accountsStrict({...})` from the catalog without keypair math at
|
|
40
|
+
call time. `tokenProgramId0/1` / `token0/1` / `chain` carry over
|
|
41
|
+
from beta.1. Additive type change (existing fields kept).
|
|
42
|
+
- **`POOL_INFO_Dev.USDC_USDT.peripheryInfo[CHAIN.SOLANA]`
|
|
43
|
+
populated** with the deployed `usdc-usdt-1bps` pool — PDAs and
|
|
44
|
+
vaults verified on-chain 2026-05-15 against the handover repo at
|
|
45
|
+
`/home/phil/works/handover/amm/solana_contracts/skate_amm/
|
|
46
|
+
config/pools.deployment.json`. Same kernel route as Arbitrum
|
|
47
|
+
periphery — Solana joins as an additional periphery for the same
|
|
48
|
+
kernel pool.
|
|
49
|
+
- **Retrieval helpers** now report SOLANA alongside ARBITRUM:
|
|
50
|
+
`getSupportedChains("DEV")` returns `[CHAIN.SOLANA, CHAIN.ARBITRUM]`,
|
|
51
|
+
`findTokensBySymbol("USDC")` finds both the Arbitrum USDC ERC-20 and
|
|
52
|
+
the Solana USDC mint. Unit tests updated accordingly.
|
|
53
|
+
- **`svmBytes32Base58ToEvmAddress(value)` (new export)** in
|
|
54
|
+
`adapter/skate.ts`. Composes `bytes32ToEvmAddress(base58ToBytes32(...))`
|
|
55
|
+
for the common case of decoding an SVM-stored EVM address
|
|
56
|
+
(`kernel_pool`, `kernel_factory`) back to its 0x-prefixed lowercase
|
|
57
|
+
form. Used by `@skate-org/amm-svm-v2`'s `readPeripheryPool`.
|
|
58
|
+
|
|
3
59
|
## 2.0.0-beta.1 — 2026-05-07
|
|
4
60
|
|
|
5
61
|
Two new token-lookup helpers in `deployment/aggregated/retrieval.ts`:
|
package/dist/adapter/skate.d.ts
CHANGED
|
@@ -5,6 +5,21 @@ export declare function hexToBase58(hexString: `0x${string}`): string;
|
|
|
5
5
|
export declare function bytes32ToBase58(hexStr: string): string;
|
|
6
6
|
export declare function evmAddressToBytes32(address: string): `0x${string}`;
|
|
7
7
|
export declare function bytes32ToEvmAddress(bytes32: string): `0x${string}`;
|
|
8
|
+
/**
|
|
9
|
+
* Decode the canonical SVM-side encoding of an EVM address back to its
|
|
10
|
+
* 0x-prefixed lowercase EVM form.
|
|
11
|
+
*
|
|
12
|
+
* SVM periphery contracts store cross-VM addresses (kernel pool, kernel
|
|
13
|
+
* factory, etc.) as base58 of the address left-padded to bytes32 — the
|
|
14
|
+
* "bytes32-base58" form produced at deploy time by
|
|
15
|
+
* `evmAddressToBytes32Base58`. SDK readers reverse it: base58-decode to
|
|
16
|
+
* 32 bytes, then truncate to the trailing 20-byte EVM address.
|
|
17
|
+
*
|
|
18
|
+
* Composition of two existing primitives, named for the common case so
|
|
19
|
+
* readers don't reinvent it. Any reader pulling an EVM address out of an
|
|
20
|
+
* SVM Anchor account should call this.
|
|
21
|
+
*/
|
|
22
|
+
export declare function svmBytes32Base58ToEvmAddress(value: string): `0x${string}`;
|
|
8
23
|
export declare function toBase58(buffer: Buffer): string;
|
|
9
24
|
export declare function bufferFromBase58(base58String: string): Buffer;
|
|
10
25
|
export declare function toBytes32Address(rawAddress: string, vmType: VM): `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skate.d.ts","sourceRoot":"","sources":["../../src/adapter/skate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAMhE;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAG5D;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAE5D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMtD;AAmBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAKlE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAIlE;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CA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+1,5 @@
|
|
|
1
|
+
import { EnvMode } from "../types";
|
|
2
|
+
/** Shared "not yet deployed" guard for STAGING / PRODUCTION accessors.
|
|
3
|
+
* `surface` distinguishes which side is missing (kernel / periphery / SVM). */
|
|
4
|
+
export declare function notDeployed(scope: string, mode: Exclude<EnvMode, "DEV">, surface?: string): never;
|
|
5
|
+
//# sourceMappingURL=_notDeployed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_notDeployed.d.ts","sourceRoot":"","sources":["../../src/deployment/_notDeployed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC;gFACgF;AAChF,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,EAC7B,OAAO,SAAW,GACjB,KAAK,CAKP"}
|
|
@@ -11,9 +11,17 @@ export interface EvmPeripheryInfo {
|
|
|
11
11
|
chain: string;
|
|
12
12
|
}
|
|
13
13
|
export interface SvmPeripheryInfo {
|
|
14
|
-
/** Periphery pool PDA (base58
|
|
14
|
+
/** Periphery pool state PDA (base58). */
|
|
15
15
|
peripheryPool: string;
|
|
16
|
-
/**
|
|
16
|
+
/** Pool-authority PDA (base58, signer-only — has no on-chain account). */
|
|
17
|
+
poolAuthority: string;
|
|
18
|
+
/** Dust PDA (base58). */
|
|
19
|
+
dust: string;
|
|
20
|
+
/** Pool token0 vault PDA (base58). */
|
|
21
|
+
poolToken0Vault: string;
|
|
22
|
+
/** Pool token1 vault PDA (base58). */
|
|
23
|
+
poolToken1Vault: string;
|
|
24
|
+
/** Periphery manager pubkey (base58). Matches the deploy-wide manager. */
|
|
17
25
|
manager: string;
|
|
18
26
|
/** SPL or Token-2022 program id for token0. */
|
|
19
27
|
tokenProgramId0: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_type_.d.ts","sourceRoot":"","sources":["../../../src/deployment/aggregated/_type_.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,
|
|
1
|
+
{"version":3,"file":"_type_.d.ts","sourceRoot":"","sources":["../../../src/deployment/aggregated/_type_.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,IAC1C,CAAC,SAAS,QAAQ,GAAG,gBAAgB,GACnC,CAAC,SAAS,QAAQ,GAAG,gBAAgB,GACrC,CAAC,SAAS,QAAQ,GAAG,gBAAgB,GACrC,KAAK,CAAC;AAEV,MAAM,MAAM,YAAY,GAAG,MAAM,CAC/B,OAAO,EACP;IACE,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE;SAAG,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC;KAAE,CAAC;CACvD,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/deployment/aggregated/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/deployment/aggregated/dev.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,aAAa,EAAE,YA4B3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieval.d.ts","sourceRoot":"","sources":["../../../src/deployment/aggregated/retrieval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEjD,wBAAgB,cAAc,CAAC,IAAI,GAAE,OAAsB,GAAG,YAAY,CAMzE;AAED,wBAAgB,cAAc,CAAC,IAAI,GAAE,OAAsB,GAAG,OAAO,EAAE,CAEtE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,OAAsB;;;;;
|
|
1
|
+
{"version":3,"file":"retrieval.d.ts","sourceRoot":"","sources":["../../../src/deployment/aggregated/retrieval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEjD,wBAAgB,cAAc,CAAC,IAAI,GAAE,OAAsB,GAAG,YAAY,CAMzE;AAED,wBAAgB,cAAc,CAAC,IAAI,GAAE,OAAsB,GAAG,OAAO,EAAE,CAEtE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,OAAsB;;;;;iCAkClB,CAAA;SAhCxD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,OAAsB,GAAG,KAAK,EAAE,CASxE;AAED,wBAAgB,iBAAiB,CA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a,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployment/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/deployment/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAkBjC,eAAO,MAAM,yBAAyB,+CAA+C,CAAC;AAoBtF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAIjE,CAAC;AAEF,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,CAEhD;
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/deployment/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAkBjC,eAAO,MAAM,yBAAyB,+CAA+C,CAAC;AAoBtF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAIjE,CAAC;AAEF,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,MAAM,EAAE,CAGjE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,MAAM,EAAE,CAGtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"periphery.d.ts","sourceRoot":"","sources":["../../src/deployment/periphery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAO1C,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;IAChC,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;IAChC,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,KAAK,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAWrE,CAAC;
|
|
1
|
+
{"version":3,"file":"periphery.d.ts","sourceRoot":"","sources":["../../src/deployment/periphery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAO1C,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;IAChC,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,KAAK,MAAM,EAAE,CAAC;IAChC,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,KAAK,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAWrE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,GACZ,mBAAmB,GAAG,IAAI,CAG5B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,GACZ,KAAK,MAAM,EAAE,GAAG,IAAI,CAEtB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,GACZ,KAAK,MAAM,EAAE,GAAG,IAAI,CAEtB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,GACZ,KAAK,MAAM,EAAE,GAAG,IAAI,CAEtB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,GACZ,KAAK,MAAM,EAAE,GAAG,IAAI,CAEtB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CHAIN, EnvMode } from "../types";
|
|
2
|
+
import type { SvmChain } from "../types/chain-vm";
|
|
3
|
+
/** Deploy-wide SVM pubkeys. Per-pool addresses live in `SVM_POOLS_<mode>`
|
|
4
|
+
* below; this struct holds the deploy-wide pieces shared across pools. */
|
|
5
|
+
export interface SvmDeployment {
|
|
6
|
+
peripheryPoolProgramId: string;
|
|
7
|
+
actionBoxProgramId: string;
|
|
8
|
+
/** `action_box state_v3` PDA. One per deploy. */
|
|
9
|
+
actionBoxStateV3: string;
|
|
10
|
+
/** `task_ledger` PDA (replay bitmap). */
|
|
11
|
+
taskLedger: string;
|
|
12
|
+
/** Manager pubkey — also serves as gateway and task-ledger admin. */
|
|
13
|
+
manager: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const SVM_DEPLOYMENT_DEV: Partial<Record<SvmChain, SvmDeployment>>;
|
|
16
|
+
/** Returns `null` for an unregistered SvmChain in DEV; throws for
|
|
17
|
+
* STAGING/PRODUCTION (no SVM deploy yet). */
|
|
18
|
+
export declare function SvmDeploymentFor(chain: SvmChain, mode: EnvMode): SvmDeployment | null;
|
|
19
|
+
/** Per-pool SVM addresses, keyed by `[poolKey][SvmChain]`. `poolKey` matches
|
|
20
|
+
* the key used by `POOL_INFO_Dev` (e.g. "USDC_USDT").
|
|
21
|
+
* - Adding a new SVM chain entry to an existing pool (e.g. Eclipse under
|
|
22
|
+
* USDC_USDT) requires editing this map only — `aggregated/dev.ts` picks
|
|
23
|
+
* it up automatically via the existing spread.
|
|
24
|
+
* - Adding a brand-new pool requires a new key here AND a new pool object
|
|
25
|
+
* in `aggregated/dev.ts` with `...SVM_POOLS_DEV.<key>` in its
|
|
26
|
+
* `peripheryInfo`. */
|
|
27
|
+
export declare const SVM_POOLS_DEV: {
|
|
28
|
+
USDC_USDT: {
|
|
29
|
+
901: {
|
|
30
|
+
peripheryPool: string;
|
|
31
|
+
poolAuthority: string;
|
|
32
|
+
dust: string;
|
|
33
|
+
poolToken0Vault: string;
|
|
34
|
+
poolToken1Vault: string;
|
|
35
|
+
manager: string;
|
|
36
|
+
tokenProgramId0: string;
|
|
37
|
+
tokenProgramId1: string;
|
|
38
|
+
token0: {
|
|
39
|
+
address: string;
|
|
40
|
+
symbol: string;
|
|
41
|
+
isNative: false;
|
|
42
|
+
decimal: number;
|
|
43
|
+
chainId: CHAIN.SOLANA;
|
|
44
|
+
};
|
|
45
|
+
token1: {
|
|
46
|
+
address: string;
|
|
47
|
+
symbol: string;
|
|
48
|
+
isNative: false;
|
|
49
|
+
decimal: number;
|
|
50
|
+
chainId: CHAIN.SOLANA;
|
|
51
|
+
};
|
|
52
|
+
chain: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=svm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svm.d.ts","sourceRoot":"","sources":["../../src/deployment/svm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD;2EAC2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAQvE,CAAC;AAEF;8CAC8C;AAC9C,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,OAAO,GACZ,aAAa,GAAG,IAAI,CAGtB;AAKD;;;;;;;yBAOyB;AACzB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B6C,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -42,8 +42,11 @@ __export(index_exports, {
|
|
|
42
42
|
PeripheryDeploymentFor: () => PeripheryDeploymentFor,
|
|
43
43
|
PeripheryEventEmitterAddress: () => PeripheryEventEmitterAddress,
|
|
44
44
|
PeripheryManagerAddress: () => PeripheryManagerAddress,
|
|
45
|
+
SVM_DEPLOYMENT_DEV: () => SVM_DEPLOYMENT_DEV,
|
|
46
|
+
SVM_POOLS_DEV: () => SVM_POOLS_DEV,
|
|
45
47
|
SdkError: () => SdkError,
|
|
46
48
|
SkateGatewayAddress: () => SkateGatewayAddress,
|
|
49
|
+
SvmDeploymentFor: () => SvmDeploymentFor,
|
|
47
50
|
TaskPhase: () => TaskPhase,
|
|
48
51
|
VM: () => VM,
|
|
49
52
|
addDelta: () => addDelta,
|
|
@@ -81,6 +84,7 @@ __export(index_exports, {
|
|
|
81
84
|
mulDivRoundingUp: () => mulDivRoundingUp,
|
|
82
85
|
normalizeMode: () => normalizeMode,
|
|
83
86
|
skateAdapter: () => skate_exports,
|
|
87
|
+
svmBytes32Base58ToEvmAddress: () => svmBytes32Base58ToEvmAddress,
|
|
84
88
|
toBase58: () => toBase58,
|
|
85
89
|
toBytes32Address: () => toBytes32Address,
|
|
86
90
|
vmTypeFromChain: () => vmTypeFromChain
|
|
@@ -230,6 +234,13 @@ var SdkError = class extends Error {
|
|
|
230
234
|
}
|
|
231
235
|
};
|
|
232
236
|
|
|
237
|
+
// src/deployment/_notDeployed.ts
|
|
238
|
+
function notDeployed(scope, mode, surface = "SDK v2") {
|
|
239
|
+
throw new SdkError(
|
|
240
|
+
`${scope}: ${surface} is not yet deployed to ${mode}; only DEV is wired today. Either pass mode="DEV" or wait for the v2 service to ship to ${mode}.`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
233
244
|
// src/deployment/kernel.ts
|
|
234
245
|
var KERNEL_MANAGER_Dev = "0x17B7207837e8884f7f687f1f4057751BDAf70a01";
|
|
235
246
|
var KERNEL_EVENT_EMITTER_Dev = "0x8989b3ecb65f250ab7A0DC03589B0Cc8b8b04b81";
|
|
@@ -242,11 +253,6 @@ var KERNEL_CHAIN_BY_MODE = {
|
|
|
242
253
|
function KernelChain(mode) {
|
|
243
254
|
return KERNEL_CHAIN_BY_MODE[mode];
|
|
244
255
|
}
|
|
245
|
-
function notDeployed(scope, mode) {
|
|
246
|
-
throw new SdkError(
|
|
247
|
-
`${scope}: SDK v2 is not yet deployed to ${mode}; only DEV is wired today. Either pass mode="DEV" or wait for the v2 service to ship to ${mode}.`
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
256
|
function KernelManagerAddress(mode) {
|
|
251
257
|
if (mode === "DEV") return KERNEL_MANAGER_Dev;
|
|
252
258
|
return notDeployed("KernelManagerAddress", mode);
|
|
@@ -269,13 +275,8 @@ var PERIPHERY_DEV = {
|
|
|
269
275
|
peripheryPoolImpl: "0x803ed7fa8934D4fe51A276cA02506b585cdb3eb4"
|
|
270
276
|
}
|
|
271
277
|
};
|
|
272
|
-
function notDeployed2(scope, mode) {
|
|
273
|
-
throw new SdkError(
|
|
274
|
-
`${scope}: SDK v2 is not yet deployed to ${mode}; only DEV is wired today. Either pass mode="DEV" or wait for the v2 service to ship to ${mode}.`
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
278
|
function PeripheryDeploymentFor(chain, mode) {
|
|
278
|
-
if (mode !== "DEV") return
|
|
279
|
+
if (mode !== "DEV") return notDeployed("PeripheryDeploymentFor", mode);
|
|
279
280
|
return PERIPHERY_DEV[chain] ?? null;
|
|
280
281
|
}
|
|
281
282
|
function PeripheryManagerAddress(chain, mode) {
|
|
@@ -291,6 +292,51 @@ function ActionBoxAddress(chain, mode) {
|
|
|
291
292
|
return PeripheryDeploymentFor(chain, mode)?.actionBox ?? null;
|
|
292
293
|
}
|
|
293
294
|
|
|
295
|
+
// src/deployment/svm.ts
|
|
296
|
+
var SVM_DEPLOYMENT_DEV = {
|
|
297
|
+
[901 /* SOLANA */]: {
|
|
298
|
+
peripheryPoolProgramId: "SPPZB76TV1oSusXvGYQDK7KZGyLBmWbr8CuzNcjb98y",
|
|
299
|
+
actionBoxProgramId: "SABZ2zgj8G8jD7V9s6hSMkT1fvNyMavssNigmmTMqa2",
|
|
300
|
+
actionBoxStateV3: "G1qLtJDbkY4JBtD7sdjqGN8GJ38QRDbzp2fWEYY4apAh",
|
|
301
|
+
taskLedger: "SkTLHEfy9X3PeMVa2dEYysg9Ccq8KtNG7zYNTAaB1NV",
|
|
302
|
+
manager: "SGMSTk5t2gmiHKQjtb9XV6qviasgD5UKTsVMHLGCSZA"
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
function SvmDeploymentFor(chain, mode) {
|
|
306
|
+
if (mode !== "DEV") return notDeployed("SvmDeploymentFor", mode, "SDK v2 SVM side");
|
|
307
|
+
return SVM_DEPLOYMENT_DEV[chain] ?? null;
|
|
308
|
+
}
|
|
309
|
+
var TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
310
|
+
var SVM_POOLS_DEV = {
|
|
311
|
+
USDC_USDT: {
|
|
312
|
+
[901 /* SOLANA */]: {
|
|
313
|
+
peripheryPool: "G2j8vLu3ryzUqPYpknpBcBLDcFiiRmXtB7z9Dpg9dVxe",
|
|
314
|
+
poolAuthority: "2Mvbo1TrsVeqyjQwNcdDDGjFNbwMk4tV8oD2TN2fV4Nw",
|
|
315
|
+
dust: "4m1AdUZvYJUSMTYpFH8df1JrgHTqUeKA3Xf7DapB4VcX",
|
|
316
|
+
poolToken0Vault: "BihGfVYmaT4KpiHiBLwH2ad9Q2ybYVHS2Bd3hQtzg486",
|
|
317
|
+
poolToken1Vault: "3DW4k4ims6dFB2cXBk5m1uAfh1zowuj9CzBbF4jm1FRh",
|
|
318
|
+
manager: "SGMSTk5t2gmiHKQjtb9XV6qviasgD5UKTsVMHLGCSZA",
|
|
319
|
+
tokenProgramId0: TOKEN_PROGRAM_ID,
|
|
320
|
+
tokenProgramId1: TOKEN_PROGRAM_ID,
|
|
321
|
+
token0: {
|
|
322
|
+
address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
|
|
323
|
+
symbol: "USDC",
|
|
324
|
+
isNative: false,
|
|
325
|
+
decimal: 6,
|
|
326
|
+
chainId: 901 /* SOLANA */
|
|
327
|
+
},
|
|
328
|
+
token1: {
|
|
329
|
+
address: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
|
|
330
|
+
symbol: "USDT",
|
|
331
|
+
isNative: false,
|
|
332
|
+
decimal: 6,
|
|
333
|
+
chainId: 901 /* SOLANA */
|
|
334
|
+
},
|
|
335
|
+
chain: "SOLANA"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
294
340
|
// src/deployment/aggregated/dev.ts
|
|
295
341
|
var POOL_INFO_Dev = {
|
|
296
342
|
USDC_USDT: {
|
|
@@ -316,7 +362,8 @@ var POOL_INFO_Dev = {
|
|
|
316
362
|
},
|
|
317
363
|
address: "0x0433CCB013a590eA4231aAC9ddf05bb753c14127",
|
|
318
364
|
chain: "ARBITRUM"
|
|
319
|
-
}
|
|
365
|
+
},
|
|
366
|
+
...SVM_POOLS_DEV.USDC_USDT
|
|
320
367
|
}
|
|
321
368
|
}
|
|
322
369
|
};
|
|
@@ -448,6 +495,7 @@ __export(skate_exports, {
|
|
|
448
495
|
evmAddressToBytes32: () => evmAddressToBytes32,
|
|
449
496
|
fromBytes32Address: () => fromBytes32Address,
|
|
450
497
|
hexToBase58: () => hexToBase58,
|
|
498
|
+
svmBytes32Base58ToEvmAddress: () => svmBytes32Base58ToEvmAddress,
|
|
451
499
|
toBase58: () => toBase58,
|
|
452
500
|
toBytes32Address: () => toBytes32Address
|
|
453
501
|
});
|
|
@@ -582,6 +630,9 @@ function bytes32ToEvmAddress(bytes32) {
|
|
|
582
630
|
const addressBigInt = userBigInt & BigInt("0xffffffffffffffffffffffffffffffffffffffff");
|
|
583
631
|
return `0x${addressBigInt.toString(16).padStart(40, "0")}`.toLowerCase();
|
|
584
632
|
}
|
|
633
|
+
function svmBytes32Base58ToEvmAddress(value) {
|
|
634
|
+
return bytes32ToEvmAddress(base58ToBytes32(value));
|
|
635
|
+
}
|
|
585
636
|
function toBase58(buffer) {
|
|
586
637
|
return bs58Encode(buffer);
|
|
587
638
|
}
|
|
@@ -985,8 +1036,11 @@ function addDelta(x, y) {
|
|
|
985
1036
|
PeripheryDeploymentFor,
|
|
986
1037
|
PeripheryEventEmitterAddress,
|
|
987
1038
|
PeripheryManagerAddress,
|
|
1039
|
+
SVM_DEPLOYMENT_DEV,
|
|
1040
|
+
SVM_POOLS_DEV,
|
|
988
1041
|
SdkError,
|
|
989
1042
|
SkateGatewayAddress,
|
|
1043
|
+
SvmDeploymentFor,
|
|
990
1044
|
TaskPhase,
|
|
991
1045
|
VM,
|
|
992
1046
|
addDelta,
|
|
@@ -1024,6 +1078,7 @@ function addDelta(x, y) {
|
|
|
1024
1078
|
mulDivRoundingUp,
|
|
1025
1079
|
normalizeMode,
|
|
1026
1080
|
skateAdapter,
|
|
1081
|
+
svmBytes32Base58ToEvmAddress,
|
|
1027
1082
|
toBase58,
|
|
1028
1083
|
toBytes32Address,
|
|
1029
1084
|
vmTypeFromChain
|