precog-markets 1.2.4 → 1.2.5
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 +2 -1
- package/package.json +1 -1
- package/src/client.js +3 -1
- package/src/index.d.ts +1 -1
- package/src/instructions.js +2 -1
package/README.md
CHANGED
|
@@ -214,6 +214,7 @@ await client.estimatePriorityFee(instructions, feePayer, { priorityLevel: "VeryH
|
|
|
214
214
|
await client.estimateComputeUnits(instructions, feePayer, { computeUnitMargin: 1.3 });
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
+
```js
|
|
217
218
|
// Transactional (sign + send)
|
|
218
219
|
await client.createSolMarket({ ... });
|
|
219
220
|
await client.placeSolBet({ ... });
|
|
@@ -416,7 +417,7 @@ const sig = await client.sendRawTransaction(signedTx);
|
|
|
416
417
|
|
|
417
418
|
## Error Handling
|
|
418
419
|
|
|
419
|
-
The SDK exports all
|
|
420
|
+
The SDK exports all 63 program error codes:
|
|
420
421
|
|
|
421
422
|
```js
|
|
422
423
|
import { ErrorCode, ErrorName } from "precog-markets";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "precog-markets",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "JavaScript SDK for Precog Markets — a Solana prediction market program — pari-mutuel markets with SOL, SPL Token, and Token-2022 support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/client.js
CHANGED
|
@@ -808,8 +808,10 @@ export class PrecogMarketsClient {
|
|
|
808
808
|
* @param {import("@solana/web3.js").ConfirmOptions} [opts]
|
|
809
809
|
*/
|
|
810
810
|
async executeProposal(payer, proposal, multisig, market, opts) {
|
|
811
|
+
const [protocolConfig] = await this.findProtocolConfig();
|
|
812
|
+
|
|
811
813
|
const instruction = ix.executeProposal(
|
|
812
|
-
{ proposal, multisig, market },
|
|
814
|
+
{ proposal, multisig, market, protocolConfig },
|
|
813
815
|
this.programId
|
|
814
816
|
);
|
|
815
817
|
const signature = await this.sendTransaction([instruction], [payer], opts);
|
package/src/index.d.ts
CHANGED
|
@@ -455,7 +455,7 @@ export declare function approveProposal(
|
|
|
455
455
|
): TransactionInstruction;
|
|
456
456
|
|
|
457
457
|
export declare function executeProposal(
|
|
458
|
-
accounts: { proposal: PublicKey; multisig: PublicKey; market: PublicKey },
|
|
458
|
+
accounts: { proposal: PublicKey; multisig: PublicKey; market: PublicKey; protocolConfig: PublicKey },
|
|
459
459
|
programId?: PublicKey
|
|
460
460
|
): TransactionInstruction;
|
|
461
461
|
|
package/src/instructions.js
CHANGED
|
@@ -536,7 +536,7 @@ export function approveProposal(accounts, programId = PROGRAM_ID) {
|
|
|
536
536
|
|
|
537
537
|
/**
|
|
538
538
|
* Permissionless once threshold is met.
|
|
539
|
-
* @param {{ proposal: PublicKey, multisig: PublicKey, market: PublicKey }} accounts
|
|
539
|
+
* @param {{ proposal: PublicKey, multisig: PublicKey, market: PublicKey, protocolConfig: PublicKey }} accounts
|
|
540
540
|
* @param {PublicKey} [programId]
|
|
541
541
|
* @returns {TransactionInstruction}
|
|
542
542
|
*/
|
|
@@ -547,6 +547,7 @@ export function executeProposal(accounts, programId = PROGRAM_ID) {
|
|
|
547
547
|
w(accounts.proposal),
|
|
548
548
|
w(accounts.multisig),
|
|
549
549
|
w(accounts.market),
|
|
550
|
+
ro(accounts.protocolConfig),
|
|
550
551
|
],
|
|
551
552
|
data: Buffer.from(DISCRIMINATORS.EXECUTE_PROPOSAL),
|
|
552
553
|
});
|