pnp-sdk 0.2.10 → 0.2.11
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/{chunk-SIMCEKAG.js → chunk-ITEBWEGS.js} +772 -24
- package/dist/chunk-ITEBWEGS.js.map +1 -0
- package/dist/cli.cjs +734 -28
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +771 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +83 -2
- package/dist/index.d.ts +83 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-SIMCEKAG.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -61,6 +61,12 @@ interface MarketType {
|
|
|
61
61
|
resolvable: boolean;
|
|
62
62
|
force_resolve: boolean;
|
|
63
63
|
version: number;
|
|
64
|
+
/** Amount of YES tokens locked in vault for creator (set during setMarketResolvableV2) */
|
|
65
|
+
creator_yes_locked: U64Like;
|
|
66
|
+
/** Amount of NO tokens locked in vault for creator (set during setMarketResolvableV2) */
|
|
67
|
+
creator_no_locked: U64Like;
|
|
68
|
+
/** Whether the creator has already claimed locked liquidity */
|
|
69
|
+
creator_liquidity_claimed: boolean;
|
|
64
70
|
}
|
|
65
71
|
interface MarketsResponse {
|
|
66
72
|
count: number;
|
|
@@ -84,6 +90,69 @@ interface GlobalConfigType {
|
|
|
84
90
|
burn_fee: U64Like;
|
|
85
91
|
trading_paused: boolean;
|
|
86
92
|
}
|
|
93
|
+
type TokenSideLike = "yes" | "no" | number | Record<string, unknown>;
|
|
94
|
+
interface MarketV3Type {
|
|
95
|
+
id: U64Like;
|
|
96
|
+
resolved: boolean;
|
|
97
|
+
/** Total collateral in YES pot */
|
|
98
|
+
yes_pot_reserve: U64Like;
|
|
99
|
+
/** Total collateral in NO pot */
|
|
100
|
+
no_pot_reserve: U64Like;
|
|
101
|
+
/** Market creator */
|
|
102
|
+
creator: PubkeyLike;
|
|
103
|
+
/** Which side creator is backing */
|
|
104
|
+
creator_side: TokenSideLike;
|
|
105
|
+
/** Initial amount creator deposited */
|
|
106
|
+
creator_initial_amount: U64Like;
|
|
107
|
+
/** Maximum liquidity allowed on creator's side */
|
|
108
|
+
creator_side_cap: U64Like;
|
|
109
|
+
/** Total YES tokens issued */
|
|
110
|
+
yes_tokens_issued: U64Like;
|
|
111
|
+
/** Total NO tokens issued */
|
|
112
|
+
no_tokens_issued: U64Like;
|
|
113
|
+
/** Collateral token mint */
|
|
114
|
+
collateral_token: PubkeyLike;
|
|
115
|
+
/** YES token mint */
|
|
116
|
+
yes_token_mint: PubkeyLike;
|
|
117
|
+
/** NO token mint */
|
|
118
|
+
no_token_mint: PubkeyLike;
|
|
119
|
+
/** Winning side after resolution */
|
|
120
|
+
winning_token_id: WinningTokenLike;
|
|
121
|
+
/** Creator's fee treasury */
|
|
122
|
+
creator_fee_treasury: PubkeyLike;
|
|
123
|
+
/** Market question */
|
|
124
|
+
question: string;
|
|
125
|
+
/** Market end timestamp */
|
|
126
|
+
end_time: U64Like;
|
|
127
|
+
/** Market creation timestamp */
|
|
128
|
+
creation_time: U64Like;
|
|
129
|
+
/** Whether market is resolvable (set by oracle) */
|
|
130
|
+
resolvable: boolean;
|
|
131
|
+
/** PDA bump */
|
|
132
|
+
bump: number;
|
|
133
|
+
/** Maximum pot ratio allowed (basis points, e.g. 10000 = 1:1, 100000 = 10:1) */
|
|
134
|
+
max_pot_ratio: number;
|
|
135
|
+
}
|
|
136
|
+
interface MarketExtensionType {
|
|
137
|
+
/** Market ID this extension belongs to */
|
|
138
|
+
market_id: U64Like;
|
|
139
|
+
/** Initial YES odds in basis points (e.g. 7000 = 70% YES) */
|
|
140
|
+
initial_yes_odds_bps: number;
|
|
141
|
+
/** Custom oracle for this market */
|
|
142
|
+
oracle: PubkeyLike;
|
|
143
|
+
/** PDA bump */
|
|
144
|
+
bump: number;
|
|
145
|
+
}
|
|
146
|
+
interface MarketV3ExtensionType {
|
|
147
|
+
/** Market ID this extension belongs to */
|
|
148
|
+
market_id: U64Like;
|
|
149
|
+
/** Odds in basis points for creator's side (e.g. 7000 = 70%) */
|
|
150
|
+
odds_bps: number;
|
|
151
|
+
/** Custom oracle for this market */
|
|
152
|
+
oracle: PubkeyLike;
|
|
153
|
+
/** PDA bump */
|
|
154
|
+
bump: number;
|
|
155
|
+
}
|
|
87
156
|
interface SettlementCriteria {
|
|
88
157
|
category: string;
|
|
89
158
|
reasoning: string;
|
|
@@ -1219,20 +1288,32 @@ declare function deriveAta(owner: PublicKey, mint: PublicKey, allowOwnerOffCurve
|
|
|
1219
1288
|
declare function deriveMarketPdaFromMints(yesMint: PublicKey, noMint: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
1220
1289
|
declare function deriveYesTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1221
1290
|
declare function deriveNoTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1291
|
+
declare function deriveMarketV2Pda(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1292
|
+
declare function deriveMarketV3Pda(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1293
|
+
declare function deriveV3YesTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1294
|
+
declare function deriveV3NoTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1295
|
+
declare function deriveMarketExtensionPda(marketId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1296
|
+
declare function deriveMarketV3ExtensionPda(marketId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1222
1297
|
declare function deriveTokenMetadataPda(mint: PublicKey, metadataProgramId: PublicKey): [PublicKey, number];
|
|
1223
1298
|
|
|
1224
1299
|
declare const pdas_deriveAta: typeof deriveAta;
|
|
1225
1300
|
declare const pdas_deriveCreatorFeeTreasuryPda: typeof deriveCreatorFeeTreasuryPda;
|
|
1226
1301
|
declare const pdas_deriveCreatorFeeTreasuryPdaLegacy: typeof deriveCreatorFeeTreasuryPdaLegacy;
|
|
1227
1302
|
declare const pdas_deriveGlobalConfigPda: typeof deriveGlobalConfigPda;
|
|
1303
|
+
declare const pdas_deriveMarketExtensionPda: typeof deriveMarketExtensionPda;
|
|
1228
1304
|
declare const pdas_deriveMarketPda: typeof deriveMarketPda;
|
|
1229
1305
|
declare const pdas_deriveMarketPdaFromMints: typeof deriveMarketPdaFromMints;
|
|
1306
|
+
declare const pdas_deriveMarketV2Pda: typeof deriveMarketV2Pda;
|
|
1307
|
+
declare const pdas_deriveMarketV3ExtensionPda: typeof deriveMarketV3ExtensionPda;
|
|
1308
|
+
declare const pdas_deriveMarketV3Pda: typeof deriveMarketV3Pda;
|
|
1230
1309
|
declare const pdas_deriveNoTokenMint: typeof deriveNoTokenMint;
|
|
1231
1310
|
declare const pdas_derivePositionPda: typeof derivePositionPda;
|
|
1232
1311
|
declare const pdas_deriveTokenMetadataPda: typeof deriveTokenMetadataPda;
|
|
1312
|
+
declare const pdas_deriveV3NoTokenMint: typeof deriveV3NoTokenMint;
|
|
1313
|
+
declare const pdas_deriveV3YesTokenMint: typeof deriveV3YesTokenMint;
|
|
1233
1314
|
declare const pdas_deriveYesTokenMint: typeof deriveYesTokenMint;
|
|
1234
1315
|
declare namespace pdas {
|
|
1235
|
-
export { pdas_deriveAta as deriveAta, pdas_deriveCreatorFeeTreasuryPda as deriveCreatorFeeTreasuryPda, pdas_deriveCreatorFeeTreasuryPdaLegacy as deriveCreatorFeeTreasuryPdaLegacy, pdas_deriveGlobalConfigPda as deriveGlobalConfigPda, pdas_deriveMarketPda as deriveMarketPda, pdas_deriveMarketPdaFromMints as deriveMarketPdaFromMints, pdas_deriveNoTokenMint as deriveNoTokenMint, pdas_derivePositionPda as derivePositionPda, pdas_deriveTokenMetadataPda as deriveTokenMetadataPda, pdas_deriveYesTokenMint as deriveYesTokenMint };
|
|
1316
|
+
export { pdas_deriveAta as deriveAta, pdas_deriveCreatorFeeTreasuryPda as deriveCreatorFeeTreasuryPda, pdas_deriveCreatorFeeTreasuryPdaLegacy as deriveCreatorFeeTreasuryPdaLegacy, pdas_deriveGlobalConfigPda as deriveGlobalConfigPda, pdas_deriveMarketExtensionPda as deriveMarketExtensionPda, pdas_deriveMarketPda as deriveMarketPda, pdas_deriveMarketPdaFromMints as deriveMarketPdaFromMints, pdas_deriveMarketV2Pda as deriveMarketV2Pda, pdas_deriveMarketV3ExtensionPda as deriveMarketV3ExtensionPda, pdas_deriveMarketV3Pda as deriveMarketV3Pda, pdas_deriveNoTokenMint as deriveNoTokenMint, pdas_derivePositionPda as derivePositionPda, pdas_deriveTokenMetadataPda as deriveTokenMetadataPda, pdas_deriveV3NoTokenMint as deriveV3NoTokenMint, pdas_deriveV3YesTokenMint as deriveV3YesTokenMint, pdas_deriveYesTokenMint as deriveYesTokenMint };
|
|
1236
1317
|
}
|
|
1237
1318
|
|
|
1238
|
-
export { Client, type Commitment, type GlobalConfigType, type Logger, type MarketMeta, MarketModule, type MarketType, type MarketsResponse, type P2PMarketResponse, PNPClient, ProgramError, type PubkeyLike, RedemptionModule, type SdkConfig, SdkError, type SettlementCriteria, type SettlementData, TradingModule, TransportError, type U64Like, ValidationError, type WinningTokenLike, pdas };
|
|
1319
|
+
export { Client, type Commitment, type GlobalConfigType, type Logger, type MarketExtensionType, type MarketMeta, MarketModule, type MarketType, type MarketV3ExtensionType, type MarketV3Type, type MarketsResponse, type P2PMarketResponse, PNPClient, ProgramError, type PubkeyLike, RedemptionModule, type SdkConfig, SdkError, type SettlementCriteria, type SettlementData, type TokenSideLike, TradingModule, TransportError, type U64Like, ValidationError, type WinningTokenLike, pdas };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,12 @@ interface MarketType {
|
|
|
61
61
|
resolvable: boolean;
|
|
62
62
|
force_resolve: boolean;
|
|
63
63
|
version: number;
|
|
64
|
+
/** Amount of YES tokens locked in vault for creator (set during setMarketResolvableV2) */
|
|
65
|
+
creator_yes_locked: U64Like;
|
|
66
|
+
/** Amount of NO tokens locked in vault for creator (set during setMarketResolvableV2) */
|
|
67
|
+
creator_no_locked: U64Like;
|
|
68
|
+
/** Whether the creator has already claimed locked liquidity */
|
|
69
|
+
creator_liquidity_claimed: boolean;
|
|
64
70
|
}
|
|
65
71
|
interface MarketsResponse {
|
|
66
72
|
count: number;
|
|
@@ -84,6 +90,69 @@ interface GlobalConfigType {
|
|
|
84
90
|
burn_fee: U64Like;
|
|
85
91
|
trading_paused: boolean;
|
|
86
92
|
}
|
|
93
|
+
type TokenSideLike = "yes" | "no" | number | Record<string, unknown>;
|
|
94
|
+
interface MarketV3Type {
|
|
95
|
+
id: U64Like;
|
|
96
|
+
resolved: boolean;
|
|
97
|
+
/** Total collateral in YES pot */
|
|
98
|
+
yes_pot_reserve: U64Like;
|
|
99
|
+
/** Total collateral in NO pot */
|
|
100
|
+
no_pot_reserve: U64Like;
|
|
101
|
+
/** Market creator */
|
|
102
|
+
creator: PubkeyLike;
|
|
103
|
+
/** Which side creator is backing */
|
|
104
|
+
creator_side: TokenSideLike;
|
|
105
|
+
/** Initial amount creator deposited */
|
|
106
|
+
creator_initial_amount: U64Like;
|
|
107
|
+
/** Maximum liquidity allowed on creator's side */
|
|
108
|
+
creator_side_cap: U64Like;
|
|
109
|
+
/** Total YES tokens issued */
|
|
110
|
+
yes_tokens_issued: U64Like;
|
|
111
|
+
/** Total NO tokens issued */
|
|
112
|
+
no_tokens_issued: U64Like;
|
|
113
|
+
/** Collateral token mint */
|
|
114
|
+
collateral_token: PubkeyLike;
|
|
115
|
+
/** YES token mint */
|
|
116
|
+
yes_token_mint: PubkeyLike;
|
|
117
|
+
/** NO token mint */
|
|
118
|
+
no_token_mint: PubkeyLike;
|
|
119
|
+
/** Winning side after resolution */
|
|
120
|
+
winning_token_id: WinningTokenLike;
|
|
121
|
+
/** Creator's fee treasury */
|
|
122
|
+
creator_fee_treasury: PubkeyLike;
|
|
123
|
+
/** Market question */
|
|
124
|
+
question: string;
|
|
125
|
+
/** Market end timestamp */
|
|
126
|
+
end_time: U64Like;
|
|
127
|
+
/** Market creation timestamp */
|
|
128
|
+
creation_time: U64Like;
|
|
129
|
+
/** Whether market is resolvable (set by oracle) */
|
|
130
|
+
resolvable: boolean;
|
|
131
|
+
/** PDA bump */
|
|
132
|
+
bump: number;
|
|
133
|
+
/** Maximum pot ratio allowed (basis points, e.g. 10000 = 1:1, 100000 = 10:1) */
|
|
134
|
+
max_pot_ratio: number;
|
|
135
|
+
}
|
|
136
|
+
interface MarketExtensionType {
|
|
137
|
+
/** Market ID this extension belongs to */
|
|
138
|
+
market_id: U64Like;
|
|
139
|
+
/** Initial YES odds in basis points (e.g. 7000 = 70% YES) */
|
|
140
|
+
initial_yes_odds_bps: number;
|
|
141
|
+
/** Custom oracle for this market */
|
|
142
|
+
oracle: PubkeyLike;
|
|
143
|
+
/** PDA bump */
|
|
144
|
+
bump: number;
|
|
145
|
+
}
|
|
146
|
+
interface MarketV3ExtensionType {
|
|
147
|
+
/** Market ID this extension belongs to */
|
|
148
|
+
market_id: U64Like;
|
|
149
|
+
/** Odds in basis points for creator's side (e.g. 7000 = 70%) */
|
|
150
|
+
odds_bps: number;
|
|
151
|
+
/** Custom oracle for this market */
|
|
152
|
+
oracle: PubkeyLike;
|
|
153
|
+
/** PDA bump */
|
|
154
|
+
bump: number;
|
|
155
|
+
}
|
|
87
156
|
interface SettlementCriteria {
|
|
88
157
|
category: string;
|
|
89
158
|
reasoning: string;
|
|
@@ -1219,20 +1288,32 @@ declare function deriveAta(owner: PublicKey, mint: PublicKey, allowOwnerOffCurve
|
|
|
1219
1288
|
declare function deriveMarketPdaFromMints(yesMint: PublicKey, noMint: PublicKey, programId: PublicKey): [PublicKey, number];
|
|
1220
1289
|
declare function deriveYesTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1221
1290
|
declare function deriveNoTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1291
|
+
declare function deriveMarketV2Pda(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1292
|
+
declare function deriveMarketV3Pda(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1293
|
+
declare function deriveV3YesTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1294
|
+
declare function deriveV3NoTokenMint(globalId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1295
|
+
declare function deriveMarketExtensionPda(marketId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1296
|
+
declare function deriveMarketV3ExtensionPda(marketId: bigint, programId: PublicKey): [PublicKey, number];
|
|
1222
1297
|
declare function deriveTokenMetadataPda(mint: PublicKey, metadataProgramId: PublicKey): [PublicKey, number];
|
|
1223
1298
|
|
|
1224
1299
|
declare const pdas_deriveAta: typeof deriveAta;
|
|
1225
1300
|
declare const pdas_deriveCreatorFeeTreasuryPda: typeof deriveCreatorFeeTreasuryPda;
|
|
1226
1301
|
declare const pdas_deriveCreatorFeeTreasuryPdaLegacy: typeof deriveCreatorFeeTreasuryPdaLegacy;
|
|
1227
1302
|
declare const pdas_deriveGlobalConfigPda: typeof deriveGlobalConfigPda;
|
|
1303
|
+
declare const pdas_deriveMarketExtensionPda: typeof deriveMarketExtensionPda;
|
|
1228
1304
|
declare const pdas_deriveMarketPda: typeof deriveMarketPda;
|
|
1229
1305
|
declare const pdas_deriveMarketPdaFromMints: typeof deriveMarketPdaFromMints;
|
|
1306
|
+
declare const pdas_deriveMarketV2Pda: typeof deriveMarketV2Pda;
|
|
1307
|
+
declare const pdas_deriveMarketV3ExtensionPda: typeof deriveMarketV3ExtensionPda;
|
|
1308
|
+
declare const pdas_deriveMarketV3Pda: typeof deriveMarketV3Pda;
|
|
1230
1309
|
declare const pdas_deriveNoTokenMint: typeof deriveNoTokenMint;
|
|
1231
1310
|
declare const pdas_derivePositionPda: typeof derivePositionPda;
|
|
1232
1311
|
declare const pdas_deriveTokenMetadataPda: typeof deriveTokenMetadataPda;
|
|
1312
|
+
declare const pdas_deriveV3NoTokenMint: typeof deriveV3NoTokenMint;
|
|
1313
|
+
declare const pdas_deriveV3YesTokenMint: typeof deriveV3YesTokenMint;
|
|
1233
1314
|
declare const pdas_deriveYesTokenMint: typeof deriveYesTokenMint;
|
|
1234
1315
|
declare namespace pdas {
|
|
1235
|
-
export { pdas_deriveAta as deriveAta, pdas_deriveCreatorFeeTreasuryPda as deriveCreatorFeeTreasuryPda, pdas_deriveCreatorFeeTreasuryPdaLegacy as deriveCreatorFeeTreasuryPdaLegacy, pdas_deriveGlobalConfigPda as deriveGlobalConfigPda, pdas_deriveMarketPda as deriveMarketPda, pdas_deriveMarketPdaFromMints as deriveMarketPdaFromMints, pdas_deriveNoTokenMint as deriveNoTokenMint, pdas_derivePositionPda as derivePositionPda, pdas_deriveTokenMetadataPda as deriveTokenMetadataPda, pdas_deriveYesTokenMint as deriveYesTokenMint };
|
|
1316
|
+
export { pdas_deriveAta as deriveAta, pdas_deriveCreatorFeeTreasuryPda as deriveCreatorFeeTreasuryPda, pdas_deriveCreatorFeeTreasuryPdaLegacy as deriveCreatorFeeTreasuryPdaLegacy, pdas_deriveGlobalConfigPda as deriveGlobalConfigPda, pdas_deriveMarketExtensionPda as deriveMarketExtensionPda, pdas_deriveMarketPda as deriveMarketPda, pdas_deriveMarketPdaFromMints as deriveMarketPdaFromMints, pdas_deriveMarketV2Pda as deriveMarketV2Pda, pdas_deriveMarketV3ExtensionPda as deriveMarketV3ExtensionPda, pdas_deriveMarketV3Pda as deriveMarketV3Pda, pdas_deriveNoTokenMint as deriveNoTokenMint, pdas_derivePositionPda as derivePositionPda, pdas_deriveTokenMetadataPda as deriveTokenMetadataPda, pdas_deriveV3NoTokenMint as deriveV3NoTokenMint, pdas_deriveV3YesTokenMint as deriveV3YesTokenMint, pdas_deriveYesTokenMint as deriveYesTokenMint };
|
|
1236
1317
|
}
|
|
1237
1318
|
|
|
1238
|
-
export { Client, type Commitment, type GlobalConfigType, type Logger, type MarketMeta, MarketModule, type MarketType, type MarketsResponse, type P2PMarketResponse, PNPClient, ProgramError, type PubkeyLike, RedemptionModule, type SdkConfig, SdkError, type SettlementCriteria, type SettlementData, TradingModule, TransportError, type U64Like, ValidationError, type WinningTokenLike, pdas };
|
|
1319
|
+
export { Client, type Commitment, type GlobalConfigType, type Logger, type MarketExtensionType, type MarketMeta, MarketModule, type MarketType, type MarketV3ExtensionType, type MarketV3Type, type MarketsResponse, type P2PMarketResponse, PNPClient, ProgramError, type PubkeyLike, RedemptionModule, type SdkConfig, SdkError, type SettlementCriteria, type SettlementData, type TokenSideLike, TradingModule, TransportError, type U64Like, ValidationError, type WinningTokenLike, pdas };
|
package/dist/index.js
CHANGED