@ocap/tx-pipeline 1.30.26 → 1.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/appchain-sovereign-hub.d.mts +160 -0
- package/esm/appchain-sovereign-hub.mjs +348 -0
- package/esm/arcvault-external-adapter.d.mts +166 -0
- package/esm/arcvault-external-adapter.mjs +376 -0
- package/esm/encrypted-nft-envelope.d.mts +172 -0
- package/esm/encrypted-nft-envelope.mjs +458 -0
- package/esm/evm-simplified-bridge.d.mts +1370 -0
- package/esm/evm-simplified-bridge.mjs +3875 -0
- package/esm/give-to-mint-karma.d.mts +472 -0
- package/esm/give-to-mint-karma.mjs +1057 -0
- package/esm/helpers/replay-guard.d.mts +15 -0
- package/esm/helpers/replay-guard.mjs +23 -0
- package/esm/index.d.mts +10 -5
- package/esm/index.mjs +14 -10
- package/esm/legacy-protocol-sunset.d.mts +251 -0
- package/esm/legacy-protocol-sunset.mjs +1519 -0
- package/esm/library.d.mts +16 -0
- package/esm/library.mjs +17 -0
- package/esm/native-abt-exchange.d.mts +2055 -0
- package/esm/native-abt-exchange.mjs +7250 -0
- package/esm/ofac-screening.d.mts +17 -0
- package/esm/ofac-screening.mjs +39 -0
- package/esm/pipes/anti-land-attack.mjs +1 -1
- package/esm/pipes/decode-itx.mjs +46 -4
- package/esm/pipes/decode-tx.d.mts +2 -3
- package/esm/pipes/decode-tx.mjs +56 -115
- package/esm/pipes/extract-signer.mjs +2 -2
- package/esm/pipes/extract-state.mjs +14 -3
- package/esm/pipes/post-execution-invariant-gate.d.mts +61 -0
- package/esm/pipes/post-execution-invariant-gate.mjs +789 -0
- package/esm/pipes/pre-flight-waf.d.mts +73 -0
- package/esm/pipes/pre-flight-waf.mjs +756 -0
- package/esm/pipes/take-state-snapshot.mjs +3 -2
- package/esm/pipes/update-owner.mjs +39 -4
- package/esm/pipes/verify-account-migration.mjs +14 -4
- package/esm/pipes/verify-blocked.mjs +1 -1
- package/esm/pipes/verify-delegation.d.mts +22 -3
- package/esm/pipes/verify-delegation.mjs +259 -36
- package/esm/pipes/verify-list-size.mjs +1 -1
- package/esm/pipes/verify-multisig-v2.mjs +15 -7
- package/esm/pipes/verify-multisig.mjs +15 -7
- package/esm/pipes/verify-sender.mjs +1 -1
- package/esm/pipes/verify-signature.mjs +35 -6
- package/esm/pipes/verify-signer.mjs +2 -2
- package/esm/pipes/verify-state-diff.mjs +3 -3
- package/esm/pipes/verify-token-access.mjs +1 -1
- package/esm/pipes/verify-token-balance.mjs +13 -5
- package/esm/pipes/verify-transferrable.d.mts +8 -1
- package/esm/pipes/verify-transferrable.mjs +3 -3
- package/esm/pipes/verify-tx-input.mjs +2 -2
- package/esm/pipes/verify-tx-size.mjs +46 -2
- package/esm/pipes/verify-tx.mjs +5 -7
- package/esm/pipes/verify-updater.mjs +1 -1
- package/esm/social-economy-factories.d.mts +346 -0
- package/esm/social-economy-factories.mjs +845 -0
- package/esm/super-suites-foundation.d.mts +513 -0
- package/esm/super-suites-foundation.mjs +1241 -0
- package/esm/transaction-block.d.mts +471 -0
- package/esm/transaction-block.mjs +1906 -0
- package/esm/uniswap-erc7683-solver.d.mts +201 -0
- package/esm/uniswap-erc7683-solver.mjs +321 -0
- package/esm/uniswap-lp-copilot.d.mts +113 -0
- package/esm/uniswap-lp-copilot.mjs +320 -0
- package/esm/uniswap-router.d.mts +335 -0
- package/esm/uniswap-router.mjs +578 -0
- package/esm/uniswap-token-factory-graduation.d.mts +187 -0
- package/esm/uniswap-token-factory-graduation.mjs +426 -0
- package/esm/uniswap-v4-hook.d.mts +173 -0
- package/esm/uniswap-v4-hook.mjs +517 -0
- package/lib/appchain-sovereign-hub.cjs +352 -0
- package/lib/appchain-sovereign-hub.d.cts +160 -0
- package/lib/arcvault-external-adapter.cjs +383 -0
- package/lib/arcvault-external-adapter.d.cts +166 -0
- package/lib/encrypted-nft-envelope.cjs +477 -0
- package/lib/encrypted-nft-envelope.d.cts +172 -0
- package/lib/evm-simplified-bridge.cjs +3943 -0
- package/lib/evm-simplified-bridge.d.cts +1370 -0
- package/lib/give-to-mint-karma.cjs +1084 -0
- package/lib/give-to-mint-karma.d.cts +472 -0
- package/lib/helpers/replay-guard.cjs +27 -0
- package/lib/helpers/replay-guard.d.cts +15 -0
- package/lib/index.cjs +49 -16
- package/lib/index.d.cts +10 -5
- package/lib/legacy-protocol-sunset.cjs +1543 -0
- package/lib/legacy-protocol-sunset.d.cts +251 -0
- package/lib/library.cjs +303 -0
- package/lib/library.d.cts +16 -0
- package/lib/native-abt-exchange.cjs +7322 -0
- package/lib/native-abt-exchange.d.cts +2055 -0
- package/lib/ofac-screening.cjs +42 -0
- package/lib/ofac-screening.d.cts +17 -0
- package/lib/pipes/anti-land-attack.cjs +2 -2
- package/lib/pipes/decode-itx.cjs +46 -4
- package/lib/pipes/decode-itx.d.cts +1 -1
- package/lib/pipes/decode-tx.cjs +55 -116
- package/lib/pipes/decode-tx.d.cts +3 -4
- package/lib/pipes/extract-signer.cjs +2 -2
- package/lib/pipes/extract-state.cjs +14 -3
- package/lib/pipes/post-execution-invariant-gate.cjs +800 -0
- package/lib/pipes/post-execution-invariant-gate.d.cts +61 -0
- package/lib/pipes/pre-flight-waf.cjs +772 -0
- package/lib/pipes/pre-flight-waf.d.cts +73 -0
- package/lib/pipes/take-state-snapshot.cjs +3 -2
- package/lib/pipes/update-owner.cjs +40 -5
- package/lib/pipes/update-owner.d.cts +1 -1
- package/lib/pipes/verify-account-migration.cjs +14 -4
- package/lib/pipes/verify-blocked.cjs +1 -1
- package/lib/pipes/verify-delegation.cjs +259 -36
- package/lib/pipes/verify-delegation.d.cts +22 -3
- package/lib/pipes/verify-list-size.cjs +1 -1
- package/lib/pipes/verify-multisig-v2.cjs +15 -7
- package/lib/pipes/verify-multisig.cjs +15 -7
- package/lib/pipes/verify-sender.cjs +1 -1
- package/lib/pipes/verify-service-fee.d.cts +1 -1
- package/lib/pipes/verify-signature.cjs +35 -6
- package/lib/pipes/verify-signature.d.cts +1 -1
- package/lib/pipes/verify-signer.cjs +2 -2
- package/lib/pipes/verify-state-diff.cjs +4 -4
- package/lib/pipes/verify-token-access.cjs +2 -2
- package/lib/pipes/verify-token-balance.cjs +13 -5
- package/lib/pipes/verify-transferrable.cjs +3 -3
- package/lib/pipes/verify-transferrable.d.cts +8 -1
- package/lib/pipes/verify-tx-input.cjs +3 -3
- package/lib/pipes/verify-tx-size.cjs +46 -2
- package/lib/pipes/verify-tx-size.d.cts +1 -1
- package/lib/pipes/verify-tx.cjs +6 -8
- package/lib/pipes/verify-tx.d.cts +1 -1
- package/lib/pipes/verify-updater.cjs +1 -1
- package/lib/social-economy-factories.cjs +852 -0
- package/lib/social-economy-factories.d.cts +346 -0
- package/lib/super-suites-foundation.cjs +1257 -0
- package/lib/super-suites-foundation.d.cts +513 -0
- package/lib/transaction-block.cjs +1941 -0
- package/lib/transaction-block.d.cts +471 -0
- package/lib/uniswap-erc7683-solver.cjs +327 -0
- package/lib/uniswap-erc7683-solver.d.cts +201 -0
- package/lib/uniswap-lp-copilot.cjs +328 -0
- package/lib/uniswap-lp-copilot.d.cts +113 -0
- package/lib/uniswap-router.cjs +593 -0
- package/lib/uniswap-router.d.cts +335 -0
- package/lib/uniswap-token-factory-graduation.cjs +431 -0
- package/lib/uniswap-token-factory-graduation.d.cts +187 -0
- package/lib/uniswap-v4-hook.cjs +527 -0
- package/lib/uniswap-v4-hook.d.cts +173 -0
- package/package.json +11 -10
- package/esm/helpers/dedup-height.d.mts +0 -16
- package/esm/helpers/dedup-height.mjs +0 -61
- package/lib/helpers/dedup-height.cjs +0 -72
- package/lib/helpers/dedup-height.d.cts +0 -16
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { AppreciationMedalKind, ArcSpaceKarmaCheckpointResult, CompanionAppreciationMedalNft, CreationSocialObject, CreatorThankYouBadge, GIVE_TO_MINT_TOKEN_TYPE, GiveToMintTokenConfig, HistoricalKarmaClaimInput, HistoricalKarmaClaimResult, KarmaCitationShare, KarmaIndexedPoolSettlementInput, KarmaIndexedPoolSettlementResult, MIN_GIVE_TO_MINT_TOKEN_CREATION_FEE, NftPayloadCustodyState, NftPayloadVisibility, OcapGiveToMintEngine } from "./give-to-mint-karma.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/social-economy-factories.d.ts
|
|
4
|
+
declare const MAX_SOVEREIGN_NFT_FACTORY_SUPPLY = 1000000;
|
|
5
|
+
declare const MAX_ISSUER_STAGING_TTL_EPOCHS = 90;
|
|
6
|
+
declare const DEFAULT_ISSUER_STAGING_TTL_EPOCHS = 7;
|
|
7
|
+
type SovereignNftCategory = 'PUBLIC_HONOR_BADGE' | 'PRIVATE_ENCRYPTED_DELIVERABLE' | 'MEMBERSHIP_PASS';
|
|
8
|
+
interface ReputationTokenFactoryInput {
|
|
9
|
+
factoryDid: string;
|
|
10
|
+
tokenAddress: string;
|
|
11
|
+
symbol: string;
|
|
12
|
+
name: string;
|
|
13
|
+
issuerDid: string;
|
|
14
|
+
epochBaseAllowance?: bigint;
|
|
15
|
+
maxHistoricalClaimPerDid?: bigint;
|
|
16
|
+
creationFeePaid: bigint;
|
|
17
|
+
epochIndex: number;
|
|
18
|
+
}
|
|
19
|
+
interface ReputationTokenFactoryRecord {
|
|
20
|
+
factoryDid: string;
|
|
21
|
+
tokenConfig: GiveToMintTokenConfig;
|
|
22
|
+
createdAtEpoch: number;
|
|
23
|
+
}
|
|
24
|
+
interface SovereignNftFactorySpec {
|
|
25
|
+
factoryDid: string;
|
|
26
|
+
creatorDid: string;
|
|
27
|
+
seriesName: string;
|
|
28
|
+
category: SovereignNftCategory;
|
|
29
|
+
defaultVisibility: NftPayloadVisibility;
|
|
30
|
+
/** Soulbound badges and private encrypted deliverables default to false */
|
|
31
|
+
transferrable?: boolean;
|
|
32
|
+
maxSupply: number;
|
|
33
|
+
/** Number of epochs the creator is obligated to stage the encrypted binary before auto-expiry (1..90) */
|
|
34
|
+
issuerStagingTtlEpochs?: number;
|
|
35
|
+
createdAtEpoch: number;
|
|
36
|
+
}
|
|
37
|
+
interface SovereignNftFactoryRecord {
|
|
38
|
+
factoryDid: string;
|
|
39
|
+
creatorDid: string;
|
|
40
|
+
seriesName: string;
|
|
41
|
+
category: SovereignNftCategory;
|
|
42
|
+
defaultVisibility: NftPayloadVisibility;
|
|
43
|
+
transferrable: boolean;
|
|
44
|
+
maxSupply: number;
|
|
45
|
+
totalMinted: number;
|
|
46
|
+
issuerStagingTtlEpochs: number;
|
|
47
|
+
createdAtEpoch: number;
|
|
48
|
+
}
|
|
49
|
+
interface MintSovereignNftInput {
|
|
50
|
+
factoryDid: string;
|
|
51
|
+
callerDid: string;
|
|
52
|
+
recipientHolderDid: string;
|
|
53
|
+
/** Immutable 32-byte SHA-256 commitment of the binary payload (e.g. private photo pack or badge metadata) */
|
|
54
|
+
payloadCommitmentDigest: string;
|
|
55
|
+
initialVisibility?: NftPayloadVisibility;
|
|
56
|
+
authorizedViewerDids?: string[];
|
|
57
|
+
epochIndex: number;
|
|
58
|
+
}
|
|
59
|
+
interface SovereignNftInstance {
|
|
60
|
+
nftDid: string;
|
|
61
|
+
factoryDid: string;
|
|
62
|
+
category: SovereignNftCategory;
|
|
63
|
+
serialNumber: number;
|
|
64
|
+
issuerDid: string;
|
|
65
|
+
holderDid: string;
|
|
66
|
+
transferrable: boolean;
|
|
67
|
+
mintedAtEpoch: number;
|
|
68
|
+
stagingExpiresAtEpoch: number;
|
|
69
|
+
/** Immutable 32-byte cryptographic digest of the NFT payload */
|
|
70
|
+
payloadCommitmentDigest: string;
|
|
71
|
+
/** Holder's own ArcSpace URI (`arcspace://${holderDid}/nfts/${nftDid}`) */
|
|
72
|
+
holderArcSpaceUri: string;
|
|
73
|
+
/** Temporary creator staging URI while `payloadCustodyState !== 'ISSUER_STORAGE_RELEASED'` */
|
|
74
|
+
issuerStagingUri?: string;
|
|
75
|
+
payloadVisibility: NftPayloadVisibility;
|
|
76
|
+
authorizedViewerDids: string[];
|
|
77
|
+
payloadCustodyState: NftPayloadCustodyState;
|
|
78
|
+
}
|
|
79
|
+
interface SovereignNftAccessResolution {
|
|
80
|
+
nftDid: string;
|
|
81
|
+
factoryDid: string;
|
|
82
|
+
holderDid: string;
|
|
83
|
+
viewerDid: string;
|
|
84
|
+
visibility: NftPayloadVisibility;
|
|
85
|
+
custodyState: NftPayloadCustodyState;
|
|
86
|
+
accessible: boolean;
|
|
87
|
+
reason: 'ALLOWED_PUBLIC' | 'ALLOWED_HOLDER' | 'ALLOWED_AUTHORIZED_VIEWER' | 'DENIED_PRIVATE' | 'DENIED_UNAUTHORIZED';
|
|
88
|
+
holderArcSpaceUri?: string;
|
|
89
|
+
issuerStagingUri?: string;
|
|
90
|
+
payloadCommitmentDigest: string;
|
|
91
|
+
}
|
|
92
|
+
interface KarmaSettlementPoolFactorySpec {
|
|
93
|
+
factoryDid: string;
|
|
94
|
+
sponsorDid: string;
|
|
95
|
+
poolKind: KarmaIndexedPoolSettlementInput['poolKind'];
|
|
96
|
+
tokenAddress?: string;
|
|
97
|
+
minRecipientKarmaWeight?: bigint;
|
|
98
|
+
createdAtEpoch: number;
|
|
99
|
+
}
|
|
100
|
+
interface KarmaSettlementPoolFactoryRecord {
|
|
101
|
+
factoryDid: string;
|
|
102
|
+
sponsorDid: string;
|
|
103
|
+
poolKind: KarmaIndexedPoolSettlementInput['poolKind'];
|
|
104
|
+
tokenAddress: string;
|
|
105
|
+
minRecipientKarmaWeight: bigint;
|
|
106
|
+
totalPoolsSettled: number;
|
|
107
|
+
cumulativeSettledAmount: bigint;
|
|
108
|
+
createdAtEpoch: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Issue #1234 (Phase 2 — Pilot A):
|
|
112
|
+
* Public Community Content Appreciation & Citation Split (`ARC Articles / Tweets`)
|
|
113
|
+
*/
|
|
114
|
+
interface PilotPublicContentAppreciationInput {
|
|
115
|
+
pilotRunId: string;
|
|
116
|
+
tokenFactoryDid?: string;
|
|
117
|
+
authorDid: string;
|
|
118
|
+
objectDid: string;
|
|
119
|
+
objectKind: CreationSocialObject['kind'];
|
|
120
|
+
citations: KarmaCitationShare[];
|
|
121
|
+
sponsoredBadgeQuotaGrant?: number;
|
|
122
|
+
historicalClaim?: Omit<HistoricalKarmaClaimInput, 'claimantDid' | 'tokenAddress' | 'epochIndex'>;
|
|
123
|
+
vouchers: Array<{
|
|
124
|
+
voucherId: string;
|
|
125
|
+
readerDid: string;
|
|
126
|
+
allowanceAmount: bigint;
|
|
127
|
+
medalKind?: AppreciationMedalKind;
|
|
128
|
+
}>;
|
|
129
|
+
epochIndex: number;
|
|
130
|
+
}
|
|
131
|
+
interface PilotPublicContentAppreciationResult {
|
|
132
|
+
pilotRunId: string;
|
|
133
|
+
tokenAddress: string;
|
|
134
|
+
objectDid: string;
|
|
135
|
+
historicalClaimResult?: HistoricalKarmaClaimResult;
|
|
136
|
+
checkpointResult: ArcSpaceKarmaCheckpointResult;
|
|
137
|
+
authorEarnedKarmaInEpoch: bigint;
|
|
138
|
+
citationEarnedKarmaByContributor: Record<string, bigint>;
|
|
139
|
+
companionMedalsIssued: CompanionAppreciationMedalNft[];
|
|
140
|
+
thankYouBadgesIssued: CreatorThankYouBadge[];
|
|
141
|
+
remainingSponsoredBadgeQuota: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Issue #1234 (Phase 2 — Pilot B):
|
|
145
|
+
* Private Circle & Encrypted Media Pack Delivery (`OnlyFans / 知识星球 Sovereign NFT Mode`)
|
|
146
|
+
*/
|
|
147
|
+
interface PilotPrivateCircleDeliveryInput {
|
|
148
|
+
pilotRunId: string;
|
|
149
|
+
nftFactoryDid: string;
|
|
150
|
+
seriesName: string;
|
|
151
|
+
creatorDid: string;
|
|
152
|
+
subscriberDid: string;
|
|
153
|
+
outsiderProbeDid: string;
|
|
154
|
+
/** 32-byte SHA-256 commitment of the encrypted photo/video/column binary */
|
|
155
|
+
payloadCommitmentDigest: string;
|
|
156
|
+
issuerStagingTtlEpochs?: number;
|
|
157
|
+
epochIndex: number;
|
|
158
|
+
}
|
|
159
|
+
interface PilotPrivateCircleDeliveryResult {
|
|
160
|
+
pilotRunId: string;
|
|
161
|
+
nftFactory: SovereignNftFactoryRecord;
|
|
162
|
+
mintedNftBeforeSave: SovereignNftInstance;
|
|
163
|
+
outsiderAccessCheck: SovereignNftAccessResolution;
|
|
164
|
+
subscriberAccessCheck: SovereignNftAccessResolution;
|
|
165
|
+
nftAfterSaveAndRelease: SovereignNftInstance;
|
|
166
|
+
issuerStorageReleased: boolean;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Issue #1235 (Phase 3 — Automated Idea-to-Factory Rollout Pipeline):
|
|
170
|
+
* Declarative blueprint and safety invariant verifier for turning any new social-economy idea
|
|
171
|
+
* ($100 BAT tipping pool, $1,000/mo Crypto AdSense pool, $200k philanthropy tax donation pool,
|
|
172
|
+
* community reputation token, or sovereign NFT series) into a live factory instance.
|
|
173
|
+
*/
|
|
174
|
+
type SocialEconomyFactoryKind = 'REPUTATION_TOKEN_FACTORY' | 'SOVEREIGN_NFT_FACTORY' | 'KARMA_SETTLEMENT_POOL_FACTORY';
|
|
175
|
+
type FactorySafetyInvariant = 'SYBIL_VERIFIED_PROPOSER_INVARIANT' | 'NON_TRANSFERABLE_REPUTATION_INVARIANT' | 'HOLDER_SOVEREIGN_VISIBILITY_INVARIANT' | 'CUSTODY_HANDOVER_RELEASE_INVARIANT' | 'CONSERVATION_AND_UNIQUE_FACTORY_DID_INVARIANT';
|
|
176
|
+
interface SocialEconomyFactoryBlueprint {
|
|
177
|
+
blueprintId: string;
|
|
178
|
+
ideaTitle: string;
|
|
179
|
+
proposerDid: string;
|
|
180
|
+
targetFactoryKind: SocialEconomyFactoryKind;
|
|
181
|
+
epochIndex: number;
|
|
182
|
+
tokenSpec?: Omit<ReputationTokenFactoryInput, 'epochIndex'>;
|
|
183
|
+
nftSpec?: Omit<SovereignNftFactorySpec, 'createdAtEpoch'>;
|
|
184
|
+
poolSpec?: Omit<KarmaSettlementPoolFactorySpec, 'createdAtEpoch'>;
|
|
185
|
+
}
|
|
186
|
+
interface FactoryBlueprintSafetyReport {
|
|
187
|
+
blueprintId: string;
|
|
188
|
+
targetFactoryKind: SocialEconomyFactoryKind;
|
|
189
|
+
safe: boolean;
|
|
190
|
+
safetyChecksPassed: FactorySafetyInvariant[];
|
|
191
|
+
violations: string[];
|
|
192
|
+
}
|
|
193
|
+
interface FactoryBlueprintRolloutResult {
|
|
194
|
+
blueprintId: string;
|
|
195
|
+
ideaTitle: string;
|
|
196
|
+
proposerDid: string;
|
|
197
|
+
targetFactoryKind: SocialEconomyFactoryKind;
|
|
198
|
+
factoryDid: string;
|
|
199
|
+
safetyReport: FactoryBlueprintSafetyReport;
|
|
200
|
+
tokenFactory?: ReputationTokenFactoryRecord;
|
|
201
|
+
nftFactory?: SovereignNftFactoryRecord;
|
|
202
|
+
poolFactory?: KarmaSettlementPoolFactoryRecord;
|
|
203
|
+
}
|
|
204
|
+
declare function deriveSovereignNftDid(factoryDid: string, recipientHolderDid: string, serialNumber: number, payloadCommitmentDigest: string): string;
|
|
205
|
+
/**
|
|
206
|
+
* Issue #1233 (Phase 1 — Foundation):
|
|
207
|
+
* Unified OCAP Social-Economy Factory Registry providing standardized, parameter-driven
|
|
208
|
+
* factories for:
|
|
209
|
+
* 1. `ReputationTokenFactory` (`type = "give_to_mint"`)
|
|
210
|
+
* 2. `SovereignNftFactory` (Holder-hosted `ArcSpace` payload, `public/authorized_only/private` consent gate,
|
|
211
|
+
* and 3-stage delivery custody handover `ISSUER_TEMP_STAGED -> HOLDER_SAVED_IN_ARCSPACE -> ISSUER_STORAGE_RELEASED`)
|
|
212
|
+
* 3. `KarmaSettlementPoolFactory` (Pro-rata KARMA-indexed epoch pool settlement)
|
|
213
|
+
*/
|
|
214
|
+
declare class OcapSocialEconomyFactoryRegistry {
|
|
215
|
+
readonly karmaEngine: OcapGiveToMintEngine;
|
|
216
|
+
private readonly tokenFactories;
|
|
217
|
+
private readonly nftFactories;
|
|
218
|
+
private readonly nftInstances;
|
|
219
|
+
private readonly poolFactories;
|
|
220
|
+
private readonly processedPilotRunIds;
|
|
221
|
+
private readonly processedBlueprintIds;
|
|
222
|
+
constructor(karmaEngine?: OcapGiveToMintEngine);
|
|
223
|
+
private assertFactoryDidAvailable;
|
|
224
|
+
private assertVerifiedIdentity;
|
|
225
|
+
/**
|
|
226
|
+
* 1. `ReputationTokenFactory`: Instantiates a new non-transferable `give_to_mint` reputation token
|
|
227
|
+
* via a standardized factory specification.
|
|
228
|
+
*/
|
|
229
|
+
createReputationTokenFromFactory(input: ReputationTokenFactoryInput): ReputationTokenFactoryRecord;
|
|
230
|
+
/**
|
|
231
|
+
* 2. `SovereignNftFactory`: Registers a standardized NFT factory template where payloads are
|
|
232
|
+
* hosted in the holder's own ArcSpace and visibility/custody follow the 2019 OCAP NFT sovereignty model.
|
|
233
|
+
*/
|
|
234
|
+
registerSovereignNftFactory(spec: SovereignNftFactorySpec): SovereignNftFactoryRecord;
|
|
235
|
+
/**
|
|
236
|
+
* Mints a new Sovereign NFT from a registered `SovereignNftFactory`.
|
|
237
|
+
* On-chain state records only the authorization header and 32B `payloadCommitmentDigest`,
|
|
238
|
+
* while the binary payload is staged for the holder's `ArcSpace`.
|
|
239
|
+
*/
|
|
240
|
+
mintSovereignNft(input: MintSovereignNftInput): SovereignNftInstance;
|
|
241
|
+
/**
|
|
242
|
+
* Holder-Sovereign Visibility Control: ONLY `holderDid` can decide whether outsiders can view
|
|
243
|
+
* the NFT payload hosted in `holderArcSpaceUri`.
|
|
244
|
+
*/
|
|
245
|
+
configureSovereignNftVisibility(params: {
|
|
246
|
+
nftDid: string;
|
|
247
|
+
callerDid: string;
|
|
248
|
+
visibility: NftPayloadVisibility;
|
|
249
|
+
authorizedViewerDids?: string[];
|
|
250
|
+
}): SovereignNftInstance;
|
|
251
|
+
/**
|
|
252
|
+
* Evaluates whether `viewerDid` can access the NFT payload.
|
|
253
|
+
* When denied (`private` or unwhitelisted `authorized_only`), both `holderArcSpaceUri` and
|
|
254
|
+
* `issuerStagingUri` are withheld so outsiders cannot see the NFT content.
|
|
255
|
+
*/
|
|
256
|
+
resolveSovereignNftPayloadAccess(params: {
|
|
257
|
+
nftDid: string;
|
|
258
|
+
viewerDid: string;
|
|
259
|
+
}): SovereignNftAccessResolution;
|
|
260
|
+
/**
|
|
261
|
+
* Stage 2 & 3 Custody Handover:
|
|
262
|
+
* Holder verifies `verifiedPayloadDigest === payloadCommitmentDigest`, saves the binary into their
|
|
263
|
+
* own `ArcSpace`, and acknowledges custody. When `releaseIssuerStorageImmediately !== false`,
|
|
264
|
+
* transitions directly to `ISSUER_STORAGE_RELEASED` and clears `issuerStagingUri`.
|
|
265
|
+
*/
|
|
266
|
+
acknowledgeSovereignNftCustody(params: {
|
|
267
|
+
nftDid: string;
|
|
268
|
+
holderDid: string;
|
|
269
|
+
verifiedPayloadDigest: string;
|
|
270
|
+
releaseIssuerStorageImmediately?: boolean;
|
|
271
|
+
}): SovereignNftInstance;
|
|
272
|
+
/**
|
|
273
|
+
* Releases the creator/issuer's temporary staging buffer (`issuerStagingUri = undefined`,
|
|
274
|
+
* `payloadCustodyState = 'ISSUER_STORAGE_RELEASED'`) once EITHER:
|
|
275
|
+
* - the holder has already saved the binary (`HOLDER_SAVED_IN_ARCSPACE` or `ISSUER_STORAGE_RELEASED`), OR
|
|
276
|
+
* - the temporary staging window has expired (`currentEpoch >= stagingExpiresAtEpoch`).
|
|
277
|
+
* Rejects premature deletion while `currentEpoch < stagingExpiresAtEpoch` and the holder has not yet saved it.
|
|
278
|
+
*/
|
|
279
|
+
purgeIssuerStagedNftPayload(params: {
|
|
280
|
+
nftDid: string;
|
|
281
|
+
callerDid: string;
|
|
282
|
+
currentEpoch: number;
|
|
283
|
+
}): SovereignNftInstance;
|
|
284
|
+
/**
|
|
285
|
+
* 3. `KarmaSettlementPoolFactory`: Registers a reusable epoch pool settlement factory
|
|
286
|
+
* (e.g., $100/mo BAT Tipping Pool, $1,000/mo Crypto AdSense Pool, $200k Philanthropy Pool).
|
|
287
|
+
*/
|
|
288
|
+
registerKarmaSettlementPoolFactory(spec: KarmaSettlementPoolFactorySpec): KarmaSettlementPoolFactoryRecord;
|
|
289
|
+
/**
|
|
290
|
+
* Executes an epoch pool settlement using a registered `KarmaSettlementPoolFactory`.
|
|
291
|
+
*/
|
|
292
|
+
executeFactoryPoolSettlement(params: {
|
|
293
|
+
factoryDid: string;
|
|
294
|
+
callerDid: string;
|
|
295
|
+
poolId: string;
|
|
296
|
+
epochIndex: number;
|
|
297
|
+
totalPoolAmount: bigint;
|
|
298
|
+
recipientWeights: Array<{
|
|
299
|
+
recipientDid: string;
|
|
300
|
+
karmaWeight: bigint;
|
|
301
|
+
}>;
|
|
302
|
+
}): KarmaIndexedPoolSettlementResult;
|
|
303
|
+
getTokenFactory(factoryDid: string): ReputationTokenFactoryRecord | undefined;
|
|
304
|
+
getSovereignNftFactory(factoryDid: string): SovereignNftFactoryRecord | undefined;
|
|
305
|
+
getSovereignNftInstance(nftDid: string): SovereignNftInstance | undefined;
|
|
306
|
+
getPoolFactory(factoryDid: string): KarmaSettlementPoolFactoryRecord | undefined;
|
|
307
|
+
/**
|
|
308
|
+
* Issue #1234 — Pilot App A:
|
|
309
|
+
* Executes the end-to-end Public Community Content Appreciation & Citation Split workflow:
|
|
310
|
+
* 1. Optionally processes the author's retroactive historical contribution claim (`claimHistoricalKarma`).
|
|
311
|
+
* 2. Grants the author protocol-sponsored free badge minting quota (`SponsoredMintQuota`, default 100).
|
|
312
|
+
* 3. Registers the content object and its upstream `citations` graph (`photo`, `music`, `skill`, `blocklet`, etc.).
|
|
313
|
+
* 4. Commits reader `Give-to-Mint` vouchers via `ArcSpace + Checkpoint`, minting `KARMA` FT across the
|
|
314
|
+
* primary author and cited contributors, companion Medal NFTs, and numbered Creator Thank-You Badges.
|
|
315
|
+
*/
|
|
316
|
+
runPilotPublicContentAppreciationWorkflow(input: PilotPublicContentAppreciationInput): PilotPublicContentAppreciationResult;
|
|
317
|
+
/**
|
|
318
|
+
* Issue #1234 — Pilot App B:
|
|
319
|
+
* Executes the end-to-end Private Circle & Encrypted Media Pack Delivery workflow
|
|
320
|
+
* (`OnlyFans / 知识星球 Sovereign NFT Mode`):
|
|
321
|
+
* 1. Registers (or safely reuses for subsequent subscribers of the same creator series) a
|
|
322
|
+
* `PRIVATE_ENCRYPTED_DELIVERABLE` `SovereignNftFactory` (`defaultVisibility: 'private'`).
|
|
323
|
+
* 2. Mints an encrypted deliverable NFT (`payloadCommitmentDigest`) to the subscriber's DID.
|
|
324
|
+
* 3. Verifies that an external outsider (`outsiderProbeDid`) is strictly blocked (`DENIED_PRIVATE`)
|
|
325
|
+
* and cannot see `holderArcSpaceUri` or `issuerStagingUri`.
|
|
326
|
+
* 4. Subscriber verifies the 32B digest, saves the binary into their own `ArcSpace`, and calls
|
|
327
|
+
* `acknowledgeSovereignNftCustody`, immediately releasing the creator's staging storage obligation
|
|
328
|
+
* (`payloadCustodyState === 'ISSUER_STORAGE_RELEASED'`, `issuerStagingUri === undefined`).
|
|
329
|
+
*/
|
|
330
|
+
runPilotPrivateCircleDeliveryWorkflow(input: PilotPrivateCircleDeliveryInput): PilotPrivateCircleDeliveryResult;
|
|
331
|
+
/**
|
|
332
|
+
* Issue #1235 (Phase 3 — Declarative Blueprint Safety Verifier):
|
|
333
|
+
* Verifies that a proposed `SocialEconomyFactoryBlueprint` satisfies all protocol safety invariants
|
|
334
|
+
* (Sybil-verified proposer, non-transferable reputation, holder-sovereign visibility, bounded creator
|
|
335
|
+
* staging custody handover, and unique factory DID / value conservation) without mutating state.
|
|
336
|
+
*/
|
|
337
|
+
verifyFactoryBlueprintSafety(blueprint: SocialEconomyFactoryBlueprint): FactoryBlueprintSafetyReport;
|
|
338
|
+
/**
|
|
339
|
+
* Issue #1235 (Phase 3 — Idea-to-Factory Autonomous Rollout Pipeline):
|
|
340
|
+
* Verifies `blueprint` against all protocol safety invariants and automatically provisions
|
|
341
|
+
* the corresponding `ReputationTokenFactory`, `SovereignNftFactory`, or `KarmaSettlementPoolFactory`.
|
|
342
|
+
*/
|
|
343
|
+
instantiateFactoryBlueprint(blueprint: SocialEconomyFactoryBlueprint): FactoryBlueprintRolloutResult;
|
|
344
|
+
}
|
|
345
|
+
//#endregion
|
|
346
|
+
export { DEFAULT_ISSUER_STAGING_TTL_EPOCHS, FactoryBlueprintRolloutResult, FactoryBlueprintSafetyReport, FactorySafetyInvariant, GIVE_TO_MINT_TOKEN_TYPE, KarmaSettlementPoolFactoryRecord, KarmaSettlementPoolFactorySpec, MAX_ISSUER_STAGING_TTL_EPOCHS, MAX_SOVEREIGN_NFT_FACTORY_SUPPLY, MIN_GIVE_TO_MINT_TOKEN_CREATION_FEE, MintSovereignNftInput, OcapSocialEconomyFactoryRegistry, PilotPrivateCircleDeliveryInput, PilotPrivateCircleDeliveryResult, PilotPublicContentAppreciationInput, PilotPublicContentAppreciationResult, ReputationTokenFactoryInput, ReputationTokenFactoryRecord, SocialEconomyFactoryBlueprint, SocialEconomyFactoryKind, SovereignNftAccessResolution, SovereignNftCategory, SovereignNftFactoryRecord, SovereignNftFactorySpec, SovereignNftInstance, deriveSovereignNftDid };
|