@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.
- package/dist/clients/typescript/src/__tests__/instruction-parsers.test.d.ts +1 -0
- package/dist/clients/typescript/src/__tests__/voucher-numeric-safety.test.d.ts +1 -0
- package/dist/clients/typescript/src/__tests__/voucher-types.test-d.d.ts +1 -0
- package/dist/clients/typescript/src/generated/accounts/channel.d.ts +59 -0
- package/dist/clients/typescript/src/generated/accounts/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/errors/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/errors/paymentChannels.d.ts +84 -0
- package/dist/clients/typescript/src/generated/index.d.ts +13 -0
- package/dist/clients/typescript/src/generated/instructions/distribute.d.ts +90 -0
- package/dist/clients/typescript/src/generated/instructions/emitEvent.d.ts +42 -0
- package/dist/clients/typescript/src/generated/instructions/index.d.ts +17 -0
- package/dist/clients/typescript/src/generated/instructions/open.d.ts +100 -0
- package/dist/clients/typescript/src/generated/instructions/reclaim.d.ts +39 -0
- package/dist/clients/typescript/src/generated/instructions/requestClose.d.ts +39 -0
- package/dist/clients/typescript/src/generated/instructions/seal.d.ts +36 -0
- package/dist/clients/typescript/src/generated/instructions/settle.d.ts +39 -0
- package/dist/clients/typescript/src/generated/instructions/settleAndSeal.d.ts +47 -0
- package/dist/clients/typescript/src/generated/instructions/topUp.d.ts +56 -0
- package/dist/clients/typescript/src/generated/instructions/withdrawPayer.d.ts +51 -0
- package/dist/clients/typescript/src/generated/pdas/eventAuthority.d.ts +11 -0
- package/dist/clients/typescript/src/generated/pdas/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/programs/index.d.ts +8 -0
- package/dist/clients/typescript/src/generated/programs/paymentChannels.d.ts +80 -0
- package/dist/clients/typescript/src/generated/types/accountDiscriminator.d.ts +16 -0
- package/dist/clients/typescript/src/generated/types/channelStatus.d.ts +18 -0
- package/dist/clients/typescript/src/generated/types/distributeArgs.d.ts +18 -0
- package/dist/clients/typescript/src/generated/types/distributionEntry.d.ts +16 -0
- package/dist/clients/typescript/src/generated/types/index.d.ts +20 -0
- package/dist/clients/typescript/src/generated/types/openArgs.d.ts +26 -0
- package/dist/clients/typescript/src/generated/types/opened.d.ts +19 -0
- package/dist/clients/typescript/src/generated/types/payoutBeneficiary.d.ts +17 -0
- package/dist/clients/typescript/src/generated/types/payoutRedirected.d.ts +26 -0
- package/dist/clients/typescript/src/generated/types/redirectReason.d.ts +18 -0
- package/dist/clients/typescript/src/generated/types/settleAndSealArgs.d.ts +15 -0
- package/dist/clients/typescript/src/generated/types/settlementWatermarks.d.ts +19 -0
- package/dist/clients/typescript/src/generated/types/topUpArgs.d.ts +17 -0
- package/dist/clients/typescript/src/generated/types/voucherArgs.d.ts +23 -0
- package/dist/clients/typescript/src/index.d.ts +1 -0
- package/dist/clients/typescript/src/safe-codecs.d.ts +6 -0
- package/dist/clients/typescript/tsup.config.d.ts +2 -0
- package/dist/index.cjs +1399 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1549 -0
- package/dist/sdk/channel.d.ts +10 -0
- package/dist/sdk/client.d.ts +31 -0
- package/dist/sdk/utils.d.ts +3 -0
- package/dist/sdk/voucher.d.ts +14 -0
- package/package.json +36 -0
- package/src/clients/typescript/package.json +32 -0
- package/src/clients/typescript/src/__tests__/instruction-parsers.test.ts +81 -0
- package/src/clients/typescript/src/__tests__/voucher-numeric-safety.test.ts +176 -0
- package/src/clients/typescript/src/__tests__/voucher-types.test-d.ts +8 -0
- package/src/clients/typescript/src/generated/accounts/channel.ts +192 -0
- package/src/clients/typescript/src/generated/accounts/index.ts +9 -0
- package/src/clients/typescript/src/generated/errors/index.ts +9 -0
- package/src/clients/typescript/src/generated/errors/paymentChannels.ts +251 -0
- package/src/clients/typescript/src/generated/index.ts +14 -0
- package/src/clients/typescript/src/generated/instructions/distribute.ts +517 -0
- package/src/clients/typescript/src/generated/instructions/emitEvent.ts +194 -0
- package/src/clients/typescript/src/generated/instructions/index.ts +18 -0
- package/src/clients/typescript/src/generated/instructions/open.ts +577 -0
- package/src/clients/typescript/src/generated/instructions/reclaim.ts +165 -0
- package/src/clients/typescript/src/generated/instructions/requestClose.ts +173 -0
- package/src/clients/typescript/src/generated/instructions/seal.ts +151 -0
- package/src/clients/typescript/src/generated/instructions/settle.ts +180 -0
- package/src/clients/typescript/src/generated/instructions/settleAndSeal.ts +224 -0
- package/src/clients/typescript/src/generated/instructions/topUp.ts +267 -0
- package/src/clients/typescript/src/generated/instructions/withdrawPayer.ts +246 -0
- package/src/clients/typescript/src/generated/pdas/eventAuthority.ts +26 -0
- package/src/clients/typescript/src/generated/pdas/index.ts +9 -0
- package/src/clients/typescript/src/generated/programs/index.ts +9 -0
- package/src/clients/typescript/src/generated/programs/paymentChannels.ts +366 -0
- package/src/clients/typescript/src/generated/types/accountDiscriminator.ts +41 -0
- package/src/clients/typescript/src/generated/types/channelStatus.ts +40 -0
- package/src/clients/typescript/src/generated/types/distributeArgs.ts +47 -0
- package/src/clients/typescript/src/generated/types/distributionEntry.ts +48 -0
- package/src/clients/typescript/src/generated/types/index.ts +21 -0
- package/src/clients/typescript/src/generated/types/openArgs.ts +70 -0
- package/src/clients/typescript/src/generated/types/opened.ts +42 -0
- package/src/clients/typescript/src/generated/types/payoutBeneficiary.ts +42 -0
- package/src/clients/typescript/src/generated/types/payoutRedirected.ts +76 -0
- package/src/clients/typescript/src/generated/types/redirectReason.ts +40 -0
- package/src/clients/typescript/src/generated/types/settleAndSealArgs.ts +39 -0
- package/src/clients/typescript/src/generated/types/settlementWatermarks.ts +48 -0
- package/src/clients/typescript/src/generated/types/topUpArgs.ts +33 -0
- package/src/clients/typescript/src/generated/types/voucherArgs.ts +68 -0
- package/src/clients/typescript/src/index.ts +1 -0
- package/src/clients/typescript/src/safe-codecs.ts +82 -0
- package/src/clients/typescript/tsconfig.json +11 -0
- package/src/clients/typescript/tsup.config.ts +9 -0
- package/src/index.ts +4 -0
- package/src/sdk/channel.ts +128 -0
- package/src/sdk/client.ts +22 -0
- package/src/sdk/utils.ts +29 -0
- package/src/sdk/voucher.ts +50 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getEnumDecoder,
|
|
12
|
+
getEnumEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
|
|
18
|
+
export enum ChannelStatus {
|
|
19
|
+
Open,
|
|
20
|
+
Sealed,
|
|
21
|
+
Closing,
|
|
22
|
+
Distributed,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type ChannelStatusArgs = ChannelStatus;
|
|
26
|
+
|
|
27
|
+
export function getChannelStatusEncoder(): FixedSizeEncoder<ChannelStatusArgs> {
|
|
28
|
+
return getEnumEncoder(ChannelStatus);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getChannelStatusDecoder(): FixedSizeDecoder<ChannelStatus> {
|
|
32
|
+
return getEnumDecoder(ChannelStatus);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getChannelStatusCodec(): FixedSizeCodec<
|
|
36
|
+
ChannelStatusArgs,
|
|
37
|
+
ChannelStatus
|
|
38
|
+
> {
|
|
39
|
+
return combineCodec(getChannelStatusEncoder(), getChannelStatusDecoder());
|
|
40
|
+
}
|
|
@@ -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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getArrayDecoder,
|
|
12
|
+
getArrayEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
type Codec,
|
|
16
|
+
type Decoder,
|
|
17
|
+
type Encoder,
|
|
18
|
+
} from "@solana/kit";
|
|
19
|
+
import {
|
|
20
|
+
getDistributionEntryDecoder,
|
|
21
|
+
getDistributionEntryEncoder,
|
|
22
|
+
type DistributionEntry,
|
|
23
|
+
type DistributionEntryArgs,
|
|
24
|
+
} from ".";
|
|
25
|
+
|
|
26
|
+
export type DistributeArgs = { recipients: Array<DistributionEntry> };
|
|
27
|
+
|
|
28
|
+
export type DistributeArgsArgs = { recipients: Array<DistributionEntryArgs> };
|
|
29
|
+
|
|
30
|
+
export function getDistributeArgsEncoder(): Encoder<DistributeArgsArgs> {
|
|
31
|
+
return getStructEncoder([
|
|
32
|
+
["recipients", getArrayEncoder(getDistributionEntryEncoder())],
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function getDistributeArgsDecoder(): Decoder<DistributeArgs> {
|
|
37
|
+
return getStructDecoder([
|
|
38
|
+
["recipients", getArrayDecoder(getDistributionEntryDecoder())],
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function getDistributeArgsCodec(): Codec<
|
|
43
|
+
DistributeArgsArgs,
|
|
44
|
+
DistributeArgs
|
|
45
|
+
> {
|
|
46
|
+
return combineCodec(getDistributeArgsEncoder(), getDistributeArgsDecoder());
|
|
47
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
type Address,
|
|
16
|
+
type FixedSizeCodec,
|
|
17
|
+
type FixedSizeDecoder,
|
|
18
|
+
type FixedSizeEncoder,
|
|
19
|
+
} from "@solana/kit";
|
|
20
|
+
import { getU16Decoder, getU16Encoder } from "../../safe-codecs.js";
|
|
21
|
+
|
|
22
|
+
export type DistributionEntry = { recipient: Address; bps: number };
|
|
23
|
+
|
|
24
|
+
export type DistributionEntryArgs = DistributionEntry;
|
|
25
|
+
|
|
26
|
+
export function getDistributionEntryEncoder(): FixedSizeEncoder<DistributionEntryArgs> {
|
|
27
|
+
return getStructEncoder([
|
|
28
|
+
["recipient", getAddressEncoder()],
|
|
29
|
+
["bps", getU16Encoder()],
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getDistributionEntryDecoder(): FixedSizeDecoder<DistributionEntry> {
|
|
34
|
+
return getStructDecoder([
|
|
35
|
+
["recipient", getAddressDecoder()],
|
|
36
|
+
["bps", getU16Decoder()],
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getDistributionEntryCodec(): FixedSizeCodec<
|
|
41
|
+
DistributionEntryArgs,
|
|
42
|
+
DistributionEntry
|
|
43
|
+
> {
|
|
44
|
+
return combineCodec(
|
|
45
|
+
getDistributionEntryEncoder(),
|
|
46
|
+
getDistributionEntryDecoder(),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
|
|
9
|
+
export * from "./accountDiscriminator";
|
|
10
|
+
export * from "./channelStatus";
|
|
11
|
+
export * from "./distributeArgs";
|
|
12
|
+
export * from "./distributionEntry";
|
|
13
|
+
export * from "./openArgs";
|
|
14
|
+
export * from "./opened";
|
|
15
|
+
export * from "./payoutBeneficiary";
|
|
16
|
+
export * from "./payoutRedirected";
|
|
17
|
+
export * from "./redirectReason";
|
|
18
|
+
export * from "./settleAndSealArgs";
|
|
19
|
+
export * from "./settlementWatermarks";
|
|
20
|
+
export * from "./topUpArgs";
|
|
21
|
+
export * from "./voucherArgs";
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getArrayDecoder,
|
|
12
|
+
getArrayEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
type Codec,
|
|
16
|
+
type Decoder,
|
|
17
|
+
type Encoder,
|
|
18
|
+
} from "@solana/kit";
|
|
19
|
+
import {
|
|
20
|
+
getDistributionEntryDecoder,
|
|
21
|
+
getDistributionEntryEncoder,
|
|
22
|
+
type DistributionEntry,
|
|
23
|
+
type DistributionEntryArgs,
|
|
24
|
+
} from ".";
|
|
25
|
+
import {
|
|
26
|
+
getU32Decoder,
|
|
27
|
+
getU32Encoder,
|
|
28
|
+
getU64Decoder,
|
|
29
|
+
getU64Encoder,
|
|
30
|
+
} from "../../safe-codecs.js";
|
|
31
|
+
|
|
32
|
+
export type OpenArgs = {
|
|
33
|
+
salt: bigint;
|
|
34
|
+
deposit: bigint;
|
|
35
|
+
gracePeriod: number;
|
|
36
|
+
openSlot: bigint;
|
|
37
|
+
recipients: Array<DistributionEntry>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type OpenArgsArgs = {
|
|
41
|
+
salt: bigint;
|
|
42
|
+
deposit: bigint;
|
|
43
|
+
gracePeriod: number;
|
|
44
|
+
openSlot: bigint;
|
|
45
|
+
recipients: Array<DistributionEntryArgs>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export function getOpenArgsEncoder(): Encoder<OpenArgsArgs> {
|
|
49
|
+
return getStructEncoder([
|
|
50
|
+
["salt", getU64Encoder()],
|
|
51
|
+
["deposit", getU64Encoder()],
|
|
52
|
+
["gracePeriod", getU32Encoder()],
|
|
53
|
+
["openSlot", getU64Encoder()],
|
|
54
|
+
["recipients", getArrayEncoder(getDistributionEntryEncoder())],
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function getOpenArgsDecoder(): Decoder<OpenArgs> {
|
|
59
|
+
return getStructDecoder([
|
|
60
|
+
["salt", getU64Decoder()],
|
|
61
|
+
["deposit", getU64Decoder()],
|
|
62
|
+
["gracePeriod", getU32Decoder()],
|
|
63
|
+
["openSlot", getU64Decoder()],
|
|
64
|
+
["recipients", getArrayDecoder(getDistributionEntryDecoder())],
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getOpenArgsCodec(): Codec<OpenArgsArgs, OpenArgs> {
|
|
69
|
+
return combineCodec(getOpenArgsEncoder(), getOpenArgsDecoder());
|
|
70
|
+
}
|
|
@@ -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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
type Address,
|
|
16
|
+
type FixedSizeCodec,
|
|
17
|
+
type FixedSizeDecoder,
|
|
18
|
+
type FixedSizeEncoder,
|
|
19
|
+
} from "@solana/kit";
|
|
20
|
+
import { getU64Decoder, getU64Encoder } from "../../safe-codecs.js";
|
|
21
|
+
|
|
22
|
+
export type Opened = { channel: Address; openSlot: bigint };
|
|
23
|
+
|
|
24
|
+
export type OpenedArgs = { channel: Address; openSlot: bigint };
|
|
25
|
+
|
|
26
|
+
export function getOpenedEncoder(): FixedSizeEncoder<OpenedArgs> {
|
|
27
|
+
return getStructEncoder([
|
|
28
|
+
["channel", getAddressEncoder()],
|
|
29
|
+
["openSlot", getU64Encoder()],
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getOpenedDecoder(): FixedSizeDecoder<Opened> {
|
|
34
|
+
return getStructDecoder([
|
|
35
|
+
["channel", getAddressDecoder()],
|
|
36
|
+
["openSlot", getU64Decoder()],
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getOpenedCodec(): FixedSizeCodec<OpenedArgs, Opened> {
|
|
41
|
+
return combineCodec(getOpenedEncoder(), getOpenedDecoder());
|
|
42
|
+
}
|
|
@@ -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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getEnumDecoder,
|
|
12
|
+
getEnumEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
|
|
18
|
+
export enum PayoutBeneficiary {
|
|
19
|
+
Recipient,
|
|
20
|
+
Payee,
|
|
21
|
+
Payer,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type PayoutBeneficiaryArgs = PayoutBeneficiary;
|
|
25
|
+
|
|
26
|
+
export function getPayoutBeneficiaryEncoder(): FixedSizeEncoder<PayoutBeneficiaryArgs> {
|
|
27
|
+
return getEnumEncoder(PayoutBeneficiary);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getPayoutBeneficiaryDecoder(): FixedSizeDecoder<PayoutBeneficiary> {
|
|
31
|
+
return getEnumDecoder(PayoutBeneficiary);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function getPayoutBeneficiaryCodec(): FixedSizeCodec<
|
|
35
|
+
PayoutBeneficiaryArgs,
|
|
36
|
+
PayoutBeneficiary
|
|
37
|
+
> {
|
|
38
|
+
return combineCodec(
|
|
39
|
+
getPayoutBeneficiaryEncoder(),
|
|
40
|
+
getPayoutBeneficiaryDecoder(),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
type Address,
|
|
16
|
+
type FixedSizeCodec,
|
|
17
|
+
type FixedSizeDecoder,
|
|
18
|
+
type FixedSizeEncoder,
|
|
19
|
+
} from "@solana/kit";
|
|
20
|
+
import {
|
|
21
|
+
getPayoutBeneficiaryDecoder,
|
|
22
|
+
getPayoutBeneficiaryEncoder,
|
|
23
|
+
getRedirectReasonDecoder,
|
|
24
|
+
getRedirectReasonEncoder,
|
|
25
|
+
type PayoutBeneficiary,
|
|
26
|
+
type PayoutBeneficiaryArgs,
|
|
27
|
+
type RedirectReason,
|
|
28
|
+
type RedirectReasonArgs,
|
|
29
|
+
} from ".";
|
|
30
|
+
import { getU64Decoder, getU64Encoder } from "../../safe-codecs.js";
|
|
31
|
+
|
|
32
|
+
export type PayoutRedirected = {
|
|
33
|
+
channel: Address;
|
|
34
|
+
owner: Address;
|
|
35
|
+
amount: bigint;
|
|
36
|
+
beneficiary: PayoutBeneficiary;
|
|
37
|
+
reason: RedirectReason;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type PayoutRedirectedArgs = {
|
|
41
|
+
channel: Address;
|
|
42
|
+
owner: Address;
|
|
43
|
+
amount: bigint;
|
|
44
|
+
beneficiary: PayoutBeneficiaryArgs;
|
|
45
|
+
reason: RedirectReasonArgs;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export function getPayoutRedirectedEncoder(): FixedSizeEncoder<PayoutRedirectedArgs> {
|
|
49
|
+
return getStructEncoder([
|
|
50
|
+
["channel", getAddressEncoder()],
|
|
51
|
+
["owner", getAddressEncoder()],
|
|
52
|
+
["amount", getU64Encoder()],
|
|
53
|
+
["beneficiary", getPayoutBeneficiaryEncoder()],
|
|
54
|
+
["reason", getRedirectReasonEncoder()],
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function getPayoutRedirectedDecoder(): FixedSizeDecoder<PayoutRedirected> {
|
|
59
|
+
return getStructDecoder([
|
|
60
|
+
["channel", getAddressDecoder()],
|
|
61
|
+
["owner", getAddressDecoder()],
|
|
62
|
+
["amount", getU64Decoder()],
|
|
63
|
+
["beneficiary", getPayoutBeneficiaryDecoder()],
|
|
64
|
+
["reason", getRedirectReasonDecoder()],
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getPayoutRedirectedCodec(): FixedSizeCodec<
|
|
69
|
+
PayoutRedirectedArgs,
|
|
70
|
+
PayoutRedirected
|
|
71
|
+
> {
|
|
72
|
+
return combineCodec(
|
|
73
|
+
getPayoutRedirectedEncoder(),
|
|
74
|
+
getPayoutRedirectedDecoder(),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getEnumDecoder,
|
|
12
|
+
getEnumEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
|
|
18
|
+
export enum RedirectReason {
|
|
19
|
+
UnsupportedExtension,
|
|
20
|
+
ClosedOrMalformed,
|
|
21
|
+
NotInitialized,
|
|
22
|
+
ReassignedAuthority,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type RedirectReasonArgs = RedirectReason;
|
|
26
|
+
|
|
27
|
+
export function getRedirectReasonEncoder(): FixedSizeEncoder<RedirectReasonArgs> {
|
|
28
|
+
return getEnumEncoder(RedirectReason);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getRedirectReasonDecoder(): FixedSizeDecoder<RedirectReason> {
|
|
32
|
+
return getEnumDecoder(RedirectReason);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getRedirectReasonCodec(): FixedSizeCodec<
|
|
36
|
+
RedirectReasonArgs,
|
|
37
|
+
RedirectReason
|
|
38
|
+
> {
|
|
39
|
+
return combineCodec(getRedirectReasonEncoder(), getRedirectReasonDecoder());
|
|
40
|
+
}
|
|
@@ -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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getStructDecoder,
|
|
12
|
+
getStructEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
import { getU8Decoder, getU8Encoder } from "../../safe-codecs.js";
|
|
18
|
+
|
|
19
|
+
export type SettleAndSealArgs = { hasVoucher: number };
|
|
20
|
+
|
|
21
|
+
export type SettleAndSealArgsArgs = SettleAndSealArgs;
|
|
22
|
+
|
|
23
|
+
export function getSettleAndSealArgsEncoder(): FixedSizeEncoder<SettleAndSealArgsArgs> {
|
|
24
|
+
return getStructEncoder([["hasVoucher", getU8Encoder()]]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getSettleAndSealArgsDecoder(): FixedSizeDecoder<SettleAndSealArgs> {
|
|
28
|
+
return getStructDecoder([["hasVoucher", getU8Decoder()]]);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getSettleAndSealArgsCodec(): FixedSizeCodec<
|
|
32
|
+
SettleAndSealArgsArgs,
|
|
33
|
+
SettleAndSealArgs
|
|
34
|
+
> {
|
|
35
|
+
return combineCodec(
|
|
36
|
+
getSettleAndSealArgsEncoder(),
|
|
37
|
+
getSettleAndSealArgsDecoder(),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getStructDecoder,
|
|
12
|
+
getStructEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
import { getU64Decoder, getU64Encoder } from "../../safe-codecs.js";
|
|
18
|
+
|
|
19
|
+
export type SettlementWatermarks = { settled: bigint; payoutWatermark: bigint };
|
|
20
|
+
|
|
21
|
+
export type SettlementWatermarksArgs = {
|
|
22
|
+
settled: bigint;
|
|
23
|
+
payoutWatermark: bigint;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function getSettlementWatermarksEncoder(): FixedSizeEncoder<SettlementWatermarksArgs> {
|
|
27
|
+
return getStructEncoder([
|
|
28
|
+
["settled", getU64Encoder()],
|
|
29
|
+
["payoutWatermark", getU64Encoder()],
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getSettlementWatermarksDecoder(): FixedSizeDecoder<SettlementWatermarks> {
|
|
34
|
+
return getStructDecoder([
|
|
35
|
+
["settled", getU64Decoder()],
|
|
36
|
+
["payoutWatermark", getU64Decoder()],
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getSettlementWatermarksCodec(): FixedSizeCodec<
|
|
41
|
+
SettlementWatermarksArgs,
|
|
42
|
+
SettlementWatermarks
|
|
43
|
+
> {
|
|
44
|
+
return combineCodec(
|
|
45
|
+
getSettlementWatermarksEncoder(),
|
|
46
|
+
getSettlementWatermarksDecoder(),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getStructDecoder,
|
|
12
|
+
getStructEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
import { getU64Decoder, getU64Encoder } from "../../safe-codecs.js";
|
|
18
|
+
|
|
19
|
+
export type TopUpArgs = { amount: bigint };
|
|
20
|
+
|
|
21
|
+
export type TopUpArgsArgs = { amount: bigint };
|
|
22
|
+
|
|
23
|
+
export function getTopUpArgsEncoder(): FixedSizeEncoder<TopUpArgsArgs> {
|
|
24
|
+
return getStructEncoder([["amount", getU64Encoder()]]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getTopUpArgsDecoder(): FixedSizeDecoder<TopUpArgs> {
|
|
28
|
+
return getStructDecoder([["amount", getU64Decoder()]]);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getTopUpArgsCodec(): FixedSizeCodec<TopUpArgsArgs, TopUpArgs> {
|
|
32
|
+
return combineCodec(getTopUpArgsEncoder(), getTopUpArgsDecoder());
|
|
33
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getArrayDecoder,
|
|
14
|
+
getArrayEncoder,
|
|
15
|
+
getStructDecoder,
|
|
16
|
+
getStructEncoder,
|
|
17
|
+
type Address,
|
|
18
|
+
type FixedSizeCodec,
|
|
19
|
+
type FixedSizeDecoder,
|
|
20
|
+
type FixedSizeEncoder,
|
|
21
|
+
} from "@solana/kit";
|
|
22
|
+
import {
|
|
23
|
+
getI64Decoder,
|
|
24
|
+
getI64Encoder,
|
|
25
|
+
getU64Decoder,
|
|
26
|
+
getU64Encoder,
|
|
27
|
+
getU8Decoder,
|
|
28
|
+
getU8Encoder,
|
|
29
|
+
} from "../../safe-codecs.js";
|
|
30
|
+
|
|
31
|
+
export type VoucherArgs = {
|
|
32
|
+
magic: Array<number>;
|
|
33
|
+
channelId: Address;
|
|
34
|
+
cumulativeAmount: bigint;
|
|
35
|
+
expiresAt: bigint;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type VoucherArgsArgs = {
|
|
39
|
+
magic: Array<number>;
|
|
40
|
+
channelId: Address;
|
|
41
|
+
cumulativeAmount: bigint;
|
|
42
|
+
expiresAt: bigint;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export function getVoucherArgsEncoder(): FixedSizeEncoder<VoucherArgsArgs> {
|
|
46
|
+
return getStructEncoder([
|
|
47
|
+
["magic", getArrayEncoder(getU8Encoder(), { size: 2 })],
|
|
48
|
+
["channelId", getAddressEncoder()],
|
|
49
|
+
["cumulativeAmount", getU64Encoder()],
|
|
50
|
+
["expiresAt", getI64Encoder()],
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function getVoucherArgsDecoder(): FixedSizeDecoder<VoucherArgs> {
|
|
55
|
+
return getStructDecoder([
|
|
56
|
+
["magic", getArrayDecoder(getU8Decoder(), { size: 2 })],
|
|
57
|
+
["channelId", getAddressDecoder()],
|
|
58
|
+
["cumulativeAmount", getU64Decoder()],
|
|
59
|
+
["expiresAt", getI64Decoder()],
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function getVoucherArgsCodec(): FixedSizeCodec<
|
|
64
|
+
VoucherArgsArgs,
|
|
65
|
+
VoucherArgs
|
|
66
|
+
> {
|
|
67
|
+
return combineCodec(getVoucherArgsEncoder(), getVoucherArgsDecoder());
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generated/index.js';
|