@black-market/sdk 0.1.0 → 0.4.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/README.md +92 -20
- package/dist/abyss.d.ts +4 -2748
- package/dist/abyss.d.ts.map +1 -1
- package/dist/abyss.js +3 -1029
- package/dist/abyss.js.map +1 -1
- package/dist/addresses.d.ts +3 -7
- package/dist/addresses.d.ts.map +1 -1
- package/dist/addresses.js +6 -21
- package/dist/addresses.js.map +1 -1
- package/dist/auction.d.ts +2 -2
- package/dist/auction.d.ts.map +1 -1
- package/dist/auction.js +2 -2
- package/dist/auction.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/launch-api.d.ts +151 -0
- package/dist/launch-api.d.ts.map +1 -0
- package/dist/launch-api.js +117 -0
- package/dist/launch-api.js.map +1 -0
- package/dist/launch.d.ts +23 -185
- package/dist/launch.d.ts.map +1 -1
- package/dist/launch.js +35 -272
- package/dist/launch.js.map +1 -1
- package/dist/lifecycle/abi.d.ts +6391 -0
- package/dist/lifecycle/abi.d.ts.map +1 -0
- package/dist/lifecycle/abi.js +335 -0
- package/dist/lifecycle/abi.js.map +1 -0
- package/dist/lifecycle/authors.d.ts +133 -0
- package/dist/lifecycle/authors.d.ts.map +1 -0
- package/dist/lifecycle/authors.js +217 -0
- package/dist/lifecycle/authors.js.map +1 -0
- package/dist/lifecycle/fork.d.ts +15 -0
- package/dist/lifecycle/fork.d.ts.map +1 -0
- package/dist/lifecycle/fork.js +36 -0
- package/dist/lifecycle/fork.js.map +1 -0
- package/dist/lifecycle/index.d.ts +10 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +10 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle/markets.d.ts +349 -0
- package/dist/lifecycle/markets.d.ts.map +1 -0
- package/dist/lifecycle/markets.js +186 -0
- package/dist/lifecycle/markets.js.map +1 -0
- package/dist/lifecycle/planner.d.ts +20 -0
- package/dist/lifecycle/planner.d.ts.map +1 -0
- package/dist/lifecycle/planner.js +481 -0
- package/dist/lifecycle/planner.js.map +1 -0
- package/dist/lifecycle/progress.d.ts +43 -0
- package/dist/lifecycle/progress.d.ts.map +1 -0
- package/dist/lifecycle/progress.js +449 -0
- package/dist/lifecycle/progress.js.map +1 -0
- package/dist/lifecycle/rpc.d.ts +17 -0
- package/dist/lifecycle/rpc.d.ts.map +1 -0
- package/dist/lifecycle/rpc.js +100 -0
- package/dist/lifecycle/rpc.js.map +1 -0
- package/dist/lifecycle/schema.d.ts +1068 -0
- package/dist/lifecycle/schema.d.ts.map +1 -0
- package/dist/lifecycle/schema.js +335 -0
- package/dist/lifecycle/schema.js.map +1 -0
- package/dist/lifecycle/simulation.d.ts +3 -0
- package/dist/lifecycle/simulation.d.ts.map +1 -0
- package/dist/lifecycle/simulation.js +393 -0
- package/dist/lifecycle/simulation.js.map +1 -0
- package/dist/lifecycle/types.d.ts +273 -0
- package/dist/lifecycle/types.d.ts.map +1 -0
- package/dist/lifecycle/types.js +11 -0
- package/dist/lifecycle/types.js.map +1 -0
- package/docs/launch-lifecycle.md +243 -0
- package/package.json +12 -3
- package/src/abyss.ts +3 -1059
- package/src/addresses.ts +9 -26
- package/src/auction.ts +2 -2
- package/src/index.ts +2 -0
- package/src/launch-api.ts +110 -0
- package/src/launch.ts +43 -411
- package/src/lifecycle/abi.ts +343 -0
- package/src/lifecycle/authors.ts +203 -0
- package/src/lifecycle/fork.ts +36 -0
- package/src/lifecycle/index.ts +9 -0
- package/src/lifecycle/markets.ts +205 -0
- package/src/lifecycle/planner.ts +396 -0
- package/src/lifecycle/progress.ts +378 -0
- package/src/lifecycle/rpc.ts +88 -0
- package/src/lifecycle/schema.ts +387 -0
- package/src/lifecycle/simulation.ts +329 -0
- package/src/lifecycle/types.ts +132 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import {
|
|
2
|
+
adapterRegistrationV1Components, launchExecutionContextV1Components, launchPlanV1Components, launchProgressV1Components,
|
|
3
|
+
launchReceiptV1Components, lifecycleFeePolicyComponents, lifecycleMarketComponents, marketIdentityV1Components,
|
|
4
|
+
marketLiveStateV1Components, positionIdentityV1Components, preparedMarketV1Components,
|
|
5
|
+
profileRegistrationV1Components, profileTopologyV1Components, launchEnvelopeV2Components, sourceTermsV3Components,
|
|
6
|
+
} from "./schema.js";
|
|
7
|
+
import { poolBoundHookParametersV1Components, v4LifecycleMarketComponents } from "./markets.js";
|
|
8
|
+
|
|
9
|
+
const planInput = { name: "plan", type: "tuple", components: launchPlanV1Components } as const;
|
|
10
|
+
export const launchLifecycleAbi = [
|
|
11
|
+
{ type: "function", name: "hashPlan", stateMutability: "pure", inputs: [planInput], outputs: [{ type: "bytes32" }] },
|
|
12
|
+
{ type: "function", name: "launchIdOf", stateMutability: "pure", inputs: [planInput], outputs: [{ type: "bytes32" }] },
|
|
13
|
+
{ type: "function", name: "predictToken", stateMutability: "view", inputs: [planInput], outputs: [{ type: "address" }] },
|
|
14
|
+
{ type: "function", name: "launchAtomic", stateMutability: "payable", inputs: [planInput], outputs: [{ type: "tuple", components: launchReceiptV1Components }] },
|
|
15
|
+
{ type: "function", name: "beginLaunch", stateMutability: "payable", inputs: [planInput, { name: "mode", type: "uint8" }], outputs: [{ type: "tuple", components: launchProgressV1Components }] },
|
|
16
|
+
{ type: "function", name: "prepareMarkets", stateMutability: "nonpayable", inputs: [planInput, { name: "firstMarket", type: "uint32" }, { name: "count", type: "uint32" }], outputs: [] },
|
|
17
|
+
{ type: "function", name: "activateLaunch", stateMutability: "nonpayable", inputs: [planInput], outputs: [{ type: "tuple", components: launchReceiptV1Components }] },
|
|
18
|
+
{ type: "function", name: "cancelLaunch", stateMutability: "nonpayable", inputs: [planInput], outputs: [] },
|
|
19
|
+
{ type: "function", name: "readLaunchProgress", stateMutability: "view", inputs: [{ name: "launchId", type: "bytes32" }], outputs: [{ type: "tuple", components: launchProgressV1Components }] },
|
|
20
|
+
{ type: "function", name: "executionContext", stateMutability: "view", inputs: [], outputs: [{ type: "tuple", components: launchExecutionContextV1Components }] },
|
|
21
|
+
{ type: "function", name: "authorizeTokenTransfer", stateMutability: "view", inputs: [{ type: "address" }, { type: "address" }, { type: "address" }, { type: "address" }, { type: "uint256" }, { type: "bool" }], outputs: [{ type: "bool" }] },
|
|
22
|
+
{ type: "function", name: "isLaunchActive", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "bool" }] },
|
|
23
|
+
{ type: "function", name: "escrowBalance", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "address" }], outputs: [{ type: "uint256" }] },
|
|
24
|
+
{ type: "function", name: "registry", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
25
|
+
{ type: "function", name: "directory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
26
|
+
{ type: "function", name: "tokenFactory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
27
|
+
{ type: "function", name: "fundingEscrow", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
28
|
+
{ type: "function", name: "feeFactory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
29
|
+
{ type: "event", name: "LaunchBegun", anonymous: false, inputs: [
|
|
30
|
+
{ name: "launchId", type: "bytes32", indexed: true }, { name: "planHash", type: "bytes32", indexed: true },
|
|
31
|
+
{ name: "creator", type: "address", indexed: true }, { name: "token", type: "address", indexed: false },
|
|
32
|
+
{ name: "feeHub", type: "address", indexed: false }, { name: "rewards", type: "address", indexed: false }, { name: "mode", type: "uint8", indexed: false },
|
|
33
|
+
] },
|
|
34
|
+
{ type: "event", name: "MarketPrepared", anonymous: false, inputs: [
|
|
35
|
+
{ name: "launchId", type: "bytes32", indexed: true }, { name: "marketIndex", type: "uint32", indexed: true },
|
|
36
|
+
{ name: "canonicalId", type: "bytes32", indexed: true }, { name: "adapter", type: "address", indexed: false },
|
|
37
|
+
{ name: "feeSource", type: "address", indexed: false }, { name: "positionCount", type: "uint32", indexed: false },
|
|
38
|
+
] },
|
|
39
|
+
{ type: "event", name: "LaunchReady", anonymous: false, inputs: [{ name: "launchId", type: "bytes32", indexed: true }] },
|
|
40
|
+
{ type: "event", name: "InitialBuyExecuted", anonymous: false, inputs: [
|
|
41
|
+
{ name: "launchId", type: "bytes32", indexed: true }, { name: "buyIndex", type: "uint32", indexed: true },
|
|
42
|
+
{ name: "marketIndex", type: "uint32", indexed: true }, { name: "quoteAsset", type: "address", indexed: false },
|
|
43
|
+
{ name: "quoteSpent", type: "uint256", indexed: false }, { name: "tokenOut", type: "uint256", indexed: false }, { name: "recipient", type: "address", indexed: false },
|
|
44
|
+
] },
|
|
45
|
+
{ type: "event", name: "LaunchActivated", anonymous: false, inputs: [
|
|
46
|
+
{ name: "launchId", type: "bytes32", indexed: true }, { name: "planHash", type: "bytes32", indexed: true },
|
|
47
|
+
{ name: "token", type: "address", indexed: true }, { name: "marketCount", type: "uint32", indexed: false }, { name: "positionCount", type: "uint32", indexed: false },
|
|
48
|
+
] },
|
|
49
|
+
{ type: "event", name: "LaunchCancelled", anonymous: false, inputs: [
|
|
50
|
+
{ name: "launchId", type: "bytes32", indexed: true }, { name: "creator", type: "address", indexed: true }, { name: "inventoryBurned", type: "bool", indexed: false },
|
|
51
|
+
] },
|
|
52
|
+
{ type: "event", name: "AssetRefunded", anonymous: false, inputs: [
|
|
53
|
+
{ name: "launchId", type: "bytes32", indexed: true }, { name: "asset", type: "address", indexed: true },
|
|
54
|
+
{ name: "creator", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false },
|
|
55
|
+
] },
|
|
56
|
+
] as const;
|
|
57
|
+
export const lifecycleRegistryAbi = [
|
|
58
|
+
{ type: "function", name: "core", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
59
|
+
{ type: "function", name: "adapter", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "tuple", components: adapterRegistrationV1Components }] },
|
|
60
|
+
{ type: "function", name: "profile", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "tuple", components: profileRegistrationV1Components }] },
|
|
61
|
+
{ type: "function", name: "profileTopology", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "tuple", components: profileTopologyV1Components }] },
|
|
62
|
+
{ type: "function", name: "requireEligible", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "bytes32" }, { type: "uint32" }, { type: "uint64" }], outputs: [{ type: "address" }] },
|
|
63
|
+
{ type: "function", name: "fundingInputAllowed", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "bool" }] },
|
|
64
|
+
{ type: "function", name: "fundingTarget", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ name: "spender", type: "address" }, { name: "codeHash", type: "bytes32" }, { name: "enabled", type: "bool" }] },
|
|
65
|
+
{ type: "function", name: "adapterCount", stateMutability: "view", inputs: [], outputs: [{ type: "uint256" }] },
|
|
66
|
+
{ type: "function", name: "profileCount", stateMutability: "view", inputs: [], outputs: [{ type: "uint256" }] },
|
|
67
|
+
{ type: "function", name: "adapterIds", stateMutability: "view", inputs: [{ type: "uint256" }, { type: "uint256" }], outputs: [{ type: "bytes32[]" }] },
|
|
68
|
+
{ type: "function", name: "profileIds", stateMutability: "view", inputs: [{ type: "uint256" }, { type: "uint256" }], outputs: [{ type: "bytes32[]" }] },
|
|
69
|
+
{ type: "function", name: "admin", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
70
|
+
{ type: "function", name: "protocolMaximumDeveloperFeeBps", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
71
|
+
{ type: "function", name: "profileEnvelope", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "tuple", components: launchEnvelopeV2Components }] },
|
|
72
|
+
{ type: "function", name: "profileId", stateMutability: "pure", inputs: [{ type: "tuple", components: launchEnvelopeV2Components }], outputs: [{ type: "bytes32" }] },
|
|
73
|
+
{ type: "function", name: "developerTerms", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [
|
|
74
|
+
{ name: "adapter", type: "address" }, { name: "beneficiary", type: "address" },
|
|
75
|
+
{ name: "maximumDeveloperFeeBps", type: "uint16" }, { name: "termsDigest", type: "bytes32" }, { name: "enabled", type: "bool" },
|
|
76
|
+
] },
|
|
77
|
+
{ type: "function", name: "beneficiaryNonces", stateMutability: "view", inputs: [{ name: "authorId", type: "address" }], outputs: [{ type: "uint256" }] },
|
|
78
|
+
{ type: "function", name: "authorizationDigest", stateMutability: "view", inputs: [
|
|
79
|
+
{ name: "profileId", type: "bytes32" }, { name: "registration", type: "tuple", components: profileRegistrationV1Components },
|
|
80
|
+
{ name: "envelope", type: "tuple", components: launchEnvelopeV2Components },
|
|
81
|
+
{ name: "nonce", type: "uint256" }, { name: "deadline", type: "uint256" },
|
|
82
|
+
], outputs: [{ type: "bytes32" }] },
|
|
83
|
+
{ type: "function", name: "registerProfile", stateMutability: "nonpayable", inputs: [
|
|
84
|
+
{ name: "profileId", type: "bytes32" }, { name: "registration", type: "tuple", components: profileRegistrationV1Components },
|
|
85
|
+
{ name: "envelope", type: "tuple", components: launchEnvelopeV2Components },
|
|
86
|
+
{ name: "nonce", type: "uint256" }, { name: "deadline", type: "uint256" }, { name: "authorization", type: "bytes" },
|
|
87
|
+
], outputs: [] },
|
|
88
|
+
{ type: "function", name: "registerAbyssProfile", stateMutability: "nonpayable", inputs: [
|
|
89
|
+
{ name: "variant", type: "uint8" },
|
|
90
|
+
{ name: "registration", type: "tuple", components: profileRegistrationV1Components },
|
|
91
|
+
], outputs: [] },
|
|
92
|
+
{ type: "function", name: "authorPayout", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "address" }] },
|
|
93
|
+
{ type: "function", name: "setAuthorPayout", stateMutability: "nonpayable", inputs: [{ name: "authorId", type: "address" }, { name: "payout", type: "address" }], outputs: [] },
|
|
94
|
+
{ type: "function", name: "authorHubCount", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }] },
|
|
95
|
+
{ type: "function", name: "authorHubs", stateMutability: "view", inputs: [{ type: "address" }, { type: "uint256" }, { type: "uint256" }], outputs: [
|
|
96
|
+
{ name: "hubs", type: "address[]" }, { name: "nextOffset", type: "uint256" }, { name: "total", type: "uint256" },
|
|
97
|
+
] },
|
|
98
|
+
{ type: "event", name: "AuthorPayoutUpdated", anonymous: false, inputs: [
|
|
99
|
+
{ name: "authorId", type: "address", indexed: true }, { name: "previousPayout", type: "address", indexed: true },
|
|
100
|
+
{ name: "newPayout", type: "address", indexed: true }, { name: "operator", type: "address", indexed: false },
|
|
101
|
+
] },
|
|
102
|
+
{ type: "event", name: "AuthorHubRegistered", anonymous: false, inputs: [
|
|
103
|
+
{ name: "authorId", type: "address", indexed: true }, { name: "hub", type: "address", indexed: true }, { name: "index", type: "uint256", indexed: false },
|
|
104
|
+
] },
|
|
105
|
+
] as const;
|
|
106
|
+
export const lifecycleAdapterAbi = [
|
|
107
|
+
{ type: "function", name: "core", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
108
|
+
{ type: "function", name: "dependencyDigest", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
109
|
+
{ type: "function", name: "resolve", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "address" }, { type: "tuple", components: lifecycleMarketComponents }], outputs: [{ type: "tuple", components: marketIdentityV1Components }] },
|
|
110
|
+
{ type: "function", name: "validatePrepared", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "uint32" }, { type: "address" }, { type: "tuple", components: lifecycleMarketComponents }, { type: "tuple", components: marketIdentityV1Components }], outputs: [] },
|
|
111
|
+
{ type: "function", name: "readMarket", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "uint32" }], outputs: [{ type: "tuple", components: marketLiveStateV1Components }] },
|
|
112
|
+
{ type: "function", name: "readPosition", stateMutability: "view", inputs: [{ type: "tuple", components: positionIdentityV1Components }], outputs: [{ type: "uint128" }, { type: "address" }] },
|
|
113
|
+
] as const;
|
|
114
|
+
|
|
115
|
+
const v4AdapterMetadataAbi = [
|
|
116
|
+
...lifecycleAdapterAbi,
|
|
117
|
+
{ type: "function", name: "PROFILE_ID", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
118
|
+
{ type: "function", name: "CONFIG_SCHEMA", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
119
|
+
{ type: "function", name: "CONFIG_VERSION", stateMutability: "view", inputs: [], outputs: [{ type: "uint32" }] },
|
|
120
|
+
{ type: "function", name: "implementationRegistry", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
121
|
+
{ type: "function", name: "poolManager", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
122
|
+
{ type: "function", name: "hookRoot", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
123
|
+
{ type: "function", name: "oracleFactory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
124
|
+
{ type: "function", name: "locker", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
125
|
+
{ type: "function", name: "collectorFactory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
126
|
+
{ type: "function", name: "hookDeployer", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
127
|
+
] as const;
|
|
128
|
+
export const sharedMarketAdapterV1Abi = [
|
|
129
|
+
...v4AdapterMetadataAbi,
|
|
130
|
+
{ type: "constructor", stateMutability: "nonpayable", inputs: [
|
|
131
|
+
{ name: "core_", type: "address" }, { name: "manager_", type: "address" }, { name: "root_", type: "address" },
|
|
132
|
+
{ name: "locker_", type: "address" }, { name: "helper_", type: "address" }, { name: "registry_", type: "address" },
|
|
133
|
+
{ name: "deployer_", type: "address" }, { name: "profileId_", type: "bytes32" },
|
|
134
|
+
] },
|
|
135
|
+
] as const;
|
|
136
|
+
export const abyssLifecycleAdapterAbi = [
|
|
137
|
+
...lifecycleAdapterAbi,
|
|
138
|
+
{ type: "function", name: "CONFIG_SCHEMA", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
139
|
+
{ type: "function", name: "CONFIG_VERSION", stateMutability: "view", inputs: [], outputs: [{ type: "uint32" }] },
|
|
140
|
+
{ type: "function", name: "profileId", stateMutability: "view", inputs: [{ type: "uint8" }], outputs: [{ type: "bytes32" }] },
|
|
141
|
+
{ type: "function", name: "factory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
142
|
+
] as const;
|
|
143
|
+
export const poolMarketAdapterV1Abi = [
|
|
144
|
+
...v4AdapterMetadataAbi,
|
|
145
|
+
{ type: "constructor", stateMutability: "nonpayable", inputs: [
|
|
146
|
+
{ name: "core_", type: "address" }, { name: "manager_", type: "address" }, { name: "oracleFactory_", type: "address" },
|
|
147
|
+
{ name: "locker_", type: "address" }, { name: "deployer_", type: "address" }, { name: "helper_", type: "address" },
|
|
148
|
+
{ name: "registry_", type: "address" }, { name: "profileId_", type: "bytes32" },
|
|
149
|
+
] },
|
|
150
|
+
{ type: "function", name: "hookDeploymentMetadata", stateMutability: "view", inputs: [
|
|
151
|
+
{ name: "token", type: "address" }, { name: "market", type: "tuple", components: lifecycleMarketComponents },
|
|
152
|
+
], outputs: [
|
|
153
|
+
{ name: "deployer", type: "address" }, { name: "initCodeHash", type: "bytes32" },
|
|
154
|
+
{ name: "salt", type: "bytes32" }, { name: "predictedHook", type: "address" },
|
|
155
|
+
] },
|
|
156
|
+
] as const;
|
|
157
|
+
const boundParametersInput = { name: "parameters", type: "tuple", components: poolBoundHookParametersV1Components } as const;
|
|
158
|
+
export const poolHookDeployerV1Abi = [
|
|
159
|
+
{ type: "constructor", stateMutability: "nonpayable", inputs: [{ name: "creationCode", type: "bytes" }] },
|
|
160
|
+
{ type: "function", name: "creationCodeHash", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
161
|
+
{ type: "function", name: "codeChunk0", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
162
|
+
{ type: "function", name: "codeChunk1", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
163
|
+
{ type: "function", name: "deployedCodeHash", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "bytes32" }] },
|
|
164
|
+
{ type: "function", name: "initCodeHash", stateMutability: "view", inputs: [boundParametersInput], outputs: [{ type: "bytes32" }] },
|
|
165
|
+
{ type: "function", name: "predict", stateMutability: "view", inputs: [boundParametersInput, { name: "salt", type: "bytes32" }], outputs: [{ type: "address" }] },
|
|
166
|
+
{ type: "function", name: "validHookAddress", stateMutability: "pure", inputs: [{ type: "address" }], outputs: [{ type: "bool" }] },
|
|
167
|
+
{ type: "function", name: "deploy", stateMutability: "nonpayable", inputs: [boundParametersInput, { name: "salt", type: "bytes32" }], outputs: [{ name: "hook", type: "address" }] },
|
|
168
|
+
] as const;
|
|
169
|
+
export const sharedHookDeployerV1Abi = [
|
|
170
|
+
{ type: "constructor", stateMutability: "nonpayable", inputs: [{ name: "creationCode", type: "bytes" }] },
|
|
171
|
+
{ type: "function", name: "creationCodeHash", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
172
|
+
{ type: "function", name: "codeChunk0", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
173
|
+
{ type: "function", name: "codeChunk1", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
174
|
+
{ type: "function", name: "deployedCodeHash", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "bytes32" }] },
|
|
175
|
+
{ type: "function", name: "predict", stateMutability: "view", inputs: [{ type: "address" }, { type: "address" }, { type: "address" }, { type: "bytes32" }], outputs: [{ type: "address" }] },
|
|
176
|
+
] as const;
|
|
177
|
+
export const lifecycleV4PoolKeyComponents = [
|
|
178
|
+
{ name: "currency0", type: "address" }, { name: "currency1", type: "address" }, { name: "fee", type: "uint24" },
|
|
179
|
+
{ name: "tickSpacing", type: "int24" }, { name: "hooks", type: "address" },
|
|
180
|
+
] as const;
|
|
181
|
+
export const lifecycleV4HookPoolConfigComponents = [
|
|
182
|
+
{ name: "collector", type: "address" }, { name: "liquidityLocker", type: "address" }, { name: "quoteCurrency", type: "address" },
|
|
183
|
+
{ name: "feeMode", type: "uint8" }, { name: "hookFeePips", type: "uint24" }, { name: "protocolFeeDenominator", type: "uint8" },
|
|
184
|
+
{ name: "treasury", type: "address" }, { name: "externalLiquidityDisabled", type: "bool" }, { name: "oracleConfigId", type: "bytes32" },
|
|
185
|
+
] as const;
|
|
186
|
+
export const lifecycleV4HookAbi = [
|
|
187
|
+
{ type: "function", name: "poolManager", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
188
|
+
{ type: "function", name: "registrar", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
189
|
+
{ type: "function", name: "oracleFactory", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
190
|
+
{ type: "function", name: "REQUIRED_HOOK_FLAGS", stateMutability: "view", inputs: [], outputs: [{ type: "uint160" }] },
|
|
191
|
+
{ type: "function", name: "ALL_HOOK_MASK", stateMutability: "view", inputs: [], outputs: [{ type: "uint160" }] },
|
|
192
|
+
{ type: "function", name: "registered", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "bool" }] },
|
|
193
|
+
{ type: "function", name: "initialized", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "bool" }] },
|
|
194
|
+
{ type: "function", name: "openingCompletedAt", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "uint256" }] },
|
|
195
|
+
{ type: "function", name: "oracleInitializedAt", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "uint256" }] },
|
|
196
|
+
{ type: "function", name: "poolKey", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "tuple", components: lifecycleV4PoolKeyComponents }] },
|
|
197
|
+
{ type: "function", name: "poolConfig", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "tuple", components: lifecycleV4HookPoolConfigComponents }] },
|
|
198
|
+
{ type: "function", name: "registerPool", stateMutability: "nonpayable", inputs: [{ type: "tuple", components: lifecycleV4PoolKeyComponents }, { type: "tuple", components: lifecycleV4HookPoolConfigComponents }], outputs: [] },
|
|
199
|
+
{ type: "function", name: "completePoolOpening", stateMutability: "nonpayable", inputs: [{ type: "tuple", components: lifecycleV4PoolKeyComponents }], outputs: [] },
|
|
200
|
+
{ type: "function", name: "validateCollector", stateMutability: "view", inputs: [{ type: "tuple", components: lifecycleV4PoolKeyComponents }, { type: "address" }, { type: "address" }], outputs: [] },
|
|
201
|
+
{ type: "function", name: "collectFees", stateMutability: "nonpayable", inputs: [{ type: "tuple", components: lifecycleV4PoolKeyComponents }], outputs: [{ type: "uint256" }, { type: "uint256" }] },
|
|
202
|
+
{ type: "function", name: "validateOracleConfig", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "uint24" }, { type: "uint16" }] },
|
|
203
|
+
{ type: "function", name: "observeTruncated", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "uint32[]" }], outputs: [{ type: "int56[]" }, { type: "uint160[]" }] },
|
|
204
|
+
{ type: "function", name: "increaseObservationCardinalityNext", stateMutability: "nonpayable", inputs: [{ type: "bytes32" }, { type: "uint16" }], outputs: [] },
|
|
205
|
+
{ type: "function", name: "pendingFees", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "address" }], outputs: [{ type: "uint256" }] },
|
|
206
|
+
{ type: "function", name: "settledFees", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "address" }], outputs: [{ type: "uint256" }] },
|
|
207
|
+
] as const;
|
|
208
|
+
export const poolBoundLaunchFeeHookV1Abi = [
|
|
209
|
+
...lifecycleV4HookAbi,
|
|
210
|
+
{ type: "constructor", stateMutability: "nonpayable", inputs: [boundParametersInput] },
|
|
211
|
+
{ type: "function", name: "boundPoolId", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
212
|
+
{ type: "function", name: "deploymentConfigHash", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
213
|
+
{ type: "function", name: "marketCommitment", stateMutability: "view", inputs: [], outputs: [{ type: "bytes32" }] },
|
|
214
|
+
{ type: "function", name: "core", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
215
|
+
{ type: "function", name: "liquidityLocker", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
216
|
+
{ type: "function", name: "token", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
217
|
+
{ type: "function", name: "openingSqrtPriceX96", stateMutability: "view", inputs: [], outputs: [{ type: "uint160" }] },
|
|
218
|
+
{ type: "function", name: "expectedPositionCount", stateMutability: "view", inputs: [], outputs: [{ type: "uint32" }] },
|
|
219
|
+
] as const;
|
|
220
|
+
export const lifecycleV4LockerAbi = [
|
|
221
|
+
{ type: "function", name: "poolManager", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
222
|
+
{ type: "function", name: "launcher", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
223
|
+
{ type: "function", name: "positionCount", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "uint256" }] },
|
|
224
|
+
{ type: "function", name: "isSealed", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "bool" }] },
|
|
225
|
+
] as const;
|
|
226
|
+
export const poolFeeCollectorFactoryV1Abi = [
|
|
227
|
+
{ type: "function", name: "collectorDeployer", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
228
|
+
{ type: "function", name: "poolBoundHookParameters", stateMutability: "view", inputs: [
|
|
229
|
+
{ name: "registrar", type: "address" }, { name: "token", type: "address" }, { name: "market", type: "tuple", components: lifecycleMarketComponents },
|
|
230
|
+
], outputs: [boundParametersInput, { name: "salt", type: "bytes32" }] },
|
|
231
|
+
{ type: "function", name: "decodeAndValidate", stateMutability: "view", inputs: [{ type: "address" }, { type: "address" }, { type: "tuple", components: lifecycleMarketComponents }], outputs: [{ type: "tuple", components: v4LifecycleMarketComponents }] },
|
|
232
|
+
{ type: "function", name: "poolBoundDeploymentMetadata", stateMutability: "view", inputs: [{ type: "address" }, { type: "address" }, { type: "tuple", components: lifecycleMarketComponents }], outputs: [{ type: "address" }, { type: "bytes32" }, { type: "bytes32" }, { type: "address" }] },
|
|
233
|
+
{ type: "function", name: "dependencyDigest", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "bytes32" }] },
|
|
234
|
+
{ type: "function", name: "create", stateMutability: "nonpayable", inputs: [{ type: "address" }, { type: "address" }, { type: "tuple", components: lifecycleV4PoolKeyComponents }, { type: "uint256" }], outputs: [{ type: "address" }] },
|
|
235
|
+
] as const;
|
|
236
|
+
export const lifecycleDirectoryAbi = [
|
|
237
|
+
{ type: "function", name: "core", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
238
|
+
{ type: "function", name: "market", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "uint32" }], outputs: [{ name: "adapter", type: "address" }, { name: "prepared", type: "tuple", components: preparedMarketV1Components }] },
|
|
239
|
+
{ type: "function", name: "positions", stateMutability: "view", inputs: [{ type: "bytes32" }, { type: "uint32" }, { type: "uint256" }, { type: "uint256" }], outputs: [{ type: "tuple[]", components: positionIdentityV1Components }] },
|
|
240
|
+
{ type: "function", name: "launches", stateMutability: "view", inputs: [{ type: "uint256" }, { type: "uint256" }], outputs: [{ type: "bytes32[]" }] },
|
|
241
|
+
{ type: "function", name: "launchOfToken", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "bytes32" }] },
|
|
242
|
+
] as const;
|
|
243
|
+
export const lifecycleFundingEscrowAbi = [
|
|
244
|
+
{ type: "function", name: "core", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
245
|
+
{ type: "function", name: "wrappedNative", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
246
|
+
] as const;
|
|
247
|
+
export const lifecycleErc20Abi = [
|
|
248
|
+
{ type: "function", name: "balanceOf", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }] },
|
|
249
|
+
{ type: "function", name: "allowance", stateMutability: "view", inputs: [{ type: "address" }, { type: "address" }], outputs: [{ type: "uint256" }] },
|
|
250
|
+
{ type: "function", name: "approve", stateMutability: "nonpayable", inputs: [{ type: "address" }, { type: "uint256" }], outputs: [{ type: "bool" }] },
|
|
251
|
+
] as const;
|
|
252
|
+
export const lifecycleOracleFactoryAbi = [
|
|
253
|
+
{ type: "function", name: "oracleConfigs", stateMutability: "view", inputs: [{ type: "bytes32" }], outputs: [{ type: "uint24" }, { type: "uint16" }] },
|
|
254
|
+
] as const;
|
|
255
|
+
export const lifecycleFeeHubAbi = [
|
|
256
|
+
{ type: "function", name: "economicVersion", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
257
|
+
{ type: "function", name: "implementationRegistry", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
258
|
+
{ type: "function", name: "protocolMaximumDeveloperFeeBps", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
259
|
+
{ type: "function", name: "configurator", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
260
|
+
{ type: "function", name: "launchToken", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
261
|
+
{ type: "function", name: "feeOwnerRegistry", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
262
|
+
{ type: "function", name: "rewards", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
263
|
+
{ type: "function", name: "requiresOwner", stateMutability: "view", inputs: [], outputs: [{ type: "bool" }] },
|
|
264
|
+
{ type: "function", name: "requiresRewards", stateMutability: "view", inputs: [], outputs: [{ type: "bool" }] },
|
|
265
|
+
{ type: "function", name: "rewardAssets", stateMutability: "view", inputs: [], outputs: [{ type: "address[]" }] },
|
|
266
|
+
{ type: "function", name: "sourceAssets", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "address[]" }] },
|
|
267
|
+
{ type: "function", name: "sourceTerms", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "tuple", components: sourceTermsV3Components }] },
|
|
268
|
+
{ type: "function", name: "claimableDeveloperFees", stateMutability: "view", inputs: [{ type: "address" }, { type: "address" }], outputs: [{ type: "uint256" }] },
|
|
269
|
+
{ type: "function", name: "reservedDeveloperFees", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }] },
|
|
270
|
+
{ type: "function", name: "claimDeveloperFees", stateMutability: "nonpayable", inputs: [{ name: "authorId", type: "address" }, { name: "asset", type: "address" }], outputs: [{ name: "amount", type: "uint256" }] },
|
|
271
|
+
{ type: "event", name: "DeveloperFeesClaimed", anonymous: false, inputs: [
|
|
272
|
+
{ name: "authorId", type: "address", indexed: true }, { name: "asset", type: "address", indexed: true },
|
|
273
|
+
{ name: "payout", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false },
|
|
274
|
+
] },
|
|
275
|
+
{ type: "event", name: "DeveloperFeesCredited", anonymous: false, inputs: [
|
|
276
|
+
{ name: "authorId", type: "address", indexed: true }, { name: "source", type: "address", indexed: true },
|
|
277
|
+
{ name: "asset", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false },
|
|
278
|
+
] },
|
|
279
|
+
{ type: "error", name: "UnsupportedAsset", inputs: [] },
|
|
280
|
+
{ type: "function", name: "MAX_EXECUTOR_FEE_BPS", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
281
|
+
{ type: "function", name: "executorFeeBps", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
282
|
+
{ type: "function", name: "setExecutorFeeBps", stateMutability: "nonpayable", inputs: [{ name: "newFeeBps", type: "uint16" }], outputs: [] },
|
|
283
|
+
{ type: "event", name: "ExecutorFeeUpdated", inputs: [{ name: "feeOwner", type: "address", indexed: true }, { name: "previousFeeBps", type: "uint16", indexed: false }, { name: "newFeeBps", type: "uint16", indexed: false }], anonymous: false },
|
|
284
|
+
{ type: "function", name: "finalized", stateMutability: "view", inputs: [], outputs: [{ type: "bool" }] },
|
|
285
|
+
{ type: "function", name: "assets", stateMutability: "view", inputs: [], outputs: [{ type: "address[]" }] },
|
|
286
|
+
{ type: "function", name: "sources", stateMutability: "view", inputs: [], outputs: [{ type: "address[]" }] },
|
|
287
|
+
{ type: "function", name: "policy", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "tuple", components: lifecycleFeePolicyComponents }] },
|
|
288
|
+
{ type: "function", name: "claimAndSplit", stateMutability: "nonpayable", inputs: [], outputs: [{ type: "tuple[]", components: [{ name: "asset", type: "address" }, { name: "amount", type: "uint256" }] }] },
|
|
289
|
+
{ type: "event", name: "Distributed", anonymous: false, inputs: [
|
|
290
|
+
{ name: "asset", type: "address", indexed: true }, { name: "owner", type: "address", indexed: true }, { name: "executor", type: "address", indexed: true },
|
|
291
|
+
{ name: "newlyCollected", type: "uint256", indexed: false }, { name: "executorAmount", type: "uint256", indexed: false },
|
|
292
|
+
{ name: "ownerAmount", type: "uint256", indexed: false }, { name: "developerAmount", type: "uint256", indexed: false },
|
|
293
|
+
{ name: "rewardsAmount", type: "uint256", indexed: false }, { name: "burnAmount", type: "uint256", indexed: false },
|
|
294
|
+
] },
|
|
295
|
+
{ type: "function", name: "claimableOwnerFees", stateMutability: "view", inputs: [{ name: "owner", type: "address" }, { name: "asset", type: "address" }], outputs: [{ type: "uint256" }] },
|
|
296
|
+
{ type: "function", name: "reservedOwnerFees", stateMutability: "view", inputs: [{ name: "asset", type: "address" }], outputs: [{ type: "uint256" }] },
|
|
297
|
+
{ type: "function", name: "claimOwnerFees", stateMutability: "nonpayable", inputs: [{ name: "asset", type: "address" }, { name: "recipient", type: "address" }], outputs: [{ name: "amount", type: "uint256" }] },
|
|
298
|
+
{ type: "event", name: "OwnerFeesCredited", inputs: [{ name: "owner", type: "address", indexed: true }, { name: "asset", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false }], anonymous: false },
|
|
299
|
+
{ type: "event", name: "OwnerFeesClaimed", inputs: [{ name: "owner", type: "address", indexed: true }, { name: "asset", type: "address", indexed: true }, { name: "recipient", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false }], anonymous: false },
|
|
300
|
+
] as const;
|
|
301
|
+
export const developerClaimResultV3Components = [
|
|
302
|
+
{ name: "hub", type: "address" }, { name: "asset", type: "address" }, { name: "amount", type: "uint256" },
|
|
303
|
+
{ name: "status", type: "uint8" }, { name: "errorSelector", type: "bytes4" },
|
|
304
|
+
] as const;
|
|
305
|
+
export const lifecycleFeeHubFactoryAbi = [
|
|
306
|
+
{ type: "function", name: "isHub", stateMutability: "view", inputs: [{ type: "address" }], outputs: [{ type: "bool" }] },
|
|
307
|
+
{ type: "function", name: "implementationRegistry", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
308
|
+
{ type: "function", name: "deploymentAuthority", stateMutability: "view", inputs: [], outputs: [{ type: "address" }] },
|
|
309
|
+
{ type: "function", name: "claimDeveloperFeesPage", stateMutability: "nonpayable", inputs: [
|
|
310
|
+
{ name: "authorId", type: "address" }, { name: "offset", type: "uint256" }, { name: "limit", type: "uint256" }, { name: "assets", type: "address[]" },
|
|
311
|
+
], outputs: [{ name: "results", type: "tuple[]", components: developerClaimResultV3Components }, { name: "nextOffset", type: "uint256" }, { name: "total", type: "uint256" }] },
|
|
312
|
+
{ type: "event", name: "DeveloperClaimResult", anonymous: false, inputs: [
|
|
313
|
+
{ name: "authorId", type: "address", indexed: true }, { name: "hub", type: "address", indexed: true },
|
|
314
|
+
{ name: "asset", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false },
|
|
315
|
+
{ name: "status", type: "uint8", indexed: false }, { name: "errorSelector", type: "bytes4", indexed: false },
|
|
316
|
+
] },
|
|
317
|
+
{ type: "event", name: "DeveloperClaimPage", anonymous: false, inputs: [
|
|
318
|
+
{ name: "authorId", type: "address", indexed: true }, { name: "offset", type: "uint256", indexed: false },
|
|
319
|
+
{ name: "nextOffset", type: "uint256", indexed: false }, { name: "total", type: "uint256", indexed: false },
|
|
320
|
+
] },
|
|
321
|
+
] as const;
|
|
322
|
+
|
|
323
|
+
/** Multiasset staking and dividend claims; return values and RewardPaid are beneficiary net. */
|
|
324
|
+
export const lifecycleRewardsAbi = [
|
|
325
|
+
{ type: "function", name: "rewardAssets", stateMutability: "view", inputs: [], outputs: [{ type: "address[]" }] },
|
|
326
|
+
{ type: "function", name: "earned", stateMutability: "view", inputs: [{ name: "beneficiary", type: "address" }, { name: "asset", type: "address" }], outputs: [{ type: "uint256" }] },
|
|
327
|
+
{ type: "function", name: "pendingRewards", stateMutability: "view", inputs: [{ name: "beneficiary", type: "address" }], outputs: [{ type: "uint256[]" }] },
|
|
328
|
+
{ type: "function", name: "lifetimeRewardsPaid", stateMutability: "view", inputs: [{ name: "asset", type: "address" }, { name: "beneficiary", type: "address" }], outputs: [{ type: "uint256" }] },
|
|
329
|
+
{ type: "function", name: "claim", stateMutability: "nonpayable", inputs: [], outputs: [{ type: "uint256[]" }] },
|
|
330
|
+
{ type: "function", name: "claimFor", stateMutability: "nonpayable", inputs: [{ name: "beneficiary", type: "address" }], outputs: [{ type: "uint256[]" }] },
|
|
331
|
+
{ type: "function", name: "claimRange", stateMutability: "nonpayable", inputs: [{ name: "beneficiary", type: "address" }, { name: "start", type: "uint256" }, { name: "count", type: "uint256" }], outputs: [{ type: "uint256[]" }] },
|
|
332
|
+
{ type: "event", name: "RewardPaid", inputs: [{ name: "beneficiary", type: "address", indexed: true }, { name: "asset", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false }], anonymous: false },
|
|
333
|
+
{ type: "event", name: "RewardClaimBountyPaid", inputs: [{ name: "executor", type: "address", indexed: true }, { name: "beneficiary", type: "address", indexed: true }, { name: "asset", type: "address", indexed: true }, { name: "amount", type: "uint256", indexed: false }], anonymous: false },
|
|
334
|
+
] as const;
|
|
335
|
+
|
|
336
|
+
/** Dividend-only policy; initially zero, controlled by the token's current registered fee owner. */
|
|
337
|
+
export const lifecycleDividendAbi = [
|
|
338
|
+
...lifecycleRewardsAbi,
|
|
339
|
+
{ type: "function", name: "MAX_DIVIDEND_BOUNTY_BPS", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
340
|
+
{ type: "function", name: "dividendBountyBps", stateMutability: "view", inputs: [], outputs: [{ type: "uint16" }] },
|
|
341
|
+
{ type: "function", name: "setDividendBountyBps", stateMutability: "nonpayable", inputs: [{ name: "newBountyBps", type: "uint16" }], outputs: [] },
|
|
342
|
+
{ type: "event", name: "DividendBountyUpdated", inputs: [{ name: "feeOwner", type: "address", indexed: true }, { name: "previousBountyBps", type: "uint16", indexed: false }, { name: "newBountyBps", type: "uint16", indexed: false }], anonymous: false },
|
|
343
|
+
] as const;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { decodeEventLog, encodeFunctionData, isAddress, zeroAddress, type Address, type Hex } from "viem";
|
|
2
|
+
import { launchLifecycleAbi, lifecycleFeeHubAbi, lifecycleFeeHubFactoryAbi, lifecycleRegistryAbi } from "./abi.js";
|
|
3
|
+
import { assertLifecycleBlock, lifecycleRpc, readLifecycleBlock, readLifecycleContract, rpcQuantity } from "./rpc.js";
|
|
4
|
+
import type { SourceTermsV3 } from "./schema.js";
|
|
5
|
+
import { LifecyclePlanningError, type LifecycleBlock, type LifecycleRpcClient } from "./types.js";
|
|
6
|
+
|
|
7
|
+
export type LifecycleUnsignedTransaction = { chainId: number; from: Address; to: Address; data: Hex; value: bigint };
|
|
8
|
+
export type LifecycleAuthorOptions = { client: LifecycleRpcClient; registry: Address; authorId: Address };
|
|
9
|
+
export type LifecycleAuthor = {
|
|
10
|
+
registry: Address; core: Address; factory: Address; authorId: Address; payout: Address; known: boolean;
|
|
11
|
+
hubCount: bigint; chainId: bigint; blockNumber: bigint; blockHash: Hex;
|
|
12
|
+
};
|
|
13
|
+
export type AuthorHubsPage = LifecycleAuthor & { hubs: readonly Address[]; offset: bigint; nextOffset: bigint; total: bigint; cursorComplete: boolean };
|
|
14
|
+
export type DeveloperFees = LifecycleAuthor & {
|
|
15
|
+
hub: Address; assets: readonly Address[];
|
|
16
|
+
balances: readonly { asset: Address; supported: boolean; claimable: bigint; reserved: bigint }[];
|
|
17
|
+
sources: readonly { source: Address; assets: readonly Address[]; terms: SourceTermsV3 }[];
|
|
18
|
+
};
|
|
19
|
+
export type DeveloperClaimTransaction = LifecycleUnsignedTransaction & {
|
|
20
|
+
claim: { kind: "direct"; registry: Address; factory: Address; authorId: Address; hub: Address; asset: Address }
|
|
21
|
+
| { kind: "page"; registry: Address; factory: Address; authorId: Address; offset: bigint; limit: bigint; assets: readonly Address[] };
|
|
22
|
+
};
|
|
23
|
+
export type DeveloperClaimResult = { hub: Address; asset: Address; amount: bigint; status: 0 | 1 | 2 | 3; outcome: "paid" | "zero" | "unsupported" | "failed"; errorSelector: Hex; payout?: Address };
|
|
24
|
+
export type DeveloperClaimReceipt = {
|
|
25
|
+
executionSucceeded: boolean; outcome: "observed" | "unobserved" | "reverted";
|
|
26
|
+
results: readonly DeveloperClaimResult[]; retryableResults: readonly DeveloperClaimResult[];
|
|
27
|
+
cursorComplete: boolean; paymentsSucceeded: boolean; offset?: bigint; nextOffset?: bigint; total?: bigint; reason?: string;
|
|
28
|
+
};
|
|
29
|
+
export type DeveloperClaimReceiptInput = {
|
|
30
|
+
status: "success" | "reverted" | "0x1" | "0x0" | number | bigint;
|
|
31
|
+
from: Address; to: Address | null; transactionHash?: Hex;
|
|
32
|
+
logs: readonly { address: Address; data: Hex; topics: readonly Hex[]; removed?: boolean }[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function requireAddress(address: Address, label: string): void {
|
|
36
|
+
if (!isAddress(address) || address.toLowerCase() === zeroAddress) throw new LifecyclePlanningError("INVALID_AUTHOR_ADDRESS", `${label} must be a nonzero address`);
|
|
37
|
+
}
|
|
38
|
+
function validateAssets(assets: readonly Address[]): void {
|
|
39
|
+
if (assets.length > 8) throw new LifecyclePlanningError("INVALID_CLAIM_ASSETS", "Claims accept at most eight explicit assets");
|
|
40
|
+
let previous = 0n;
|
|
41
|
+
for (const asset of assets) {
|
|
42
|
+
requireAddress(asset, "Claim asset");
|
|
43
|
+
if (BigInt(asset) <= previous) throw new LifecyclePlanningError("INVALID_CLAIM_ASSETS", "Explicit assets must be sorted, unique and nonzero");
|
|
44
|
+
previous = BigInt(asset);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function requirePage(offset: bigint, limit: bigint, maximum: bigint): void {
|
|
48
|
+
if (offset < 0n || offset >= 1n << 256n || limit < 1n || limit > maximum) throw new LifecyclePlanningError("INVALID_AUTHOR_PAGE", `Page offset must be uint256 and limit must be 1..${maximum}`);
|
|
49
|
+
}
|
|
50
|
+
async function readAuthorContext(options: LifecycleAuthorOptions, block: LifecycleBlock): Promise<LifecycleAuthor> {
|
|
51
|
+
const { client, registry, authorId } = options;
|
|
52
|
+
requireAddress(registry, "Implementation registry"); requireAddress(authorId, "Stable author identity");
|
|
53
|
+
const chainId = rpcQuantity(await lifecycleRpc(client, "eth_chainId"), "author chain ID");
|
|
54
|
+
const core = await readLifecycleContract<Address>(client, registry, lifecycleRegistryAbi, "core", [], block);
|
|
55
|
+
requireAddress(core, "Registry core");
|
|
56
|
+
if ((await readLifecycleContract<Address>(client, core, launchLifecycleAbi, "registry", [], block)).toLowerCase() !== registry.toLowerCase()) throw new LifecyclePlanningError("REGISTRY_BINDING", "Selected core does not bind this implementation registry");
|
|
57
|
+
const factory = await readLifecycleContract<Address>(client, core, launchLifecycleAbi, "feeFactory", [], block);
|
|
58
|
+
requireAddress(factory, "Canonical fee factory");
|
|
59
|
+
if ((await readLifecycleContract<Address>(client, factory, lifecycleFeeHubFactoryAbi, "implementationRegistry", [], block)).toLowerCase() !== registry.toLowerCase() ||
|
|
60
|
+
(await readLifecycleContract<Address>(client, factory, lifecycleFeeHubFactoryAbi, "deploymentAuthority", [], block)).toLowerCase() !== core.toLowerCase()) throw new LifecyclePlanningError("FEE_FACTORY_BINDING", "Canonical fee factory differs from the selected registry/core domain");
|
|
61
|
+
const payout = await readLifecycleContract<Address>(client, registry, lifecycleRegistryAbi, "authorPayout", [authorId], block);
|
|
62
|
+
const hubCount = await readLifecycleContract<bigint>(client, registry, lifecycleRegistryAbi, "authorHubCount", [authorId], block);
|
|
63
|
+
return { registry, core, factory, authorId, payout, known: payout.toLowerCase() !== zeroAddress, hubCount, chainId, blockNumber: block.number, blockHash: block.hash };
|
|
64
|
+
}
|
|
65
|
+
async function requireCanonicalHub(client: LifecycleRpcClient, author: LifecycleAuthor, hub: Address, block: LifecycleBlock): Promise<void> {
|
|
66
|
+
requireAddress(hub, "Developer fee hub");
|
|
67
|
+
// Membership is checked through registry.core -> core.feeFactory, before ANY hub self-report.
|
|
68
|
+
if (!await readLifecycleContract<boolean>(client, author.factory, lifecycleFeeHubFactoryAbi, "isHub", [hub], block)) throw new LifecyclePlanningError("UNAUTHENTICATED_HUB", "Hub is not a member of this registry core's canonical V3 factory");
|
|
69
|
+
if (await readLifecycleContract<number>(client, hub, lifecycleFeeHubAbi, "economicVersion", [], block) !== 3 ||
|
|
70
|
+
(await readLifecycleContract<Address>(client, hub, lifecycleFeeHubAbi, "implementationRegistry", [], block)).toLowerCase() !== author.registry.toLowerCase() ||
|
|
71
|
+
(await readLifecycleContract<Address>(client, hub, lifecycleFeeHubAbi, "configurator", [], block)).toLowerCase() !== author.core.toLowerCase()) throw new LifecyclePlanningError("FEE_HUB_BINDING", "Canonical hub does not implement the selected V3 economic domain");
|
|
72
|
+
}
|
|
73
|
+
function unsignedTransaction(options: { account: Address; chainId: bigint }, author: LifecycleAuthor, to: Address, data: Hex): LifecycleUnsignedTransaction {
|
|
74
|
+
requireAddress(options.account, "Transaction account");
|
|
75
|
+
if (options.chainId !== author.chainId || options.chainId <= 0n || options.chainId > BigInt(Number.MAX_SAFE_INTEGER)) throw new LifecyclePlanningError("CHAIN_MISMATCH", "Unsigned transaction chain must exactly match the selected author domain");
|
|
76
|
+
return { chainId: Number(options.chainId), from: options.account, to, data, value: 0n };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function readLifecycleAuthor(options: LifecycleAuthorOptions, pinnedBlock?: LifecycleBlock): Promise<LifecycleAuthor> {
|
|
80
|
+
const block = pinnedBlock ?? await readLifecycleBlock(options.client);
|
|
81
|
+
const author = await readAuthorContext(options, block);
|
|
82
|
+
if (pinnedBlock === undefined) await assertLifecycleBlock(options.client, block);
|
|
83
|
+
return author;
|
|
84
|
+
}
|
|
85
|
+
export async function readAuthorHubs(options: LifecycleAuthorOptions & { offset?: bigint; limit?: bigint }, pinnedBlock?: LifecycleBlock): Promise<AuthorHubsPage> {
|
|
86
|
+
const offset = options.offset ?? 0n; const limit = options.limit ?? 100n;
|
|
87
|
+
requirePage(offset, limit, 100n);
|
|
88
|
+
const block = pinnedBlock ?? await readLifecycleBlock(options.client);
|
|
89
|
+
const author = await readAuthorContext(options, block);
|
|
90
|
+
if (offset > author.hubCount) throw new LifecyclePlanningError("INVALID_AUTHOR_PAGE", "Author discovery offset exceeds the registered hub count");
|
|
91
|
+
const [hubs, nextOffset, total] = await readLifecycleContract<readonly [readonly Address[], bigint, bigint]>(options.client, options.registry, lifecycleRegistryAbi, "authorHubs", [options.authorId, offset, limit], block);
|
|
92
|
+
if (total !== author.hubCount || nextOffset !== offset + BigInt(hubs.length) || nextOffset > total || BigInt(hubs.length) > limit) throw new LifecyclePlanningError("INVALID_AUTHOR_PAGE", "Registry returned an inconsistent discovery cursor");
|
|
93
|
+
for (const hub of hubs) await requireCanonicalHub(options.client, author, hub, block);
|
|
94
|
+
if (pinnedBlock === undefined) await assertLifecycleBlock(options.client, block);
|
|
95
|
+
return { ...author, hubs, offset, nextOffset, total, cursorComplete: nextOffset === total };
|
|
96
|
+
}
|
|
97
|
+
export async function readDeveloperFees(options: LifecycleAuthorOptions & { hub: Address; assets?: readonly Address[] }, pinnedBlock?: LifecycleBlock): Promise<DeveloperFees> {
|
|
98
|
+
const explicitAssets = options.assets ?? [];
|
|
99
|
+
validateAssets(explicitAssets);
|
|
100
|
+
const block = pinnedBlock ?? await readLifecycleBlock(options.client);
|
|
101
|
+
const author = await readAuthorContext(options, block);
|
|
102
|
+
await requireCanonicalHub(options.client, author, options.hub, block);
|
|
103
|
+
const assets = await readLifecycleContract<readonly Address[]>(options.client, options.hub, lifecycleFeeHubAbi, "assets", [], block);
|
|
104
|
+
const selected = explicitAssets.length === 0 ? assets : explicitAssets;
|
|
105
|
+
const balances: { asset: Address; supported: boolean; claimable: bigint; reserved: bigint }[] = [];
|
|
106
|
+
for (const asset of selected) {
|
|
107
|
+
const supported = assets.some((actual) => actual.toLowerCase() === asset.toLowerCase());
|
|
108
|
+
const claimable = supported ? await readLifecycleContract<bigint>(options.client, options.hub, lifecycleFeeHubAbi, "claimableDeveloperFees", [options.authorId, asset], block) : 0n;
|
|
109
|
+
const reserved = supported ? await readLifecycleContract<bigint>(options.client, options.hub, lifecycleFeeHubAbi, "reservedDeveloperFees", [asset], block) : 0n;
|
|
110
|
+
balances.push({ asset, supported, claimable, reserved });
|
|
111
|
+
}
|
|
112
|
+
const sources: { source: Address; assets: readonly Address[]; terms: SourceTermsV3 }[] = [];
|
|
113
|
+
for (const source of await readLifecycleContract<readonly Address[]>(options.client, options.hub, lifecycleFeeHubAbi, "sources", [], block)) {
|
|
114
|
+
sources.push({ source, assets: await readLifecycleContract<readonly Address[]>(options.client, options.hub, lifecycleFeeHubAbi, "sourceAssets", [source], block),
|
|
115
|
+
terms: await readLifecycleContract<SourceTermsV3>(options.client, options.hub, lifecycleFeeHubAbi, "sourceTerms", [source], block) });
|
|
116
|
+
}
|
|
117
|
+
if (pinnedBlock === undefined) await assertLifecycleBlock(options.client, block);
|
|
118
|
+
return { ...author, hub: options.hub, assets, balances, sources };
|
|
119
|
+
}
|
|
120
|
+
export async function buildSetAuthorPayoutTransaction(options: LifecycleAuthorOptions & { payout: Address; account: Address; chainId: bigint }): Promise<LifecycleUnsignedTransaction> {
|
|
121
|
+
requireAddress(options.payout, "New payout/controller");
|
|
122
|
+
const block = await readLifecycleBlock(options.client);
|
|
123
|
+
const author = await readAuthorContext(options, block);
|
|
124
|
+
if (!author.known) throw new LifecyclePlanningError("UNKNOWN_AUTHOR", "Cannot set a payout for an unknown stable author identity");
|
|
125
|
+
const admin = await readLifecycleContract<Address>(options.client, options.registry, lifecycleRegistryAbi, "admin", [], block);
|
|
126
|
+
if (![author.payout, admin].some((address) => address.toLowerCase() === options.account.toLowerCase())) throw new LifecyclePlanningError("AUTHOR_AUTHORIZATION", "Only the registry admin or current live payout/controller may change routing");
|
|
127
|
+
const transaction = unsignedTransaction(options, author, options.registry, encodeFunctionData({ abi: lifecycleRegistryAbi, functionName: "setAuthorPayout", args: [options.authorId, options.payout] }));
|
|
128
|
+
await assertLifecycleBlock(options.client, block);
|
|
129
|
+
return transaction;
|
|
130
|
+
}
|
|
131
|
+
export async function buildClaimDeveloperFeesTransaction(options: LifecycleAuthorOptions & { hub: Address; asset: Address; account: Address; chainId: bigint }): Promise<DeveloperClaimTransaction> {
|
|
132
|
+
requireAddress(options.asset, "Developer fee asset");
|
|
133
|
+
const block = await readLifecycleBlock(options.client);
|
|
134
|
+
const author = await readAuthorContext(options, block);
|
|
135
|
+
await requireCanonicalHub(options.client, author, options.hub, block);
|
|
136
|
+
const assets = await readLifecycleContract<readonly Address[]>(options.client, options.hub, lifecycleFeeHubAbi, "assets", [], block);
|
|
137
|
+
if (!assets.some((asset) => asset.toLowerCase() === options.asset.toLowerCase())) throw new LifecyclePlanningError("UNSUPPORTED_ASSET", "Direct developer claims require an asset supported by this canonical hub");
|
|
138
|
+
const transaction = unsignedTransaction(options, author, options.hub, encodeFunctionData({ abi: lifecycleFeeHubAbi, functionName: "claimDeveloperFees", args: [options.authorId, options.asset] }));
|
|
139
|
+
await assertLifecycleBlock(options.client, block);
|
|
140
|
+
return { ...transaction, claim: { kind: "direct", registry: options.registry, factory: author.factory, authorId: options.authorId, hub: options.hub, asset: options.asset } };
|
|
141
|
+
}
|
|
142
|
+
export async function buildClaimDeveloperFeesPageTransaction(options: LifecycleAuthorOptions & { offset: bigint; limit: bigint; assets?: readonly Address[]; account: Address; chainId: bigint }): Promise<DeveloperClaimTransaction> {
|
|
143
|
+
const assets = [...options.assets ?? []];
|
|
144
|
+
validateAssets(assets); requirePage(options.offset, options.limit, 10n);
|
|
145
|
+
const block = await readLifecycleBlock(options.client);
|
|
146
|
+
const page = await readAuthorHubs(options, block);
|
|
147
|
+
const transaction = unsignedTransaction(options, page, page.factory, encodeFunctionData({ abi: lifecycleFeeHubFactoryAbi, functionName: "claimDeveloperFeesPage", args: [options.authorId, options.offset, options.limit, assets] }));
|
|
148
|
+
await assertLifecycleBlock(options.client, block);
|
|
149
|
+
return { ...transaction, claim: { kind: "page", registry: options.registry, factory: page.factory, authorId: options.authorId, offset: options.offset, limit: options.limit, assets } };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Receipt logs report payment facts, not pending credits or a promise that every cursor row paid. */
|
|
153
|
+
export function decodeDeveloperClaimReceipt(options: { receipt: DeveloperClaimReceiptInput; transaction: DeveloperClaimTransaction }): DeveloperClaimReceipt {
|
|
154
|
+
const { receipt, transaction } = options; const claim = transaction.claim;
|
|
155
|
+
if (receipt.from.toLowerCase() !== transaction.from.toLowerCase() || receipt.to?.toLowerCase() !== transaction.to.toLowerCase() || transaction.value !== 0n) throw new LifecyclePlanningError("CLAIM_RECEIPT_IDENTITY", "Receipt account/target differs from the unsigned claim context");
|
|
156
|
+
const expectedData = claim.kind === "direct"
|
|
157
|
+
? encodeFunctionData({ abi: lifecycleFeeHubAbi, functionName: "claimDeveloperFees", args: [claim.authorId, claim.asset] })
|
|
158
|
+
: encodeFunctionData({ abi: lifecycleFeeHubFactoryAbi, functionName: "claimDeveloperFeesPage", args: [claim.authorId, claim.offset, claim.limit, claim.assets] });
|
|
159
|
+
if (transaction.data.toLowerCase() !== expectedData.toLowerCase() || transaction.to.toLowerCase() !== (claim.kind === "direct" ? claim.hub : claim.factory).toLowerCase()) throw new LifecyclePlanningError("CLAIM_RECEIPT_IDENTITY", "Unsigned context does not encode this exact fixed-destination claim");
|
|
160
|
+
const executionSucceeded = ["success", "0x1", 1, 1n].includes(receipt.status);
|
|
161
|
+
if (!executionSucceeded) {
|
|
162
|
+
if (!["reverted", "0x0", 0, 0n].includes(receipt.status)) throw new LifecyclePlanningError("INVALID_CLAIM_RECEIPT", "Receipt status is not a canonical success/revert value");
|
|
163
|
+
return { executionSucceeded: false, outcome: "reverted", results: [], retryableResults: [], cursorComplete: false, paymentsSucceeded: false, reason: "Claim execution reverted; no payment or cursor advancement occurred" };
|
|
164
|
+
}
|
|
165
|
+
const results: DeveloperClaimResult[] = [];
|
|
166
|
+
let cursor: { offset: bigint; nextOffset: bigint; total: bigint } | undefined;
|
|
167
|
+
const seen = new Set<string>();
|
|
168
|
+
for (const log of receipt.logs) {
|
|
169
|
+
if (log.address.toLowerCase() !== transaction.to.toLowerCase()) continue;
|
|
170
|
+
if (log.removed) throw new LifecyclePlanningError("CLAIM_RECEIPT_REORGED", "Removed claim logs cannot prove payment");
|
|
171
|
+
if (claim.kind === "direct") {
|
|
172
|
+
let event;
|
|
173
|
+
try { event = decodeEventLog({ abi: lifecycleFeeHubAbi, data: log.data, topics: log.topics as [Hex, ...Hex[]], strict: true }); } catch { continue; }
|
|
174
|
+
if (event.eventName !== "DeveloperFeesClaimed") continue;
|
|
175
|
+
if (event.args.authorId.toLowerCase() !== claim.authorId.toLowerCase() || event.args.asset.toLowerCase() !== claim.asset.toLowerCase() || event.args.amount === 0n || results.length !== 0) throw new LifecyclePlanningError("INVALID_CLAIM_RECEIPT", "Direct payment event differs from the expected author/asset or is duplicated");
|
|
176
|
+
results.push({ hub: claim.hub, asset: event.args.asset, amount: event.args.amount, status: 0, outcome: "paid", errorSelector: "0x00000000", payout: event.args.payout });
|
|
177
|
+
} else {
|
|
178
|
+
let event;
|
|
179
|
+
try { event = decodeEventLog({ abi: lifecycleFeeHubFactoryAbi, data: log.data, topics: log.topics as [Hex, ...Hex[]], strict: true }); } catch { continue; }
|
|
180
|
+
if (event.eventName === "DeveloperClaimPage") {
|
|
181
|
+
if (event.args.authorId.toLowerCase() !== claim.authorId.toLowerCase() || event.args.offset !== claim.offset || cursor !== undefined || event.args.nextOffset < claim.offset || event.args.nextOffset > event.args.total || event.args.nextOffset - claim.offset > claim.limit) throw new LifecyclePlanningError("INVALID_CLAIM_RECEIPT", "Page cursor differs from the bounded expected claim");
|
|
182
|
+
cursor = { offset: event.args.offset, nextOffset: event.args.nextOffset, total: event.args.total };
|
|
183
|
+
} else if (event.eventName === "DeveloperClaimResult") {
|
|
184
|
+
const { authorId, hub, asset, amount, status, errorSelector } = event.args;
|
|
185
|
+
const key = `${hub.toLowerCase()}:${asset.toLowerCase()}`;
|
|
186
|
+
if (authorId.toLowerCase() !== claim.authorId.toLowerCase() || status > 3 || seen.has(key) ||
|
|
187
|
+
(claim.assets.length !== 0 && !claim.assets.some((selected) => selected.toLowerCase() === asset.toLowerCase())) ||
|
|
188
|
+
(status === 0 ? amount === 0n : amount !== 0n) || (status < 2 && errorSelector !== "0x00000000")) throw new LifecyclePlanningError("INVALID_CLAIM_RECEIPT", "Factory result has a mismatched author, asset, status, amount or duplicate row");
|
|
189
|
+
seen.add(key);
|
|
190
|
+
results.push({ hub, asset, amount, status: status as 0 | 1 | 2 | 3, outcome: (["paid", "zero", "unsupported", "failed"] as const)[status]!, errorSelector });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (claim.kind === "page") {
|
|
195
|
+
if (cursor === undefined) throw new LifecyclePlanningError("INVALID_CLAIM_RECEIPT", "Successful page receipt lacks the canonical cursor event");
|
|
196
|
+
const hubCount = BigInt(new Set(results.map((result) => result.hub.toLowerCase())).size);
|
|
197
|
+
if (hubCount !== cursor.nextOffset - cursor.offset || (claim.assets.length !== 0 && BigInt(results.length) !== hubCount * BigInt(claim.assets.length))) throw new LifecyclePlanningError("INVALID_CLAIM_RECEIPT", "Receipt rows do not account for every hub/asset in the observed cursor page");
|
|
198
|
+
}
|
|
199
|
+
return { executionSucceeded: true, outcome: results.length !== 0 || cursor !== undefined ? "observed" : "unobserved", results,
|
|
200
|
+
retryableResults: results.filter((result) => result.status === 3), cursorComplete: cursor !== undefined && cursor.nextOffset === cursor.total,
|
|
201
|
+
paymentsSucceeded: (results.length !== 0 || cursor !== undefined) && results.every((result) => result.status < 2), ...cursor,
|
|
202
|
+
reason: claim.kind === "direct" && results.length === 0 ? "No direct payment event is present; zero credit is possible, but an amount is not receipt-proven" : undefined };
|
|
203
|
+
}
|