@hadron-fi/sdk 0.4.3 → 0.4.4

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/index.d.mts CHANGED
@@ -5,7 +5,7 @@ declare enum PoolState {
5
5
  Uninitialized = 0,
6
6
  Initialized = 1,
7
7
  Paused = 2,
8
- WithdrawOnly = 3
8
+ RejectSwaps = 3
9
9
  }
10
10
  declare enum OracleMode {
11
11
  /** Off-chain authority updates the oracle */
@@ -280,6 +280,7 @@ interface InitializeSpreadConfigParams {
280
280
  interface SpreadTriggerInput {
281
281
  account: PublicKey;
282
282
  spreadBps: number;
283
+ matchMode?: number;
283
284
  }
284
285
  interface UpdateSpreadConfigParams {
285
286
  triggers: SpreadTriggerInput[];
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ declare enum PoolState {
5
5
  Uninitialized = 0,
6
6
  Initialized = 1,
7
7
  Paused = 2,
8
- WithdrawOnly = 3
8
+ RejectSwaps = 3
9
9
  }
10
10
  declare enum OracleMode {
11
11
  /** Off-chain authority updates the oracle */
@@ -280,6 +280,7 @@ interface InitializeSpreadConfigParams {
280
280
  interface SpreadTriggerInput {
281
281
  account: PublicKey;
282
282
  spreadBps: number;
283
+ matchMode?: number;
283
284
  }
284
285
  interface UpdateSpreadConfigParams {
285
286
  triggers: SpreadTriggerInput[];
package/dist/index.js CHANGED
@@ -271,7 +271,7 @@ var PoolState = /* @__PURE__ */ ((PoolState3) => {
271
271
  PoolState3[PoolState3["Uninitialized"] = 0] = "Uninitialized";
272
272
  PoolState3[PoolState3["Initialized"] = 1] = "Initialized";
273
273
  PoolState3[PoolState3["Paused"] = 2] = "Paused";
274
- PoolState3[PoolState3["WithdrawOnly"] = 3] = "WithdrawOnly";
274
+ PoolState3[PoolState3["RejectSwaps"] = 3] = "RejectSwaps";
275
275
  return PoolState3;
276
276
  })(PoolState || {});
277
277
  var OracleMode = /* @__PURE__ */ ((OracleMode3) => {
@@ -422,7 +422,8 @@ function decodeSpreadConfig(data) {
422
422
  const off = triggersStart + i * SPREAD_TRIGGER_LEN;
423
423
  const account = new (0, _web3js.PublicKey)(buf.subarray(off, off + 32));
424
424
  const spreadBps = buf.readUInt16LE(off + 32);
425
- triggers.push({ account, spreadBps });
425
+ const matchMode = buf.readUInt8(off + 34);
426
+ triggers.push({ account, spreadBps, matchMode });
426
427
  }
427
428
  return { initialized, bump, numTriggers, admin, config, triggers };
428
429
  }
@@ -1254,7 +1255,7 @@ function buildInitializeSpreadConfig(payer, authority, configPda, params, progra
1254
1255
  function buildUpdateSpreadConfig(admin, configPda, params, programId = HADRON_PROGRAM_ID) {
1255
1256
  const [spreadConfigPda] = getSpreadConfigAddress(configPda, programId);
1256
1257
  const numTriggers = params.triggers.length;
1257
- const data = Buffer.alloc(1 + 1 + numTriggers * 34);
1258
+ const data = Buffer.alloc(1 + 1 + numTriggers * 35);
1258
1259
  let offset = 0;
1259
1260
  data.writeUInt8(Discriminator.UpdateSpreadConfig, offset);
1260
1261
  offset += 1;
@@ -1265,6 +1266,8 @@ function buildUpdateSpreadConfig(admin, configPda, params, programId = HADRON_PR
1265
1266
  offset += 32;
1266
1267
  data.writeUInt16LE(t.spreadBps, offset);
1267
1268
  offset += 2;
1269
+ data.writeUInt8(_nullishCoalesce(t.matchMode, () => ( 0)), offset);
1270
+ offset += 1;
1268
1271
  }
1269
1272
  return new (0, _web3js.TransactionInstruction)({
1270
1273
  programId,