@smithii_io/mixoor 0.0.10 → 0.0.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.
@@ -1,4 +1,4 @@
1
- import { fixEncoderSize, getBytesEncoder, transformEncoder, getStructEncoder, getI64Encoder, getStructDecoder, fixDecoderSize, getI64Decoder, getBytesDecoder, combineCodec, decodeAccount, assertAccountExists, fetchEncodedAccount, assertAccountsExist, fetchEncodedAccounts, getEnumEncoder, getEnumDecoder, getU32Encoder, getAddressEncoder, getU32Decoder, getAddressDecoder, getArrayEncoder, getU64Encoder, getU8Encoder, getArrayDecoder, getU64Decoder, getU8Decoder, containsBytes, isProgramError, getProgramDerivedAddress, AccountRole, upgradeRoleToSigner, isTransactionSigner as isTransactionSigner$1 } from '@solana/kit';
1
+ import { fixEncoderSize, getBytesEncoder, transformEncoder, getStructEncoder, getI64Encoder, getStructDecoder, fixDecoderSize, getI64Decoder, getBytesDecoder, combineCodec, decodeAccount, assertAccountExists, fetchEncodedAccount, assertAccountsExist, fetchEncodedAccounts, getEnumEncoder, getEnumDecoder, getU32Encoder, getAddressEncoder, getU32Decoder, getAddressDecoder, getArrayEncoder, getU64Encoder, getU8Encoder, getArrayDecoder, getU64Decoder, getU8Decoder, containsBytes, isProgramError, getProgramDerivedAddress, getEnumCodec, AccountRole, upgradeRoleToSigner, isTransactionSigner as isTransactionSigner$1 } from '@solana/kit';
2
2
  import { buildPoseidon } from 'circomlibjs';
3
3
  import * as fs from 'fs';
4
4
  import * as path from 'path';
@@ -150,7 +150,7 @@ function getPoolEncoder() {
150
150
  ["mint", getAddressEncoder()],
151
151
  ["vault", getAddressEncoder()],
152
152
  ["feeCollector", getAddressEncoder()],
153
- ["rootHistory", getArrayEncoder(getRootEntryEncoder(), { size: 30 })],
153
+ ["rootHistory", getArrayEncoder(getRootEntryEncoder(), { size: 50 })],
154
154
  ["totalDeposited", getU64Encoder()],
155
155
  ["totalWithdrawn", getU64Encoder()],
156
156
  ["nextLeafIndex", getU32Encoder()],
@@ -169,7 +169,7 @@ function getPoolDecoder() {
169
169
  ["mint", getAddressDecoder()],
170
170
  ["vault", getAddressDecoder()],
171
171
  ["feeCollector", getAddressDecoder()],
172
- ["rootHistory", getArrayDecoder(getRootEntryDecoder(), { size: 30 })],
172
+ ["rootHistory", getArrayDecoder(getRootEntryDecoder(), { size: 50 })],
173
173
  ["totalDeposited", getU64Decoder()],
174
174
  ["totalWithdrawn", getU64Decoder()],
175
175
  ["nextLeafIndex", getU32Decoder()],
@@ -207,7 +207,7 @@ async function fetchAllMaybePool(rpc, addresses, config) {
207
207
  return maybeAccounts.map((maybeAccount) => decodePool(maybeAccount));
208
208
  }
209
209
  function getPoolSize() {
210
- return 1360;
210
+ return 2160;
211
211
  }
212
212
  var VAULT_DISCRIMINATOR = new Uint8Array([
213
213
  211,
@@ -263,7 +263,7 @@ async function fetchAllMaybeVault(rpc, addresses, config) {
263
263
  function getVaultSize() {
264
264
  return 8;
265
265
  }
266
- var MIXOOR_PROGRAM_ADDRESS = "mixmC791jTymqvJR2Zgvd8NAvXpXw99GdCW5uQcMBj8";
266
+ var MIXOOR_PROGRAM_ADDRESS = "mixEcfx7w47hvRwb9Nj7UeSQkCz6vZMbRHixMyYMLMb";
267
267
  var MixoorAccount = /* @__PURE__ */ ((MixoorAccount2) => {
268
268
  MixoorAccount2[MixoorAccount2["NullifierAccount"] = 0] = "NullifierAccount";
269
269
  MixoorAccount2[MixoorAccount2["Pool"] = 1] = "Pool";
@@ -670,7 +670,8 @@ async function getInitializePoolInstructionAsync(input, config) {
670
670
  programAddress,
671
671
  seeds: [
672
672
  getBytesEncoder().encode(new Uint8Array([112, 111, 111, 108])),
673
- getAddressEncoder().encode(expectAddress(accounts.mint.value))
673
+ getAddressEncoder().encode(expectAddress(accounts.mint.value)),
674
+ getAssetTypeEncoder().encode(expectSome(args.assetType))
674
675
  ]
675
676
  });
676
677
  }
@@ -1338,7 +1339,11 @@ async function findPoolAddress(seeds, config = {}) {
1338
1339
  const { programAddress = MIXOOR_PROGRAM_ADDRESS } = config;
1339
1340
  return await getProgramDerivedAddress({
1340
1341
  programAddress,
1341
- seeds: ["pool", getAddressEncoder().encode(seeds.mint)]
1342
+ seeds: [
1343
+ "pool",
1344
+ getAddressEncoder().encode(seeds.mint),
1345
+ getEnumCodec(AssetType).encode(seeds.assetType)
1346
+ ]
1342
1347
  });
1343
1348
  }
1344
1349
  async function findMerkleTreeAddress(seeds, config = {}) {