@wuwei-labs/srsly 2.0.0-beta.15 → 2.0.0-beta.16

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 (196) hide show
  1. package/README.md +115 -937
  2. package/dist/cjs/codama/accounts/config.js +88 -0
  3. package/dist/cjs/codama/accounts/config.js.map +1 -0
  4. package/dist/cjs/codama/accounts/contractState.js +87 -0
  5. package/dist/cjs/codama/accounts/contractState.js.map +1 -0
  6. package/dist/cjs/codama/accounts/fleet.js +77 -0
  7. package/dist/cjs/codama/accounts/fleet.js.map +1 -0
  8. package/dist/cjs/codama/accounts/index.js +29 -0
  9. package/dist/cjs/codama/accounts/index.js.map +1 -0
  10. package/dist/cjs/codama/accounts/rentalState.js +87 -0
  11. package/dist/cjs/codama/accounts/rentalState.js.map +1 -0
  12. package/dist/cjs/codama/accounts/thread.js +89 -0
  13. package/dist/cjs/codama/accounts/thread.js.map +1 -0
  14. package/dist/cjs/codama/errors/index.js +25 -0
  15. package/dist/cjs/codama/errors/index.js.map +1 -0
  16. package/dist/cjs/codama/errors/srsly.js +86 -0
  17. package/dist/cjs/codama/errors/srsly.js.map +1 -0
  18. package/dist/cjs/codama/index.js +29 -0
  19. package/dist/cjs/codama/index.js.map +1 -0
  20. package/dist/cjs/codama/instructions/acceptRental.js +354 -0
  21. package/dist/cjs/codama/instructions/acceptRental.js.map +1 -0
  22. package/dist/cjs/codama/instructions/cancelRental.js +202 -0
  23. package/dist/cjs/codama/instructions/cancelRental.js.map +1 -0
  24. package/dist/cjs/codama/instructions/closeContract.js +211 -0
  25. package/dist/cjs/codama/instructions/closeContract.js.map +1 -0
  26. package/dist/cjs/codama/instructions/closeRental.js +233 -0
  27. package/dist/cjs/codama/instructions/closeRental.js.map +1 -0
  28. package/dist/cjs/codama/instructions/createContract.js +258 -0
  29. package/dist/cjs/codama/instructions/createContract.js.map +1 -0
  30. package/dist/cjs/codama/instructions/index.js +33 -0
  31. package/dist/cjs/codama/instructions/index.js.map +1 -0
  32. package/dist/cjs/codama/instructions/initializeConfig.js +131 -0
  33. package/dist/cjs/codama/instructions/initializeConfig.js.map +1 -0
  34. package/dist/cjs/codama/instructions/payRental.js +245 -0
  35. package/dist/cjs/codama/instructions/payRental.js.map +1 -0
  36. package/dist/cjs/codama/instructions/resetRental.js +146 -0
  37. package/dist/cjs/codama/instructions/resetRental.js.map +1 -0
  38. package/dist/cjs/codama/instructions/updateConfig.js +145 -0
  39. package/dist/cjs/codama/instructions/updateConfig.js.map +1 -0
  40. package/dist/cjs/codama/programs/index.js +25 -0
  41. package/dist/cjs/codama/programs/index.js.map +1 -0
  42. package/dist/cjs/codama/programs/srsly.js +85 -0
  43. package/dist/cjs/codama/programs/srsly.js.map +1 -0
  44. package/dist/cjs/codama/shared/index.js +95 -0
  45. package/dist/cjs/codama/shared/index.js.map +1 -0
  46. package/dist/cjs/codama/types/clockData.js +31 -0
  47. package/dist/cjs/codama/types/clockData.js.map +1 -0
  48. package/dist/cjs/codama/types/equality.js +30 -0
  49. package/dist/cjs/codama/types/equality.js.map +1 -0
  50. package/dist/cjs/codama/types/execContext.js +38 -0
  51. package/dist/cjs/codama/types/execContext.js.map +1 -0
  52. package/dist/cjs/codama/types/index.js +33 -0
  53. package/dist/cjs/codama/types/index.js.map +1 -0
  54. package/dist/cjs/codama/types/paymentFrequency.js +34 -0
  55. package/dist/cjs/codama/types/paymentFrequency.js.map +1 -0
  56. package/dist/cjs/codama/types/serializableAccount.js +31 -0
  57. package/dist/cjs/codama/types/serializableAccount.js.map +1 -0
  58. package/dist/cjs/codama/types/serializableInstruction.js +32 -0
  59. package/dist/cjs/codama/types/serializableInstruction.js.map +1 -0
  60. package/dist/cjs/codama/types/threadResponse.js +38 -0
  61. package/dist/cjs/codama/types/threadResponse.js.map +1 -0
  62. package/dist/cjs/codama/types/trigger.js +90 -0
  63. package/dist/cjs/codama/types/trigger.js.map +1 -0
  64. package/dist/cjs/codama/types/triggerContext.js +49 -0
  65. package/dist/cjs/codama/types/triggerContext.js.map +1 -0
  66. package/dist/cjs/package.json +1 -1
  67. package/dist/esm/codama/accounts/config.js +76 -0
  68. package/dist/esm/codama/accounts/config.js.map +1 -0
  69. package/dist/esm/codama/accounts/contractState.js +75 -0
  70. package/dist/esm/codama/accounts/contractState.js.map +1 -0
  71. package/dist/esm/codama/accounts/fleet.js +64 -0
  72. package/dist/esm/codama/accounts/fleet.js.map +1 -0
  73. package/dist/esm/codama/accounts/index.js +13 -0
  74. package/dist/esm/codama/accounts/index.js.map +1 -0
  75. package/dist/esm/codama/accounts/rentalState.js +74 -0
  76. package/dist/esm/codama/accounts/rentalState.js.map +1 -0
  77. package/dist/esm/codama/accounts/thread.js +77 -0
  78. package/dist/esm/codama/accounts/thread.js.map +1 -0
  79. package/dist/esm/codama/errors/index.js +9 -0
  80. package/dist/esm/codama/errors/index.js.map +1 -0
  81. package/dist/esm/codama/errors/srsly.js +81 -0
  82. package/dist/esm/codama/errors/srsly.js.map +1 -0
  83. package/dist/esm/codama/index.js +13 -0
  84. package/dist/esm/codama/index.js.map +1 -0
  85. package/dist/esm/codama/instructions/acceptRental.js +344 -0
  86. package/dist/esm/codama/instructions/acceptRental.js.map +1 -0
  87. package/dist/esm/codama/instructions/cancelRental.js +192 -0
  88. package/dist/esm/codama/instructions/cancelRental.js.map +1 -0
  89. package/dist/esm/codama/instructions/closeContract.js +201 -0
  90. package/dist/esm/codama/instructions/closeContract.js.map +1 -0
  91. package/dist/esm/codama/instructions/closeRental.js +223 -0
  92. package/dist/esm/codama/instructions/closeRental.js.map +1 -0
  93. package/dist/esm/codama/instructions/createContract.js +248 -0
  94. package/dist/esm/codama/instructions/createContract.js.map +1 -0
  95. package/dist/esm/codama/instructions/index.js +17 -0
  96. package/dist/esm/codama/instructions/index.js.map +1 -0
  97. package/dist/esm/codama/instructions/initializeConfig.js +121 -0
  98. package/dist/esm/codama/instructions/initializeConfig.js.map +1 -0
  99. package/dist/esm/codama/instructions/payRental.js +235 -0
  100. package/dist/esm/codama/instructions/payRental.js.map +1 -0
  101. package/dist/esm/codama/instructions/resetRental.js +136 -0
  102. package/dist/esm/codama/instructions/resetRental.js.map +1 -0
  103. package/dist/esm/codama/instructions/updateConfig.js +135 -0
  104. package/dist/esm/codama/instructions/updateConfig.js.map +1 -0
  105. package/dist/esm/codama/programs/index.js +9 -0
  106. package/dist/esm/codama/programs/index.js.map +1 -0
  107. package/dist/esm/codama/programs/srsly.js +80 -0
  108. package/dist/esm/codama/programs/srsly.js.map +1 -0
  109. package/dist/esm/codama/shared/index.js +87 -0
  110. package/dist/esm/codama/shared/index.js.map +1 -0
  111. package/dist/esm/codama/types/clockData.js +26 -0
  112. package/dist/esm/codama/types/clockData.js.map +1 -0
  113. package/dist/esm/codama/types/equality.js +24 -0
  114. package/dist/esm/codama/types/equality.js.map +1 -0
  115. package/dist/esm/codama/types/execContext.js +33 -0
  116. package/dist/esm/codama/types/execContext.js.map +1 -0
  117. package/dist/esm/codama/types/index.js +17 -0
  118. package/dist/esm/codama/types/index.js.map +1 -0
  119. package/dist/esm/codama/types/paymentFrequency.js +28 -0
  120. package/dist/esm/codama/types/paymentFrequency.js.map +1 -0
  121. package/dist/esm/codama/types/serializableAccount.js +26 -0
  122. package/dist/esm/codama/types/serializableAccount.js.map +1 -0
  123. package/dist/esm/codama/types/serializableInstruction.js +27 -0
  124. package/dist/esm/codama/types/serializableInstruction.js.map +1 -0
  125. package/dist/esm/codama/types/threadResponse.js +33 -0
  126. package/dist/esm/codama/types/threadResponse.js.map +1 -0
  127. package/dist/esm/codama/types/trigger.js +83 -0
  128. package/dist/esm/codama/types/trigger.js.map +1 -0
  129. package/dist/esm/codama/types/triggerContext.js +42 -0
  130. package/dist/esm/codama/types/triggerContext.js.map +1 -0
  131. package/dist/esm/package.json +1 -1
  132. package/dist/types/codama/accounts/config.d.ts +52 -0
  133. package/dist/types/codama/accounts/config.d.ts.map +1 -0
  134. package/dist/types/codama/accounts/contractState.d.ts +51 -0
  135. package/dist/types/codama/accounts/contractState.d.ts.map +1 -0
  136. package/dist/types/codama/accounts/fleet.d.ts +38 -0
  137. package/dist/types/codama/accounts/fleet.d.ts.map +1 -0
  138. package/dist/types/codama/accounts/index.d.ts +13 -0
  139. package/dist/types/codama/accounts/index.d.ts.map +1 -0
  140. package/dist/types/codama/accounts/rentalState.d.ts +48 -0
  141. package/dist/types/codama/accounts/rentalState.d.ts.map +1 -0
  142. package/dist/types/codama/accounts/thread.d.ts +74 -0
  143. package/dist/types/codama/accounts/thread.d.ts.map +1 -0
  144. package/dist/types/codama/errors/index.d.ts +9 -0
  145. package/dist/types/codama/errors/index.d.ts.map +1 -0
  146. package/dist/types/codama/errors/srsly.d.ts +58 -0
  147. package/dist/types/codama/errors/srsly.d.ts.map +1 -0
  148. package/dist/types/codama/index.d.ts +13 -0
  149. package/dist/types/codama/index.d.ts.map +1 -0
  150. package/dist/types/codama/instructions/acceptRental.d.ts +135 -0
  151. package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -0
  152. package/dist/types/codama/instructions/cancelRental.d.ts +75 -0
  153. package/dist/types/codama/instructions/cancelRental.d.ts.map +1 -0
  154. package/dist/types/codama/instructions/closeContract.d.ts +104 -0
  155. package/dist/types/codama/instructions/closeContract.d.ts.map +1 -0
  156. package/dist/types/codama/instructions/closeRental.d.ts +87 -0
  157. package/dist/types/codama/instructions/closeRental.d.ts.map +1 -0
  158. package/dist/types/codama/instructions/createContract.d.ts +112 -0
  159. package/dist/types/codama/instructions/createContract.d.ts.map +1 -0
  160. package/dist/types/codama/instructions/index.d.ts +17 -0
  161. package/dist/types/codama/instructions/index.d.ts.map +1 -0
  162. package/dist/types/codama/instructions/initializeConfig.d.ts +60 -0
  163. package/dist/types/codama/instructions/initializeConfig.d.ts.map +1 -0
  164. package/dist/types/codama/instructions/payRental.d.ts +114 -0
  165. package/dist/types/codama/instructions/payRental.d.ts.map +1 -0
  166. package/dist/types/codama/instructions/resetRental.d.ts +71 -0
  167. package/dist/types/codama/instructions/resetRental.d.ts.map +1 -0
  168. package/dist/types/codama/instructions/updateConfig.d.ts +93 -0
  169. package/dist/types/codama/instructions/updateConfig.d.ts.map +1 -0
  170. package/dist/types/codama/programs/index.d.ts +9 -0
  171. package/dist/types/codama/programs/index.d.ts.map +1 -0
  172. package/dist/types/codama/programs/srsly.d.ts +54 -0
  173. package/dist/types/codama/programs/srsly.d.ts.map +1 -0
  174. package/dist/types/codama/shared/index.d.ts +50 -0
  175. package/dist/types/codama/shared/index.d.ts.map +1 -0
  176. package/dist/types/codama/types/clockData.d.ts +29 -0
  177. package/dist/types/codama/types/clockData.d.ts.map +1 -0
  178. package/dist/types/codama/types/equality.d.ts +18 -0
  179. package/dist/types/codama/types/equality.d.ts.map +1 -0
  180. package/dist/types/codama/types/execContext.d.ts +48 -0
  181. package/dist/types/codama/types/execContext.d.ts.map +1 -0
  182. package/dist/types/codama/types/index.d.ts +17 -0
  183. package/dist/types/codama/types/index.d.ts.map +1 -0
  184. package/dist/types/codama/types/paymentFrequency.d.ts +22 -0
  185. package/dist/types/codama/types/paymentFrequency.d.ts.map +1 -0
  186. package/dist/types/codama/types/serializableAccount.d.ts +22 -0
  187. package/dist/types/codama/types/serializableAccount.d.ts.map +1 -0
  188. package/dist/types/codama/types/serializableInstruction.d.ts +30 -0
  189. package/dist/types/codama/types/serializableInstruction.d.ts.map +1 -0
  190. package/dist/types/codama/types/threadResponse.d.ts +42 -0
  191. package/dist/types/codama/types/threadResponse.d.ts.map +1 -0
  192. package/dist/types/codama/types/trigger.d.ts +98 -0
  193. package/dist/types/codama/types/trigger.d.ts.map +1 -0
  194. package/dist/types/codama/types/triggerContext.d.ts +75 -0
  195. package/dist/types/codama/types/triggerContext.d.ts.map +1 -0
  196. package/package.json +13 -3
@@ -0,0 +1,344 @@
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, getAddressEncoder, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, transformEncoder, } from '@solana/kit';
9
+ import { SRSLY_PROGRAM_ADDRESS } from '../programs';
10
+ import { expectAddress, getAccountMetaFactory, } from '../shared';
11
+ export const ACCEPT_RENTAL_DISCRIMINATOR = new Uint8Array([
12
+ 192, 221, 241, 212, 141, 161, 36, 146,
13
+ ]);
14
+ export function getAcceptRentalDiscriminatorBytes() {
15
+ return fixEncoderSize(getBytesEncoder(), 8).encode(ACCEPT_RENTAL_DISCRIMINATOR);
16
+ }
17
+ export function getAcceptRentalInstructionDataEncoder() {
18
+ return transformEncoder(getStructEncoder([
19
+ ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
20
+ ['amount', getU64Encoder()],
21
+ ['duration', getU64Encoder()],
22
+ ]), (value) => ({ ...value, discriminator: ACCEPT_RENTAL_DISCRIMINATOR }));
23
+ }
24
+ export function getAcceptRentalInstructionDataDecoder() {
25
+ return getStructDecoder([
26
+ ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
27
+ ['amount', getU64Decoder()],
28
+ ['duration', getU64Decoder()],
29
+ ]);
30
+ }
31
+ export function getAcceptRentalInstructionDataCodec() {
32
+ return combineCodec(getAcceptRentalInstructionDataEncoder(), getAcceptRentalInstructionDataDecoder());
33
+ }
34
+ export async function getAcceptRentalInstructionAsync(input, config) {
35
+ // Program address.
36
+ const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
37
+ // Original accounts.
38
+ const originalAccounts = {
39
+ mint: { value: input.mint ?? null, isWritable: false },
40
+ borrower: { value: input.borrower ?? null, isWritable: true },
41
+ borrowerProfile: {
42
+ value: input.borrowerProfile ?? null,
43
+ isWritable: false,
44
+ },
45
+ borrowerProfileFaction: {
46
+ value: input.borrowerProfileFaction ?? null,
47
+ isWritable: false,
48
+ },
49
+ borrowerTokenAccount: {
50
+ value: input.borrowerTokenAccount ?? null,
51
+ isWritable: true,
52
+ },
53
+ fleet: { value: input.fleet ?? null, isWritable: true },
54
+ gameId: { value: input.gameId ?? null, isWritable: false },
55
+ starbase: { value: input.starbase ?? null, isWritable: false },
56
+ starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true },
57
+ contract: { value: input.contract ?? null, isWritable: true },
58
+ rentalState: { value: input.rentalState ?? null, isWritable: true },
59
+ rentalAuthority: {
60
+ value: input.rentalAuthority ?? null,
61
+ isWritable: false,
62
+ },
63
+ rentalTokenAccount: {
64
+ value: input.rentalTokenAccount ?? null,
65
+ isWritable: true,
66
+ },
67
+ rentalThread: { value: input.rentalThread ?? null, isWritable: true },
68
+ referralTokenAccount: {
69
+ value: input.referralTokenAccount ?? null,
70
+ isWritable: false,
71
+ },
72
+ config: { value: input.config ?? null, isWritable: false },
73
+ sageProgram: { value: input.sageProgram ?? null, isWritable: false },
74
+ antegenProgram: { value: input.antegenProgram ?? null, isWritable: false },
75
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
76
+ associatedTokenProgram: {
77
+ value: input.associatedTokenProgram ?? null,
78
+ isWritable: false,
79
+ },
80
+ systemProgram: { value: input.systemProgram ?? null, isWritable: false },
81
+ };
82
+ const accounts = originalAccounts;
83
+ // Original args.
84
+ const args = { ...input };
85
+ // Resolve default values.
86
+ if (!accounts.borrowerTokenAccount.value) {
87
+ accounts.borrowerTokenAccount.value = await getProgramDerivedAddress({
88
+ programAddress: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
89
+ seeds: [
90
+ getAddressEncoder().encode(expectAddress(accounts.borrower.value)),
91
+ getBytesEncoder().encode(new Uint8Array([
92
+ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,
93
+ 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,
94
+ 126, 255, 0, 169,
95
+ ])),
96
+ getAddressEncoder().encode(expectAddress(accounts.mint.value)),
97
+ ],
98
+ });
99
+ }
100
+ if (!accounts.rentalState.value) {
101
+ accounts.rentalState.value = await getProgramDerivedAddress({
102
+ programAddress,
103
+ seeds: [
104
+ getBytesEncoder().encode(new Uint8Array([
105
+ 114, 101, 110, 116, 97, 108, 95, 115, 116, 97, 116, 101,
106
+ ])),
107
+ getAddressEncoder().encode(expectAddress(accounts.contract.value)),
108
+ getAddressEncoder().encode(expectAddress(accounts.borrower.value)),
109
+ ],
110
+ });
111
+ }
112
+ if (!accounts.rentalAuthority.value) {
113
+ accounts.rentalAuthority.value = await getProgramDerivedAddress({
114
+ programAddress,
115
+ seeds: [
116
+ getBytesEncoder().encode(new Uint8Array([
117
+ 114, 101, 110, 116, 97, 108, 95, 97, 117, 116, 104, 111, 114, 105,
118
+ 116, 121,
119
+ ])),
120
+ ],
121
+ });
122
+ }
123
+ if (!accounts.rentalTokenAccount.value) {
124
+ accounts.rentalTokenAccount.value = await getProgramDerivedAddress({
125
+ programAddress: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
126
+ seeds: [
127
+ getAddressEncoder().encode(expectAddress(accounts.rentalState.value)),
128
+ getBytesEncoder().encode(new Uint8Array([
129
+ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,
130
+ 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,
131
+ 126, 255, 0, 169,
132
+ ])),
133
+ getAddressEncoder().encode(expectAddress(accounts.mint.value)),
134
+ ],
135
+ });
136
+ }
137
+ if (!accounts.rentalThread.value) {
138
+ accounts.rentalThread.value = await getProgramDerivedAddress({
139
+ programAddress,
140
+ seeds: [
141
+ getBytesEncoder().encode(new Uint8Array([116, 104, 114, 101, 97, 100])),
142
+ getAddressEncoder().encode(expectAddress(accounts.rentalAuthority.value)),
143
+ getAddressEncoder().encode(expectAddress(accounts.rentalState.value)),
144
+ ],
145
+ });
146
+ }
147
+ if (!accounts.config.value) {
148
+ accounts.config.value = await getProgramDerivedAddress({
149
+ programAddress,
150
+ seeds: [
151
+ getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103])),
152
+ ],
153
+ });
154
+ }
155
+ if (!accounts.antegenProgram.value) {
156
+ accounts.antegenProgram.value =
157
+ 'AgThdyi1P5RkVeZD2rQahTvs8HePJoGFFxKtvok5s2J1';
158
+ }
159
+ if (!accounts.tokenProgram.value) {
160
+ accounts.tokenProgram.value =
161
+ 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
162
+ }
163
+ if (!accounts.associatedTokenProgram.value) {
164
+ accounts.associatedTokenProgram.value =
165
+ 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
166
+ }
167
+ if (!accounts.systemProgram.value) {
168
+ accounts.systemProgram.value =
169
+ '11111111111111111111111111111111';
170
+ }
171
+ const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
172
+ const instruction = {
173
+ accounts: [
174
+ getAccountMeta(accounts.mint),
175
+ getAccountMeta(accounts.borrower),
176
+ getAccountMeta(accounts.borrowerProfile),
177
+ getAccountMeta(accounts.borrowerProfileFaction),
178
+ getAccountMeta(accounts.borrowerTokenAccount),
179
+ getAccountMeta(accounts.fleet),
180
+ getAccountMeta(accounts.gameId),
181
+ getAccountMeta(accounts.starbase),
182
+ getAccountMeta(accounts.starbasePlayer),
183
+ getAccountMeta(accounts.contract),
184
+ getAccountMeta(accounts.rentalState),
185
+ getAccountMeta(accounts.rentalAuthority),
186
+ getAccountMeta(accounts.rentalTokenAccount),
187
+ getAccountMeta(accounts.rentalThread),
188
+ getAccountMeta(accounts.referralTokenAccount),
189
+ getAccountMeta(accounts.config),
190
+ getAccountMeta(accounts.sageProgram),
191
+ getAccountMeta(accounts.antegenProgram),
192
+ getAccountMeta(accounts.tokenProgram),
193
+ getAccountMeta(accounts.associatedTokenProgram),
194
+ getAccountMeta(accounts.systemProgram),
195
+ ],
196
+ programAddress,
197
+ data: getAcceptRentalInstructionDataEncoder().encode(args),
198
+ };
199
+ return instruction;
200
+ }
201
+ export function getAcceptRentalInstruction(input, config) {
202
+ // Program address.
203
+ const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
204
+ // Original accounts.
205
+ const originalAccounts = {
206
+ mint: { value: input.mint ?? null, isWritable: false },
207
+ borrower: { value: input.borrower ?? null, isWritable: true },
208
+ borrowerProfile: {
209
+ value: input.borrowerProfile ?? null,
210
+ isWritable: false,
211
+ },
212
+ borrowerProfileFaction: {
213
+ value: input.borrowerProfileFaction ?? null,
214
+ isWritable: false,
215
+ },
216
+ borrowerTokenAccount: {
217
+ value: input.borrowerTokenAccount ?? null,
218
+ isWritable: true,
219
+ },
220
+ fleet: { value: input.fleet ?? null, isWritable: true },
221
+ gameId: { value: input.gameId ?? null, isWritable: false },
222
+ starbase: { value: input.starbase ?? null, isWritable: false },
223
+ starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true },
224
+ contract: { value: input.contract ?? null, isWritable: true },
225
+ rentalState: { value: input.rentalState ?? null, isWritable: true },
226
+ rentalAuthority: {
227
+ value: input.rentalAuthority ?? null,
228
+ isWritable: false,
229
+ },
230
+ rentalTokenAccount: {
231
+ value: input.rentalTokenAccount ?? null,
232
+ isWritable: true,
233
+ },
234
+ rentalThread: { value: input.rentalThread ?? null, isWritable: true },
235
+ referralTokenAccount: {
236
+ value: input.referralTokenAccount ?? null,
237
+ isWritable: false,
238
+ },
239
+ config: { value: input.config ?? null, isWritable: false },
240
+ sageProgram: { value: input.sageProgram ?? null, isWritable: false },
241
+ antegenProgram: { value: input.antegenProgram ?? null, isWritable: false },
242
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
243
+ associatedTokenProgram: {
244
+ value: input.associatedTokenProgram ?? null,
245
+ isWritable: false,
246
+ },
247
+ systemProgram: { value: input.systemProgram ?? null, isWritable: false },
248
+ };
249
+ const accounts = originalAccounts;
250
+ // Original args.
251
+ const args = { ...input };
252
+ // Resolve default values.
253
+ if (!accounts.antegenProgram.value) {
254
+ accounts.antegenProgram.value =
255
+ 'AgThdyi1P5RkVeZD2rQahTvs8HePJoGFFxKtvok5s2J1';
256
+ }
257
+ if (!accounts.tokenProgram.value) {
258
+ accounts.tokenProgram.value =
259
+ 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
260
+ }
261
+ if (!accounts.associatedTokenProgram.value) {
262
+ accounts.associatedTokenProgram.value =
263
+ 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
264
+ }
265
+ if (!accounts.systemProgram.value) {
266
+ accounts.systemProgram.value =
267
+ '11111111111111111111111111111111';
268
+ }
269
+ const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
270
+ const instruction = {
271
+ accounts: [
272
+ getAccountMeta(accounts.mint),
273
+ getAccountMeta(accounts.borrower),
274
+ getAccountMeta(accounts.borrowerProfile),
275
+ getAccountMeta(accounts.borrowerProfileFaction),
276
+ getAccountMeta(accounts.borrowerTokenAccount),
277
+ getAccountMeta(accounts.fleet),
278
+ getAccountMeta(accounts.gameId),
279
+ getAccountMeta(accounts.starbase),
280
+ getAccountMeta(accounts.starbasePlayer),
281
+ getAccountMeta(accounts.contract),
282
+ getAccountMeta(accounts.rentalState),
283
+ getAccountMeta(accounts.rentalAuthority),
284
+ getAccountMeta(accounts.rentalTokenAccount),
285
+ getAccountMeta(accounts.rentalThread),
286
+ getAccountMeta(accounts.referralTokenAccount),
287
+ getAccountMeta(accounts.config),
288
+ getAccountMeta(accounts.sageProgram),
289
+ getAccountMeta(accounts.antegenProgram),
290
+ getAccountMeta(accounts.tokenProgram),
291
+ getAccountMeta(accounts.associatedTokenProgram),
292
+ getAccountMeta(accounts.systemProgram),
293
+ ],
294
+ programAddress,
295
+ data: getAcceptRentalInstructionDataEncoder().encode(args),
296
+ };
297
+ return instruction;
298
+ }
299
+ export function parseAcceptRentalInstruction(instruction) {
300
+ if (instruction.accounts.length < 21) {
301
+ // TODO: Coded error.
302
+ throw new Error('Not enough accounts');
303
+ }
304
+ let accountIndex = 0;
305
+ const getNextAccount = () => {
306
+ const accountMeta = instruction.accounts[accountIndex];
307
+ accountIndex += 1;
308
+ return accountMeta;
309
+ };
310
+ const getNextOptionalAccount = () => {
311
+ const accountMeta = getNextAccount();
312
+ return accountMeta.address === SRSLY_PROGRAM_ADDRESS
313
+ ? undefined
314
+ : accountMeta;
315
+ };
316
+ return {
317
+ programAddress: instruction.programAddress,
318
+ accounts: {
319
+ mint: getNextAccount(),
320
+ borrower: getNextAccount(),
321
+ borrowerProfile: getNextAccount(),
322
+ borrowerProfileFaction: getNextAccount(),
323
+ borrowerTokenAccount: getNextAccount(),
324
+ fleet: getNextAccount(),
325
+ gameId: getNextAccount(),
326
+ starbase: getNextAccount(),
327
+ starbasePlayer: getNextAccount(),
328
+ contract: getNextAccount(),
329
+ rentalState: getNextAccount(),
330
+ rentalAuthority: getNextAccount(),
331
+ rentalTokenAccount: getNextAccount(),
332
+ rentalThread: getNextAccount(),
333
+ referralTokenAccount: getNextOptionalAccount(),
334
+ config: getNextAccount(),
335
+ sageProgram: getNextAccount(),
336
+ antegenProgram: getNextAccount(),
337
+ tokenProgram: getNextAccount(),
338
+ associatedTokenProgram: getNextAccount(),
339
+ systemProgram: getNextAccount(),
340
+ },
341
+ data: getAcceptRentalInstructionDataDecoder().decode(instruction.data),
342
+ };
343
+ }
344
+ //# sourceMappingURL=acceptRental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptRental.js","sourceRoot":"","sources":["../../../../src/codama/instructions/acceptRental.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OA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AE;YACR,IAAI,EAAE,cAAc,EAAE;YACtB,QAAQ,EAAE,cAAc,EAAE;YAC1B,eAAe,EAAE,cAAc,EAAE;YACjC,sBAAsB,EAAE,cAAc,EAAE;YACxC,oBAAoB,EAAE,cAAc,EAAE;YACtC,KAAK,EAAE,cAAc,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE;YACxB,QAAQ,EAAE,cAAc,EAAE;YAC1B,cAAc,EAAE,cAAc,EAAE;YAChC,QAAQ,EAAE,cAAc,EAAE;YAC1B,WAAW,EAAE,cAAc,EAAE;YAC7B,eAAe,EAAE,cAAc,EAAE;YACjC,kBAAkB,EAAE,cAAc,EAAE;YACpC,YAAY,EAAE,cAAc,EAAE;YAC9B,oBAAoB,EAAE,sBAAsB,EAAE;YAC9C,MAAM,EAAE,cAAc,EAAE;YACxB,WAAW,EAAE,cAAc,EAAE;YAC7B,cAAc,EAAE,cAAc,EAAE;YAChC,YAAY,EAAE,cAAc,EAAE;YAC9B,sBAAsB,EAAE,cAAc,EAAE;YACxC,aAAa,EAAE,cAAc,EAAE;SAChC;QACD,IAAI,EAAE,qCAAqC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACvE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,192 @@
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, getAddressEncoder, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
9
+ import { SRSLY_PROGRAM_ADDRESS } from '../programs';
10
+ import { expectAddress, getAccountMetaFactory, } from '../shared';
11
+ export const CANCEL_RENTAL_DISCRIMINATOR = new Uint8Array([
12
+ 97, 204, 63, 8, 84, 34, 28, 43,
13
+ ]);
14
+ export function getCancelRentalDiscriminatorBytes() {
15
+ return fixEncoderSize(getBytesEncoder(), 8).encode(CANCEL_RENTAL_DISCRIMINATOR);
16
+ }
17
+ export function getCancelRentalInstructionDataEncoder() {
18
+ return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: CANCEL_RENTAL_DISCRIMINATOR }));
19
+ }
20
+ export function getCancelRentalInstructionDataDecoder() {
21
+ return getStructDecoder([
22
+ ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
23
+ ]);
24
+ }
25
+ export function getCancelRentalInstructionDataCodec() {
26
+ return combineCodec(getCancelRentalInstructionDataEncoder(), getCancelRentalInstructionDataDecoder());
27
+ }
28
+ export async function getCancelRentalInstructionAsync(input, config) {
29
+ // Program address.
30
+ const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
31
+ // Original accounts.
32
+ const originalAccounts = {
33
+ borrower: { value: input.borrower ?? null, isWritable: false },
34
+ borrowerTokenAccount: {
35
+ value: input.borrowerTokenAccount ?? null,
36
+ isWritable: true,
37
+ },
38
+ rentalThread: { value: input.rentalThread ?? null, isWritable: false },
39
+ contract: { value: input.contract ?? null, isWritable: false },
40
+ rentalState: { value: input.rentalState ?? null, isWritable: true },
41
+ rentalTokenAccount: {
42
+ value: input.rentalTokenAccount ?? null,
43
+ isWritable: true,
44
+ },
45
+ rentalAuthority: {
46
+ value: input.rentalAuthority ?? null,
47
+ isWritable: false,
48
+ },
49
+ config: { value: input.config ?? null, isWritable: false },
50
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
51
+ };
52
+ const accounts = originalAccounts;
53
+ // Resolve default values.
54
+ if (!accounts.rentalAuthority.value) {
55
+ accounts.rentalAuthority.value = await getProgramDerivedAddress({
56
+ programAddress,
57
+ seeds: [
58
+ getBytesEncoder().encode(new Uint8Array([
59
+ 114, 101, 110, 116, 97, 108, 95, 97, 117, 116, 104, 111, 114, 105,
60
+ 116, 121,
61
+ ])),
62
+ ],
63
+ });
64
+ }
65
+ if (!accounts.rentalState.value) {
66
+ accounts.rentalState.value = await getProgramDerivedAddress({
67
+ programAddress,
68
+ seeds: [
69
+ getBytesEncoder().encode(new Uint8Array([
70
+ 114, 101, 110, 116, 97, 108, 95, 115, 116, 97, 116, 101,
71
+ ])),
72
+ getAddressEncoder().encode(expectAddress(accounts.contract.value)),
73
+ getAddressEncoder().encode(expectAddress(accounts.borrower.value)),
74
+ ],
75
+ });
76
+ }
77
+ if (!accounts.rentalThread.value) {
78
+ accounts.rentalThread.value = await getProgramDerivedAddress({
79
+ programAddress,
80
+ seeds: [
81
+ getBytesEncoder().encode(new Uint8Array([116, 104, 114, 101, 97, 100])),
82
+ getAddressEncoder().encode(expectAddress(accounts.rentalAuthority.value)),
83
+ getAddressEncoder().encode(expectAddress(accounts.rentalState.value)),
84
+ ],
85
+ });
86
+ }
87
+ if (!accounts.config.value) {
88
+ accounts.config.value = await getProgramDerivedAddress({
89
+ programAddress,
90
+ seeds: [
91
+ getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103])),
92
+ ],
93
+ });
94
+ }
95
+ if (!accounts.tokenProgram.value) {
96
+ accounts.tokenProgram.value =
97
+ 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
98
+ }
99
+ const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
100
+ const instruction = {
101
+ accounts: [
102
+ getAccountMeta(accounts.borrower),
103
+ getAccountMeta(accounts.borrowerTokenAccount),
104
+ getAccountMeta(accounts.rentalThread),
105
+ getAccountMeta(accounts.contract),
106
+ getAccountMeta(accounts.rentalState),
107
+ getAccountMeta(accounts.rentalTokenAccount),
108
+ getAccountMeta(accounts.rentalAuthority),
109
+ getAccountMeta(accounts.config),
110
+ getAccountMeta(accounts.tokenProgram),
111
+ ],
112
+ programAddress,
113
+ data: getCancelRentalInstructionDataEncoder().encode({}),
114
+ };
115
+ return instruction;
116
+ }
117
+ export function getCancelRentalInstruction(input, config) {
118
+ // Program address.
119
+ const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
120
+ // Original accounts.
121
+ const originalAccounts = {
122
+ borrower: { value: input.borrower ?? null, isWritable: false },
123
+ borrowerTokenAccount: {
124
+ value: input.borrowerTokenAccount ?? null,
125
+ isWritable: true,
126
+ },
127
+ rentalThread: { value: input.rentalThread ?? null, isWritable: false },
128
+ contract: { value: input.contract ?? null, isWritable: false },
129
+ rentalState: { value: input.rentalState ?? null, isWritable: true },
130
+ rentalTokenAccount: {
131
+ value: input.rentalTokenAccount ?? null,
132
+ isWritable: true,
133
+ },
134
+ rentalAuthority: {
135
+ value: input.rentalAuthority ?? null,
136
+ isWritable: false,
137
+ },
138
+ config: { value: input.config ?? null, isWritable: false },
139
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
140
+ };
141
+ const accounts = originalAccounts;
142
+ // Resolve default values.
143
+ if (!accounts.tokenProgram.value) {
144
+ accounts.tokenProgram.value =
145
+ 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
146
+ }
147
+ const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
148
+ const instruction = {
149
+ accounts: [
150
+ getAccountMeta(accounts.borrower),
151
+ getAccountMeta(accounts.borrowerTokenAccount),
152
+ getAccountMeta(accounts.rentalThread),
153
+ getAccountMeta(accounts.contract),
154
+ getAccountMeta(accounts.rentalState),
155
+ getAccountMeta(accounts.rentalTokenAccount),
156
+ getAccountMeta(accounts.rentalAuthority),
157
+ getAccountMeta(accounts.config),
158
+ getAccountMeta(accounts.tokenProgram),
159
+ ],
160
+ programAddress,
161
+ data: getCancelRentalInstructionDataEncoder().encode({}),
162
+ };
163
+ return instruction;
164
+ }
165
+ export function parseCancelRentalInstruction(instruction) {
166
+ if (instruction.accounts.length < 9) {
167
+ // TODO: Coded error.
168
+ throw new Error('Not enough accounts');
169
+ }
170
+ let accountIndex = 0;
171
+ const getNextAccount = () => {
172
+ const accountMeta = instruction.accounts[accountIndex];
173
+ accountIndex += 1;
174
+ return accountMeta;
175
+ };
176
+ return {
177
+ programAddress: instruction.programAddress,
178
+ accounts: {
179
+ borrower: getNextAccount(),
180
+ borrowerTokenAccount: getNextAccount(),
181
+ rentalThread: getNextAccount(),
182
+ contract: getNextAccount(),
183
+ rentalState: getNextAccount(),
184
+ rentalTokenAccount: getNextAccount(),
185
+ rentalAuthority: getNextAccount(),
186
+ config: getNextAccount(),
187
+ tokenProgram: getNextAccount(),
188
+ },
189
+ data: getCancelRentalInstructionDataDecoder().decode(instruction.data),
190
+ };
191
+ }
192
+ //# sourceMappingURL=cancelRental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancelRental.js","sourceRoot":"","sources":["../../../../src/codama/instructions/cancelRental.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,aAAa,EACb,qBAAqB,GAEtB,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,UAAU,CAAC;IACxD,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC;IAC/C,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,2BAA2B,CAC5B,CAAC;AACJ,CAAC;AAwDD,MAAM,UAAU,qCAAqC;IACnD,OAAO,gBAAgB,CACrB,gBAAgB,CAAC,CAAC,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC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