@cypher-zk/sdk 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{client-BECBXFEY.d.ts → client-C6xXOySs.d.ts} +840 -452
- package/dist/cypher-3HKPZR2F.json +6053 -0
- package/dist/index.d.ts +66 -58
- package/dist/index.js +193 -114
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +6 -2
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/src/idl/cypher.json +780 -438
- package/src/idl/cypher.ts +780 -438
- package/src/idl/cypher.ts.bak +5717 -0
- /package/{dist/cypher-G57ZWFM3.json → src/idl/cypher.json.bak} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as Cypher, C as CypherClient, l as CircuitName } from './client-
|
|
2
|
-
export { m as ACCOUNT_DISCRIMINATOR_SIZE, n as ALL_CIRCUITS, o as ALL_EVENT_NAMES, p as ActionProgressEvent, q as ActionStage, r as AdminClaimRemainingParams, A as AdminOverrideResolutionInputs, s as AdminOverrideResolutionParams, t as AwaitComputationOptions, B as BPS_DENOMINATOR, u as BetPlacedEvent, v as CIRCUITS, w as CLUSTERS, a as CancelMarketParams, c as ClaimInputs, x as ClaimParams, b as ClaimResult, y as ClusterConfig, z as ClusterName, D as ComputationResult, H as CreateMarketMultiParams, e as CreateMarketParams, d as CreateMarketResult, I as CreatorWithdrawnEvent, J as CypherClientOptions, j as CypherEvent, K as CypherEventName, L as DEFAULT_CLAIM_PERIOD_SECS, N as DEFAULT_REFUND_PERIOD_SECS, O as DEFAULT_RESOLUTION_WINDOW_SECS, E as EncryptedPositionAccount, Q as EventCallback, T as EventSubscription, F as FinalizeResolutionInputs, U as FinalizeResolutionParams, f as FlagResolutionInputs, V as FlagResolutionParams, G as GlobalStateAccount, W as INIT_COMP_DEF_INSTRUCTIONS, X as InitCompDefMethodName, Y as InitCompDefParams, Z as
|
|
1
|
+
import { k as Cypher, C as CypherClient, l as CircuitName } from './client-C6xXOySs.js';
|
|
2
|
+
export { m as ACCOUNT_DISCRIMINATOR_SIZE, n as ALL_CIRCUITS, o as ALL_EVENT_NAMES, p as ActionProgressEvent, q as ActionStage, r as AdminClaimRemainingParams, A as AdminOverrideResolutionInputs, s as AdminOverrideResolutionParams, t as AwaitComputationOptions, B as BPS_DENOMINATOR, u as BetPlacedEvent, v as CIRCUITS, w as CLUSTERS, a as CancelMarketParams, c as ClaimInputs, x as ClaimParams, b as ClaimResult, y as ClusterConfig, z as ClusterName, D as ComputationResult, H as CreateMarketMultiParams, e as CreateMarketParams, d as CreateMarketResult, I as CreatorWithdrawnEvent, J as CypherClientOptions, j as CypherEvent, K as CypherEventName, L as DEFAULT_CLAIM_PERIOD_SECS, N as DEFAULT_REFUND_PERIOD_SECS, O as DEFAULT_RESOLUTION_WINDOW_SECS, E as EncryptedPositionAccount, Q as EventCallback, T as EventSubscription, F as FinalizeResolutionInputs, U as FinalizeResolutionParams, f as FlagResolutionInputs, V as FlagResolutionParams, G as GlobalStateAccount, W as INIT_COMP_DEF_INSTRUCTIONS, X as InitCompDefMethodName, Y as InitCompDefParams, Z as InitSignPdaParams, _ as InitializeParams, $ as KNOWN_MINTS, a0 as LpPositionAccount, a1 as MAX_CHALLENGE_PERIOD_SECS, a2 as MAX_LP_FEE_BPS, a3 as MAX_OUTCOMES_MULTI, a4 as MAX_PROTOCOL_FEE_BPS, a5 as MAX_QUESTION_BYTES, a6 as MIN_BET_USDC, a7 as MIN_CHALLENGE_PERIOD_SECS, a8 as MIN_CREATOR_BOND, a9 as MIN_OUTCOMES_MULTI, M as MarketAccount, aa as MarketCancelledEvent, ab as MarketCategory, ac as MarketCategoryValue, ad as MarketCreatedEvent, ae as MarketFinalizedEvent, af as MarketQuestionAccount, ag as MarketResolvedEvent, ah as MarketState, ai as MarketStateValue, aj as MarketType, ak as MarketTypeValue, al as ODDS_SCALE, am as PROGRAM_ID, an as PayoutClaimedEvent, g as PlaceBetInputs, P as PlaceBetResult, ao as PlacePrivateBetParams, ap as PollEventsOptions, aq as PolledEvent, ar as ProgressCallback, as as RefundClaimedEvent, R as ResolutionActionResult, at as ResolutionFlaggedEvent, au as ResolutionOverriddenEvent, i as ResolveMarketInputs, av as ResolveMarketParams, h as ResolveMarketResult, aw as SendIxOptions, ax as SubmitBetParams, S as SubscribeOptions, ay as UpdateAcceptedMintParams, az as UserCryptoKeypair, aA as Wallet, aB as WithdrawCreatorFundsParams, aC as adminClaimRemainingIx, aD as adminOverrideResolutionAction, aE as adminOverrideResolutionIx, aF as awaitComputation, aG as buildAllInitCompDefIx, aH as cancelMarketAction, aI as cancelMarketIx, aJ as claimPayoutAction, aK as claimPayoutMultiIx, aL as claimPayoutYesnoIx, aM as claimRefundAction, aN as claimRefundMultiIx, aO as claimRefundYesnoIx, aP as compDefOffsetBytes, aQ as compDefOffsetU32, aR as createCipher, aS as createMarketAction, aT as createMarketIx, aU as createMarketMultiAction, aV as createMarketMultiIx, aW as createUserKeypair, aX as deriveSharedSecret, aY as fetchAllMarkets, aZ as fetchGlobalState, a_ as fetchLpPosition, a$ as fetchLpPositionsByProvider, b0 as fetchMarket, b1 as fetchMarketQuestion, b2 as fetchMarketQuestions, b3 as fetchMarketsByCreator, b4 as fetchMarketsByState, b5 as fetchMxePublicKey, b6 as fetchPosition, b7 as fetchPositionsForMarket, b8 as fetchUserPositions, b9 as finalizeResolutionAction, ba as finalizeResolutionIx, bb as flagResolutionAction, bc as flagResolutionIx, bd as freshNonce, be as initCompDefIx, bf as initSignPdaIx, bg as initializeIx, bh as keypairToWallet, bi as leBytesToBigInt, bj as onBetPlaced, bk as onCreatorWithdrawn, bl as onMarketCancelled, bm as onMarketCreated, bn as onMarketFinalized, bo as onMarketResolved, bp as onPayoutClaimed, bq as onRefundClaimed, br as onResolutionFlagged, bs as onResolutionOverridden, bt as parseLogs, bu as parseLogsFor, bv as placeBetAction, bw as placePrivateBetMultiIx, bx as placePrivateBetYesnoIx, by as pollEvents, bz as randomComputationOffset, bA as readonlyWallet, bB as resolveMarketAction, bC as resolveMarketMultiIx, bD as resolveMarketYesnoIx, bE as sendIx, bF as sendIxAndAwaitArcium, bG as sendTx, bH as submitBetMultiIx, bI as submitBetYesnoIx, bJ as subscribeAll, bK as subscribeEvent, bL as updateAcceptedMintIx, bM as withdrawCreatorFundsAction, bN as withdrawCreatorFundsIx } from './client-C6xXOySs.js';
|
|
3
3
|
import { GetProgramAccountsFilter, PublicKey } from '@solana/web3.js';
|
|
4
4
|
import { BN } from '@anchor-lang/core';
|
|
5
5
|
import { RescueCipher } from '@arcium-hq/client';
|
|
@@ -43,45 +43,43 @@ declare const lpPositionFilters: {
|
|
|
43
43
|
*/
|
|
44
44
|
declare const MARKET_OFFSETS: {
|
|
45
45
|
readonly marketId: 0;
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
57
|
-
readonly
|
|
58
|
-
readonly
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
readonly
|
|
67
|
-
readonly
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
71
|
-
readonly
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
74
|
-
readonly
|
|
75
|
-
readonly
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly bump: 578;
|
|
84
|
-
readonly vaultBump: 579;
|
|
46
|
+
readonly marketType: 8;
|
|
47
|
+
readonly numOutcomes: 9;
|
|
48
|
+
readonly category: 10;
|
|
49
|
+
readonly creator: 11;
|
|
50
|
+
readonly resolver: 43;
|
|
51
|
+
readonly creatorBond: 75;
|
|
52
|
+
readonly bondWithdrawn: 83;
|
|
53
|
+
readonly totalBetsCount: 84;
|
|
54
|
+
readonly encryptedPool0: 92;
|
|
55
|
+
readonly encryptedPool1: 124;
|
|
56
|
+
readonly encryptedPool2: 156;
|
|
57
|
+
readonly encryptedPool3: 188;
|
|
58
|
+
readonly mxeNonce: 220;
|
|
59
|
+
readonly revealedPool0: 236;
|
|
60
|
+
readonly revealedPool1: 244;
|
|
61
|
+
readonly revealedPool2: 252;
|
|
62
|
+
readonly revealedPool3: 260;
|
|
63
|
+
readonly state: 268;
|
|
64
|
+
readonly outcome: 269;
|
|
65
|
+
readonly pendingOutcome: 270;
|
|
66
|
+
readonly closeTime: 271;
|
|
67
|
+
readonly resolutionTime: 279;
|
|
68
|
+
readonly payoutRatio: 287;
|
|
69
|
+
readonly accumulatedLpFees: 295;
|
|
70
|
+
readonly accumulatedProtocolFees: 303;
|
|
71
|
+
readonly minBet: 311;
|
|
72
|
+
readonly totalPayoutsClaimed: 319;
|
|
73
|
+
readonly totalRefundsClaimed: 327;
|
|
74
|
+
readonly adminClaimedRemaining: 335;
|
|
75
|
+
readonly resolutionDeadline: 336;
|
|
76
|
+
readonly claimDeadline: 344;
|
|
77
|
+
readonly refundDeadline: 352;
|
|
78
|
+
readonly challengePeriod: 360;
|
|
79
|
+
readonly challengeDeadline: 368;
|
|
80
|
+
readonly disputed: 376;
|
|
81
|
+
readonly bump: 377;
|
|
82
|
+
readonly vaultBump: 378;
|
|
85
83
|
};
|
|
86
84
|
declare const ENCRYPTED_POSITION_OFFSETS: {
|
|
87
85
|
readonly user: 0;
|
|
@@ -93,7 +91,13 @@ declare const ENCRYPTED_POSITION_OFFSETS: {
|
|
|
93
91
|
readonly entryOdds: 176;
|
|
94
92
|
readonly netAmount: 184;
|
|
95
93
|
readonly claimed: 192;
|
|
96
|
-
readonly
|
|
94
|
+
readonly computationQueued: 193;
|
|
95
|
+
readonly bump: 194;
|
|
96
|
+
};
|
|
97
|
+
declare const MARKET_QUESTION_OFFSETS: {
|
|
98
|
+
readonly question: 0;
|
|
99
|
+
readonly questionLen: 200;
|
|
100
|
+
readonly bump: 201;
|
|
97
101
|
};
|
|
98
102
|
declare const LP_POSITION_OFFSETS: {
|
|
99
103
|
readonly lpProvider: 0;
|
|
@@ -222,6 +226,8 @@ declare function marketVaultPda(market: PublicKey, programId?: PublicKey): [Publ
|
|
|
222
226
|
declare function positionPda(market: PublicKey, user: PublicKey, programId?: PublicKey): [PublicKey, number];
|
|
223
227
|
/** `[b"lp-position", market, creator]` — bond + LP fee accounting. */
|
|
224
228
|
declare function lpPositionPda(market: PublicKey, creator: PublicKey, programId?: PublicKey): [PublicKey, number];
|
|
229
|
+
/** `[b"market_question", market]` — separate PDA holding the market's question text. */
|
|
230
|
+
declare function marketQuestionPda(market: PublicKey, programId?: PublicKey): [PublicKey, number];
|
|
225
231
|
/**
|
|
226
232
|
* `[b"ArciumSignerAccount"]` — Arcium-side signer PDA used as the queue-time
|
|
227
233
|
* CPI authority for callback verification. The seed literal is dictated by
|
|
@@ -392,21 +398,23 @@ declare const CypherErrorCode: {
|
|
|
392
398
|
readonly ResolutionDeadlineNotReached: 6025;
|
|
393
399
|
readonly ClaimPeriodExpired: 6026;
|
|
394
400
|
readonly RefundPeriodExpired: 6027;
|
|
395
|
-
readonly
|
|
396
|
-
readonly
|
|
397
|
-
readonly
|
|
398
|
-
readonly
|
|
399
|
-
readonly
|
|
400
|
-
readonly
|
|
401
|
-
readonly
|
|
402
|
-
readonly
|
|
403
|
-
readonly
|
|
404
|
-
readonly
|
|
405
|
-
readonly
|
|
406
|
-
readonly
|
|
407
|
-
readonly
|
|
408
|
-
readonly
|
|
409
|
-
readonly
|
|
401
|
+
readonly ComputationAlreadyQueued: 6028;
|
|
402
|
+
readonly AbortedComputation: 6029;
|
|
403
|
+
readonly ComputationVerificationFailed: 6030;
|
|
404
|
+
readonly CannotWithdrawFromUnresolved: 6031;
|
|
405
|
+
readonly AdminAlreadyClaimed: 6032;
|
|
406
|
+
readonly WrongMarketType: 6033;
|
|
407
|
+
readonly WrongMint: 6034;
|
|
408
|
+
readonly NotAcceptedMint: 6035;
|
|
409
|
+
readonly InvalidCategory: 6036;
|
|
410
|
+
readonly InvalidChallengePeriod: 6037;
|
|
411
|
+
readonly BondTooSmall: 6038;
|
|
412
|
+
readonly NotPendingResolution: 6039;
|
|
413
|
+
readonly ChallengePeriodNotElapsed: 6040;
|
|
414
|
+
readonly ChallengePeriodElapsed: 6041;
|
|
415
|
+
readonly MarketDisputed: 6042;
|
|
416
|
+
readonly MarketNotDisputed: 6043;
|
|
417
|
+
readonly UnauthorizedUser: 6044;
|
|
410
418
|
};
|
|
411
419
|
type CypherErrorName = keyof typeof CypherErrorCode;
|
|
412
420
|
type CypherErrorCodeValue = (typeof CypherErrorCode)[keyof typeof CypherErrorCode];
|
|
@@ -491,4 +499,4 @@ declare function fetchMxeLookupTable(client: CypherClient): Promise<{
|
|
|
491
499
|
slot: BN;
|
|
492
500
|
}>;
|
|
493
501
|
|
|
494
|
-
export { ADDRESS_LOOKUP_TABLE_PROGRAM_ID, type ArciumQueueAccounts, type BetInput, CYPHER_ERROR_MESSAGES, CircuitName, Cypher, CypherClient, CypherErrorCode, type CypherErrorCodeValue, type CypherErrorName, ENCRYPTED_POSITION_OFFSETS, type EncryptedBetInput, type EncryptedRefundInput, type FeeBreakdown, type FeeRates, GLOBAL_STATE_OFFSETS, IDL, IDL_PROGRAM_ID, LP_POSITION_OFFSETS, MARKET_OFFSETS, type MarketDeadlineInputs, type MarketPhase, type ParsedCypherError, type RefundInput, arciumSignerPda, bigIntToLeBytes, buildArciumQueueAccounts, computeFees, cypherErrorName, decryptBetInput, discriminatorFilter, encryptBetInput, encryptRefundInput, fetchMxeLookupTable, globalStatePda, isBetAmountValid, isValidCloseTime, lpPositionFilters, lpPositionPda, marketFilters, marketPda, marketPhase, marketVaultPda, parseCypherError, positionFilters, positionPda, projectDeadlines, toBN, userAta };
|
|
502
|
+
export { ADDRESS_LOOKUP_TABLE_PROGRAM_ID, type ArciumQueueAccounts, type BetInput, CYPHER_ERROR_MESSAGES, CircuitName, Cypher, CypherClient, CypherErrorCode, type CypherErrorCodeValue, type CypherErrorName, ENCRYPTED_POSITION_OFFSETS, type EncryptedBetInput, type EncryptedRefundInput, type FeeBreakdown, type FeeRates, GLOBAL_STATE_OFFSETS, IDL, IDL_PROGRAM_ID, LP_POSITION_OFFSETS, MARKET_OFFSETS, MARKET_QUESTION_OFFSETS, type MarketDeadlineInputs, type MarketPhase, type ParsedCypherError, type RefundInput, arciumSignerPda, bigIntToLeBytes, buildArciumQueueAccounts, computeFees, cypherErrorName, decryptBetInput, discriminatorFilter, encryptBetInput, encryptRefundInput, fetchMxeLookupTable, globalStatePda, isBetAmountValid, isValidCloseTime, lpPositionFilters, lpPositionPda, marketFilters, marketPda, marketPhase, marketQuestionPda, marketVaultPda, parseCypherError, positionFilters, positionPda, projectDeadlines, toBN, userAta };
|