@interest-protocol/blast-migrators-sdk 0.0.0-stage → 0.1.1

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/README.md CHANGED
@@ -1,3 +1,9 @@
1
- # Temporary Holding Version
1
+ # @interest-protocol/blast-migrators-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The migrators package in the [Blast SDK monorepo](https://github.com/interest-protocol/blast-v2-sdk).
4
+
5
+ ```sh
6
+ npm install @interest-protocol/blast-migrators-sdk
7
+ ```
8
+
9
+ See the repository README and docs for usage, development, and release guidance.
@@ -0,0 +1,57 @@
1
+ import type { SharedObjectReference } from "@interest-protocol/blast-core/sui";
2
+ import type { LaunchTypes } from "@interest-protocol/blast-launchpad-sdk/transactions";
3
+ import type { Transaction, TransactionObjectArgument, TransactionObjectInput } from "@mysten/sui/transactions";
4
+ /** Bluefin's pool metadata; amounts and prices always use atomic coin units. */
5
+ export type BluefinCoinMetadata = {
6
+ symbol: string;
7
+ decimals: number;
8
+ iconUrl?: string;
9
+ };
10
+ export type BluefinPoolCreation = LaunchTypes & {
11
+ /** Runtime package and config from the deployment's Bluefin venue identities. */
12
+ bluefinPackageId: string;
13
+ bluefinConfig: SharedObjectReference<true>;
14
+ memeMetadata: BluefinCoinMetadata;
15
+ quoteMetadata: BluefinCoinMetadata;
16
+ /** Optional pool NFT icon. The name is `<Meme symbol>-<Quote symbol>`. */
17
+ iconUrl?: string;
18
+ tickSpacing: number;
19
+ /** Bluefin fee units: 1,000,000 is 100%. */
20
+ feeRate: bigint;
21
+ /** Q64.64 square root of Quote atoms per Meme atom. */
22
+ sqrtPriceX64: bigint;
23
+ /** SUI atoms (MIST), read from the current config; never assumed zero. */
24
+ creationFee: bigint;
25
+ /** Signed ticks, aligned to tickSpacing; encoded as i32 two's-complement bits. */
26
+ lowerTick: number;
27
+ upperTick: number;
28
+ /** Coins consumed; their balances bound each side's maximum contribution. */
29
+ memeCoin: TransactionObjectInput;
30
+ quoteCoin: TransactionObjectInput;
31
+ /** Atomic amount on the fixed side. Bluefin calculates the other side. */
32
+ fixedAmount: bigint;
33
+ fixedMeme: boolean;
34
+ };
35
+ export type BluefinPoolCreationResult = {
36
+ /** Fresh owned Pool<Meme, Quote>. Call shareBluefinPool after composing. */
37
+ pool: TransactionObjectArgument;
38
+ /** Position to pass to PresaleCalls.newBluefinVault, or transfer to its owner. */
39
+ position: TransactionObjectArgument;
40
+ /** Residual coins, including zero coins; callers must consume or transfer both. */
41
+ memeResidual: TransactionObjectArgument;
42
+ quoteResidual: TransactionObjectArgument;
43
+ };
44
+ /**
45
+ * Creates Pool<Meme, Quote>, opens a position, and adds fixed-side liquidity.
46
+ * Mirrors the pinned Bluefin Spot interface (91ce930). No presale is needed.
47
+ * The fresh pool remains usable in this PTB, e.g. by newBluefinVault; the
48
+ * caller must then share it, consume the position, and handle both residuals.
49
+ * The input coins cap spending; Bluefin aborts if the other side is too small.
50
+ */
51
+ export declare function addBluefinPoolWithLiquidity(tx: Transaction, options: BluefinPoolCreation): BluefinPoolCreationResult;
52
+ /** Shares a fresh Bluefin pool after all calls that borrow it in this PTB. */
53
+ export declare function shareBluefinPool(tx: Transaction, options: LaunchTypes & {
54
+ bluefinPackageId: string;
55
+ pool: TransactionObjectInput;
56
+ }): void;
57
+ //# sourceMappingURL=bluefin-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bluefin-pool.d.ts","sourceRoot":"","sources":["../src/bluefin-pool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAEvF,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAGlC,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG;IAChC,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IACzB,IAAI,EAAE,sBAAsB,CAAC;CAC9B,GACA,IAAI,CAON"}
@@ -0,0 +1,102 @@
1
+ import { requireU64 } from "@interest-protocol/blast-core/integers";
2
+ import { moveResults } from "@interest-protocol/blast-core/ptb";
3
+ import { normalizeSharedObjectReference } from "@interest-protocol/blast-core/sui";
4
+ import { normalizeLaunchTypes } from "@interest-protocol/blast-launchpad-sdk/transactions";
5
+ import { normalizeSuiAddress, SUI_TYPE_ARG } from "@mysten/sui/utils";
6
+ /**
7
+ * Creates Pool<Meme, Quote>, opens a position, and adds fixed-side liquidity.
8
+ * Mirrors the pinned Bluefin Spot interface (91ce930). No presale is needed.
9
+ * The fresh pool remains usable in this PTB, e.g. by newBluefinVault; the
10
+ * caller must then share it, consume the position, and handle both residuals.
11
+ * The input coins cap spending; Bluefin aborts if the other side is too small.
12
+ */
13
+ export function addBluefinPoolWithLiquidity(tx, options) {
14
+ const types = normalizeLaunchTypes(options);
15
+ const typeArguments = [types.memeType, types.quoteType];
16
+ const target = (name) => `${normalizeSuiAddress(options.bluefinPackageId)}::pool::${name}`;
17
+ const config = tx.sharedObjectRef(normalizeSharedObjectReference("bluefinConfig", options.bluefinConfig, true));
18
+ const bytes = (value) => tx.pure.vector("u8", new TextEncoder().encode(value));
19
+ const balance = (coin, type) => tx.moveCall({
20
+ target: "0x2::coin::into_balance",
21
+ typeArguments: [type],
22
+ arguments: [tx.object(coin)],
23
+ });
24
+ const creationFee = requireU64("creationFee", options.creationFee);
25
+ const fee = creationFee === 0n
26
+ ? tx.moveCall({
27
+ target: "0x2::balance::zero",
28
+ typeArguments: [SUI_TYPE_ARG],
29
+ })
30
+ : balance(tx.coin({ type: SUI_TYPE_ARG, balance: creationFee }), SUI_TYPE_ARG);
31
+ const pool = tx.moveCall({
32
+ target: target("create_pool_and_get_object"),
33
+ typeArguments: [...typeArguments, SUI_TYPE_ARG],
34
+ arguments: [
35
+ tx.object.clock(),
36
+ config,
37
+ bytes(`${options.memeMetadata.symbol}-${options.quoteMetadata.symbol}`),
38
+ bytes(options.iconUrl ?? ""),
39
+ bytes(options.memeMetadata.symbol),
40
+ tx.pure.u8(options.memeMetadata.decimals),
41
+ bytes(options.memeMetadata.iconUrl ?? ""),
42
+ bytes(options.quoteMetadata.symbol),
43
+ tx.pure.u8(options.quoteMetadata.decimals),
44
+ bytes(options.quoteMetadata.iconUrl ?? ""),
45
+ tx.pure.u32(options.tickSpacing),
46
+ tx.pure.u64(options.feeRate),
47
+ tx.pure.u128(options.sqrtPriceX64),
48
+ fee,
49
+ ],
50
+ });
51
+ const position = tx.moveCall({
52
+ target: target("open_position"),
53
+ typeArguments,
54
+ arguments: [
55
+ config,
56
+ pool,
57
+ tx.pure.u32(tickBits(options.lowerTick)),
58
+ tx.pure.u32(tickBits(options.upperTick)),
59
+ ],
60
+ });
61
+ const [, , memeResidual, quoteResidual] = moveResults(tx.moveCall({
62
+ target: target("add_liquidity_with_fixed_amount"),
63
+ typeArguments,
64
+ arguments: [
65
+ tx.object.clock(),
66
+ config,
67
+ pool,
68
+ position,
69
+ balance(options.memeCoin, types.memeType),
70
+ balance(options.quoteCoin, types.quoteType),
71
+ tx.pure.u64(options.fixedAmount),
72
+ tx.pure.bool(options.fixedMeme),
73
+ ],
74
+ }), 4);
75
+ const coin = (residual, type) => tx.moveCall({
76
+ target: "0x2::coin::from_balance",
77
+ typeArguments: [type],
78
+ arguments: [residual],
79
+ });
80
+ return {
81
+ pool,
82
+ position,
83
+ memeResidual: coin(memeResidual, types.memeType),
84
+ quoteResidual: coin(quoteResidual, types.quoteType),
85
+ };
86
+ }
87
+ /** Shares a fresh Bluefin pool after all calls that borrow it in this PTB. */
88
+ export function shareBluefinPool(tx, options) {
89
+ const { memeType, quoteType } = normalizeLaunchTypes(options);
90
+ tx.moveCall({
91
+ target: `${normalizeSuiAddress(options.bluefinPackageId)}::pool::share_pool_object`,
92
+ typeArguments: [memeType, quoteType],
93
+ arguments: [tx.object(options.pool)],
94
+ });
95
+ }
96
+ function tickBits(tick) {
97
+ if (!Number.isInteger(tick) || tick < -(2 ** 31) || tick > 2 ** 31 - 1) {
98
+ throw new RangeError("tick must be an i32");
99
+ }
100
+ return tick >>> 0;
101
+ }
102
+ //# sourceMappingURL=bluefin-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bluefin-pool.js","sourceRoot":"","sources":["../src/bluefin-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AAEnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAM3F,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA6CtE;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,EAAe,EACf,OAA4B;IAE5B,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,aAAa,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAC9B,GAAG,mBAAmB,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,IAAI,EAAE,CAAC;IACpE,MAAM,MAAM,GAAG,EAAE,CAAC,eAAe,CAC/B,8BAA8B,CAC5B,eAAe,EACf,OAAO,CAAC,aAAa,EACrB,IAAI,CACL,CACF,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9B,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,CAAC,IAA4B,EAAE,IAAY,EAAE,EAAE,CAC7D,EAAE,CAAC,Q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AAC,QAAmC,EAAE,IAAY,EAAE,EAAE,CACjE,EAAE,CAAC,QAAQ,CAAC;QACV,MAAM,EAAE,yBAAyB;QACjC,aAAa,EAAE,CAAC,IAAI,CAAC;QACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;KACtB,CAAC,CAAC;IACL,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC;QAChD,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;KACpD,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,gBAAgB,CAC9B,EAAe,EACf,OAGC;IAED,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9D,EAAE,CAAC,QAAQ,CAAC;QACV,MAAM,EAAE,GAAG,mBAAmB,CAAC,OAAO,CAAC,gBAAgB,CAAC,2BAA2B;QACnF,aAAa,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;QACpC,SAAS,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { SharedObjectReference } from "@interest-protocol/blast-core/sui";
2
+ import type { LaunchTypes } from "@interest-protocol/blast-launchpad-sdk/transactions";
3
+ import type { Transaction, TransactionObjectArgument, TransactionObjectInput } from "@mysten/sui/transactions";
4
+ export type CetusPoolCreation = LaunchTypes & {
5
+ /** Runtime package and shared objects from the deployment's Cetus identities. */
6
+ cetusPackageId: string;
7
+ cetusConfig: SharedObjectReference<false>;
8
+ cetusPools: SharedObjectReference<true>;
9
+ tickSpacing: number;
10
+ /** Q64.64 square root of coin B atoms per coin A atom, in Cetus coin order. */
11
+ sqrtPriceX64: bigint;
12
+ /** Pool/position metadata URL; empty by default. */
13
+ url?: string;
14
+ /** Signed ticks aligned to tickSpacing, encoded as i32 two's-complement bits. */
15
+ lowerTick: number;
16
+ upperTick: number;
17
+ /**
18
+ * Coins consumed. The fixed side uses this coin's entire balance; the other
19
+ * coin caps the maximum contribution. Split exact input coins beforehand.
20
+ */
21
+ memeCoin: TransactionObjectInput;
22
+ quoteCoin: TransactionObjectInput;
23
+ fixedMeme: boolean;
24
+ /** Required only for a pair/tier already reserved by this Cetus creation cap. */
25
+ poolCreationCap?: TransactionObjectInput;
26
+ };
27
+ export type CetusPoolCreationResult = {
28
+ /** Transfer to its owner; newCetusVault can consume it in the next PTB. */
29
+ position: TransactionObjectArgument;
30
+ /** Residual Coins, including zero coins; consume or transfer both. */
31
+ memeResidual: TransactionObjectArgument;
32
+ quoteResidual: TransactionObjectArgument;
33
+ };
34
+ /**
35
+ * Creates and seeds a Cetus pool through the revision-15 pool_creator v3 API.
36
+ * Coin types, input coins, fixed side and residuals follow cetusMemeSide.
37
+ * Cetus shares the pool internally; its public API returns no pool handle.
38
+ * Execute this PTB, read the shared pool/position IDs, then call newCetusVault
39
+ * in a later PTB. No presale or TreasuryCap is needed for an unreserved pair.
40
+ * ABI: CetusProtocol/cetus-contracts ddfbdeba, pool_creator.move and factory.move;
41
+ * runtime package 0x260693ec785a6e6c9d81d58c7d2ff72f1288ae0fa6a9725abe05a6478b11f084.
42
+ */
43
+ export declare function addCetusPoolWithLiquidity(tx: Transaction, options: CetusPoolCreation): CetusPoolCreationResult;
44
+ //# sourceMappingURL=cetus-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cetus-pool.d.ts","sourceRoot":"","sources":["../src/cetus-pool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAEvF,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,iFAAiF;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC1C,UAAU,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,EAAE,sBAAsB,CAAC;IACjC,SAAS,EAAE,sBAAsB,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,2EAA2E;IAC3E,QAAQ,EAAE,yBAAyB,CAAC;IACpC,sEAAsE;IACtE,YAAY,EAAE,yBAAyB,CAAC;IACxC,aAAa,EAAE,yBAAyB,CAAC;CAC1C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,iBAAiB,GACzB,uBAAuB,CAyCzB"}
@@ -0,0 +1,57 @@
1
+ import { cetusMemeSide } from "@interest-protocol/blast-core/cetus";
2
+ import { grossGasBudget } from "@interest-protocol/blast-core/gas";
3
+ import { moveResults } from "@interest-protocol/blast-core/ptb";
4
+ import { normalizeSharedObjectReference } from "@interest-protocol/blast-core/sui";
5
+ import { normalizeLaunchTypes } from "@interest-protocol/blast-launchpad-sdk/transactions";
6
+ import { normalizeSuiAddress } from "@mysten/sui/utils";
7
+ /**
8
+ * Creates and seeds a Cetus pool through the revision-15 pool_creator v3 API.
9
+ * Coin types, input coins, fixed side and residuals follow cetusMemeSide.
10
+ * Cetus shares the pool internally; its public API returns no pool handle.
11
+ * Execute this PTB, read the shared pool/position IDs, then call newCetusVault
12
+ * in a later PTB. No presale or TreasuryCap is needed for an unreserved pair.
13
+ * ABI: CetusProtocol/cetus-contracts ddfbdeba, pool_creator.move and factory.move;
14
+ * runtime package 0x260693ec785a6e6c9d81d58c7d2ff72f1288ae0fa6a9725abe05a6478b11f084.
15
+ */
16
+ export function addCetusPoolWithLiquidity(tx, options) {
17
+ const { memeType, quoteType } = normalizeLaunchTypes(options);
18
+ const memeIsA = cetusMemeSide(memeType, quoteType) === "a";
19
+ const typeArguments = memeIsA ? [memeType, quoteType] : [quoteType, memeType];
20
+ const lowerTick = tickBits(options.lowerTick);
21
+ const upperTick = tickBits(options.upperTick);
22
+ const config = tx.sharedObjectRef(normalizeSharedObjectReference("cetusConfig", options.cetusConfig, false));
23
+ const pools = tx.sharedObjectRef(normalizeSharedObjectReference("cetusPools", options.cetusPools, true));
24
+ tx.addBuildPlugin(grossGasBudget());
25
+ const [position, residualA, residualB] = moveResults(tx.moveCall({
26
+ target: `${normalizeSuiAddress(options.cetusPackageId)}::pool_creator::${options.poolCreationCap === undefined ? "create_pool_v3" : "create_pool_v3_with_creation_cap"}`,
27
+ typeArguments,
28
+ arguments: [
29
+ config,
30
+ pools,
31
+ ...(options.poolCreationCap === undefined
32
+ ? []
33
+ : [tx.object(options.poolCreationCap)]),
34
+ tx.pure.u32(options.tickSpacing),
35
+ tx.pure.u128(options.sqrtPriceX64),
36
+ tx.pure.string(options.url ?? ""),
37
+ tx.pure.u32(lowerTick),
38
+ tx.pure.u32(upperTick),
39
+ tx.object(memeIsA ? options.memeCoin : options.quoteCoin),
40
+ tx.object(memeIsA ? options.quoteCoin : options.memeCoin),
41
+ tx.pure.bool(memeIsA === options.fixedMeme),
42
+ tx.object.clock(),
43
+ ],
44
+ }), 3);
45
+ return {
46
+ position,
47
+ memeResidual: memeIsA ? residualA : residualB,
48
+ quoteResidual: memeIsA ? residualB : residualA,
49
+ };
50
+ }
51
+ function tickBits(tick) {
52
+ if (!Number.isInteger(tick) || tick < -(2 ** 31) || tick > 2 ** 31 - 1) {
53
+ throw new RangeError("tick must be an i32");
54
+ }
55
+ return tick >>> 0;
56
+ }
57
+ //# sourceMappingURL=cetus-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cetus-pool.js","sourceRoot":"","sources":["../src/cetus-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AAEnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAM3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAkCxD;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CACvC,EAAe,EACf,OAA0B;IAE1B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,GAAG,CAAC;IAC3D,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC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GAAG,CAAC,SAAS,CAAC;YACtB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;YACzD,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;YACzD,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,SAAS,CAAC;YAC3C,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;SAClB;KACF,CAAC,EACF,CAAC,CACF,CAAC;IACF,OAAO;QACL,QAAQ;QACR,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC7C,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;KAC/C,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { CoinSourceOptions } from "@interest-protocol/blast-core/coins";
2
+ import type { RewardRoundState } from "@interest-protocol/blast-core/rewards/state";
3
+ import type { ClientWithCoreApi, SuiClientRegistration } from "@mysten/sui/client";
4
+ import type { LpFeePolicyState, LpFeeShares, LpVaultState } from "./state.ts";
5
+ import type { MigratorsDeployment } from "./transactions.ts";
6
+ import { MigratorCalls, MigratorTransactions } from "./transactions.ts";
7
+ export declare class MigratorsClient {
8
+ #private;
9
+ readonly call: MigratorCalls;
10
+ readonly tx: MigratorTransactions;
11
+ constructor(client: ClientWithCoreApi, deployment: MigratorsDeployment, options?: CoinSourceOptions);
12
+ getLpVault(objectId: string): Promise<LpVaultState>;
13
+ getLpFeePolicy(): Promise<LpFeePolicyState>;
14
+ /** Blast's live LP-fee shares for `memeType`: its own pair, else the defaults. */
15
+ getLpFeeShares(memeType: string): Promise<LpFeeShares & {
16
+ source: "coin" | "default";
17
+ }>;
18
+ getHolderRewardRound(objectId: string): Promise<RewardRoundState>;
19
+ }
20
+ export type MigratorsExtensionOptions<Name extends string> = MigratorsDeployment & {
21
+ name?: Name;
22
+ };
23
+ /** Adds a typed `blastMigrators` extension to any Sui Core API client. */
24
+ export declare function blastMigrators<const Name extends string = "blastMigrators">({ name, ...deployment }: MigratorsExtensionOptions<Name>): SuiClientRegistration<ClientWithCoreApi, Name, MigratorsClient>;
25
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAExE,qBAAa,eAAe;;IAC1B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,oBAAoB,CAAC;IAGlC,YACE,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,mBAAmB,EAC/B,OAAO,GAAE,iBAAsB,EAKhC;IAEK,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAMxD;IAEK,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAMhD;IAED,kFAAkF;IAC5E,cAAc,CAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,GAAG;QAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAEvD;IAEK,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAMtE;CACF;AAED,MAAM,MAAM,yBAAyB,CAAC,IAAI,SAAS,MAAM,IACvD,mBAAmB,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAExC,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,GAAG,gBAAgB,EAAE,EAC3E,IAA+B,EAC/B,GAAG,UAAU,EACd,EAAE,yBAAyB,CAAC,IAAI,CAAC,GAAG,qBAAqB,CACxD,iBAAiB,EACjB,IAAI,EACJ,eAAe,CAChB,CAKA"}
package/dist/client.js ADDED
@@ -0,0 +1,34 @@
1
+ import { getRewardRound } from "@interest-protocol/blast-core/rewards/state";
2
+ import { getLpFeePolicy, getLpFeeShares, getLpVault } from "./state.js";
3
+ import { MigratorCalls, MigratorTransactions } from "./transactions.js";
4
+ export class MigratorsClient {
5
+ call;
6
+ tx;
7
+ #client;
8
+ constructor(client, deployment, options = {}) {
9
+ this.#client = client;
10
+ this.call = new MigratorCalls(deployment);
11
+ this.tx = new MigratorTransactions(deployment, options);
12
+ }
13
+ async getLpVault(objectId) {
14
+ return getLpVault(this.#client, objectId, this.call.deployment.originalPackageId);
15
+ }
16
+ async getLpFeePolicy() {
17
+ return getLpFeePolicy(this.#client, this.call.deployment.lpFeePolicy.objectId, this.call.deployment.originalPackageId);
18
+ }
19
+ /** Blast's live LP-fee shares for `memeType`: its own pair, else the defaults. */
20
+ async getLpFeeShares(memeType) {
21
+ return getLpFeeShares(this.#client, await this.getLpFeePolicy(), memeType);
22
+ }
23
+ async getHolderRewardRound(objectId) {
24
+ return getRewardRound(this.#client, objectId, this.call.deployment.originalPackageId);
25
+ }
26
+ }
27
+ /** Adds a typed `blastMigrators` extension to any Sui Core API client. */
28
+ export function blastMigrators({ name = "blastMigrators", ...deployment }) {
29
+ return {
30
+ name,
31
+ register: (client) => new MigratorsClient(client, deployment),
32
+ };
33
+ }
34
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAM7E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,OAAO,eAAe;IACjB,IAAI,CAAgB;IACpB,EAAE,CAAuB;IACzB,OAAO,CAAoB;IAEpC,YACE,MAAyB,EACzB,UAA+B,EAC/B,OAAO,GAAsB,EAAE;QAE/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,GAAG,IAAI,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAAgB;QAC/B,OAAO,UAAU,CACf,IAAI,CAAC,OAAO,EACZ,QAAQ,EACR,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CACvC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,OAAO,cAAc,CACnB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,EACzC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CACvC,CAAC;IACJ,CAAC;IAED,kFAAkF;IAClF,KAAK,CAAC,cAAc,CAClB,QAAgB;QAEhB,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,QAAgB;QACzC,OAAO,cAAc,CACnB,IAAI,CAAC,OAAO,EACZ,QAAQ,EACR,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CACvC,CAAC;IACJ,CAAC;CACF;AAKD,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAA+C,EAC3E,IAAI,GAAG,gBAAwB,EAC/B,GAAG,UAAU,EACmB;IAKhC,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC;KAC9D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,168 @@
1
+ import type { SuiEventPosition } from "@interest-protocol/blast-core/events";
2
+ import type { FeeSplit } from "@interest-protocol/blast-launchpad-sdk/allocation";
3
+ import type { BcsType } from "@mysten/sui/bcs";
4
+ import type { SuiClientTypes } from "@mysten/sui/client";
5
+ type MigratorEventFieldDescriptor = "id" | "typeName" | "address" | "u64" | "u128" | "u32" | "bytes" | "u64Vector" | "optionAddress" | "optionTypeName" | "optionU64" | "feeSplit";
6
+ export declare const migratorEventSpecs: {
7
+ readonly AutoLiquidityAdded: {
8
+ readonly vault_id: "id";
9
+ readonly meme_amount: "u64";
10
+ readonly quote_amount: "u64";
11
+ readonly meme_pending: "u64";
12
+ readonly quote_pending: "u64";
13
+ };
14
+ readonly AutoLpPositionOpened: {
15
+ readonly vault_id: "id";
16
+ readonly position_id: "id";
17
+ };
18
+ readonly BuybackBurned: {
19
+ readonly vault_id: "id";
20
+ readonly quote_spent: "u64";
21
+ readonly meme_burned: "u64";
22
+ readonly quote_pending: "u64";
23
+ };
24
+ readonly CetusPoolReserved: {
25
+ readonly meme: "typeName";
26
+ readonly quote: "typeName";
27
+ readonly pool_creation_cap_id: "id";
28
+ readonly tick_spacing: "u32";
29
+ };
30
+ readonly CreatorFeesClaimed: {
31
+ readonly vault_id: "id";
32
+ readonly meme_amount: "u64";
33
+ readonly quote_amount: "u64";
34
+ };
35
+ readonly FeeSplitChanged: {
36
+ readonly vault_id: "id";
37
+ readonly old_fee_split: "feeSplit";
38
+ readonly new_fee_split: "feeSplit";
39
+ };
40
+ readonly FeesCollected: {
41
+ readonly vault_id: "id";
42
+ readonly gross_meme: "u64";
43
+ readonly gross_quote: "u64";
44
+ readonly protocol_destination: "optionAddress";
45
+ readonly protocol_meme: "u64";
46
+ readonly protocol_quote: "u64";
47
+ readonly creator_meme: "u64";
48
+ readonly creator_quote: "u64";
49
+ readonly auto_lp_meme: "u64";
50
+ readonly auto_lp_quote: "u64";
51
+ readonly rewards_meme: "u64";
52
+ readonly rewards_quote: "u64";
53
+ readonly burn_meme: "u64";
54
+ readonly burn_quote: "u64";
55
+ readonly recipient_meme: "u64Vector";
56
+ readonly recipient_quote: "u64Vector";
57
+ };
58
+ readonly LpFeeDestinationChanged: {
59
+ readonly old_destination: "address";
60
+ readonly new_destination: "address";
61
+ };
62
+ readonly LpFeePolicyChanged: {
63
+ readonly meme: "optionTypeName";
64
+ readonly old_meme_bps: "optionU64";
65
+ readonly old_quote_bps: "optionU64";
66
+ readonly new_meme_bps: "optionU64";
67
+ readonly new_quote_bps: "optionU64";
68
+ };
69
+ readonly ProtocolFeesClaimed: {
70
+ readonly vault_id: "id";
71
+ readonly meme: "typeName";
72
+ readonly quote: "typeName";
73
+ readonly claimant: "address";
74
+ readonly meme_amount: "u64";
75
+ readonly quote_amount: "u64";
76
+ };
77
+ readonly ProtocolLpFeesClaimed: {
78
+ readonly vault_id: "id";
79
+ readonly protocol_destination: "address";
80
+ readonly protocol_meme: "u64";
81
+ readonly protocol_quote: "u64";
82
+ readonly partner_meme: "u64";
83
+ readonly partner_quote: "u64";
84
+ };
85
+ readonly RewardPaid: {
86
+ readonly round_id: "id";
87
+ readonly index: "u64";
88
+ readonly beneficiary: "address";
89
+ readonly meme_amount: "u64";
90
+ readonly quote_amount: "u64";
91
+ readonly meme_remaining: "u64";
92
+ readonly quote_remaining: "u64";
93
+ };
94
+ readonly RoundPublished: {
95
+ readonly vault_id: "id";
96
+ readonly round_id: "id";
97
+ readonly number: "u64";
98
+ readonly start_checkpoint: "u64";
99
+ readonly end_checkpoint: "u64";
100
+ readonly root: "bytes";
101
+ readonly manifest_digest: "bytes";
102
+ readonly leaf_count: "u64";
103
+ readonly meme_amount: "u64";
104
+ readonly quote_amount: "u64";
105
+ readonly meme_unallocated: "u64";
106
+ readonly quote_unallocated: "u64";
107
+ };
108
+ readonly VaultCreated: {
109
+ readonly vault_id: "id";
110
+ readonly pool_id: "id";
111
+ readonly position_id: "id";
112
+ readonly venue: "typeName";
113
+ readonly meme: "typeName";
114
+ readonly quote: "typeName";
115
+ readonly residual_meme: "u64";
116
+ readonly residual_quote: "u64";
117
+ readonly liquidity: "u128";
118
+ readonly fee_split: "feeSplit";
119
+ };
120
+ };
121
+ export type MigratorEventKind = keyof typeof migratorEventSpecs;
122
+ type DescriptorOutputs = {
123
+ id: string;
124
+ typeName: string;
125
+ address: string;
126
+ u64: bigint;
127
+ u128: bigint;
128
+ u32: number;
129
+ bytes: Uint8Array;
130
+ u64Vector: bigint[];
131
+ /** Null when a partnered vault holds Blast's share for the partner claim. */
132
+ optionAddress: string | null;
133
+ optionTypeName: string | null;
134
+ optionU64: bigint | null;
135
+ feeSplit: FeeSplit;
136
+ };
137
+ export type MigratorEventPayloads = {
138
+ [Kind in MigratorEventKind]: {
139
+ [Field in keyof (typeof migratorEventSpecs)[Kind]]: DescriptorOutputs[Extract<(typeof migratorEventSpecs)[Kind][Field], MigratorEventFieldDescriptor>];
140
+ };
141
+ };
142
+ type MigratorEventBcsMap = {
143
+ [Kind in MigratorEventKind]: BcsType<MigratorEventPayloads[Kind], MigratorEventPayloads[Kind]>;
144
+ };
145
+ export declare const migratorEventBcs: MigratorEventBcsMap;
146
+ /**
147
+ * Migrator events are authenticated by their type, which names the original
148
+ * package's `blast_events` module; Sui records only the transaction's called
149
+ * package and module on each event.
150
+ */
151
+ export type MigratorEventPackageIdentity = {
152
+ originalPackageId: string;
153
+ };
154
+ type DecodedMigratorEventBase = {
155
+ source: "migrators";
156
+ sender: string;
157
+ position: SuiEventPosition;
158
+ };
159
+ export type DecodedMigratorEvent = {
160
+ [Kind in MigratorEventKind]: DecodedMigratorEventBase & {
161
+ kind: Kind;
162
+ payload: MigratorEventPayloads[Kind];
163
+ };
164
+ }[MigratorEventKind];
165
+ export declare function decodeMigratorEvent(event: SuiClientTypes.EventEntry, packages: MigratorEventPackageIdentity): DecodedMigratorEvent;
166
+ export declare function migratorEventId(event: DecodedMigratorEvent): string;
167
+ export {};
168
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAS7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAElF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,KAAK,4BAA4B,GAC7B,IAAI,GACJ,UAAU,GACV,SAAS,GACT,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,WAAW,GACX,UAAU,CAAC;AAEf,eAAO,MAAM,kBAAkB;;iBAE3B,QAAQ,EAAE,IAAI;iB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