@interest-protocol/blast-migrators-sdk 0.1.2 → 0.2.0
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/dist/aborts.d.ts +12 -0
- package/dist/aborts.d.ts.map +1 -0
- package/dist/aborts.js +21 -0
- package/dist/aborts.js.map +1 -0
- package/dist/client.d.ts +8 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -14
- package/dist/client.js.map +1 -1
- package/dist/events.d.ts +30 -160
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +33 -168
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/reducer.d.ts +20 -132
- package/dist/reducer.d.ts.map +1 -1
- package/dist/reducer.js +28 -361
- package/dist/reducer.js.map +1 -1
- package/dist/state.d.ts +32 -152
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +61 -167
- package/dist/state.js.map +1 -1
- package/dist/transactions.d.ts +204 -259
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +347 -449
- package/dist/transactions.js.map +1 -1
- package/package.json +7 -10
- package/src/aborts.ts +24 -0
- package/src/client.ts +19 -34
- package/src/events.ts +54 -261
- package/src/index.ts +1 -3
- package/src/reducer.ts +46 -538
- package/src/state.ts +88 -282
- package/src/transactions.ts +569 -838
- package/dist/bluefin-pool.d.ts +0 -57
- package/dist/bluefin-pool.d.ts.map +0 -1
- package/dist/bluefin-pool.js +0 -102
- package/dist/bluefin-pool.js.map +0 -1
- package/dist/cetus-pool.d.ts +0 -44
- package/dist/cetus-pool.d.ts.map +0 -1
- package/dist/cetus-pool.js +0 -57
- package/dist/cetus-pool.js.map +0 -1
- package/src/bluefin-pool.ts +0 -180
- package/src/cetus-pool.ts +0 -107
package/dist/aborts.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `blast_migrators` error registry (`sui/migrators/sources/lib/errors.move`):
|
|
3
|
+
* a name's index is its numeric abort code. Codes are package-wide, so check
|
|
4
|
+
* first that the abort location's package is the migrators package. A vault
|
|
5
|
+
* upgrade the migrators have not followed aborts in `blast_admin` instead
|
|
6
|
+
* (`EVersionMismatch`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const MIGRATORS_ABORTS: readonly ["EInvalidCoinOrder", "EPositionPoolMismatch", "EWrongCoinPair", "EInvalidTier", "ESymbolTooLong", "EInvalidAutoLpPrice"];
|
|
9
|
+
export type MigratorsAbortName = (typeof MIGRATORS_ABORTS)[number];
|
|
10
|
+
/** The error a `blast_migrators` abort `code` names; null for an unknown code. */
|
|
11
|
+
export declare function migratorsAbortName(code: number): MigratorsAbortName | null;
|
|
12
|
+
//# sourceMappingURL=aborts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aborts.d.ts","sourceRoot":"","sources":["../src/aborts.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,YAC3B,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,CACb,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAE1E"}
|
package/dist/aborts.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { abortName } from "@interest-protocol/blast-core/aborts";
|
|
2
|
+
/**
|
|
3
|
+
* The `blast_migrators` error registry (`sui/migrators/sources/lib/errors.move`):
|
|
4
|
+
* a name's index is its numeric abort code. Codes are package-wide, so check
|
|
5
|
+
* first that the abort location's package is the migrators package. A vault
|
|
6
|
+
* upgrade the migrators have not followed aborts in `blast_admin` instead
|
|
7
|
+
* (`EVersionMismatch`).
|
|
8
|
+
*/
|
|
9
|
+
export const MIGRATORS_ABORTS = [
|
|
10
|
+
"EInvalidCoinOrder",
|
|
11
|
+
"EPositionPoolMismatch",
|
|
12
|
+
"EWrongCoinPair",
|
|
13
|
+
"EInvalidTier",
|
|
14
|
+
"ESymbolTooLong",
|
|
15
|
+
"EInvalidAutoLpPrice",
|
|
16
|
+
];
|
|
17
|
+
/** The error a `blast_migrators` abort `code` names; null for an unknown code. */
|
|
18
|
+
export function migratorsAbortName(code) {
|
|
19
|
+
return abortName(MIGRATORS_ABORTS, code);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=aborts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aborts.js","sourceRoot":"","sources":["../src/aborts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,mBAAmB;IACnB,uBAAuB;IACvB,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,qBAAqB;CACb,CAAC;AAIX,kFAAkF;AAClF,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import type { CoinSourceOptions } from "@interest-protocol/blast-core/coins";
|
|
2
|
-
import type { RewardRoundState } from "@interest-protocol/blast-core/rewards/state";
|
|
3
1
|
import type { ClientWithCoreApi, SuiClientRegistration } from "@mysten/sui/client";
|
|
4
|
-
import type {
|
|
2
|
+
import type { BluefinPoolTier } from "./state.ts";
|
|
5
3
|
import type { MigratorsDeployment } from "./transactions.ts";
|
|
6
4
|
import { MigratorCalls, MigratorTransactions } from "./transactions.ts";
|
|
7
5
|
export declare class MigratorsClient {
|
|
8
6
|
#private;
|
|
9
7
|
readonly call: MigratorCalls;
|
|
10
8
|
readonly tx: MigratorTransactions;
|
|
11
|
-
constructor(client: ClientWithCoreApi, deployment: MigratorsDeployment
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getHolderRewardRound(objectId: string): Promise<RewardRoundState>;
|
|
9
|
+
constructor(client: ClientWithCoreApi, deployment: MigratorsDeployment);
|
|
10
|
+
/** The Meme's recorded Cetus tick spacing, or null before `cetus::prepare`. */
|
|
11
|
+
getCetusPoolTier(memeType: string): Promise<number | null>;
|
|
12
|
+
/** The Meme's Cetus `PoolCreationCap` ID, or null before `cetus::prepare`. */
|
|
13
|
+
getCetusPoolCreationCapId(memeType: string): Promise<string | null>;
|
|
14
|
+
/** The Meme's recorded Bluefin tier, or null before `bluefin::prepare`. */
|
|
15
|
+
getBluefinPoolTier(memeType: string): Promise<BluefinPoolTier | null>;
|
|
19
16
|
}
|
|
20
17
|
export type MigratorsExtensionOptions<Name extends string> = MigratorsDeployment & {
|
|
21
18
|
name?: Name;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAMlD,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,YAAY,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAIrE;IAED,+EAA+E;IAC/E,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEzD;IAED,8EAA8E;IAC9E,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMlE;IAED,2EAA2E;IAC3E,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAEpE;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
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getLpFeePolicy, getLpFeeShares, getLpVault } from "./state.js";
|
|
1
|
+
import { getBluefinPoolTier, getCetusPoolCreationCapId, getCetusPoolTier, } from "./state.js";
|
|
3
2
|
import { MigratorCalls, MigratorTransactions } from "./transactions.js";
|
|
4
3
|
export class MigratorsClient {
|
|
5
4
|
call;
|
|
6
5
|
tx;
|
|
7
6
|
#client;
|
|
8
|
-
constructor(client, deployment
|
|
7
|
+
constructor(client, deployment) {
|
|
9
8
|
this.#client = client;
|
|
10
9
|
this.call = new MigratorCalls(deployment);
|
|
11
|
-
this.tx = new MigratorTransactions(deployment
|
|
10
|
+
this.tx = new MigratorTransactions(this.call.deployment);
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/** The Meme's recorded Cetus tick spacing, or null before `cetus::prepare`. */
|
|
13
|
+
getCetusPoolTier(memeType) {
|
|
14
|
+
return getCetusPoolTier(this.#client, this.call.deployment, memeType);
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/** The Meme's Cetus `PoolCreationCap` ID, or null before `cetus::prepare`. */
|
|
17
|
+
getCetusPoolCreationCapId(memeType) {
|
|
18
|
+
return getCetusPoolCreationCapId(this.#client, this.call.deployment, memeType);
|
|
18
19
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
async getHolderRewardRound(objectId) {
|
|
24
|
-
return getRewardRound(this.#client, objectId, this.call.deployment.originalPackageId);
|
|
20
|
+
/** The Meme's recorded Bluefin tier, or null before `bluefin::prepare`. */
|
|
21
|
+
getBluefinPoolTier(memeType) {
|
|
22
|
+
return getBluefinPoolTier(this.#client, this.call.deployment, memeType);
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
/** Adds a typed `blastMigrators` extension to any Sui Core API client. */
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,OAAO,eAAe;IACjB,IAAI,CAAgB;IACpB,EAAE,CAAuB;IACzB,OAAO,CAAoB;IAEpC,YAAY,MAAyB,EAAE,UAA+B;QACpE,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,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED,+EAA+E;IAC/E,gBAAgB,CAAC,QAAgB;QAC/B,OAAO,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACxE,CAAC;IAED,8EAA8E;IAC9E,yBAAyB,CAAC,QAAgB;QACxC,OAAO,yBAAyB,CAC9B,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EACpB,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,2EAA2E;IAC3E,kBAAkB,CAAC,QAAgB;QACjC,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC1E,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"}
|
package/dist/events.d.ts
CHANGED
|
@@ -1,168 +1,38 @@
|
|
|
1
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
2
|
import type { SuiClientTypes } from "@mysten/sui/client";
|
|
5
|
-
type
|
|
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;
|
|
3
|
+
import type { MigratorsDeployment } from "./transactions.ts";
|
|
146
4
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
5
|
+
* The two `blast_migrators::events` structs, in Move field order, each typed
|
|
6
|
+
* `<Meme, Quote>`: the pool tier a venue records while preparing a pair.
|
|
7
|
+
* Vault creation, fee collection, auto-LP, buybacks and holder rewards are
|
|
8
|
+
* the vault package's events; versions and upgrades are the admin package's.
|
|
150
9
|
*/
|
|
151
|
-
export
|
|
152
|
-
|
|
10
|
+
export declare const migratorsEventBcs: {
|
|
11
|
+
/** The Meme's one Cetus `PoolCreationCap` and the tick spacing its migration uses. */
|
|
12
|
+
CetusPoolReserved: import("@mysten/sui/bcs").BcsStruct<{
|
|
13
|
+
pool_creation_cap_id: import("@mysten/sui/bcs").BcsType<string, string, string>;
|
|
14
|
+
tick_spacing: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
15
|
+
}, string>;
|
|
16
|
+
BluefinPoolTierRecorded: import("@mysten/sui/bcs").BcsStruct<{
|
|
17
|
+
tick_spacing: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
18
|
+
fee_rate: import("@mysten/sui/bcs").BcsType<bigint, bigint, "u64">;
|
|
19
|
+
}, string>;
|
|
153
20
|
};
|
|
154
|
-
type
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
position: SuiEventPosition;
|
|
21
|
+
export type MigratorsEventKind = keyof typeof migratorsEventBcs;
|
|
22
|
+
export type MigratorsEventPayloads = {
|
|
23
|
+
[Kind in MigratorsEventKind]: ReturnType<(typeof migratorsEventBcs)[Kind]["parse"]>;
|
|
158
24
|
};
|
|
159
|
-
export type
|
|
160
|
-
[Kind in
|
|
25
|
+
export type DecodedMigratorsEvent = {
|
|
26
|
+
[Kind in MigratorsEventKind]: {
|
|
27
|
+
source: "migrators";
|
|
161
28
|
kind: Kind;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
29
|
+
memeType: string;
|
|
30
|
+
quoteType: string;
|
|
31
|
+
payload: MigratorsEventPayloads[Kind];
|
|
32
|
+
sender: string;
|
|
33
|
+
position: SuiEventPosition;
|
|
34
|
+
};
|
|
35
|
+
}[MigratorsEventKind];
|
|
36
|
+
/** Decodes one `<migrators original>::events::<Kind><Meme, Quote>`. */
|
|
37
|
+
export declare function decodeMigratorsEvent(event: SuiClientTypes.EventEntry, migrators: Pick<MigratorsDeployment, "originalPackageId">): DecodedMigratorsEvent;
|
|
168
38
|
//# sourceMappingURL=events.d.ts.map
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;IAC5B,sFAAsF;IACtF,iBAAiB;;;;IAIjB,uBAAuB;;;;CAIxB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAEhE,MAAM,MAAM,sBAAsB,GAAG;KAClC,IAAI,IAAI,kBAAkB,GAAG,UAAU,CACtC,CAAC,OAAO,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAC1C;CACF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;KACjC,IAAI,IAAI,kBAAkB,GAAG;QAC5B,MAAM,EAAE,WAAW,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,gBAAgB,CAAC;KAC5B;CACF,CAAC,kBAAkB,CAAC,CAAC;AAEtB,uEAAuE;AACvE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,cAAc,CAAC,UAAU,EAChC,SAAS,EAAE,IAAI,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,GACxD,qBAAqB,CAuBvB"}
|
package/dist/events.js
CHANGED
|
@@ -1,180 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { normalizeSuiEventPosition
|
|
3
|
-
import { requireU64, requireU128, } from "@interest-protocol/blast-core/integers";
|
|
4
|
-
import { feeSplitBcs } from "@interest-protocol/blast-launchpad-sdk/allocation";
|
|
1
|
+
import { suiObjectIdBcs, u64Bcs } from "@interest-protocol/blast-core/bcs";
|
|
2
|
+
import { normalizeSuiEventPosition } from "@interest-protocol/blast-core/events";
|
|
5
3
|
import { bcs } from "@mysten/sui/bcs";
|
|
6
|
-
import { normalizeSuiAddress, parseStructTag } from "@mysten/sui/utils";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
quote_pending: "u64",
|
|
24
|
-
},
|
|
25
|
-
CetusPoolReserved: {
|
|
26
|
-
meme: "typeName",
|
|
27
|
-
quote: "typeName",
|
|
28
|
-
pool_creation_cap_id: "id",
|
|
29
|
-
tick_spacing: "u32",
|
|
30
|
-
},
|
|
31
|
-
CreatorFeesClaimed: {
|
|
32
|
-
vault_id: "id",
|
|
33
|
-
meme_amount: "u64",
|
|
34
|
-
quote_amount: "u64",
|
|
35
|
-
},
|
|
36
|
-
FeeSplitChanged: {
|
|
37
|
-
vault_id: "id",
|
|
38
|
-
old_fee_split: "feeSplit",
|
|
39
|
-
new_fee_split: "feeSplit",
|
|
40
|
-
},
|
|
41
|
-
FeesCollected: {
|
|
42
|
-
vault_id: "id",
|
|
43
|
-
gross_meme: "u64",
|
|
44
|
-
gross_quote: "u64",
|
|
45
|
-
protocol_destination: "optionAddress",
|
|
46
|
-
protocol_meme: "u64",
|
|
47
|
-
protocol_quote: "u64",
|
|
48
|
-
creator_meme: "u64",
|
|
49
|
-
creator_quote: "u64",
|
|
50
|
-
auto_lp_meme: "u64",
|
|
51
|
-
auto_lp_quote: "u64",
|
|
52
|
-
rewards_meme: "u64",
|
|
53
|
-
rewards_quote: "u64",
|
|
54
|
-
burn_meme: "u64",
|
|
55
|
-
burn_quote: "u64",
|
|
56
|
-
recipient_meme: "u64Vector",
|
|
57
|
-
recipient_quote: "u64Vector",
|
|
58
|
-
},
|
|
59
|
-
LpFeeDestinationChanged: {
|
|
60
|
-
old_destination: "address",
|
|
61
|
-
new_destination: "address",
|
|
62
|
-
},
|
|
63
|
-
LpFeePolicyChanged: {
|
|
64
|
-
meme: "optionTypeName",
|
|
65
|
-
old_meme_bps: "optionU64",
|
|
66
|
-
old_quote_bps: "optionU64",
|
|
67
|
-
new_meme_bps: "optionU64",
|
|
68
|
-
new_quote_bps: "optionU64",
|
|
69
|
-
},
|
|
70
|
-
ProtocolFeesClaimed: {
|
|
71
|
-
vault_id: "id",
|
|
72
|
-
meme: "typeName",
|
|
73
|
-
quote: "typeName",
|
|
74
|
-
claimant: "address",
|
|
75
|
-
meme_amount: "u64",
|
|
76
|
-
quote_amount: "u64",
|
|
77
|
-
},
|
|
78
|
-
ProtocolLpFeesClaimed: {
|
|
79
|
-
vault_id: "id",
|
|
80
|
-
protocol_destination: "address",
|
|
81
|
-
protocol_meme: "u64",
|
|
82
|
-
protocol_quote: "u64",
|
|
83
|
-
partner_meme: "u64",
|
|
84
|
-
partner_quote: "u64",
|
|
85
|
-
},
|
|
86
|
-
RewardPaid: {
|
|
87
|
-
round_id: "id",
|
|
88
|
-
index: "u64",
|
|
89
|
-
beneficiary: "address",
|
|
90
|
-
meme_amount: "u64",
|
|
91
|
-
quote_amount: "u64",
|
|
92
|
-
meme_remaining: "u64",
|
|
93
|
-
quote_remaining: "u64",
|
|
94
|
-
},
|
|
95
|
-
RoundPublished: {
|
|
96
|
-
vault_id: "id",
|
|
97
|
-
round_id: "id",
|
|
98
|
-
number: "u64",
|
|
99
|
-
start_checkpoint: "u64",
|
|
100
|
-
end_checkpoint: "u64",
|
|
101
|
-
root: "bytes",
|
|
102
|
-
manifest_digest: "bytes",
|
|
103
|
-
leaf_count: "u64",
|
|
104
|
-
meme_amount: "u64",
|
|
105
|
-
quote_amount: "u64",
|
|
106
|
-
meme_unallocated: "u64",
|
|
107
|
-
quote_unallocated: "u64",
|
|
108
|
-
},
|
|
109
|
-
VaultCreated: {
|
|
110
|
-
vault_id: "id",
|
|
111
|
-
pool_id: "id",
|
|
112
|
-
position_id: "id",
|
|
113
|
-
venue: "typeName",
|
|
114
|
-
meme: "typeName",
|
|
115
|
-
quote: "typeName",
|
|
116
|
-
residual_meme: "u64",
|
|
117
|
-
residual_quote: "u64",
|
|
118
|
-
liquidity: "u128",
|
|
119
|
-
fee_split: "feeSplit",
|
|
120
|
-
},
|
|
4
|
+
import { normalizeStructTag, normalizeSuiAddress, parseStructTag, } from "@mysten/sui/utils";
|
|
5
|
+
/**
|
|
6
|
+
* The two `blast_migrators::events` structs, in Move field order, each typed
|
|
7
|
+
* `<Meme, Quote>`: the pool tier a venue records while preparing a pair.
|
|
8
|
+
* Vault creation, fee collection, auto-LP, buybacks and holder rewards are
|
|
9
|
+
* the vault package's events; versions and upgrades are the admin package's.
|
|
10
|
+
*/
|
|
11
|
+
export const migratorsEventBcs = {
|
|
12
|
+
/** The Meme's one Cetus `PoolCreationCap` and the tick spacing its migration uses. */
|
|
13
|
+
CetusPoolReserved: bcs.struct("CetusPoolReserved", {
|
|
14
|
+
pool_creation_cap_id: suiObjectIdBcs,
|
|
15
|
+
tick_spacing: bcs.u32(),
|
|
16
|
+
}),
|
|
17
|
+
BluefinPoolTierRecorded: bcs.struct("BluefinPoolTierRecorded", {
|
|
18
|
+
tick_spacing: bcs.u32(),
|
|
19
|
+
fee_rate: u64Bcs,
|
|
20
|
+
}),
|
|
121
21
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
output: (value) => BigInt(value),
|
|
125
|
-
});
|
|
126
|
-
const U128Bcs = bcs.u128().transform({
|
|
127
|
-
input: (value) => requireU128("event u128", value),
|
|
128
|
-
output: (value) => BigInt(value),
|
|
129
|
-
});
|
|
130
|
-
const BytesBcs = bcs.vector(bcs.u8()).transform({
|
|
131
|
-
input: (value) => Array.from(value),
|
|
132
|
-
output: (value) => Uint8Array.from(value),
|
|
133
|
-
});
|
|
134
|
-
const AddressBcs = bcs.Address.transform({
|
|
135
|
-
input: (value) => normalizeSuiAddress(value),
|
|
136
|
-
output: (value) => normalizeSuiAddress(value),
|
|
137
|
-
});
|
|
138
|
-
const MIGRATOR_EVENT_FIELD_BCS = {
|
|
139
|
-
id: suiObjectIdBcs,
|
|
140
|
-
typeName: moveTypeNameBcs,
|
|
141
|
-
address: AddressBcs,
|
|
142
|
-
u64: U64Bcs,
|
|
143
|
-
u128: U128Bcs,
|
|
144
|
-
u32: bcs.u32(),
|
|
145
|
-
bytes: BytesBcs,
|
|
146
|
-
u64Vector: bcs.vector(U64Bcs),
|
|
147
|
-
optionAddress: bcs.option(AddressBcs),
|
|
148
|
-
optionTypeName: bcs.option(moveTypeNameBcs),
|
|
149
|
-
optionU64: bcs.option(U64Bcs),
|
|
150
|
-
feeSplit: feeSplitBcs,
|
|
151
|
-
};
|
|
152
|
-
export const migratorEventBcs = Object.fromEntries(Object.entries(migratorEventSpecs).map(([name, spec]) => [
|
|
153
|
-
name,
|
|
154
|
-
bcs.struct(name, Object.fromEntries(Object.entries(spec).map(([field, descriptor]) => [
|
|
155
|
-
field,
|
|
156
|
-
MIGRATOR_EVENT_FIELD_BCS[descriptor],
|
|
157
|
-
]))),
|
|
158
|
-
]));
|
|
159
|
-
export function decodeMigratorEvent(event, packages) {
|
|
160
|
-
const originalPackageId = normalizeSuiAddress(packages.originalPackageId);
|
|
22
|
+
/** Decodes one `<migrators original>::events::<Kind><Meme, Quote>`. */
|
|
23
|
+
export function decodeMigratorsEvent(event, migrators) {
|
|
161
24
|
const tag = parseStructTag(event.eventType);
|
|
162
|
-
if (tag.address !== originalPackageId ||
|
|
163
|
-
tag.module !== "blast_events" ||
|
|
164
|
-
tag.typeParams.length !== 0 ||
|
|
165
|
-
!Object.hasOwn(migratorEventSpecs, tag.name)) {
|
|
166
|
-
throw new TypeError("migrator event has an unexpected event package");
|
|
167
|
-
}
|
|
168
25
|
const kind = tag.name;
|
|
26
|
+
const [meme, quote, ...extra] = tag.typeParams;
|
|
27
|
+
if (tag.address !== normalizeSuiAddress(migrators.originalPackageId) ||
|
|
28
|
+
tag.module !== "events" ||
|
|
29
|
+
!Object.hasOwn(migratorsEventBcs, kind) ||
|
|
30
|
+
meme === undefined ||
|
|
31
|
+
quote === undefined ||
|
|
32
|
+
extra.length > 0) {
|
|
33
|
+
throw new TypeError(`unexpected migrators event type ${event.eventType}`);
|
|
34
|
+
}
|
|
169
35
|
return {
|
|
170
36
|
source: "migrators",
|
|
171
37
|
kind,
|
|
172
|
-
|
|
38
|
+
memeType: normalizeStructTag(meme),
|
|
39
|
+
quoteType: normalizeStructTag(quote),
|
|
40
|
+
payload: migratorsEventBcs[kind].parse(event.bcs),
|
|
173
41
|
sender: normalizeSuiAddress(event.sender),
|
|
174
42
|
position: normalizeSuiEventPosition(event),
|
|
175
43
|
};
|
|
176
44
|
}
|
|
177
|
-
export function migratorEventId(event) {
|
|
178
|
-
return suiEventId(event.position);
|
|
179
|
-
}
|
|
180
45
|
//# sourceMappingURL=events.js.map
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,sFAAsF;IACtF,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,EAAE;QACjD,oBAAoB,EAAE,cAAc;QACpC,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE;KACxB,CAAC;IACF,uBAAuB,EAAE,GAAG,CAAC,MAAM,CAAC,yBAAyB,EAAE;QAC7D,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE;QACvB,QAAQ,EAAE,MAAM;KACjB,CAAC;CACH,CAAC;AAsBF,uEAAuE;AACvE,MAAM,UAAU,oBAAoB,CAClC,KAAgC,EAChC,SAAyD;IAEzD,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,GAAG,CAAC,IAA0B,CAAC;IAC5C,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC;IAC/C,IACE,GAAG,CAAC,OAAO,KAAK,mBAAmB,CAAC,SAAS,CAAC,iBAAiB,CAAC;QAChE,GAAG,CAAC,MAAM,KAAK,QAAQ;QACvB,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACvC,IAAI,KAAK,SAAS;QAClB,KAAK,KAAK,SAAS;QACnB,KAAK,CAAC,MAAM,GAAG,CAAC,EAChB,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,mCAAmC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,IAAI;QACJ,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAClC,SAAS,EAAE,kBAAkB,CAAC,KAAK,CAAC;QACpC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;QACjD,MAAM,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC;QACzC,QAAQ,EAAE,yBAAyB,CAAC,KAAK,CAAC;KAClB,CAAC;AAC7B,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"}
|