@wuwei-labs/srsly 3.0.0-beta.14 → 3.0.0-beta.15

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 (98) hide show
  1. package/dist/cjs/index.js +4 -3
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/instructions/acceptRental.js +5 -15
  4. package/dist/cjs/instructions/acceptRental.js.map +1 -1
  5. package/dist/cjs/instructions/claimRental.js +5 -15
  6. package/dist/cjs/instructions/claimRental.js.map +1 -1
  7. package/dist/cjs/package.json +1 -1
  8. package/dist/cjs/utils/discountAuth.js +19 -6
  9. package/dist/cjs/utils/discountAuth.js.map +1 -1
  10. package/dist/cjs/utils/index.js +2 -1
  11. package/dist/cjs/utils/index.js.map +1 -1
  12. package/dist/cjs/version.js +1 -1
  13. package/dist/esm/index.js +1 -1
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/instructions/acceptRental.js +6 -16
  16. package/dist/esm/instructions/acceptRental.js.map +1 -1
  17. package/dist/esm/instructions/claimRental.js +6 -16
  18. package/dist/esm/instructions/claimRental.js.map +1 -1
  19. package/dist/esm/package.json +1 -1
  20. package/dist/esm/utils/discountAuth.js +18 -6
  21. package/dist/esm/utils/discountAuth.js.map +1 -1
  22. package/dist/esm/utils/index.js +1 -1
  23. package/dist/esm/utils/index.js.map +1 -1
  24. package/dist/esm/version.js +1 -1
  25. package/dist/types/generated/codama/types/discountAuthorization.d.ts +3 -3
  26. package/dist/types/generated/codama/types/discountAuthorization.d.ts.map +1 -1
  27. package/dist/types/index.d.ts +1 -1
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/types/instructions/acceptRental.d.ts +2 -6
  30. package/dist/types/instructions/acceptRental.d.ts.map +1 -1
  31. package/dist/types/instructions/claimRental.d.ts +2 -6
  32. package/dist/types/instructions/claimRental.d.ts.map +1 -1
  33. package/dist/types/utils/discountAuth.d.ts +10 -0
  34. package/dist/types/utils/discountAuth.d.ts.map +1 -1
  35. package/dist/types/utils/index.d.ts +1 -1
  36. package/dist/types/utils/index.d.ts.map +1 -1
  37. package/dist/types/version.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/dist/cjs/generated/codama/accounts/memberState.js +0 -78
  40. package/dist/cjs/generated/codama/accounts/memberState.js.map +0 -1
  41. package/dist/cjs/generated/codama/accounts/vaultState.js +0 -82
  42. package/dist/cjs/generated/codama/accounts/vaultState.js.map +0 -1
  43. package/dist/cjs/generated/codama/types/contractTerms.js +0 -35
  44. package/dist/cjs/generated/codama/types/contractTerms.js.map +0 -1
  45. package/dist/cjs/generated/codama/types/memberConfig.js +0 -33
  46. package/dist/cjs/generated/codama/types/memberConfig.js.map +0 -1
  47. package/dist/cjs/generated/codama/types/memberType.js +0 -57
  48. package/dist/cjs/generated/codama/types/memberType.js.map +0 -1
  49. package/dist/cjs/generated/codama/types/rebateAuthorization.js +0 -33
  50. package/dist/cjs/generated/codama/types/rebateAuthorization.js.map +0 -1
  51. package/dist/cjs/generated/codama/types/reservation.js +0 -32
  52. package/dist/cjs/generated/codama/types/reservation.js.map +0 -1
  53. package/dist/cjs/instructions/approveReferral.js +0 -11
  54. package/dist/cjs/instructions/approveReferral.js.map +0 -1
  55. package/dist/cjs/instructions/createReferral.js +0 -54
  56. package/dist/cjs/instructions/createReferral.js.map +0 -1
  57. package/dist/cjs/instructions/removeReferral.js +0 -11
  58. package/dist/cjs/instructions/removeReferral.js.map +0 -1
  59. package/dist/esm/generated/codama/accounts/memberState.js +0 -66
  60. package/dist/esm/generated/codama/accounts/memberState.js.map +0 -1
  61. package/dist/esm/generated/codama/accounts/vaultState.js +0 -70
  62. package/dist/esm/generated/codama/accounts/vaultState.js.map +0 -1
  63. package/dist/esm/generated/codama/types/contractTerms.js +0 -30
  64. package/dist/esm/generated/codama/types/contractTerms.js.map +0 -1
  65. package/dist/esm/generated/codama/types/memberConfig.js +0 -28
  66. package/dist/esm/generated/codama/types/memberConfig.js.map +0 -1
  67. package/dist/esm/generated/codama/types/memberType.js +0 -50
  68. package/dist/esm/generated/codama/types/memberType.js.map +0 -1
  69. package/dist/esm/generated/codama/types/rebateAuthorization.js +0 -28
  70. package/dist/esm/generated/codama/types/rebateAuthorization.js.map +0 -1
  71. package/dist/esm/generated/codama/types/reservation.js +0 -27
  72. package/dist/esm/generated/codama/types/reservation.js.map +0 -1
  73. package/dist/esm/instructions/approveReferral.js +0 -7
  74. package/dist/esm/instructions/approveReferral.js.map +0 -1
  75. package/dist/esm/instructions/createReferral.js +0 -51
  76. package/dist/esm/instructions/createReferral.js.map +0 -1
  77. package/dist/esm/instructions/removeReferral.js +0 -7
  78. package/dist/esm/instructions/removeReferral.js.map +0 -1
  79. package/dist/types/generated/codama/accounts/memberState.d.ts +0 -58
  80. package/dist/types/generated/codama/accounts/memberState.d.ts.map +0 -1
  81. package/dist/types/generated/codama/accounts/vaultState.d.ts +0 -66
  82. package/dist/types/generated/codama/accounts/vaultState.d.ts.map +0 -1
  83. package/dist/types/generated/codama/types/contractTerms.d.ts +0 -40
  84. package/dist/types/generated/codama/types/contractTerms.d.ts.map +0 -1
  85. package/dist/types/generated/codama/types/memberConfig.d.ts +0 -33
  86. package/dist/types/generated/codama/types/memberConfig.d.ts.map +0 -1
  87. package/dist/types/generated/codama/types/memberType.d.ts +0 -57
  88. package/dist/types/generated/codama/types/memberType.d.ts.map +0 -1
  89. package/dist/types/generated/codama/types/rebateAuthorization.d.ts +0 -36
  90. package/dist/types/generated/codama/types/rebateAuthorization.d.ts.map +0 -1
  91. package/dist/types/generated/codama/types/reservation.d.ts +0 -33
  92. package/dist/types/generated/codama/types/reservation.d.ts.map +0 -1
  93. package/dist/types/instructions/approveReferral.d.ts +0 -7
  94. package/dist/types/instructions/approveReferral.d.ts.map +0 -1
  95. package/dist/types/instructions/createReferral.d.ts +0 -59
  96. package/dist/types/instructions/createReferral.d.ts.map +0 -1
  97. package/dist/types/instructions/removeReferral.d.ts +0 -7
  98. package/dist/types/instructions/removeReferral.d.ts.map +0 -1
@@ -1,54 +0,0 @@
1
- "use strict";
2
- /**
3
- * @purpose Create a pending referral (Share member) for SRSLY vault
4
- *
5
- * Wraps slyvault's initMember instruction with Share type pre-configured.
6
- * Uses "referral" terminology for SRSLY context.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createReferral = createReferral;
10
- const slyvault_1 = require("@wuwei-labs/slyvault");
11
- /**
12
- * Create a pending referral (Share member)
13
- *
14
- * Creates a new Share member state that references a parent Normal member.
15
- * The referral must be approved by the parent member's authority using approveReferral.
16
- *
17
- * @param params - Referral creation parameters
18
- * @returns Prepared instruction(s)
19
- *
20
- * @example
21
- * ```typescript
22
- * import { createReferral } from '@wuwei-labs/srsly';
23
- *
24
- * // Create referral referencing parent member at nonce 0
25
- * const ix = await createReferral({
26
- * member: wallet,
27
- * vault: vaultAddress,
28
- * parentMemberNonce: 0
29
- * });
30
- * ```
31
- */
32
- async function createReferral(params) {
33
- if (!params.member)
34
- throw new Error('member is required');
35
- if (!params.vault)
36
- throw new Error('vault is required');
37
- if (params.parentMemberNonce === undefined)
38
- throw new Error('parentMemberNonce is required');
39
- // Call slyvault initMember with Share type pre-configured
40
- return (0, slyvault_1.initMember)({
41
- member: params.member,
42
- vault: params.vault,
43
- nonce: params.nonce,
44
- memberType: {
45
- __kind: 'Share',
46
- parentMemberNonce: params.parentMemberNonce,
47
- percentageBps: 0,
48
- claimableBalance: 0n,
49
- isActive: false,
50
- },
51
- computeUnits: params.computeUnits,
52
- });
53
- }
54
- //# sourceMappingURL=createReferral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createReferral.js","sourceRoot":"","sources":["../../../src/instructions/createReferral.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA8DH,wCAqBC;AAhFD,mDAG8B;AAmC9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,KAAK,UAAU,cAAc,CAClC,MAA4B;IAE5B,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxD,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE7F,0DAA0D;IAC1D,OAAO,IAAA,qBAAU,EAAC;QAChB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE;YACV,MAAM,EAAE,OAAO;YACf,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,aAAa,EAAE,CAAC;YAChB,gBAAgB,EAAE,EAAE;YACpB,QAAQ,EAAE,KAAK;SAChB;QACD,YAAY,EAAE,MAAM,CAAC,YAAY;KAClC,CAAC,CAAC;AACL,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- /**
3
- * @purpose Remove a referral and close account
4
- *
5
- * Re-exports slyvault's removeReferral instruction for SRSLY context.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.removeReferral = void 0;
9
- var slyvault_1 = require("@wuwei-labs/slyvault");
10
- Object.defineProperty(exports, "removeReferral", { enumerable: true, get: function () { return slyvault_1.removeReferral; } });
11
- //# sourceMappingURL=removeReferral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"removeReferral.js","sourceRoot":"","sources":["../../../src/instructions/removeReferral.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iDAG8B;AAF5B,0GAAA,cAAc,OAAA"}
@@ -1,66 +0,0 @@
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 { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesDecoder, getBytesEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU8Decoder, getU8Encoder, transformEncoder, } from '@solana/kit';
9
- import { getMemberTypeDecoder, getMemberTypeEncoder, } from '../types';
10
- export const MEMBER_STATE_DISCRIMINATOR = new Uint8Array([
11
- 41, 28, 21, 90, 91, 49, 228, 104,
12
- ]);
13
- export function getMemberStateDiscriminatorBytes() {
14
- return fixEncoderSize(getBytesEncoder(), 8).encode(MEMBER_STATE_DISCRIMINATOR);
15
- }
16
- export function getMemberStateEncoder() {
17
- return transformEncoder(getStructEncoder([
18
- ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
19
- ['version', getU32Encoder()],
20
- ['bump', getU8Encoder()],
21
- ['vault', getAddressEncoder()],
22
- ['authority', getAddressEncoder()],
23
- ['nonce', getU32Encoder()],
24
- ['memberType', getMemberTypeEncoder()],
25
- ['createdAt', getI64Encoder()],
26
- ['updatedAt', getI64Encoder()],
27
- ]), (value) => ({ ...value, discriminator: MEMBER_STATE_DISCRIMINATOR }));
28
- }
29
- export function getMemberStateDecoder() {
30
- return getStructDecoder([
31
- ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
32
- ['version', getU32Decoder()],
33
- ['bump', getU8Decoder()],
34
- ['vault', getAddressDecoder()],
35
- ['authority', getAddressDecoder()],
36
- ['nonce', getU32Decoder()],
37
- ['memberType', getMemberTypeDecoder()],
38
- ['createdAt', getI64Decoder()],
39
- ['updatedAt', getI64Decoder()],
40
- ]);
41
- }
42
- export function getMemberStateCodec() {
43
- return combineCodec(getMemberStateEncoder(), getMemberStateDecoder());
44
- }
45
- export function decodeMemberState(encodedAccount) {
46
- return decodeAccount(encodedAccount, getMemberStateDecoder());
47
- }
48
- export async function fetchMemberState(rpc, address, config) {
49
- const maybeAccount = await fetchMaybeMemberState(rpc, address, config);
50
- assertAccountExists(maybeAccount);
51
- return maybeAccount;
52
- }
53
- export async function fetchMaybeMemberState(rpc, address, config) {
54
- const maybeAccount = await fetchEncodedAccount(rpc, address, config);
55
- return decodeMemberState(maybeAccount);
56
- }
57
- export async function fetchAllMemberState(rpc, addresses, config) {
58
- const maybeAccounts = await fetchAllMaybeMemberState(rpc, addresses, config);
59
- assertAccountsExist(maybeAccounts);
60
- return maybeAccounts;
61
- }
62
- export async function fetchAllMaybeMemberState(rpc, addresses, config) {
63
- const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
64
- return maybeAccounts.map((maybeAccount) => decodeMemberState(maybeAccount));
65
- }
66
- //# sourceMappingURL=memberState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memberState.js","sourceRoot":"","sources":["../../../../../src/generated/codama/accounts/memberState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,GAYjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAGrB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,UAAU,CAAC;IACvD,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG;CACjC,CAAC,CAAC;AAEH,MAAM,UAAU,gCAAgC;IAC9C,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,0BAA0B,CAC3B,CAAC;AACJ,CAAC;AA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AAQD,MAAM,UAAU,iBAAiB,CAC/B,cAAwE;IAExE,OAAO,aAAa,CAClB,cAA+C,EAC/C,qBAAqB,EAAE,CACxB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAA8C,EAC9C,OAA0B,EAC1B,MAA2B;IAE3B,MAAM,YAAY,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAClC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,GAA8C,EAC9C,OAA0B,EAC1B,MAA2B;IAE3B,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACrE,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAA+C,EAC/C,SAAyB,EACzB,MAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,wBAAwB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC7E,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACnC,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,GAA+C,EAC/C,SAAyB,EACzB,MAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC9E,CAAC"}
@@ -1,70 +0,0 @@
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 { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBytesDecoder, getBytesEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, transformEncoder, } from '@solana/kit';
9
- import { getMemberConfigDecoder, getMemberConfigEncoder, } from '../types';
10
- export const VAULT_STATE_DISCRIMINATOR = new Uint8Array([
11
- 228, 196, 82, 165, 98, 210, 235, 152,
12
- ]);
13
- export function getVaultStateDiscriminatorBytes() {
14
- return fixEncoderSize(getBytesEncoder(), 8).encode(VAULT_STATE_DISCRIMINATOR);
15
- }
16
- export function getVaultStateEncoder() {
17
- return transformEncoder(getStructEncoder([
18
- ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
19
- ['version', getU32Encoder()],
20
- ['bump', getU8Encoder()],
21
- ['creator', getAddressEncoder()],
22
- ['authority', getAddressEncoder()],
23
- ['mint', getAddressEncoder()],
24
- ['members', getArrayEncoder(getMemberConfigEncoder())],
25
- ['nextMemberNonce', getU32Encoder()],
26
- ['accumulatedBalance', getU64Encoder()],
27
- ['createdAt', getI64Encoder()],
28
- ['updatedAt', getI64Encoder()],
29
- ]), (value) => ({ ...value, discriminator: VAULT_STATE_DISCRIMINATOR }));
30
- }
31
- export function getVaultStateDecoder() {
32
- return getStructDecoder([
33
- ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
34
- ['version', getU32Decoder()],
35
- ['bump', getU8Decoder()],
36
- ['creator', getAddressDecoder()],
37
- ['authority', getAddressDecoder()],
38
- ['mint', getAddressDecoder()],
39
- ['members', getArrayDecoder(getMemberConfigDecoder())],
40
- ['nextMemberNonce', getU32Decoder()],
41
- ['accumulatedBalance', getU64Decoder()],
42
- ['createdAt', getI64Decoder()],
43
- ['updatedAt', getI64Decoder()],
44
- ]);
45
- }
46
- export function getVaultStateCodec() {
47
- return combineCodec(getVaultStateEncoder(), getVaultStateDecoder());
48
- }
49
- export function decodeVaultState(encodedAccount) {
50
- return decodeAccount(encodedAccount, getVaultStateDecoder());
51
- }
52
- export async function fetchVaultState(rpc, address, config) {
53
- const maybeAccount = await fetchMaybeVaultState(rpc, address, config);
54
- assertAccountExists(maybeAccount);
55
- return maybeAccount;
56
- }
57
- export async function fetchMaybeVaultState(rpc, address, config) {
58
- const maybeAccount = await fetchEncodedAccount(rpc, address, config);
59
- return decodeVaultState(maybeAccount);
60
- }
61
- export async function fetchAllVaultState(rpc, addresses, config) {
62
- const maybeAccounts = await fetchAllMaybeVaultState(rpc, addresses, config);
63
- assertAccountsExist(maybeAccounts);
64
- return maybeAccounts;
65
- }
66
- export async function fetchAllMaybeVaultState(rpc, addresses, config) {
67
- const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
68
- return maybeAccounts.map((maybeAccount) => decodeVaultState(maybeAccount));
69
- }
70
- //# sourceMappingURL=vaultState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vaultState.js","sourceRoot":"","sources":["../../../../../src/generated/codama/accounts/vaultState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,GAYjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GAGvB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,y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CAAC,CAAC;IAC5E,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACnC,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,GAA+C,EAC/C,SAAyB,EACzB,MAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -1,30 +0,0 @@
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 { addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getUtf8Decoder, getUtf8Encoder, } from '@solana/kit';
9
- export function getContractTermsEncoder() {
10
- return getStructEncoder([
11
- ['rate', getU64Encoder()],
12
- ['durationMinSeconds', getU64Encoder()],
13
- ['durationMaxSeconds', getU64Encoder()],
14
- ['paymentsFreq', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
15
- ['cancelDelayMin', getU64Encoder()],
16
- ]);
17
- }
18
- export function getContractTermsDecoder() {
19
- return getStructDecoder([
20
- ['rate', getU64Decoder()],
21
- ['durationMinSeconds', getU64Decoder()],
22
- ['durationMaxSeconds', getU64Decoder()],
23
- ['paymentsFreq', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
24
- ['cancelDelayMin', getU64Decoder()],
25
- ]);
26
- }
27
- export function getContractTermsCodec() {
28
- return combineCodec(getContractTermsEncoder(), getContractTermsDecoder());
29
- }
30
- //# sourceMappingURL=contractTerms.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contractTerms.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/contractTerms.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,GAIf,MAAM,aAAa,CAAC;AAgCrB,MAAM,UAAU,uBAAuB;IACrC,OAAO,gBAAgB,CAAC;QACtB,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC;QACzB,CAAC,oBAAoB,EAAE,aAAa,EAAE,CAAC;QACvC,CAAC,oBAAoB,EAAE,aAAa,EAAE,CAAC;QACvC,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAc,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;QACzE,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,gBAAgB,CAAC;QACtB,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC;QACzB,CAAC,oBAAoB,EAAE,aAAa,EAAE,CAAC;QACvC,CAAC,oBAAoB,EAAE,aAAa,EAAE,CAAC;QACvC,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAc,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;QACzE,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB;IAInC,OAAO,YAAY,CAAC,uBAAuB,EAAE,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAC5E,CAAC"}
@@ -1,28 +0,0 @@
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 { combineCodec, getAddressDecoder, getAddressEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, } from '@solana/kit';
9
- export function getMemberConfigEncoder() {
10
- return getStructEncoder([
11
- ['nonce', getU32Encoder()],
12
- ['authority', getAddressEncoder()],
13
- ['percentageBps', getU32Encoder()],
14
- ['claimableBalance', getU64Encoder()],
15
- ]);
16
- }
17
- export function getMemberConfigDecoder() {
18
- return getStructDecoder([
19
- ['nonce', getU32Decoder()],
20
- ['authority', getAddressDecoder()],
21
- ['percentageBps', getU32Decoder()],
22
- ['claimableBalance', getU64Decoder()],
23
- ]);
24
- }
25
- export function getMemberConfigCodec() {
26
- return combineCodec(getMemberConfigEncoder(), getMemberConfigDecoder());
27
- }
28
- //# sourceMappingURL=memberConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memberConfig.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/memberConfig.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,GAKd,MAAM,aAAa,CAAC;AAyBrB,MAAM,UAAU,sBAAsB;IACpC,OAAO,gBAAgB,CAAC;QACtB,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;QAC1B,CAAC,WAAW,EAAE,iBAAiB,EAAE,CAAC;QAClC,CAAC,eAAe,EAAE,aAAa,EAAE,CAAC;QAClC,CAAC,kBAAkB,EAAE,aAAa,EAAE,CAAC;KACtC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,gBAAgB,CAAC;QACtB,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;QAC1B,CAAC,WAAW,EAAE,iBAAiB,EAAE,CAAC;QAClC,CAAC,eAAe,EAAE,aAAa,EAAE,CAAC;QAClC,CAAC,kBAAkB,EAAE,aAAa,EAAE,CAAC;KACtC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,oBAAoB;IAIlC,OAAO,YAAY,CAAC,sBAAsB,EAAE,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAC1E,CAAC"}
@@ -1,50 +0,0 @@
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 { combineCodec, getBooleanDecoder, getBooleanEncoder, getDiscriminatedUnionDecoder, getDiscriminatedUnionEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, } from '@solana/kit';
9
- export function getMemberTypeEncoder() {
10
- return getDiscriminatedUnionEncoder([
11
- ['Normal', getStructEncoder([['shareEnabled', getBooleanEncoder()]])],
12
- [
13
- 'Share',
14
- getStructEncoder([
15
- ['parentMemberNonce', getU32Encoder()],
16
- ['percentageBps', getU32Encoder()],
17
- ['claimableBalance', getU64Encoder()],
18
- ['isActive', getBooleanEncoder()],
19
- ]),
20
- ],
21
- ['Rebate', getStructEncoder([['claimableBalance', getU64Encoder()]])],
22
- ]);
23
- }
24
- export function getMemberTypeDecoder() {
25
- return getDiscriminatedUnionDecoder([
26
- ['Normal', getStructDecoder([['shareEnabled', getBooleanDecoder()]])],
27
- [
28
- 'Share',
29
- getStructDecoder([
30
- ['parentMemberNonce', getU32Decoder()],
31
- ['percentageBps', getU32Decoder()],
32
- ['claimableBalance', getU64Decoder()],
33
- ['isActive', getBooleanDecoder()],
34
- ]),
35
- ],
36
- ['Rebate', getStructDecoder([['claimableBalance', getU64Decoder()]])],
37
- ]);
38
- }
39
- export function getMemberTypeCodec() {
40
- return combineCodec(getMemberTypeEncoder(), getMemberTypeDecoder());
41
- }
42
- export function memberType(kind, data) {
43
- return Array.isArray(data)
44
- ? { __kind: kind, fields: data }
45
- : { __kind: kind, ...(data ?? {}) };
46
- }
47
- export function isMemberType(kind, value) {
48
- return value.__kind === kind;
49
- }
50
- //# sourceMappingURL=memberType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memberType.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/memberType.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,GAMd,MAAM,aAAa,CAAC;AAiDrB,MAAM,UAAU,oBAAoB;IAClC,OAAO,4BAA4B,CAAC;QAClC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,cAAc,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE;YACE,OAAO;YACP,gBAAgB,CAAC;gBACf,CAAC,mBAAmB,EAAE,aAAa,EAAE,CAAC;gBACtC,CAAC,eAAe,EAAE,aAAa,EAAE,CAAC;gBAClC,CAAC,kBAAkB,EAAE,aAAa,EAAE,CAAC;gBACrC,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;aAClC,CAAC;SACH;QACD,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;KACtE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,4BAA4B,CAAC;QAClC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,cAAc,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE;YACE,OAAO;YACP,gBAAgB,CAAC;gBACf,CAAC,mBAAmB,EAAE,aAAa,EAAE,CAAC;gBACtC,CAAC,eAAe,EAAE,aAAa,EAAE,CAAC;gBAClC,CAAC,kBAAkB,EAAE,aAAa,EAAE,CAAC;gBACrC,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;aAClC,CAAC;SACH;QACD,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;KACtE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,YAAY,CAAC,oBAAoB,EAAE,EAAE,oBAAoB,EAAE,CAAC,CAAC;AACtE,CAAC;AAeD,MAAM,UAAU,UAAU,CACxB,IAAO,EACP,IAAW;IAEX,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACxB,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QAChC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,IAAO,EACP,KAAiB;IAEjB,OAAO,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;AAC/B,CAAC"}
@@ -1,28 +0,0 @@
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 { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, } from "@solana/kit";
9
- export function getRebateAuthorizationEncoder() {
10
- return getStructEncoder([
11
- ["memberNonce", getU32Encoder()],
12
- ["rebateBps", getU16Encoder()],
13
- ["expirySlot", getU64Encoder()],
14
- ["signature", fixEncoderSize(getBytesEncoder(), 64)],
15
- ]);
16
- }
17
- export function getRebateAuthorizationDecoder() {
18
- return getStructDecoder([
19
- ["memberNonce", getU32Decoder()],
20
- ["rebateBps", getU16Decoder()],
21
- ["expirySlot", getU64Decoder()],
22
- ["signature", fixDecoderSize(getBytesDecoder(), 64)],
23
- ]);
24
- }
25
- export function getRebateAuthorizationCodec() {
26
- return combineCodec(getRebateAuthorizationEncoder(), getRebateAuthorizationDecoder());
27
- }
28
- //# sourceMappingURL=rebateAuthorization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rebateAuthorization.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/rebateAuthorization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,GAKd,MAAM,aAAa,CAAC;AA4BrB,MAAM,UAAU,6BAA6B;IAC3C,OAAO,gBAAgB,CAAC;QACtB,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC;QAChC,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;QAC9B,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC;QAC/B,CAAC,WAAW,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;KACrD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,gBAAgB,CAAC;QACtB,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC;QAChC,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;QAC9B,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC;QAC/B,CAAC,WAAW,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;KACrD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,2BAA2B;IAIzC,OAAO,YAAY,CACjB,6BAA6B,EAAE,EAC/B,6BAA6B,EAAE,CAChC,CAAC;AACJ,CAAC"}
@@ -1,27 +0,0 @@
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 { combineCodec, getAddressDecoder, getAddressEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, } from '@solana/kit';
9
- import { getContractTermsDecoder, getContractTermsEncoder, } from '.';
10
- export function getReservationEncoder() {
11
- return getStructEncoder([
12
- ['holder', getAddressEncoder()],
13
- ['expiresAt', getI64Encoder()],
14
- ['lockedTerms', getContractTermsEncoder()],
15
- ]);
16
- }
17
- export function getReservationDecoder() {
18
- return getStructDecoder([
19
- ['holder', getAddressDecoder()],
20
- ['expiresAt', getI64Decoder()],
21
- ['lockedTerms', getContractTermsDecoder()],
22
- ]);
23
- }
24
- export function getReservationCodec() {
25
- return combineCodec(getReservationEncoder(), getReservationDecoder());
26
- }
27
- //# sourceMappingURL=reservation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reservation.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/reservation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GAKjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GAGxB,MAAM,GAAG,CAAC;AAwBX,MAAM,UAAU,qBAAqB;IACnC,OAAO,gBAAgB,CAAC;QACtB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;QAC/B,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;QAC9B,CAAC,aAAa,EAAE,uBAAuB,EAAE,CAAC;KAC3C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,gBAAgB,CAAC;QACtB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;QAC/B,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;QAC9B,CAAC,aAAa,EAAE,uBAAuB,EAAE,CAAC;KAC3C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,YAAY,CAAC,qBAAqB,EAAE,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACxE,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * @purpose Approve and activate a referral
3
- *
4
- * Re-exports slyvault's approveReferral instruction for SRSLY context.
5
- */
6
- export { approveReferral, } from '@wuwei-labs/slyvault';
7
- //# sourceMappingURL=approveReferral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"approveReferral.js","sourceRoot":"","sources":["../../../src/instructions/approveReferral.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,GAEhB,MAAM,sBAAsB,CAAC"}
@@ -1,51 +0,0 @@
1
- /**
2
- * @purpose Create a pending referral (Share member) for SRSLY vault
3
- *
4
- * Wraps slyvault's initMember instruction with Share type pre-configured.
5
- * Uses "referral" terminology for SRSLY context.
6
- */
7
- import { initMember, } from '@wuwei-labs/slyvault';
8
- /**
9
- * Create a pending referral (Share member)
10
- *
11
- * Creates a new Share member state that references a parent Normal member.
12
- * The referral must be approved by the parent member's authority using approveReferral.
13
- *
14
- * @param params - Referral creation parameters
15
- * @returns Prepared instruction(s)
16
- *
17
- * @example
18
- * ```typescript
19
- * import { createReferral } from '@wuwei-labs/srsly';
20
- *
21
- * // Create referral referencing parent member at nonce 0
22
- * const ix = await createReferral({
23
- * member: wallet,
24
- * vault: vaultAddress,
25
- * parentMemberNonce: 0
26
- * });
27
- * ```
28
- */
29
- export async function createReferral(params) {
30
- if (!params.member)
31
- throw new Error('member is required');
32
- if (!params.vault)
33
- throw new Error('vault is required');
34
- if (params.parentMemberNonce === undefined)
35
- throw new Error('parentMemberNonce is required');
36
- // Call slyvault initMember with Share type pre-configured
37
- return initMember({
38
- member: params.member,
39
- vault: params.vault,
40
- nonce: params.nonce,
41
- memberType: {
42
- __kind: 'Share',
43
- parentMemberNonce: params.parentMemberNonce,
44
- percentageBps: 0,
45
- claimableBalance: 0n,
46
- isActive: false,
47
- },
48
- computeUnits: params.computeUnits,
49
- });
50
- }
51
- //# sourceMappingURL=createReferral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createReferral.js","sourceRoot":"","sources":["../../../src/instructions/createReferral.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,UAAU,GAEX,MAAM,sBAAsB,CAAC;AAmC9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA4B;IAE5B,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxD,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE7F,0DAA0D;IAC1D,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE;YACV,MAAM,EAAE,OAAO;YACf,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,aAAa,EAAE,CAAC;YAChB,gBAAgB,EAAE,EAAE;YACpB,QAAQ,EAAE,KAAK;SAChB;QACD,YAAY,EAAE,MAAM,CAAC,YAAY;KAClC,CAAC,CAAC;AACL,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * @purpose Remove a referral and close account
3
- *
4
- * Re-exports slyvault's removeReferral instruction for SRSLY context.
5
- */
6
- export { removeReferral, } from '@wuwei-labs/slyvault';
7
- //# sourceMappingURL=removeReferral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"removeReferral.js","sourceRoot":"","sources":["../../../src/instructions/removeReferral.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,GAEf,MAAM,sBAAsB,CAAC"}
@@ -1,58 +0,0 @@
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 Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
9
- import { type MemberType, type MemberTypeArgs } from '../types';
10
- export declare const MEMBER_STATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
11
- export declare function getMemberStateDiscriminatorBytes(): ReadonlyUint8Array;
12
- export type MemberState = {
13
- discriminator: ReadonlyUint8Array;
14
- /** Account version for migrations */
15
- version: number;
16
- /** PDA bump */
17
- bump: number;
18
- /** Vault this member belongs to */
19
- vault: Address;
20
- /** Authority who controls this member slot (can transfer) */
21
- authority: Address;
22
- /** Member's nonce in the vault */
23
- nonce: number;
24
- /** Member type (Normal or Share) */
25
- memberType: MemberType;
26
- /** When member state was created */
27
- createdAt: bigint;
28
- /** When member state was last updated */
29
- updatedAt: bigint;
30
- };
31
- export type MemberStateArgs = {
32
- /** Account version for migrations */
33
- version: number;
34
- /** PDA bump */
35
- bump: number;
36
- /** Vault this member belongs to */
37
- vault: Address;
38
- /** Authority who controls this member slot (can transfer) */
39
- authority: Address;
40
- /** Member's nonce in the vault */
41
- nonce: number;
42
- /** Member type (Normal or Share) */
43
- memberType: MemberTypeArgs;
44
- /** When member state was created */
45
- createdAt: number | bigint;
46
- /** When member state was last updated */
47
- updatedAt: number | bigint;
48
- };
49
- export declare function getMemberStateEncoder(): Encoder<MemberStateArgs>;
50
- export declare function getMemberStateDecoder(): Decoder<MemberState>;
51
- export declare function getMemberStateCodec(): Codec<MemberStateArgs, MemberState>;
52
- export declare function decodeMemberState<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<MemberState, TAddress>;
53
- export declare function decodeMemberState<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<MemberState, TAddress>;
54
- export declare function fetchMemberState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<MemberState, TAddress>>;
55
- export declare function fetchMaybeMemberState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<MemberState, TAddress>>;
56
- export declare function fetchAllMemberState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<MemberState>[]>;
57
- export declare function fetchAllMaybeMemberState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<MemberState>[]>;
58
- //# sourceMappingURL=memberState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memberState.d.ts","sourceRoot":"","sources":["../../../../../src/generated/codama/accounts/memberState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,mBAAmB,EACnB,oBAAoB,EAgBpB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,0BAA0B,yBAErC,CAAC;AAEH,wBAAgB,gCAAgC,uBA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erun Codama to update it.
5
- *
6
- * @see https://github.com/codama-idl/codama
7
- */
8
- import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
9
- import { type MemberConfig, type MemberConfigArgs } from '../types';
10
- export declare const VAULT_STATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
11
- export declare function getVaultStateDiscriminatorBytes(): ReadonlyUint8Array;
12
- export type VaultState = {
13
- discriminator: ReadonlyUint8Array;
14
- /** Account version for migrations */
15
- version: number;
16
- /** PDA bump */
17
- bump: number;
18
- /** Vault creator (immutable, used in PDA seeds) */
19
- creator: Address;
20
- /** Vault authority (can update config) */
21
- authority: Address;
22
- /** Token mint for distributions */
23
- mint: Address;
24
- /** Current member configurations */
25
- members: Array<MemberConfig>;
26
- /** Next member nonce to assign */
27
- nextMemberNonce: number;
28
- /** Accumulated balance in vault */
29
- accumulatedBalance: bigint;
30
- /** When vault was created */
31
- createdAt: bigint;
32
- /** When config was last updated */
33
- updatedAt: bigint;
34
- };
35
- export type VaultStateArgs = {
36
- /** Account version for migrations */
37
- version: number;
38
- /** PDA bump */
39
- bump: number;
40
- /** Vault creator (immutable, used in PDA seeds) */
41
- creator: Address;
42
- /** Vault authority (can update config) */
43
- authority: Address;
44
- /** Token mint for distributions */
45
- mint: Address;
46
- /** Current member configurations */
47
- members: Array<MemberConfigArgs>;
48
- /** Next member nonce to assign */
49
- nextMemberNonce: number;
50
- /** Accumulated balance in vault */
51
- accumulatedBalance: number | bigint;
52
- /** When vault was created */
53
- createdAt: number | bigint;
54
- /** When config was last updated */
55
- updatedAt: number | bigint;
56
- };
57
- export declare function getVaultStateEncoder(): Encoder<VaultStateArgs>;
58
- export declare function getVaultStateDecoder(): Decoder<VaultState>;
59
- export declare function getVaultStateCodec(): Codec<VaultStateArgs, VaultState>;
60
- export declare function decodeVaultState<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<VaultState, TAddress>;
61
- export declare function decodeVaultState<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<VaultState, TAddress>;
62
- export declare function fetchVaultState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<VaultState, TAddress>>;
63
- export declare function fetchMaybeVaultState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<VaultState, TAddress>>;
64
- export declare function fetchAllVaultState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<VaultState>[]>;
65
- export declare function fetchAllMaybeVaultState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<VaultState>[]>;
66
- //# sourceMappingURL=vaultState.d.ts.map