@infantmen-labs/harbor-sdk 0.3.0 → 0.4.3

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.
@@ -15,6 +15,6 @@ export interface SubmitReceiptArgs {
15
15
  signer: PublicKey;
16
16
  }
17
17
  export declare function submitReceiptIx(programId: PublicKey, merchant: PublicKey, bond: PublicKey, binding: PublicKey, receipt: PublicKey, args: SubmitReceiptArgs): TransactionInstruction;
18
- export declare function openDisputeIx(programId: PublicKey, claimant: PublicKey, bond: PublicKey, binding: PublicKey, channel: PublicKey, dispute: PublicKey, mint: PublicKey, claimantAta: PublicKey, vault: PublicKey, nonce: bigint, reason: number, claimSpend: bigint): TransactionInstruction;
18
+ export declare function openDisputeIx(programId: PublicKey, claimant: PublicKey, bond: PublicKey, binding: PublicKey, channel: PublicKey, dispute: PublicKey, claim: PublicKey, mint: PublicKey, claimantAta: PublicKey, vault: PublicKey, nonce: bigint, reason: number, claimSpend: bigint): TransactionInstruction;
19
19
  export declare function haltBindingIx(programId: PublicKey, merchant: PublicKey, binding: PublicKey): TransactionInstruction;
20
20
  export declare function resolveTimeoutIx(programId: PublicKey, resolver: PublicKey, bond: PublicKey, mint: PublicKey, binding: PublicKey, dispute: PublicKey, claimant: PublicKey, treasury: PublicKey, vault: PublicKey, treasuryAta: PublicKey, claimantAta: PublicKey, nonce: bigint): TransactionInstruction;
@@ -137,13 +137,14 @@ function submitReceiptIx(programId, merchant, bond, binding, receipt, args) {
137
137
  { key: ids_1.SYSTEM_PROGRAM_ID },
138
138
  ]);
139
139
  }
140
- function openDisputeIx(programId, claimant, bond, binding, channel, dispute, mint, claimantAta, vault, nonce, reason, claimSpend) {
140
+ function openDisputeIx(programId, claimant, bond, binding, channel, dispute, claim, mint, claimantAta, vault, nonce, reason, claimSpend) {
141
141
  return keys(programId, D.openDispute, Buffer.concat([u64(nonce), u8(reason), u64(claimSpend)]), [
142
142
  { key: claimant, w: true, s: true },
143
143
  { key: bond, w: true },
144
144
  { key: binding },
145
145
  { key: channel },
146
146
  { key: dispute, w: true },
147
+ { key: claim, w: true },
147
148
  { key: mint },
148
149
  { key: claimantAta, w: true },
149
150
  { key: vault, w: true },
package/dist/src/pda.d.ts CHANGED
@@ -4,5 +4,7 @@ export declare function bindingPda(channel: PublicKey): [PublicKey, number];
4
4
  export declare function receiptPda(binding: PublicKey, nonce: bigint): [PublicKey, number];
5
5
  export declare function disputePda(binding: PublicKey, nonce: bigint): [PublicKey, number];
6
6
  export declare function treasuryPda(mint: PublicKey): [PublicKey, number];
7
+ /** Tombstone marking a (binding, nonce) as claimed exactly once. */
8
+ export declare function claimPda(binding: PublicKey, nonce: bigint): [PublicKey, number];
7
9
  export declare function channelPda(channelProgram: PublicKey, payer: PublicKey, payee: PublicKey, mint: PublicKey, authorizedSigner: PublicKey, salt: bigint, openSlot: bigint): [PublicKey, number];
8
10
  export declare function channelAta(channel: PublicKey, tokenProgram: PublicKey, mint: PublicKey, ataProgram: PublicKey): [PublicKey, number];
package/dist/src/pda.js CHANGED
@@ -5,6 +5,7 @@ exports.bindingPda = bindingPda;
5
5
  exports.receiptPda = receiptPda;
6
6
  exports.disputePda = disputePda;
7
7
  exports.treasuryPda = treasuryPda;
8
+ exports.claimPda = claimPda;
8
9
  exports.channelPda = channelPda;
9
10
  exports.channelAta = channelAta;
10
11
  const web3_js_1 = require("@solana/web3.js");
@@ -28,6 +29,12 @@ function disputePda(binding, nonce) {
28
29
  function treasuryPda(mint) {
29
30
  return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("treasury"), mint.toBuffer()], ids_1.HARBOR_PROGRAM_ID);
30
31
  }
32
+ /** Tombstone marking a (binding, nonce) as claimed exactly once. */
33
+ function claimPda(binding, nonce) {
34
+ const nonceBuf = Buffer.alloc(8);
35
+ nonceBuf.writeBigUInt64LE(nonce);
36
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("claim"), binding.toBuffer(), nonceBuf], ids_1.HARBOR_PROGRAM_ID);
37
+ }
31
38
  function channelPda(channelProgram, payer, payee, mint, authorizedSigner, salt, openSlot) {
32
39
  const saltBuf = Buffer.alloc(8);
33
40
  saltBuf.writeBigUInt64LE(salt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infantmen-labs/harbor-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.3",
4
4
  "description": "TypeScript SDK for Harbor bonded refunds on Solana: PDA helpers, instruction builders, receipt codec, ed25519 verify, account decoders.",
5
5
  "license": "MIT",
6
6
  "keywords": [