@molpha/sdk 0.2.0-dev-20261005112114 → 0.2.0-dev-20261005191253

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/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { Wallet } from '@anchor-lang/core';
2
- import { r as SolanaKeypair, M as MolphaWallet } from './wallet-LqCFWwV4.js';
2
+ import { r as SolanaKeypair, M as MolphaWallet } from './wallet--IGHoCtG.js';
3
3
  import '@solana/kit';
4
4
 
5
5
  /** Load a Solana CLI keypair JSON file (array of 64 bytes) into a `Keypair`. */
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { keypairFromSecretKey } from './chunk-2X22JY7Q.js';
1
+ import { keypairFromSecretKey } from './chunk-H77BBZOL.js';
2
2
  import { readFileSync } from 'fs';
3
3
  import { Wallet } from '@anchor-lang/core';
4
4
  export { Wallet } from '@anchor-lang/core';
@@ -242,4 +242,4 @@ declare function signerFromKeypair(keypair: SolanaKeypair): Signer;
242
242
  /** Resolve the gateway auth signer for a Molpha wallet, if available. */
243
243
  declare function gatewaySignerFromWallet(wallet: Wallet): Signer | undefined;
244
244
 
245
- export { type APIConfig as A, type EvmSigner as E, type MolphaWallet as M, type NodeKeyVerifier as N, type RegistrySelectionConfig as R, type Signer as S, type UpstreamQuote as U, type AssetDomain as a, type UpstreamTerms as b, type Node as c, type NodesInfo as d, type SourcePaymentOptions as e, type Attestation as f, type SolanaAccountMeta as g, type SolanaConnection as h, type SolanaAddress as i, type NodeKeyVerifierArgs as j, type AggregationConfig as k, type AttestationPayload as l, type EncKeyBundle as m, type NumericConfig as n, type RegistryInfo as o, type SchnorrSignature as p, gatewaySignerFromWallet as q, type SolanaKeypair as r, signerFromKeypair as s };
245
+ export { type APIConfig as A, type EvmSigner as E, type MolphaWallet as M, type Node as N, type RegistrySelectionConfig as R, type Signer as S, type UpstreamQuote as U, type AssetDomain as a, type UpstreamTerms as b, type SourcePaymentOptions as c, type NodeKeyVerifier as d, type NodesInfo as e, type Attestation as f, type SolanaAccountMeta as g, type SolanaConnection as h, type SolanaAddress as i, type NodeKeyVerifierArgs as j, type AggregationConfig as k, type AttestationPayload as l, type EncKeyBundle as m, type NumericConfig as n, type RegistryInfo as o, type SchnorrSignature as p, gatewaySignerFromWallet as q, type SolanaKeypair as r, signerFromKeypair as s };
package/idl/molpha.json CHANGED
@@ -4980,6 +4980,11 @@
4980
4980
  "code": 6100,
4981
4981
  "name": "InvalidRentReceiver",
4982
4982
  "msg": "rent receiver must be the account that paid for the closed account"
4983
+ },
4984
+ {
4985
+ "code": 6101,
4986
+ "name": "InvalidInitialTau",
4987
+ "msg": "initial_tau is below the minimum ticket threshold"
4983
4988
  }
4984
4989
  ],
4985
4990
  "types": [
@@ -6019,6 +6024,18 @@
6019
6024
  {
6020
6025
  "name": "protocol_fee_bps",
6021
6026
  "type": "u16"
6027
+ },
6028
+ {
6029
+ "name": "initial_tau",
6030
+ "docs": [
6031
+ "Ticket threshold of the two genesis epochs: a round is a ticket when the 64-bit prefix of its",
6032
+ "ticket hash is below it, so the sampling probability is `initial_tau / 2^64`. Size it as",
6033
+ "`2^64 * target_tickets_per_epoch / expected_rounds_per_epoch`. `u64::MAX` samples every round",
6034
+ "(every round then costs a ticket transaction until the controller, which moves the",
6035
+ "threshold at most 8x per epoch with a two-epoch lag, brings it down). Must be at least",
6036
+ "`TAU_MIN`."
6037
+ ],
6038
+ "type": "u64"
6022
6039
  }
6023
6040
  ]
6024
6041
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molpha/sdk",
3
- "version": "0.2.0-dev-20261005112114",
3
+ "version": "0.2.0-dev-20261005191253",
4
4
  "description": "Molpha Consumer SDK — subscribe, request signed data from the gateway, submit attestations and read on-chain feeds.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/solana/kit.ts"],"names":[],"mappings":";;;;AAaO,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qBAAqB,SAAA,EAAsC;AACzE,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,SAAS,CAAA;AAC7C","file":"chunk-2X22JY7Q.js","sourcesContent":["import { web3 } from \"@anchor-lang/core\";\nimport { address, getAddressDecoder, getAddressEncoder, type Address } from \"@solana/kit\";\n\nexport type SolanaAddress = Address | string | InstanceType<typeof web3.PublicKey>;\nexport type SolanaConnection = InstanceType<typeof web3.Connection>;\nexport type SolanaKeypair = InstanceType<typeof web3.Keypair>;\nexport type SolanaInstruction = InstanceType<typeof web3.TransactionInstruction>;\nexport type SolanaAccountMeta = {\n pubkey: InstanceType<typeof web3.PublicKey>;\n isSigner: boolean;\n isWritable: boolean;\n};\n\nexport const TOKEN_PROGRAM_ADDRESS = address(\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\");\nexport const ASSOCIATED_TOKEN_PROGRAM_ADDRESS = address(\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n);\nexport const SYSTEM_PROGRAM_ADDRESS = address(\"11111111111111111111111111111111\");\n\nconst addressEncoder = getAddressEncoder();\nconst addressDecoder = getAddressDecoder();\n\nexport function toSolanaAddress(value: SolanaAddress): Address {\n return address(typeof value === \"string\" ? value : value.toBase58());\n}\n\nexport function toPublicKey(value: SolanaAddress): InstanceType<typeof web3.PublicKey> {\n return value instanceof web3.PublicKey ? value : new web3.PublicKey(value);\n}\n\nexport function addressBytes(value: SolanaAddress): Uint8Array {\n return Uint8Array.from(addressEncoder.encode(toSolanaAddress(value)));\n}\n\n/** Base58 `Address` from 32 raw bytes (e.g. a `Registry.nodes[i]` entry). */\nexport function addressFromBytes(bytes: Uint8Array): Address {\n return addressDecoder.decode(bytes);\n}\n\nexport function findProgramAddressSync(\n seeds: Uint8Array[],\n programAddress: SolanaAddress,\n): Address {\n const [pda] = web3.PublicKey.findProgramAddressSync(seeds, toPublicKey(programAddress));\n return toSolanaAddress(pda);\n}\n\nexport function findProgramPublicKeySync(\n seeds: Uint8Array[],\n programAddress: SolanaAddress,\n): InstanceType<typeof web3.PublicKey> {\n const [pda] = web3.PublicKey.findProgramAddressSync(seeds, toPublicKey(programAddress));\n return pda;\n}\n\nexport function getAssociatedTokenAddressSync(\n mint: SolanaAddress,\n owner: SolanaAddress,\n tokenProgram: SolanaAddress = TOKEN_PROGRAM_ADDRESS,\n): Address {\n return findProgramAddressSync(\n [addressBytes(owner), addressBytes(tokenProgram), addressBytes(mint)],\n ASSOCIATED_TOKEN_PROGRAM_ADDRESS,\n );\n}\n\nexport function setComputeUnitLimit(units: number): SolanaInstruction {\n return web3.ComputeBudgetProgram.setComputeUnitLimit({ units });\n}\n\nexport function keypairFromSecretKey(secretKey: Uint8Array): SolanaKeypair {\n return web3.Keypair.fromSecretKey(secretKey);\n}\n\nexport function generateKeypair(): SolanaKeypair {\n return web3.Keypair.generate();\n}\n"]}