@shunt-network/sdk 1.0.0

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.
Files changed (96) hide show
  1. package/dist/clients/typescript/src/__tests__/instruction-parsers.test.d.ts +1 -0
  2. package/dist/clients/typescript/src/__tests__/voucher-numeric-safety.test.d.ts +1 -0
  3. package/dist/clients/typescript/src/__tests__/voucher-types.test-d.d.ts +1 -0
  4. package/dist/clients/typescript/src/generated/accounts/channel.d.ts +59 -0
  5. package/dist/clients/typescript/src/generated/accounts/index.d.ts +8 -0
  6. package/dist/clients/typescript/src/generated/errors/index.d.ts +8 -0
  7. package/dist/clients/typescript/src/generated/errors/paymentChannels.d.ts +84 -0
  8. package/dist/clients/typescript/src/generated/index.d.ts +13 -0
  9. package/dist/clients/typescript/src/generated/instructions/distribute.d.ts +90 -0
  10. package/dist/clients/typescript/src/generated/instructions/emitEvent.d.ts +42 -0
  11. package/dist/clients/typescript/src/generated/instructions/index.d.ts +17 -0
  12. package/dist/clients/typescript/src/generated/instructions/open.d.ts +100 -0
  13. package/dist/clients/typescript/src/generated/instructions/reclaim.d.ts +39 -0
  14. package/dist/clients/typescript/src/generated/instructions/requestClose.d.ts +39 -0
  15. package/dist/clients/typescript/src/generated/instructions/seal.d.ts +36 -0
  16. package/dist/clients/typescript/src/generated/instructions/settle.d.ts +39 -0
  17. package/dist/clients/typescript/src/generated/instructions/settleAndSeal.d.ts +47 -0
  18. package/dist/clients/typescript/src/generated/instructions/topUp.d.ts +56 -0
  19. package/dist/clients/typescript/src/generated/instructions/withdrawPayer.d.ts +51 -0
  20. package/dist/clients/typescript/src/generated/pdas/eventAuthority.d.ts +11 -0
  21. package/dist/clients/typescript/src/generated/pdas/index.d.ts +8 -0
  22. package/dist/clients/typescript/src/generated/programs/index.d.ts +8 -0
  23. package/dist/clients/typescript/src/generated/programs/paymentChannels.d.ts +80 -0
  24. package/dist/clients/typescript/src/generated/types/accountDiscriminator.d.ts +16 -0
  25. package/dist/clients/typescript/src/generated/types/channelStatus.d.ts +18 -0
  26. package/dist/clients/typescript/src/generated/types/distributeArgs.d.ts +18 -0
  27. package/dist/clients/typescript/src/generated/types/distributionEntry.d.ts +16 -0
  28. package/dist/clients/typescript/src/generated/types/index.d.ts +20 -0
  29. package/dist/clients/typescript/src/generated/types/openArgs.d.ts +26 -0
  30. package/dist/clients/typescript/src/generated/types/opened.d.ts +19 -0
  31. package/dist/clients/typescript/src/generated/types/payoutBeneficiary.d.ts +17 -0
  32. package/dist/clients/typescript/src/generated/types/payoutRedirected.d.ts +26 -0
  33. package/dist/clients/typescript/src/generated/types/redirectReason.d.ts +18 -0
  34. package/dist/clients/typescript/src/generated/types/settleAndSealArgs.d.ts +15 -0
  35. package/dist/clients/typescript/src/generated/types/settlementWatermarks.d.ts +19 -0
  36. package/dist/clients/typescript/src/generated/types/topUpArgs.d.ts +17 -0
  37. package/dist/clients/typescript/src/generated/types/voucherArgs.d.ts +23 -0
  38. package/dist/clients/typescript/src/index.d.ts +1 -0
  39. package/dist/clients/typescript/src/safe-codecs.d.ts +6 -0
  40. package/dist/clients/typescript/tsup.config.d.ts +2 -0
  41. package/dist/index.cjs +1399 -0
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.js +1549 -0
  44. package/dist/sdk/channel.d.ts +10 -0
  45. package/dist/sdk/client.d.ts +31 -0
  46. package/dist/sdk/utils.d.ts +3 -0
  47. package/dist/sdk/voucher.d.ts +14 -0
  48. package/package.json +36 -0
  49. package/src/clients/typescript/package.json +32 -0
  50. package/src/clients/typescript/src/__tests__/instruction-parsers.test.ts +81 -0
  51. package/src/clients/typescript/src/__tests__/voucher-numeric-safety.test.ts +176 -0
  52. package/src/clients/typescript/src/__tests__/voucher-types.test-d.ts +8 -0
  53. package/src/clients/typescript/src/generated/accounts/channel.ts +192 -0
  54. package/src/clients/typescript/src/generated/accounts/index.ts +9 -0
  55. package/src/clients/typescript/src/generated/errors/index.ts +9 -0
  56. package/src/clients/typescript/src/generated/errors/paymentChannels.ts +251 -0
  57. package/src/clients/typescript/src/generated/index.ts +14 -0
  58. package/src/clients/typescript/src/generated/instructions/distribute.ts +517 -0
  59. package/src/clients/typescript/src/generated/instructions/emitEvent.ts +194 -0
  60. package/src/clients/typescript/src/generated/instructions/index.ts +18 -0
  61. package/src/clients/typescript/src/generated/instructions/open.ts +577 -0
  62. package/src/clients/typescript/src/generated/instructions/reclaim.ts +165 -0
  63. package/src/clients/typescript/src/generated/instructions/requestClose.ts +173 -0
  64. package/src/clients/typescript/src/generated/instructions/seal.ts +151 -0
  65. package/src/clients/typescript/src/generated/instructions/settle.ts +180 -0
  66. package/src/clients/typescript/src/generated/instructions/settleAndSeal.ts +224 -0
  67. package/src/clients/typescript/src/generated/instructions/topUp.ts +267 -0
  68. package/src/clients/typescript/src/generated/instructions/withdrawPayer.ts +246 -0
  69. package/src/clients/typescript/src/generated/pdas/eventAuthority.ts +26 -0
  70. package/src/clients/typescript/src/generated/pdas/index.ts +9 -0
  71. package/src/clients/typescript/src/generated/programs/index.ts +9 -0
  72. package/src/clients/typescript/src/generated/programs/paymentChannels.ts +366 -0
  73. package/src/clients/typescript/src/generated/types/accountDiscriminator.ts +41 -0
  74. package/src/clients/typescript/src/generated/types/channelStatus.ts +40 -0
  75. package/src/clients/typescript/src/generated/types/distributeArgs.ts +47 -0
  76. package/src/clients/typescript/src/generated/types/distributionEntry.ts +48 -0
  77. package/src/clients/typescript/src/generated/types/index.ts +21 -0
  78. package/src/clients/typescript/src/generated/types/openArgs.ts +70 -0
  79. package/src/clients/typescript/src/generated/types/opened.ts +42 -0
  80. package/src/clients/typescript/src/generated/types/payoutBeneficiary.ts +42 -0
  81. package/src/clients/typescript/src/generated/types/payoutRedirected.ts +76 -0
  82. package/src/clients/typescript/src/generated/types/redirectReason.ts +40 -0
  83. package/src/clients/typescript/src/generated/types/settleAndSealArgs.ts +39 -0
  84. package/src/clients/typescript/src/generated/types/settlementWatermarks.ts +48 -0
  85. package/src/clients/typescript/src/generated/types/topUpArgs.ts +33 -0
  86. package/src/clients/typescript/src/generated/types/voucherArgs.ts +68 -0
  87. package/src/clients/typescript/src/index.ts +1 -0
  88. package/src/clients/typescript/src/safe-codecs.ts +82 -0
  89. package/src/clients/typescript/tsconfig.json +11 -0
  90. package/src/clients/typescript/tsup.config.ts +9 -0
  91. package/src/index.ts +4 -0
  92. package/src/sdk/channel.ts +128 -0
  93. package/src/sdk/client.ts +22 -0
  94. package/src/sdk/utils.ts +29 -0
  95. package/src/sdk/voucher.ts +50 -0
  96. package/tsconfig.json +15 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type EncodedAccount, type FetchAccountConfig, type FetchAccountsConfig, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type MaybeAccount, type MaybeEncodedAccount } from "@solana/kit";
9
+ import { type SettlementWatermarks, type SettlementWatermarksArgs } from "../types";
10
+ export type Channel = {
11
+ discriminator: number;
12
+ version: number;
13
+ bump: number;
14
+ status: number;
15
+ salt: bigint;
16
+ deposit: bigint;
17
+ settlement: SettlementWatermarks;
18
+ closureStartedAt: bigint;
19
+ payerWithdrawnAt: bigint;
20
+ gracePeriod: number;
21
+ distributionHash: Array<number>;
22
+ payer: Address;
23
+ payee: Address;
24
+ authorizedSigner: Address;
25
+ mint: Address;
26
+ rentPayer: Address;
27
+ openSlot: bigint;
28
+ };
29
+ export type ChannelArgs = {
30
+ discriminator: number;
31
+ version: number;
32
+ bump: number;
33
+ status: number;
34
+ salt: bigint;
35
+ deposit: bigint;
36
+ settlement: SettlementWatermarksArgs;
37
+ closureStartedAt: bigint;
38
+ payerWithdrawnAt: bigint;
39
+ gracePeriod: number;
40
+ distributionHash: Array<number>;
41
+ payer: Address;
42
+ payee: Address;
43
+ authorizedSigner: Address;
44
+ mint: Address;
45
+ rentPayer: Address;
46
+ openSlot: bigint;
47
+ };
48
+ /** Gets the encoder for {@link ChannelArgs} account data. */
49
+ export declare function getChannelEncoder(): FixedSizeEncoder<ChannelArgs>;
50
+ /** Gets the decoder for {@link Channel} account data. */
51
+ export declare function getChannelDecoder(): FixedSizeDecoder<Channel>;
52
+ /** Gets the codec for {@link Channel} account data. */
53
+ export declare function getChannelCodec(): FixedSizeCodec<ChannelArgs, Channel>;
54
+ export declare function decodeChannel<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Channel, TAddress>;
55
+ export declare function decodeChannel<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Channel, TAddress>;
56
+ export declare function fetchChannel<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Channel, TAddress>>;
57
+ export declare function fetchMaybeChannel<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Channel, TAddress>>;
58
+ export declare function fetchAllChannel(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Channel>[]>;
59
+ export declare function fetchAllMaybeChannel(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Channel>[]>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from "./channel";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from "./paymentChannels";
@@ -0,0 +1,84 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from "@solana/kit";
9
+ export declare const PAYMENT_CHANNELS_ERROR__NOT_IMPLEMENTED = 0;
10
+ export declare const PAYMENT_CHANNELS_ERROR__MISSING_REQUIRED_SIGNATURE = 1;
11
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_STATUS = 2;
12
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR = 3;
13
+ export declare const PAYMENT_CHANNELS_ERROR__UNSUPPORTED_CHANNEL_VERSION = 4;
14
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_PAYER = 5;
15
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_PAYEE = 6;
16
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_MINT = 7;
17
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_EVENT_AUTHORITY = 8;
18
+ export declare const PAYMENT_CHANNELS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS = 9;
19
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_RENT_PAYER = 10;
20
+ export declare const PAYMENT_CHANNELS_ERROR__CHANNEL_ACCOUNT_MISMATCH = 50;
21
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_TOKEN_ACCOUNT = 51;
22
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_TOKEN_EXTENSIONS = 52;
23
+ export declare const PAYMENT_CHANNELS_ERROR__MINT_ACCOUNT_MISMATCH = 53;
24
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_MINT_TOKEN_PROGRAM = 54;
25
+ export declare const PAYMENT_CHANNELS_ERROR__MALFORMED_MINT_TOKEN_ACCOUNT_DATA = 55;
26
+ export declare const PAYMENT_CHANNELS_ERROR__MALFORMED_MINT_TOKEN_EXTENSIONS = 56;
27
+ export declare const PAYMENT_CHANNELS_ERROR__PAYER_ACCOUNT_MISMATCH = 57;
28
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_PAYER_TOKEN_ACCOUNT = 58;
29
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_PAYER_TOKEN_EXTENSIONS = 59;
30
+ export declare const PAYMENT_CHANNELS_ERROR__PAYEE_ACCOUNT_MISMATCH = 60;
31
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_PAYEE_TOKEN_ACCOUNT = 61;
32
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_PAYEE_TOKEN_EXTENSIONS = 62;
33
+ export declare const PAYMENT_CHANNELS_ERROR__DEPOSIT_MUST_BE_NON_ZERO = 200;
34
+ export declare const PAYMENT_CHANNELS_ERROR__GRACE_PERIOD_MUST_BE_NON_ZERO = 201;
35
+ export declare const PAYMENT_CHANNELS_ERROR__MISSING_ED25519_VERIFICATION = 230;
36
+ export declare const PAYMENT_CHANNELS_ERROR__MALFORMED_ED25519_INSTRUCTION = 231;
37
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_CHANNEL_MISMATCH = 232;
38
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_EXPIRED = 233;
39
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_WATERMARK_NOT_MONOTONIC = 234;
40
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_OVER_DEPOSIT = 235;
41
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_MESSAGE_MISMATCH = 236;
42
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_SIGNER_MISMATCH = 237;
43
+ export declare const PAYMENT_CHANNELS_ERROR__VOUCHER_BAD_MAGIC = 238;
44
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_RECIPIENT_COUNT = 260;
45
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_SPLIT_CONFIG = 261;
46
+ export declare const PAYMENT_CHANNELS_ERROR__DISTRIBUTION_PARTS_OVERFLOW = 262;
47
+ export declare const PAYMENT_CHANNELS_ERROR__DUPLICATE_RECIPIENT = 263;
48
+ export declare const PAYMENT_CHANNELS_ERROR__DISTRIBUTION_AMOUNT_OVERFLOW = 264;
49
+ export declare const PAYMENT_CHANNELS_ERROR__DISTRIBUTION_PREIMAGE_LENGTH_OVERFLOW = 265;
50
+ export declare const PAYMENT_CHANNELS_ERROR__CHANNEL_ADDRESS_MISMATCH = 2000;
51
+ export declare const PAYMENT_CHANNELS_ERROR__PAYER_PAYEE_MUST_DIFFER = 2001;
52
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_AUTHORIZED_SIGNER = 2002;
53
+ export declare const PAYMENT_CHANNELS_ERROR__OPEN_SLOT_OUT_OF_WINDOW = 2003;
54
+ export declare const PAYMENT_CHANNELS_ERROR__TOP_UP_DEPOSIT_OVERFLOW = 2100;
55
+ export declare const PAYMENT_CHANNELS_ERROR__SEAL_DEADLINE_OVERFLOW = 2200;
56
+ export declare const PAYMENT_CHANNELS_ERROR__SEAL_GRACE_PERIOD_NOT_ELAPSED = 2201;
57
+ export declare const PAYMENT_CHANNELS_ERROR__PAYER_ALREADY_WITHDRAWN = 2300;
58
+ export declare const PAYMENT_CHANNELS_ERROR__REFUND_CALCULATION_OVERFLOW = 2301;
59
+ export declare const PAYMENT_CHANNELS_ERROR__CHANNEL_NOT_DISTRIBUTABLE = 2400;
60
+ export declare const PAYMENT_CHANNELS_ERROR__TREASURY_ACCOUNT_MISMATCH = 2401;
61
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_TREASURY_TOKEN_ACCOUNT = 2402;
62
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_TREASURY_TOKEN_EXTENSIONS = 2403;
63
+ export declare const PAYMENT_CHANNELS_ERROR__RECIPIENT_ACCOUNT_MISMATCH = 2404;
64
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_RECIPIENT_TOKEN_ACCOUNT = 2405;
65
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_RECIPIENT_TOKEN_EXTENSIONS = 2406;
66
+ export declare const PAYMENT_CHANNELS_ERROR__INVALID_DISTRIBUTION_HASH = 2407;
67
+ export declare const PAYMENT_CHANNELS_ERROR__NOTHING_TO_DISTRIBUTE = 2408;
68
+ export declare const PAYMENT_CHANNELS_ERROR__RECIPIENT_ACCOUNT_COUNT_MISMATCH = 2409;
69
+ export declare const PAYMENT_CHANNELS_ERROR__DISTRIBUTE_POOL_OVERFLOW = 2410;
70
+ export declare const PAYMENT_CHANNELS_ERROR__DISTRIBUTE_BALANCE_CALCULATION_OVERFLOW = 2411;
71
+ export declare const PAYMENT_CHANNELS_ERROR__RENT_PAYER_BALANCE_OVERFLOW = 2412;
72
+ export declare const PAYMENT_CHANNELS_ERROR__DISTRIBUTE_TRANSFER_QUEUE_OVERFLOW = 2413;
73
+ export declare const PAYMENT_CHANNELS_ERROR__CHANNEL_CLOSE_TOO_EARLY = 2414;
74
+ export type PaymentChannelsError = typeof PAYMENT_CHANNELS_ERROR__CHANNEL_ACCOUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__CHANNEL_ADDRESS_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__CHANNEL_CLOSE_TOO_EARLY | typeof PAYMENT_CHANNELS_ERROR__CHANNEL_NOT_DISTRIBUTABLE | typeof PAYMENT_CHANNELS_ERROR__DEPOSIT_MUST_BE_NON_ZERO | typeof PAYMENT_CHANNELS_ERROR__DISTRIBUTE_BALANCE_CALCULATION_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__DISTRIBUTE_POOL_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__DISTRIBUTE_TRANSFER_QUEUE_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__DISTRIBUTION_AMOUNT_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__DISTRIBUTION_PARTS_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__DISTRIBUTION_PREIMAGE_LENGTH_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__DUPLICATE_RECIPIENT | typeof PAYMENT_CHANNELS_ERROR__GRACE_PERIOD_MUST_BE_NON_ZERO | typeof PAYMENT_CHANNELS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR | typeof PAYMENT_CHANNELS_ERROR__INVALID_AUTHORIZED_SIGNER | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_MINT | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_PAYEE | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_PAYER | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_RENT_PAYER | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_STATUS | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_TOKEN_ACCOUNT | typeof PAYMENT_CHANNELS_ERROR__INVALID_CHANNEL_TOKEN_EXTENSIONS | typeof PAYMENT_CHANNELS_ERROR__INVALID_DISTRIBUTION_HASH | typeof PAYMENT_CHANNELS_ERROR__INVALID_EVENT_AUTHORITY | typeof PAYMENT_CHANNELS_ERROR__INVALID_MINT_TOKEN_PROGRAM | typeof PAYMENT_CHANNELS_ERROR__INVALID_PAYEE_TOKEN_ACCOUNT | typeof PAYMENT_CHANNELS_ERROR__INVALID_PAYEE_TOKEN_EXTENSIONS | typeof PAYMENT_CHANNELS_ERROR__INVALID_PAYER_TOKEN_ACCOUNT | typeof PAYMENT_CHANNELS_ERROR__INVALID_PAYER_TOKEN_EXTENSIONS | typeof PAYMENT_CHANNELS_ERROR__INVALID_RECIPIENT_COUNT | typeof PAYMENT_CHANNELS_ERROR__INVALID_RECIPIENT_TOKEN_ACCOUNT | typeof PAYMENT_CHANNELS_ERROR__INVALID_RECIPIENT_TOKEN_EXTENSIONS | typeof PAYMENT_CHANNELS_ERROR__INVALID_SPLIT_CONFIG | typeof PAYMENT_CHANNELS_ERROR__INVALID_TREASURY_TOKEN_ACCOUNT | typeof PAYMENT_CHANNELS_ERROR__INVALID_TREASURY_TOKEN_EXTENSIONS | typeof PAYMENT_CHANNELS_ERROR__MALFORMED_ED25519_INSTRUCTION | typeof PAYMENT_CHANNELS_ERROR__MALFORMED_MINT_TOKEN_ACCOUNT_DATA | typeof PAYMENT_CHANNELS_ERROR__MALFORMED_MINT_TOKEN_EXTENSIONS | typeof PAYMENT_CHANNELS_ERROR__MINT_ACCOUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__MISSING_ED25519_VERIFICATION | typeof PAYMENT_CHANNELS_ERROR__MISSING_REQUIRED_SIGNATURE | typeof PAYMENT_CHANNELS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS | typeof PAYMENT_CHANNELS_ERROR__NOTHING_TO_DISTRIBUTE | typeof PAYMENT_CHANNELS_ERROR__NOT_IMPLEMENTED | typeof PAYMENT_CHANNELS_ERROR__OPEN_SLOT_OUT_OF_WINDOW | typeof PAYMENT_CHANNELS_ERROR__PAYEE_ACCOUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__PAYER_ACCOUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__PAYER_ALREADY_WITHDRAWN | typeof PAYMENT_CHANNELS_ERROR__PAYER_PAYEE_MUST_DIFFER | typeof PAYMENT_CHANNELS_ERROR__RECIPIENT_ACCOUNT_COUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__RECIPIENT_ACCOUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__REFUND_CALCULATION_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__RENT_PAYER_BALANCE_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__SEAL_DEADLINE_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__SEAL_GRACE_PERIOD_NOT_ELAPSED | typeof PAYMENT_CHANNELS_ERROR__TOP_UP_DEPOSIT_OVERFLOW | typeof PAYMENT_CHANNELS_ERROR__TREASURY_ACCOUNT_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__UNSUPPORTED_CHANNEL_VERSION | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_BAD_MAGIC | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_CHANNEL_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_EXPIRED | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_MESSAGE_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_OVER_DEPOSIT | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_SIGNER_MISMATCH | typeof PAYMENT_CHANNELS_ERROR__VOUCHER_WATERMARK_NOT_MONOTONIC;
75
+ export declare function getPaymentChannelsErrorMessage(code: PaymentChannelsError): string;
76
+ export declare function isPaymentChannelsError<TProgramErrorCode extends PaymentChannelsError>(error: unknown, transactionMessage: {
77
+ instructions: Record<number, {
78
+ programAddress: Address;
79
+ }>;
80
+ }, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
81
+ context: Readonly<{
82
+ code: TProgramErrorCode;
83
+ }>;
84
+ }>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from "./accounts";
9
+ export * from "./errors";
10
+ export * from "./instructions";
11
+ export * from "./pdas";
12
+ export * from "./programs";
13
+ export * from "./types";
@@ -0,0 +1,90 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ import { type DistributeArgs, type DistributeArgsArgs } from "../types";
11
+ export declare const DISTRIBUTE_DISCRIMINATOR = 7;
12
+ export declare function getDistributeDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type DistributeInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountChannel extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountRentPayer extends string | AccountMeta<string> = string, TAccountChannelTokenAccount extends string | AccountMeta<string> = string, TAccountPayerTokenAccount extends string | AccountMeta<string> = string, TAccountPayeeTokenAccount extends string | AccountMeta<string> = string, TAccountTreasuryTokenAccount extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = string, TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountSelfProgram extends string | AccountMeta<string> = "CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
15
+ TAccountPayer extends string ? WritableAccount<TAccountPayer> : TAccountPayer,
16
+ TAccountRentPayer extends string ? WritableAccount<TAccountRentPayer> : TAccountRentPayer,
17
+ TAccountChannelTokenAccount extends string ? WritableAccount<TAccountChannelTokenAccount> : TAccountChannelTokenAccount,
18
+ TAccountPayerTokenAccount extends string ? WritableAccount<TAccountPayerTokenAccount> : TAccountPayerTokenAccount,
19
+ TAccountPayeeTokenAccount extends string ? WritableAccount<TAccountPayeeTokenAccount> : TAccountPayeeTokenAccount,
20
+ TAccountTreasuryTokenAccount extends string ? WritableAccount<TAccountTreasuryTokenAccount> : TAccountTreasuryTokenAccount,
21
+ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
22
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
23
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
24
+ TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,
25
+ ...TRemainingAccounts
26
+ ]>;
27
+ export type DistributeInstructionData = {
28
+ discriminator: number;
29
+ distributeArgs: DistributeArgs;
30
+ };
31
+ export type DistributeInstructionDataArgs = {
32
+ distributeArgs: DistributeArgsArgs;
33
+ };
34
+ export declare function getDistributeInstructionDataEncoder(): Encoder<DistributeInstructionDataArgs>;
35
+ export declare function getDistributeInstructionDataDecoder(): Decoder<DistributeInstructionData>;
36
+ export declare function getDistributeInstructionDataCodec(): Codec<DistributeInstructionDataArgs, DistributeInstructionData>;
37
+ export type DistributeAsyncInput<TAccountChannel extends string = string, TAccountPayer extends string = string, TAccountRentPayer extends string = string, TAccountChannelTokenAccount extends string = string, TAccountPayerTokenAccount extends string = string, TAccountPayeeTokenAccount extends string = string, TAccountTreasuryTokenAccount extends string = string, TAccountMint extends string = string, TAccountTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountSelfProgram extends string = string> = {
38
+ channel: Address<TAccountChannel>;
39
+ payer: Address<TAccountPayer>;
40
+ rentPayer: Address<TAccountRentPayer>;
41
+ channelTokenAccount: Address<TAccountChannelTokenAccount>;
42
+ payerTokenAccount: Address<TAccountPayerTokenAccount>;
43
+ payeeTokenAccount: Address<TAccountPayeeTokenAccount>;
44
+ treasuryTokenAccount: Address<TAccountTreasuryTokenAccount>;
45
+ mint: Address<TAccountMint>;
46
+ tokenProgram: Address<TAccountTokenProgram>;
47
+ eventAuthority?: Address<TAccountEventAuthority>;
48
+ selfProgram?: Address<TAccountSelfProgram>;
49
+ distributeArgs: DistributeInstructionDataArgs["distributeArgs"];
50
+ recipientTokenAccounts: Array<Address>;
51
+ };
52
+ export declare function getDistributeInstructionAsync<TAccountChannel extends string, TAccountPayer extends string, TAccountRentPayer extends string, TAccountChannelTokenAccount extends string, TAccountPayerTokenAccount extends string, TAccountPayeeTokenAccount extends string, TAccountTreasuryTokenAccount extends string, TAccountMint extends string, TAccountTokenProgram extends string, TAccountEventAuthority extends string, TAccountSelfProgram extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: DistributeAsyncInput<TAccountChannel, TAccountPayer, TAccountRentPayer, TAccountChannelTokenAccount, TAccountPayerTokenAccount, TAccountPayeeTokenAccount, TAccountTreasuryTokenAccount, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountSelfProgram>, config?: {
53
+ programAddress?: TProgramAddress;
54
+ }): Promise<DistributeInstruction<TProgramAddress, TAccountChannel, TAccountPayer, TAccountRentPayer, TAccountChannelTokenAccount, TAccountPayerTokenAccount, TAccountPayeeTokenAccount, TAccountTreasuryTokenAccount, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountSelfProgram>>;
55
+ export type DistributeInput<TAccountChannel extends string = string, TAccountPayer extends string = string, TAccountRentPayer extends string = string, TAccountChannelTokenAccount extends string = string, TAccountPayerTokenAccount extends string = string, TAccountPayeeTokenAccount extends string = string, TAccountTreasuryTokenAccount extends string = string, TAccountMint extends string = string, TAccountTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountSelfProgram extends string = string> = {
56
+ channel: Address<TAccountChannel>;
57
+ payer: Address<TAccountPayer>;
58
+ rentPayer: Address<TAccountRentPayer>;
59
+ channelTokenAccount: Address<TAccountChannelTokenAccount>;
60
+ payerTokenAccount: Address<TAccountPayerTokenAccount>;
61
+ payeeTokenAccount: Address<TAccountPayeeTokenAccount>;
62
+ treasuryTokenAccount: Address<TAccountTreasuryTokenAccount>;
63
+ mint: Address<TAccountMint>;
64
+ tokenProgram: Address<TAccountTokenProgram>;
65
+ eventAuthority: Address<TAccountEventAuthority>;
66
+ selfProgram?: Address<TAccountSelfProgram>;
67
+ distributeArgs: DistributeInstructionDataArgs["distributeArgs"];
68
+ recipientTokenAccounts: Array<Address>;
69
+ };
70
+ export declare function getDistributeInstruction<TAccountChannel extends string, TAccountPayer extends string, TAccountRentPayer extends string, TAccountChannelTokenAccount extends string, TAccountPayerTokenAccount extends string, TAccountPayeeTokenAccount extends string, TAccountTreasuryTokenAccount extends string, TAccountMint extends string, TAccountTokenProgram extends string, TAccountEventAuthority extends string, TAccountSelfProgram extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: DistributeInput<TAccountChannel, TAccountPayer, TAccountRentPayer, TAccountChannelTokenAccount, TAccountPayerTokenAccount, TAccountPayeeTokenAccount, TAccountTreasuryTokenAccount, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountSelfProgram>, config?: {
71
+ programAddress?: TProgramAddress;
72
+ }): DistributeInstruction<TProgramAddress, TAccountChannel, TAccountPayer, TAccountRentPayer, TAccountChannelTokenAccount, TAccountPayerTokenAccount, TAccountPayeeTokenAccount, TAccountTreasuryTokenAccount, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountSelfProgram>;
73
+ export type ParsedDistributeInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
74
+ programAddress: Address<TProgram>;
75
+ accounts: {
76
+ channel: TAccountMetas[0];
77
+ payer: TAccountMetas[1];
78
+ rentPayer: TAccountMetas[2];
79
+ channelTokenAccount: TAccountMetas[3];
80
+ payerTokenAccount: TAccountMetas[4];
81
+ payeeTokenAccount: TAccountMetas[5];
82
+ treasuryTokenAccount: TAccountMetas[6];
83
+ mint: TAccountMetas[7];
84
+ tokenProgram: TAccountMetas[8];
85
+ eventAuthority: TAccountMetas[9];
86
+ selfProgram: TAccountMetas[10];
87
+ };
88
+ data: DistributeInstructionData;
89
+ };
90
+ export declare function parseDistributeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedDistributeInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ export declare const EMIT_EVENT_DISCRIMINATOR = 228;
11
+ export declare function getEmitEventDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type EmitEventInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountEventAuthority extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
+ TAccountEventAuthority extends string ? ReadonlySignerAccount<TAccountEventAuthority> & AccountSignerMeta<TAccountEventAuthority> : TAccountEventAuthority,
14
+ ...TRemainingAccounts
15
+ ]>;
16
+ export type EmitEventInstructionData = {
17
+ discriminator: number;
18
+ };
19
+ export type EmitEventInstructionDataArgs = {};
20
+ export declare function getEmitEventInstructionDataEncoder(): FixedSizeEncoder<EmitEventInstructionDataArgs>;
21
+ export declare function getEmitEventInstructionDataDecoder(): FixedSizeDecoder<EmitEventInstructionData>;
22
+ export declare function getEmitEventInstructionDataCodec(): FixedSizeCodec<EmitEventInstructionDataArgs, EmitEventInstructionData>;
23
+ export type EmitEventAsyncInput<TAccountEventAuthority extends string = string> = {
24
+ eventAuthority?: TransactionSigner<TAccountEventAuthority>;
25
+ };
26
+ export declare function getEmitEventInstructionAsync<TAccountEventAuthority extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: EmitEventAsyncInput<TAccountEventAuthority>, config?: {
27
+ programAddress?: TProgramAddress;
28
+ }): Promise<EmitEventInstruction<TProgramAddress, TAccountEventAuthority>>;
29
+ export type EmitEventInput<TAccountEventAuthority extends string = string> = {
30
+ eventAuthority: TransactionSigner<TAccountEventAuthority>;
31
+ };
32
+ export declare function getEmitEventInstruction<TAccountEventAuthority extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: EmitEventInput<TAccountEventAuthority>, config?: {
33
+ programAddress?: TProgramAddress;
34
+ }): EmitEventInstruction<TProgramAddress, TAccountEventAuthority>;
35
+ export type ParsedEmitEventInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
36
+ programAddress: Address<TProgram>;
37
+ accounts: {
38
+ eventAuthority: TAccountMetas[0];
39
+ };
40
+ data: EmitEventInstructionData;
41
+ };
42
+ export declare function parseEmitEventInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedEmitEventInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from "./distribute";
9
+ export * from "./emitEvent";
10
+ export * from "./open";
11
+ export * from "./reclaim";
12
+ export * from "./requestClose";
13
+ export * from "./seal";
14
+ export * from "./settle";
15
+ export * from "./settleAndSeal";
16
+ export * from "./topUp";
17
+ export * from "./withdrawPayer";
@@ -0,0 +1,100 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ import { type OpenArgs, type OpenArgsArgs } from "../types";
11
+ export declare const OPEN_DISCRIMINATOR = 1;
12
+ export declare function getOpenDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type OpenInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountRentPayer extends string | AccountMeta<string> = string, TAccountPayee extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAuthorizedSigner extends string | AccountMeta<string> = string, TAccountChannel extends string | AccountMeta<string> = string, TAccountPayerTokenAccount extends string | AccountMeta<string> = string, TAccountChannelTokenAccount extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountRent extends string | AccountMeta<string> = string, TAccountAssociatedTokenProgram extends string | AccountMeta<string> = string, TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountSelfProgram extends string | AccountMeta<string> = "CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
15
+ TAccountRentPayer extends string ? WritableSignerAccount<TAccountRentPayer> & AccountSignerMeta<TAccountRentPayer> : TAccountRentPayer,
16
+ TAccountPayee extends string ? ReadonlyAccount<TAccountPayee> : TAccountPayee,
17
+ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
18
+ TAccountAuthorizedSigner extends string ? ReadonlyAccount<TAccountAuthorizedSigner> : TAccountAuthorizedSigner,
19
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
20
+ TAccountPayerTokenAccount extends string ? WritableAccount<TAccountPayerTokenAccount> : TAccountPayerTokenAccount,
21
+ TAccountChannelTokenAccount extends string ? WritableAccount<TAccountChannelTokenAccount> : TAccountChannelTokenAccount,
22
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
23
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
24
+ TAccountRent extends string ? ReadonlyAccount<TAccountRent> : TAccountRent,
25
+ TAccountAssociatedTokenProgram extends string ? ReadonlyAccount<TAccountAssociatedTokenProgram> : TAccountAssociatedTokenProgram,
26
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
27
+ TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,
28
+ ...TRemainingAccounts
29
+ ]>;
30
+ export type OpenInstructionData = {
31
+ discriminator: number;
32
+ openArgs: OpenArgs;
33
+ };
34
+ export type OpenInstructionDataArgs = {
35
+ openArgs: OpenArgsArgs;
36
+ };
37
+ export declare function getOpenInstructionDataEncoder(): Encoder<OpenInstructionDataArgs>;
38
+ export declare function getOpenInstructionDataDecoder(): Decoder<OpenInstructionData>;
39
+ export declare function getOpenInstructionDataCodec(): Codec<OpenInstructionDataArgs, OpenInstructionData>;
40
+ export type OpenAsyncInput<TAccountPayer extends string = string, TAccountRentPayer extends string = string, TAccountPayee extends string = string, TAccountMint extends string = string, TAccountAuthorizedSigner extends string = string, TAccountChannel extends string = string, TAccountPayerTokenAccount extends string = string, TAccountChannelTokenAccount extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountAssociatedTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountSelfProgram extends string = string> = {
41
+ payer: TransactionSigner<TAccountPayer>;
42
+ rentPayer: TransactionSigner<TAccountRentPayer>;
43
+ payee: Address<TAccountPayee>;
44
+ mint: Address<TAccountMint>;
45
+ authorizedSigner: Address<TAccountAuthorizedSigner>;
46
+ channel: Address<TAccountChannel>;
47
+ payerTokenAccount: Address<TAccountPayerTokenAccount>;
48
+ channelTokenAccount: Address<TAccountChannelTokenAccount>;
49
+ tokenProgram: Address<TAccountTokenProgram>;
50
+ systemProgram?: Address<TAccountSystemProgram>;
51
+ rent: Address<TAccountRent>;
52
+ associatedTokenProgram: Address<TAccountAssociatedTokenProgram>;
53
+ eventAuthority?: Address<TAccountEventAuthority>;
54
+ selfProgram?: Address<TAccountSelfProgram>;
55
+ openArgs: OpenInstructionDataArgs["openArgs"];
56
+ };
57
+ export declare function getOpenInstructionAsync<TAccountPayer extends string, TAccountRentPayer extends string, TAccountPayee extends string, TAccountMint extends string, TAccountAuthorizedSigner extends string, TAccountChannel extends string, TAccountPayerTokenAccount extends string, TAccountChannelTokenAccount extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TAccountRent extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountSelfProgram extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: OpenAsyncInput<TAccountPayer, TAccountRentPayer, TAccountPayee, TAccountMint, TAccountAuthorizedSigner, TAccountChannel, TAccountPayerTokenAccount, TAccountChannelTokenAccount, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountSelfProgram>, config?: {
58
+ programAddress?: TProgramAddress;
59
+ }): Promise<OpenInstruction<TProgramAddress, TAccountPayer, TAccountRentPayer, TAccountPayee, TAccountMint, TAccountAuthorizedSigner, TAccountChannel, TAccountPayerTokenAccount, TAccountChannelTokenAccount, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountSelfProgram>>;
60
+ export type OpenInput<TAccountPayer extends string = string, TAccountRentPayer extends string = string, TAccountPayee extends string = string, TAccountMint extends string = string, TAccountAuthorizedSigner extends string = string, TAccountChannel extends string = string, TAccountPayerTokenAccount extends string = string, TAccountChannelTokenAccount extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountAssociatedTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountSelfProgram extends string = string> = {
61
+ payer: TransactionSigner<TAccountPayer>;
62
+ rentPayer: TransactionSigner<TAccountRentPayer>;
63
+ payee: Address<TAccountPayee>;
64
+ mint: Address<TAccountMint>;
65
+ authorizedSigner: Address<TAccountAuthorizedSigner>;
66
+ channel: Address<TAccountChannel>;
67
+ payerTokenAccount: Address<TAccountPayerTokenAccount>;
68
+ channelTokenAccount: Address<TAccountChannelTokenAccount>;
69
+ tokenProgram: Address<TAccountTokenProgram>;
70
+ systemProgram?: Address<TAccountSystemProgram>;
71
+ rent: Address<TAccountRent>;
72
+ associatedTokenProgram: Address<TAccountAssociatedTokenProgram>;
73
+ eventAuthority: Address<TAccountEventAuthority>;
74
+ selfProgram?: Address<TAccountSelfProgram>;
75
+ openArgs: OpenInstructionDataArgs["openArgs"];
76
+ };
77
+ export declare function getOpenInstruction<TAccountPayer extends string, TAccountRentPayer extends string, TAccountPayee extends string, TAccountMint extends string, TAccountAuthorizedSigner extends string, TAccountChannel extends string, TAccountPayerTokenAccount extends string, TAccountChannelTokenAccount extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TAccountRent extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountSelfProgram extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: OpenInput<TAccountPayer, TAccountRentPayer, TAccountPayee, TAccountMint, TAccountAuthorizedSigner, TAccountChannel, TAccountPayerTokenAccount, TAccountChannelTokenAccount, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountSelfProgram>, config?: {
78
+ programAddress?: TProgramAddress;
79
+ }): OpenInstruction<TProgramAddress, TAccountPayer, TAccountRentPayer, TAccountPayee, TAccountMint, TAccountAuthorizedSigner, TAccountChannel, TAccountPayerTokenAccount, TAccountChannelTokenAccount, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountSelfProgram>;
80
+ export type ParsedOpenInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
81
+ programAddress: Address<TProgram>;
82
+ accounts: {
83
+ payer: TAccountMetas[0];
84
+ rentPayer: TAccountMetas[1];
85
+ payee: TAccountMetas[2];
86
+ mint: TAccountMetas[3];
87
+ authorizedSigner: TAccountMetas[4];
88
+ channel: TAccountMetas[5];
89
+ payerTokenAccount: TAccountMetas[6];
90
+ channelTokenAccount: TAccountMetas[7];
91
+ tokenProgram: TAccountMetas[8];
92
+ systemProgram: TAccountMetas[9];
93
+ rent: TAccountMetas[10];
94
+ associatedTokenProgram: TAccountMetas[11];
95
+ eventAuthority: TAccountMetas[12];
96
+ selfProgram: TAccountMetas[13];
97
+ };
98
+ data: OpenInstructionData;
99
+ };
100
+ export declare function parseOpenInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedOpenInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyUint8Array, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ export declare const RECLAIM_DISCRIMINATOR = 9;
11
+ export declare function getReclaimDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type ReclaimInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountChannel extends string | AccountMeta<string> = string, TAccountRentPayer extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
14
+ TAccountRentPayer extends string ? WritableAccount<TAccountRentPayer> : TAccountRentPayer,
15
+ ...TRemainingAccounts
16
+ ]>;
17
+ export type ReclaimInstructionData = {
18
+ discriminator: number;
19
+ };
20
+ export type ReclaimInstructionDataArgs = {};
21
+ export declare function getReclaimInstructionDataEncoder(): FixedSizeEncoder<ReclaimInstructionDataArgs>;
22
+ export declare function getReclaimInstructionDataDecoder(): FixedSizeDecoder<ReclaimInstructionData>;
23
+ export declare function getReclaimInstructionDataCodec(): FixedSizeCodec<ReclaimInstructionDataArgs, ReclaimInstructionData>;
24
+ export type ReclaimInput<TAccountChannel extends string = string, TAccountRentPayer extends string = string> = {
25
+ channel: Address<TAccountChannel>;
26
+ rentPayer: Address<TAccountRentPayer>;
27
+ };
28
+ export declare function getReclaimInstruction<TAccountChannel extends string, TAccountRentPayer extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: ReclaimInput<TAccountChannel, TAccountRentPayer>, config?: {
29
+ programAddress?: TProgramAddress;
30
+ }): ReclaimInstruction<TProgramAddress, TAccountChannel, TAccountRentPayer>;
31
+ export type ParsedReclaimInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
32
+ programAddress: Address<TProgram>;
33
+ accounts: {
34
+ channel: TAccountMetas[0];
35
+ rentPayer: TAccountMetas[1];
36
+ };
37
+ data: ReclaimInstructionData;
38
+ };
39
+ export declare function parseReclaimInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedReclaimInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ export declare const REQUEST_CLOSE_DISCRIMINATOR = 5;
11
+ export declare function getRequestCloseDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type RequestCloseInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountChannel extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
+ TAccountPayer extends string ? ReadonlySignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
14
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
15
+ ...TRemainingAccounts
16
+ ]>;
17
+ export type RequestCloseInstructionData = {
18
+ discriminator: number;
19
+ };
20
+ export type RequestCloseInstructionDataArgs = {};
21
+ export declare function getRequestCloseInstructionDataEncoder(): FixedSizeEncoder<RequestCloseInstructionDataArgs>;
22
+ export declare function getRequestCloseInstructionDataDecoder(): FixedSizeDecoder<RequestCloseInstructionData>;
23
+ export declare function getRequestCloseInstructionDataCodec(): FixedSizeCodec<RequestCloseInstructionDataArgs, RequestCloseInstructionData>;
24
+ export type RequestCloseInput<TAccountPayer extends string = string, TAccountChannel extends string = string> = {
25
+ payer: TransactionSigner<TAccountPayer>;
26
+ channel: Address<TAccountChannel>;
27
+ };
28
+ export declare function getRequestCloseInstruction<TAccountPayer extends string, TAccountChannel extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: RequestCloseInput<TAccountPayer, TAccountChannel>, config?: {
29
+ programAddress?: TProgramAddress;
30
+ }): RequestCloseInstruction<TProgramAddress, TAccountPayer, TAccountChannel>;
31
+ export type ParsedRequestCloseInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
32
+ programAddress: Address<TProgram>;
33
+ accounts: {
34
+ payer: TAccountMetas[0];
35
+ channel: TAccountMetas[1];
36
+ };
37
+ data: RequestCloseInstructionData;
38
+ };
39
+ export declare function parseRequestCloseInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedRequestCloseInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyUint8Array, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ export declare const SEAL_DISCRIMINATOR = 6;
11
+ export declare function getSealDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type SealInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountChannel extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
14
+ ...TRemainingAccounts
15
+ ]>;
16
+ export type SealInstructionData = {
17
+ discriminator: number;
18
+ };
19
+ export type SealInstructionDataArgs = {};
20
+ export declare function getSealInstructionDataEncoder(): FixedSizeEncoder<SealInstructionDataArgs>;
21
+ export declare function getSealInstructionDataDecoder(): FixedSizeDecoder<SealInstructionData>;
22
+ export declare function getSealInstructionDataCodec(): FixedSizeCodec<SealInstructionDataArgs, SealInstructionData>;
23
+ export type SealInput<TAccountChannel extends string = string> = {
24
+ channel: Address<TAccountChannel>;
25
+ };
26
+ export declare function getSealInstruction<TAccountChannel extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: SealInput<TAccountChannel>, config?: {
27
+ programAddress?: TProgramAddress;
28
+ }): SealInstruction<TProgramAddress, TAccountChannel>;
29
+ export type ParsedSealInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
30
+ programAddress: Address<TProgram>;
31
+ accounts: {
32
+ channel: TAccountMetas[0];
33
+ };
34
+ data: SealInstructionData;
35
+ };
36
+ export declare function parseSealInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSealInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type AccountMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ export declare const SETTLE_DISCRIMINATOR = 2;
11
+ export declare function getSettleDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type SettleInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountChannel extends string | AccountMeta<string> = string, TAccountInstructionsSysvar extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
14
+ TAccountInstructionsSysvar extends string ? ReadonlyAccount<TAccountInstructionsSysvar> : TAccountInstructionsSysvar,
15
+ ...TRemainingAccounts
16
+ ]>;
17
+ export type SettleInstructionData = {
18
+ discriminator: number;
19
+ };
20
+ export type SettleInstructionDataArgs = {};
21
+ export declare function getSettleInstructionDataEncoder(): FixedSizeEncoder<SettleInstructionDataArgs>;
22
+ export declare function getSettleInstructionDataDecoder(): FixedSizeDecoder<SettleInstructionData>;
23
+ export declare function getSettleInstructionDataCodec(): FixedSizeCodec<SettleInstructionDataArgs, SettleInstructionData>;
24
+ export type SettleInput<TAccountChannel extends string = string, TAccountInstructionsSysvar extends string = string> = {
25
+ channel: Address<TAccountChannel>;
26
+ instructionsSysvar: Address<TAccountInstructionsSysvar>;
27
+ };
28
+ export declare function getSettleInstruction<TAccountChannel extends string, TAccountInstructionsSysvar extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: SettleInput<TAccountChannel, TAccountInstructionsSysvar>, config?: {
29
+ programAddress?: TProgramAddress;
30
+ }): SettleInstruction<TProgramAddress, TAccountChannel, TAccountInstructionsSysvar>;
31
+ export type ParsedSettleInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
32
+ programAddress: Address<TProgram>;
33
+ accounts: {
34
+ channel: TAccountMetas[0];
35
+ instructionsSysvar: TAccountMetas[1];
36
+ };
37
+ data: SettleInstructionData;
38
+ };
39
+ export declare function parseSettleInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSettleInstruction<TProgram, TAccountMetas>;