@wzrd_sol/sdk 0.1.3 → 0.1.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/accounts.js CHANGED
@@ -42,7 +42,7 @@ export function parseProtocolState(data) {
42
42
  }
43
43
  /** Parse a UserMarketPosition account. Returns null if data is too short. */
44
44
  export function parseUserMarketPosition(data) {
45
- if (data.length < 106)
45
+ if (data.length < 114)
46
46
  return null;
47
47
  const d = data.subarray(8); // skip Anchor discriminator
48
48
  return {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * PDA derivation, instruction builders, and account parsers for
5
5
  * deposit_market, settle_market, and claim_global.
6
6
  */
7
- export declare const VERSION = "0.1.1";
7
+ export declare const VERSION = "0.1.4";
8
8
  export { PROGRAM_ID, DEVNET_PROGRAM_ID, MAINNET_PROGRAM_ID, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID, PROTOCOL_STATE_SEED, MARKET_VAULT_SEED, MARKET_POSITION_SEED, GLOBAL_ROOT_SEED, CLAIM_STATE_GLOBAL_SEED, CHANNEL_CONFIG_V2_SEED, } from './constants.js';
9
9
  export { getProtocolStatePDA, getMarketVaultPDA, getUserPositionPDA, getGlobalRootConfigPDA, getClaimStatePDA, getChannelConfigV2PDA, getAta, } from './pda.js';
10
10
  export type { MarketVaultData, MarketVaultFull, ProtocolStateData, OnChainPosition, } from './accounts.js';
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * PDA derivation, instruction builders, and account parsers for
5
5
  * deposit_market, settle_market, and claim_global.
6
6
  */
7
- export const VERSION = '0.1.1';
7
+ export const VERSION = '0.1.4';
8
8
  // ── Constants ──────────────────────────────────────────
9
9
  export { PROGRAM_ID, DEVNET_PROGRAM_ID, MAINNET_PROGRAM_ID, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID, PROTOCOL_STATE_SEED, MARKET_VAULT_SEED, MARKET_POSITION_SEED, GLOBAL_ROOT_SEED, CLAIM_STATE_GLOBAL_SEED, CHANNEL_CONFIG_V2_SEED, } from './constants.js';
10
10
  // ── PDA Derivation ─────────────────────────────────────
@@ -221,8 +221,10 @@ export async function createSettleMarketIx(connection, user, marketId, programId
221
221
  const protocolState = getProtocolStatePDA(programId);
222
222
  const marketVault = getMarketVaultPDA(protocolState, marketId, programId);
223
223
  const userPosition = getUserPositionPDA(marketVault, user, programId);
224
- const accountsMode = options.accountsMode
225
- ?? 'current';
224
+ // 'auto' resolves based on program ID: mainnet uses legacy_ccm layout
225
+ const accountsMode = options.accountsMode === 'auto' || !options.accountsMode
226
+ ? (programId.equals(PROGRAM_ID) ? 'legacy_ccm' : 'current')
227
+ : options.accountsMode;
226
228
  // Fetch vault + protocol state to discover mints/accounts.
227
229
  const vaultInfo = await connection.getAccountInfo(marketVault);
228
230
  if (!vaultInfo)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzrd_sol/sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "TypeScript SDK for the WZRD Liquid Attention Protocol — deposit, settle, claim on Solana",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",