@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,47 @@
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 ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ import { type SettleAndSealArgs, type SettleAndSealArgsArgs } from "../types";
11
+ export declare const SETTLE_AND_SEAL_DISCRIMINATOR = 4;
12
+ export declare function getSettleAndSealDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type SettleAndSealInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountPayee extends string | AccountMeta<string> = string, TAccountChannel extends string | AccountMeta<string> = string, TAccountInstructionsSysvar extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountPayee extends string ? ReadonlySignerAccount<TAccountPayee> & AccountSignerMeta<TAccountPayee> : TAccountPayee,
15
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
16
+ TAccountInstructionsSysvar extends string ? ReadonlyAccount<TAccountInstructionsSysvar> : TAccountInstructionsSysvar,
17
+ ...TRemainingAccounts
18
+ ]>;
19
+ export type SettleAndSealInstructionData = {
20
+ discriminator: number;
21
+ settleAndSealArgs: SettleAndSealArgs;
22
+ };
23
+ export type SettleAndSealInstructionDataArgs = {
24
+ settleAndSealArgs: SettleAndSealArgsArgs;
25
+ };
26
+ export declare function getSettleAndSealInstructionDataEncoder(): FixedSizeEncoder<SettleAndSealInstructionDataArgs>;
27
+ export declare function getSettleAndSealInstructionDataDecoder(): FixedSizeDecoder<SettleAndSealInstructionData>;
28
+ export declare function getSettleAndSealInstructionDataCodec(): FixedSizeCodec<SettleAndSealInstructionDataArgs, SettleAndSealInstructionData>;
29
+ export type SettleAndSealInput<TAccountPayee extends string = string, TAccountChannel extends string = string, TAccountInstructionsSysvar extends string = string> = {
30
+ payee: TransactionSigner<TAccountPayee>;
31
+ channel: Address<TAccountChannel>;
32
+ instructionsSysvar: Address<TAccountInstructionsSysvar>;
33
+ settleAndSealArgs: SettleAndSealInstructionDataArgs["settleAndSealArgs"];
34
+ };
35
+ export declare function getSettleAndSealInstruction<TAccountPayee extends string, TAccountChannel extends string, TAccountInstructionsSysvar extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: SettleAndSealInput<TAccountPayee, TAccountChannel, TAccountInstructionsSysvar>, config?: {
36
+ programAddress?: TProgramAddress;
37
+ }): SettleAndSealInstruction<TProgramAddress, TAccountPayee, TAccountChannel, TAccountInstructionsSysvar>;
38
+ export type ParsedSettleAndSealInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
39
+ programAddress: Address<TProgram>;
40
+ accounts: {
41
+ payee: TAccountMetas[0];
42
+ channel: TAccountMetas[1];
43
+ instructionsSysvar: TAccountMetas[2];
44
+ };
45
+ data: SettleAndSealInstructionData;
46
+ };
47
+ export declare function parseSettleAndSealInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSettleAndSealInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,56 @@
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 ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ import { type TopUpArgs, type TopUpArgsArgs } from "../types";
11
+ export declare const TOP_UP_DISCRIMINATOR = 3;
12
+ export declare function getTopUpDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type TopUpInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountChannel extends string | AccountMeta<string> = string, TAccountPayerTokenAccount extends string | AccountMeta<string> = string, TAccountChannelTokenAccount extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
15
+ TAccountChannel extends string ? WritableAccount<TAccountChannel> : TAccountChannel,
16
+ TAccountPayerTokenAccount extends string ? WritableAccount<TAccountPayerTokenAccount> : TAccountPayerTokenAccount,
17
+ TAccountChannelTokenAccount extends string ? WritableAccount<TAccountChannelTokenAccount> : TAccountChannelTokenAccount,
18
+ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
19
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
20
+ ...TRemainingAccounts
21
+ ]>;
22
+ export type TopUpInstructionData = {
23
+ discriminator: number;
24
+ topUpArgs: TopUpArgs;
25
+ };
26
+ export type TopUpInstructionDataArgs = {
27
+ topUpArgs: TopUpArgsArgs;
28
+ };
29
+ export declare function getTopUpInstructionDataEncoder(): FixedSizeEncoder<TopUpInstructionDataArgs>;
30
+ export declare function getTopUpInstructionDataDecoder(): FixedSizeDecoder<TopUpInstructionData>;
31
+ export declare function getTopUpInstructionDataCodec(): FixedSizeCodec<TopUpInstructionDataArgs, TopUpInstructionData>;
32
+ export type TopUpInput<TAccountPayer extends string = string, TAccountChannel extends string = string, TAccountPayerTokenAccount extends string = string, TAccountChannelTokenAccount extends string = string, TAccountMint extends string = string, TAccountTokenProgram extends string = string> = {
33
+ payer: TransactionSigner<TAccountPayer>;
34
+ channel: Address<TAccountChannel>;
35
+ payerTokenAccount: Address<TAccountPayerTokenAccount>;
36
+ channelTokenAccount: Address<TAccountChannelTokenAccount>;
37
+ mint: Address<TAccountMint>;
38
+ tokenProgram: Address<TAccountTokenProgram>;
39
+ topUpArgs: TopUpInstructionDataArgs["topUpArgs"];
40
+ };
41
+ export declare function getTopUpInstruction<TAccountPayer extends string, TAccountChannel extends string, TAccountPayerTokenAccount extends string, TAccountChannelTokenAccount extends string, TAccountMint extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: TopUpInput<TAccountPayer, TAccountChannel, TAccountPayerTokenAccount, TAccountChannelTokenAccount, TAccountMint, TAccountTokenProgram>, config?: {
42
+ programAddress?: TProgramAddress;
43
+ }): TopUpInstruction<TProgramAddress, TAccountPayer, TAccountChannel, TAccountPayerTokenAccount, TAccountChannelTokenAccount, TAccountMint, TAccountTokenProgram>;
44
+ export type ParsedTopUpInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
45
+ programAddress: Address<TProgram>;
46
+ accounts: {
47
+ payer: TAccountMetas[0];
48
+ channel: TAccountMetas[1];
49
+ payerTokenAccount: TAccountMetas[2];
50
+ channelTokenAccount: TAccountMetas[3];
51
+ mint: TAccountMetas[4];
52
+ tokenProgram: TAccountMetas[5];
53
+ };
54
+ data: TopUpInstructionData;
55
+ };
56
+ export declare function parseTopUpInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedTopUpInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,51 @@
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 ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
9
+ import { PAYMENT_CHANNELS_PROGRAM_ADDRESS } from "../programs";
10
+ export declare const WITHDRAW_PAYER_DISCRIMINATOR = 8;
11
+ export declare function getWithdrawPayerDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type WithdrawPayerInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountChannel extends string | AccountMeta<string> = string, TAccountChannelTokenAccount extends string | AccountMeta<string> = string, TAccountPayerTokenAccount extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountTokenProgram 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
+ TAccountChannelTokenAccount extends string ? WritableAccount<TAccountChannelTokenAccount> : TAccountChannelTokenAccount,
16
+ TAccountPayerTokenAccount extends string ? WritableAccount<TAccountPayerTokenAccount> : TAccountPayerTokenAccount,
17
+ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
18
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
19
+ ...TRemainingAccounts
20
+ ]>;
21
+ export type WithdrawPayerInstructionData = {
22
+ discriminator: number;
23
+ };
24
+ export type WithdrawPayerInstructionDataArgs = {};
25
+ export declare function getWithdrawPayerInstructionDataEncoder(): FixedSizeEncoder<WithdrawPayerInstructionDataArgs>;
26
+ export declare function getWithdrawPayerInstructionDataDecoder(): FixedSizeDecoder<WithdrawPayerInstructionData>;
27
+ export declare function getWithdrawPayerInstructionDataCodec(): FixedSizeCodec<WithdrawPayerInstructionDataArgs, WithdrawPayerInstructionData>;
28
+ export type WithdrawPayerInput<TAccountPayer extends string = string, TAccountChannel extends string = string, TAccountChannelTokenAccount extends string = string, TAccountPayerTokenAccount extends string = string, TAccountMint extends string = string, TAccountTokenProgram extends string = string> = {
29
+ payer: TransactionSigner<TAccountPayer>;
30
+ channel: Address<TAccountChannel>;
31
+ channelTokenAccount: Address<TAccountChannelTokenAccount>;
32
+ payerTokenAccount: Address<TAccountPayerTokenAccount>;
33
+ mint: Address<TAccountMint>;
34
+ tokenProgram: Address<TAccountTokenProgram>;
35
+ };
36
+ export declare function getWithdrawPayerInstruction<TAccountPayer extends string, TAccountChannel extends string, TAccountChannelTokenAccount extends string, TAccountPayerTokenAccount extends string, TAccountMint extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS>(input: WithdrawPayerInput<TAccountPayer, TAccountChannel, TAccountChannelTokenAccount, TAccountPayerTokenAccount, TAccountMint, TAccountTokenProgram>, config?: {
37
+ programAddress?: TProgramAddress;
38
+ }): WithdrawPayerInstruction<TProgramAddress, TAccountPayer, TAccountChannel, TAccountChannelTokenAccount, TAccountPayerTokenAccount, TAccountMint, TAccountTokenProgram>;
39
+ export type ParsedWithdrawPayerInstruction<TProgram extends string = typeof PAYMENT_CHANNELS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
40
+ programAddress: Address<TProgram>;
41
+ accounts: {
42
+ payer: TAccountMetas[0];
43
+ channel: TAccountMetas[1];
44
+ channelTokenAccount: TAccountMetas[2];
45
+ payerTokenAccount: TAccountMetas[3];
46
+ mint: TAccountMetas[4];
47
+ tokenProgram: TAccountMetas[5];
48
+ };
49
+ data: WithdrawPayerInstructionData;
50
+ };
51
+ export declare function parseWithdrawPayerInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedWithdrawPayerInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,11 @@
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 ProgramDerivedAddress } from "@solana/kit";
9
+ export declare function findEventAuthorityPda(config?: {
10
+ programAddress?: Address | undefined;
11
+ }): Promise<ProgramDerivedAddress>;
@@ -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 "./eventAuthority";
@@ -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,80 @@
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 ClientWithRpc, type ClientWithTransactionPlanning, type ClientWithTransactionSending, type GetAccountInfoApi, type GetMultipleAccountsApi, type Instruction, type InstructionWithData, type ReadonlyUint8Array } from "@solana/kit";
9
+ import { type SelfFetchFunctions, type SelfPlanAndSendFunctions } from "@solana/program-client-core";
10
+ import { getChannelCodec, type Channel, type ChannelArgs } from "../accounts";
11
+ import { getDistributeInstructionAsync, getEmitEventInstructionAsync, getOpenInstructionAsync, getReclaimInstruction, getRequestCloseInstruction, getSealInstruction, getSettleAndSealInstruction, getSettleInstruction, getTopUpInstruction, getWithdrawPayerInstruction, type DistributeAsyncInput, type EmitEventAsyncInput, type OpenAsyncInput, type ParsedDistributeInstruction, type ParsedEmitEventInstruction, type ParsedOpenInstruction, type ParsedReclaimInstruction, type ParsedRequestCloseInstruction, type ParsedSealInstruction, type ParsedSettleAndSealInstruction, type ParsedSettleInstruction, type ParsedTopUpInstruction, type ParsedWithdrawPayerInstruction, type ReclaimInput, type RequestCloseInput, type SealInput, type SettleAndSealInput, type SettleInput, type TopUpInput, type WithdrawPayerInput } from "../instructions";
12
+ import { findEventAuthorityPda } from "../pdas";
13
+ export declare const PAYMENT_CHANNELS_PROGRAM_ADDRESS: Address<"CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX">;
14
+ export declare enum PaymentChannelsAccount {
15
+ Channel = 0
16
+ }
17
+ export declare enum PaymentChannelsInstruction {
18
+ Open = 0,
19
+ Settle = 1,
20
+ TopUp = 2,
21
+ SettleAndSeal = 3,
22
+ RequestClose = 4,
23
+ Seal = 5,
24
+ Distribute = 6,
25
+ WithdrawPayer = 7,
26
+ Reclaim = 8,
27
+ EmitEvent = 9
28
+ }
29
+ export declare function identifyPaymentChannelsInstruction(instruction: {
30
+ data: ReadonlyUint8Array;
31
+ } | ReadonlyUint8Array): PaymentChannelsInstruction;
32
+ export type ParsedPaymentChannelsInstruction<TProgram extends string = "CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX"> = ({
33
+ instructionType: PaymentChannelsInstruction.Open;
34
+ } & ParsedOpenInstruction<TProgram>) | ({
35
+ instructionType: PaymentChannelsInstruction.Settle;
36
+ } & ParsedSettleInstruction<TProgram>) | ({
37
+ instructionType: PaymentChannelsInstruction.TopUp;
38
+ } & ParsedTopUpInstruction<TProgram>) | ({
39
+ instructionType: PaymentChannelsInstruction.SettleAndSeal;
40
+ } & ParsedSettleAndSealInstruction<TProgram>) | ({
41
+ instructionType: PaymentChannelsInstruction.RequestClose;
42
+ } & ParsedRequestCloseInstruction<TProgram>) | ({
43
+ instructionType: PaymentChannelsInstruction.Seal;
44
+ } & ParsedSealInstruction<TProgram>) | ({
45
+ instructionType: PaymentChannelsInstruction.Distribute;
46
+ } & ParsedDistributeInstruction<TProgram>) | ({
47
+ instructionType: PaymentChannelsInstruction.WithdrawPayer;
48
+ } & ParsedWithdrawPayerInstruction<TProgram>) | ({
49
+ instructionType: PaymentChannelsInstruction.Reclaim;
50
+ } & ParsedReclaimInstruction<TProgram>) | ({
51
+ instructionType: PaymentChannelsInstruction.EmitEvent;
52
+ } & ParsedEmitEventInstruction<TProgram>);
53
+ export declare function parsePaymentChannelsInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedPaymentChannelsInstruction<TProgram>;
54
+ export type PaymentChannelsPlugin = {
55
+ accounts: PaymentChannelsPluginAccounts;
56
+ instructions: PaymentChannelsPluginInstructions;
57
+ pdas: PaymentChannelsPluginPdas;
58
+ };
59
+ export type PaymentChannelsPluginAccounts = {
60
+ channel: ReturnType<typeof getChannelCodec> & SelfFetchFunctions<ChannelArgs, Channel>;
61
+ };
62
+ export type PaymentChannelsPluginInstructions = {
63
+ open: (input: OpenAsyncInput) => ReturnType<typeof getOpenInstructionAsync> & SelfPlanAndSendFunctions;
64
+ settle: (input: SettleInput) => ReturnType<typeof getSettleInstruction> & SelfPlanAndSendFunctions;
65
+ topUp: (input: TopUpInput) => ReturnType<typeof getTopUpInstruction> & SelfPlanAndSendFunctions;
66
+ settleAndSeal: (input: SettleAndSealInput) => ReturnType<typeof getSettleAndSealInstruction> & SelfPlanAndSendFunctions;
67
+ requestClose: (input: RequestCloseInput) => ReturnType<typeof getRequestCloseInstruction> & SelfPlanAndSendFunctions;
68
+ seal: (input: SealInput) => ReturnType<typeof getSealInstruction> & SelfPlanAndSendFunctions;
69
+ distribute: (input: DistributeAsyncInput) => ReturnType<typeof getDistributeInstructionAsync> & SelfPlanAndSendFunctions;
70
+ withdrawPayer: (input: WithdrawPayerInput) => ReturnType<typeof getWithdrawPayerInstruction> & SelfPlanAndSendFunctions;
71
+ reclaim: (input: ReclaimInput) => ReturnType<typeof getReclaimInstruction> & SelfPlanAndSendFunctions;
72
+ emitEvent: (input: EmitEventAsyncInput) => ReturnType<typeof getEmitEventInstructionAsync> & SelfPlanAndSendFunctions;
73
+ };
74
+ export type PaymentChannelsPluginPdas = {
75
+ eventAuthority: typeof findEventAuthorityPda;
76
+ };
77
+ export type PaymentChannelsPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithTransactionPlanning & ClientWithTransactionSending;
78
+ export declare function paymentChannelsProgram(): <T extends PaymentChannelsPluginRequirements>(client: T) => Omit<T, "paymentChannels"> & {
79
+ paymentChannels: PaymentChannelsPlugin;
80
+ };
@@ -0,0 +1,16 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum AccountDiscriminator {
10
+ Channel = 0,
11
+ ClosedChannel = 1
12
+ }
13
+ export type AccountDiscriminatorArgs = AccountDiscriminator;
14
+ export declare function getAccountDiscriminatorEncoder(): FixedSizeEncoder<AccountDiscriminatorArgs>;
15
+ export declare function getAccountDiscriminatorDecoder(): FixedSizeDecoder<AccountDiscriminator>;
16
+ export declare function getAccountDiscriminatorCodec(): FixedSizeCodec<AccountDiscriminatorArgs, AccountDiscriminator>;
@@ -0,0 +1,18 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum ChannelStatus {
10
+ Open = 0,
11
+ Sealed = 1,
12
+ Closing = 2,
13
+ Distributed = 3
14
+ }
15
+ export type ChannelStatusArgs = ChannelStatus;
16
+ export declare function getChannelStatusEncoder(): FixedSizeEncoder<ChannelStatusArgs>;
17
+ export declare function getChannelStatusDecoder(): FixedSizeDecoder<ChannelStatus>;
18
+ export declare function getChannelStatusCodec(): FixedSizeCodec<ChannelStatusArgs, ChannelStatus>;
@@ -0,0 +1,18 @@
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 Codec, type Decoder, type Encoder } from "@solana/kit";
9
+ import { type DistributionEntry, type DistributionEntryArgs } from ".";
10
+ export type DistributeArgs = {
11
+ recipients: Array<DistributionEntry>;
12
+ };
13
+ export type DistributeArgsArgs = {
14
+ recipients: Array<DistributionEntryArgs>;
15
+ };
16
+ export declare function getDistributeArgsEncoder(): Encoder<DistributeArgsArgs>;
17
+ export declare function getDistributeArgsDecoder(): Decoder<DistributeArgs>;
18
+ export declare function getDistributeArgsCodec(): Codec<DistributeArgsArgs, DistributeArgs>;
@@ -0,0 +1,16 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type DistributionEntry = {
10
+ recipient: Address;
11
+ bps: number;
12
+ };
13
+ export type DistributionEntryArgs = DistributionEntry;
14
+ export declare function getDistributionEntryEncoder(): FixedSizeEncoder<DistributionEntryArgs>;
15
+ export declare function getDistributionEntryDecoder(): FixedSizeDecoder<DistributionEntry>;
16
+ export declare function getDistributionEntryCodec(): FixedSizeCodec<DistributionEntryArgs, DistributionEntry>;
@@ -0,0 +1,20 @@
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 "./accountDiscriminator";
9
+ export * from "./channelStatus";
10
+ export * from "./distributeArgs";
11
+ export * from "./distributionEntry";
12
+ export * from "./openArgs";
13
+ export * from "./opened";
14
+ export * from "./payoutBeneficiary";
15
+ export * from "./payoutRedirected";
16
+ export * from "./redirectReason";
17
+ export * from "./settleAndSealArgs";
18
+ export * from "./settlementWatermarks";
19
+ export * from "./topUpArgs";
20
+ export * from "./voucherArgs";
@@ -0,0 +1,26 @@
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 Codec, type Decoder, type Encoder } from "@solana/kit";
9
+ import { type DistributionEntry, type DistributionEntryArgs } from ".";
10
+ export type OpenArgs = {
11
+ salt: bigint;
12
+ deposit: bigint;
13
+ gracePeriod: number;
14
+ openSlot: bigint;
15
+ recipients: Array<DistributionEntry>;
16
+ };
17
+ export type OpenArgsArgs = {
18
+ salt: bigint;
19
+ deposit: bigint;
20
+ gracePeriod: number;
21
+ openSlot: bigint;
22
+ recipients: Array<DistributionEntryArgs>;
23
+ };
24
+ export declare function getOpenArgsEncoder(): Encoder<OpenArgsArgs>;
25
+ export declare function getOpenArgsDecoder(): Decoder<OpenArgs>;
26
+ export declare function getOpenArgsCodec(): Codec<OpenArgsArgs, OpenArgs>;
@@ -0,0 +1,19 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type Opened = {
10
+ channel: Address;
11
+ openSlot: bigint;
12
+ };
13
+ export type OpenedArgs = {
14
+ channel: Address;
15
+ openSlot: bigint;
16
+ };
17
+ export declare function getOpenedEncoder(): FixedSizeEncoder<OpenedArgs>;
18
+ export declare function getOpenedDecoder(): FixedSizeDecoder<Opened>;
19
+ export declare function getOpenedCodec(): FixedSizeCodec<OpenedArgs, Opened>;
@@ -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
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum PayoutBeneficiary {
10
+ Recipient = 0,
11
+ Payee = 1,
12
+ Payer = 2
13
+ }
14
+ export type PayoutBeneficiaryArgs = PayoutBeneficiary;
15
+ export declare function getPayoutBeneficiaryEncoder(): FixedSizeEncoder<PayoutBeneficiaryArgs>;
16
+ export declare function getPayoutBeneficiaryDecoder(): FixedSizeDecoder<PayoutBeneficiary>;
17
+ export declare function getPayoutBeneficiaryCodec(): FixedSizeCodec<PayoutBeneficiaryArgs, PayoutBeneficiary>;
@@ -0,0 +1,26 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ import { type PayoutBeneficiary, type PayoutBeneficiaryArgs, type RedirectReason, type RedirectReasonArgs } from ".";
10
+ export type PayoutRedirected = {
11
+ channel: Address;
12
+ owner: Address;
13
+ amount: bigint;
14
+ beneficiary: PayoutBeneficiary;
15
+ reason: RedirectReason;
16
+ };
17
+ export type PayoutRedirectedArgs = {
18
+ channel: Address;
19
+ owner: Address;
20
+ amount: bigint;
21
+ beneficiary: PayoutBeneficiaryArgs;
22
+ reason: RedirectReasonArgs;
23
+ };
24
+ export declare function getPayoutRedirectedEncoder(): FixedSizeEncoder<PayoutRedirectedArgs>;
25
+ export declare function getPayoutRedirectedDecoder(): FixedSizeDecoder<PayoutRedirected>;
26
+ export declare function getPayoutRedirectedCodec(): FixedSizeCodec<PayoutRedirectedArgs, PayoutRedirected>;
@@ -0,0 +1,18 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export declare enum RedirectReason {
10
+ UnsupportedExtension = 0,
11
+ ClosedOrMalformed = 1,
12
+ NotInitialized = 2,
13
+ ReassignedAuthority = 3
14
+ }
15
+ export type RedirectReasonArgs = RedirectReason;
16
+ export declare function getRedirectReasonEncoder(): FixedSizeEncoder<RedirectReasonArgs>;
17
+ export declare function getRedirectReasonDecoder(): FixedSizeDecoder<RedirectReason>;
18
+ export declare function getRedirectReasonCodec(): FixedSizeCodec<RedirectReasonArgs, RedirectReason>;
@@ -0,0 +1,15 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type SettleAndSealArgs = {
10
+ hasVoucher: number;
11
+ };
12
+ export type SettleAndSealArgsArgs = SettleAndSealArgs;
13
+ export declare function getSettleAndSealArgsEncoder(): FixedSizeEncoder<SettleAndSealArgsArgs>;
14
+ export declare function getSettleAndSealArgsDecoder(): FixedSizeDecoder<SettleAndSealArgs>;
15
+ export declare function getSettleAndSealArgsCodec(): FixedSizeCodec<SettleAndSealArgsArgs, SettleAndSealArgs>;
@@ -0,0 +1,19 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type SettlementWatermarks = {
10
+ settled: bigint;
11
+ payoutWatermark: bigint;
12
+ };
13
+ export type SettlementWatermarksArgs = {
14
+ settled: bigint;
15
+ payoutWatermark: bigint;
16
+ };
17
+ export declare function getSettlementWatermarksEncoder(): FixedSizeEncoder<SettlementWatermarksArgs>;
18
+ export declare function getSettlementWatermarksDecoder(): FixedSizeDecoder<SettlementWatermarks>;
19
+ export declare function getSettlementWatermarksCodec(): FixedSizeCodec<SettlementWatermarksArgs, SettlementWatermarks>;
@@ -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
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type TopUpArgs = {
10
+ amount: bigint;
11
+ };
12
+ export type TopUpArgsArgs = {
13
+ amount: bigint;
14
+ };
15
+ export declare function getTopUpArgsEncoder(): FixedSizeEncoder<TopUpArgsArgs>;
16
+ export declare function getTopUpArgsDecoder(): FixedSizeDecoder<TopUpArgs>;
17
+ export declare function getTopUpArgsCodec(): FixedSizeCodec<TopUpArgsArgs, TopUpArgs>;
@@ -0,0 +1,23 @@
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
9
+ export type VoucherArgs = {
10
+ magic: Array<number>;
11
+ channelId: Address;
12
+ cumulativeAmount: bigint;
13
+ expiresAt: bigint;
14
+ };
15
+ export type VoucherArgsArgs = {
16
+ magic: Array<number>;
17
+ channelId: Address;
18
+ cumulativeAmount: bigint;
19
+ expiresAt: bigint;
20
+ };
21
+ export declare function getVoucherArgsEncoder(): FixedSizeEncoder<VoucherArgsArgs>;
22
+ export declare function getVoucherArgsDecoder(): FixedSizeDecoder<VoucherArgs>;
23
+ export declare function getVoucherArgsCodec(): FixedSizeCodec<VoucherArgsArgs, VoucherArgs>;
@@ -0,0 +1 @@
1
+ export * from './generated/index.js';
@@ -0,0 +1,6 @@
1
+ import { type FixedSizeEncoder } from '@solana/kit';
2
+ export * from '@solana/kit';
3
+ export declare function getU64Encoder(): FixedSizeEncoder<bigint, 8>;
4
+ export declare function getU128Encoder(): FixedSizeEncoder<bigint, 16>;
5
+ export declare function getI64Encoder(): FixedSizeEncoder<bigint, 8>;
6
+ export declare function getI128Encoder(): FixedSizeEncoder<bigint, 16>;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("tsup").Options[] | import("tsup").Options | ((overrideOptions: import("tsup").Options) => import("tsup").Options[] | import("tsup").Options | Promise<import("tsup").Options[] | import("tsup").Options>);
2
+ export default _default;