@wuwei-labs/srsly 1.0.0-beta.1
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/README.md +33 -0
- package/dist/cjs/codama/accounts/contractState.js +92 -0
- package/dist/cjs/codama/accounts/contractState.js.map +1 -0
- package/dist/cjs/codama/accounts/fleet.js +77 -0
- package/dist/cjs/codama/accounts/fleet.js.map +1 -0
- package/dist/cjs/codama/accounts/index.js +28 -0
- package/dist/cjs/codama/accounts/index.js.map +1 -0
- package/dist/cjs/codama/accounts/rentalState.js +85 -0
- package/dist/cjs/codama/accounts/rentalState.js.map +1 -0
- package/dist/cjs/codama/accounts/thread.js +89 -0
- package/dist/cjs/codama/accounts/thread.js.map +1 -0
- package/dist/cjs/codama/errors/index.js +25 -0
- package/dist/cjs/codama/errors/index.js.map +1 -0
- package/dist/cjs/codama/errors/srsly.js +71 -0
- package/dist/cjs/codama/errors/srsly.js.map +1 -0
- package/dist/cjs/codama/index.js +29 -0
- package/dist/cjs/codama/index.js.map +1 -0
- package/dist/cjs/codama/instructions/acceptRental.js +363 -0
- package/dist/cjs/codama/instructions/acceptRental.js.map +1 -0
- package/dist/cjs/codama/instructions/cancelRental.js +225 -0
- package/dist/cjs/codama/instructions/cancelRental.js.map +1 -0
- package/dist/cjs/codama/instructions/closeContract.js +219 -0
- package/dist/cjs/codama/instructions/closeContract.js.map +1 -0
- package/dist/cjs/codama/instructions/closeRental.js +233 -0
- package/dist/cjs/codama/instructions/closeRental.js.map +1 -0
- package/dist/cjs/codama/instructions/createContract.js +261 -0
- package/dist/cjs/codama/instructions/createContract.js.map +1 -0
- package/dist/cjs/codama/instructions/index.js +32 -0
- package/dist/cjs/codama/instructions/index.js.map +1 -0
- package/dist/cjs/codama/instructions/normalizeAdmin.js +152 -0
- package/dist/cjs/codama/instructions/normalizeAdmin.js.map +1 -0
- package/dist/cjs/codama/instructions/payRental.js +236 -0
- package/dist/cjs/codama/instructions/payRental.js.map +1 -0
- package/dist/cjs/codama/instructions/resetRental.js +155 -0
- package/dist/cjs/codama/instructions/resetRental.js.map +1 -0
- package/dist/cjs/codama/programs/index.js +25 -0
- package/dist/cjs/codama/programs/index.js.map +1 -0
- package/dist/cjs/codama/programs/srsly.js +77 -0
- package/dist/cjs/codama/programs/srsly.js.map +1 -0
- package/dist/cjs/codama/shared/index.js +95 -0
- package/dist/cjs/codama/shared/index.js.map +1 -0
- package/dist/cjs/codama/types/clockData.js +31 -0
- package/dist/cjs/codama/types/clockData.js.map +1 -0
- package/dist/cjs/codama/types/equality.js +30 -0
- package/dist/cjs/codama/types/equality.js.map +1 -0
- package/dist/cjs/codama/types/execContext.js +38 -0
- package/dist/cjs/codama/types/execContext.js.map +1 -0
- package/dist/cjs/codama/types/index.js +33 -0
- package/dist/cjs/codama/types/index.js.map +1 -0
- package/dist/cjs/codama/types/paymentFrequency.js +34 -0
- package/dist/cjs/codama/types/paymentFrequency.js.map +1 -0
- package/dist/cjs/codama/types/serializableAccount.js +31 -0
- package/dist/cjs/codama/types/serializableAccount.js.map +1 -0
- package/dist/cjs/codama/types/serializableInstruction.js +32 -0
- package/dist/cjs/codama/types/serializableInstruction.js.map +1 -0
- package/dist/cjs/codama/types/threadResponse.js +38 -0
- package/dist/cjs/codama/types/threadResponse.js.map +1 -0
- package/dist/cjs/codama/types/trigger.js +90 -0
- package/dist/cjs/codama/types/trigger.js.map +1 -0
- package/dist/cjs/codama/types/triggerContext.js +49 -0
- package/dist/cjs/codama/types/triggerContext.js.map +1 -0
- package/dist/cjs/contract/close.js +48 -0
- package/dist/cjs/contract/close.js.map +1 -0
- package/dist/cjs/contract/create.js +49 -0
- package/dist/cjs/contract/create.js.map +1 -0
- package/dist/cjs/contract/index.js +19 -0
- package/dist/cjs/contract/index.js.map +1 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/rental/accept.js +53 -0
- package/dist/cjs/rental/accept.js.map +1 -0
- package/dist/cjs/rental/cancel.js +37 -0
- package/dist/cjs/rental/cancel.js.map +1 -0
- package/dist/cjs/rental/close.js +39 -0
- package/dist/cjs/rental/close.js.map +1 -0
- package/dist/cjs/rental/index.js +21 -0
- package/dist/cjs/rental/index.js.map +1 -0
- package/dist/cjs/rental/reset.js +56 -0
- package/dist/cjs/rental/reset.js.map +1 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/constants.js +34 -0
- package/dist/cjs/utils/constants.js.map +1 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/profiles.js +139 -0
- package/dist/cjs/utils/profiles.js.map +1 -0
- package/dist/esm/codama/accounts/contractState.js +79 -0
- package/dist/esm/codama/accounts/contractState.js.map +1 -0
- package/dist/esm/codama/accounts/fleet.js +64 -0
- package/dist/esm/codama/accounts/fleet.js.map +1 -0
- package/dist/esm/codama/accounts/index.js +12 -0
- package/dist/esm/codama/accounts/index.js.map +1 -0
- package/dist/esm/codama/accounts/rentalState.js +72 -0
- package/dist/esm/codama/accounts/rentalState.js.map +1 -0
- package/dist/esm/codama/accounts/thread.js +77 -0
- package/dist/esm/codama/accounts/thread.js.map +1 -0
- package/dist/esm/codama/errors/index.js +9 -0
- package/dist/esm/codama/errors/index.js.map +1 -0
- package/dist/esm/codama/errors/srsly.js +66 -0
- package/dist/esm/codama/errors/srsly.js.map +1 -0
- package/dist/esm/codama/index.js +13 -0
- package/dist/esm/codama/index.js.map +1 -0
- package/dist/esm/codama/instructions/acceptRental.js +353 -0
- package/dist/esm/codama/instructions/acceptRental.js.map +1 -0
- package/dist/esm/codama/instructions/cancelRental.js +215 -0
- package/dist/esm/codama/instructions/cancelRental.js.map +1 -0
- package/dist/esm/codama/instructions/closeContract.js +209 -0
- package/dist/esm/codama/instructions/closeContract.js.map +1 -0
- package/dist/esm/codama/instructions/closeRental.js +223 -0
- package/dist/esm/codama/instructions/closeRental.js.map +1 -0
- package/dist/esm/codama/instructions/createContract.js +251 -0
- package/dist/esm/codama/instructions/createContract.js.map +1 -0
- package/dist/esm/codama/instructions/index.js +16 -0
- package/dist/esm/codama/instructions/index.js.map +1 -0
- package/dist/esm/codama/instructions/normalizeAdmin.js +142 -0
- package/dist/esm/codama/instructions/normalizeAdmin.js.map +1 -0
- package/dist/esm/codama/instructions/payRental.js +226 -0
- package/dist/esm/codama/instructions/payRental.js.map +1 -0
- package/dist/esm/codama/instructions/resetRental.js +145 -0
- package/dist/esm/codama/instructions/resetRental.js.map +1 -0
- package/dist/esm/codama/programs/index.js +9 -0
- package/dist/esm/codama/programs/index.js.map +1 -0
- package/dist/esm/codama/programs/srsly.js +72 -0
- package/dist/esm/codama/programs/srsly.js.map +1 -0
- package/dist/esm/codama/shared/index.js +87 -0
- package/dist/esm/codama/shared/index.js.map +1 -0
- package/dist/esm/codama/types/clockData.js +26 -0
- package/dist/esm/codama/types/clockData.js.map +1 -0
- package/dist/esm/codama/types/equality.js +24 -0
- package/dist/esm/codama/types/equality.js.map +1 -0
- package/dist/esm/codama/types/execContext.js +33 -0
- package/dist/esm/codama/types/execContext.js.map +1 -0
- package/dist/esm/codama/types/index.js +17 -0
- package/dist/esm/codama/types/index.js.map +1 -0
- package/dist/esm/codama/types/paymentFrequency.js +28 -0
- package/dist/esm/codama/types/paymentFrequency.js.map +1 -0
- package/dist/esm/codama/types/serializableAccount.js +26 -0
- package/dist/esm/codama/types/serializableAccount.js.map +1 -0
- package/dist/esm/codama/types/serializableInstruction.js +27 -0
- package/dist/esm/codama/types/serializableInstruction.js.map +1 -0
- package/dist/esm/codama/types/threadResponse.js +33 -0
- package/dist/esm/codama/types/threadResponse.js.map +1 -0
- package/dist/esm/codama/types/trigger.js +83 -0
- package/dist/esm/codama/types/trigger.js.map +1 -0
- package/dist/esm/codama/types/triggerContext.js +42 -0
- package/dist/esm/codama/types/triggerContext.js.map +1 -0
- package/dist/esm/contract/close.js +44 -0
- package/dist/esm/contract/close.js.map +1 -0
- package/dist/esm/contract/create.js +45 -0
- package/dist/esm/contract/create.js.map +1 -0
- package/dist/esm/contract/index.js +3 -0
- package/dist/esm/contract/index.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/rental/accept.js +49 -0
- package/dist/esm/rental/accept.js.map +1 -0
- package/dist/esm/rental/cancel.js +33 -0
- package/dist/esm/rental/cancel.js.map +1 -0
- package/dist/esm/rental/close.js +35 -0
- package/dist/esm/rental/close.js.map +1 -0
- package/dist/esm/rental/index.js +5 -0
- package/dist/esm/rental/index.js.map +1 -0
- package/dist/esm/rental/reset.js +52 -0
- package/dist/esm/rental/reset.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/constants.js +30 -0
- package/dist/esm/utils/constants.js.map +1 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/profiles.js +132 -0
- package/dist/esm/utils/profiles.js.map +1 -0
- package/dist/types/codama/accounts/contractState.d.ts +53 -0
- package/dist/types/codama/accounts/contractState.d.ts.map +1 -0
- package/dist/types/codama/accounts/fleet.d.ts +38 -0
- package/dist/types/codama/accounts/fleet.d.ts.map +1 -0
- package/dist/types/codama/accounts/index.d.ts +12 -0
- package/dist/types/codama/accounts/index.d.ts.map +1 -0
- package/dist/types/codama/accounts/rentalState.d.ts +46 -0
- package/dist/types/codama/accounts/rentalState.d.ts.map +1 -0
- package/dist/types/codama/accounts/thread.d.ts +74 -0
- package/dist/types/codama/accounts/thread.d.ts.map +1 -0
- package/dist/types/codama/errors/index.d.ts +9 -0
- package/dist/types/codama/errors/index.d.ts.map +1 -0
- package/dist/types/codama/errors/srsly.d.ts +48 -0
- package/dist/types/codama/errors/srsly.d.ts.map +1 -0
- package/dist/types/codama/index.d.ts +13 -0
- package/dist/types/codama/index.d.ts.map +1 -0
- package/dist/types/codama/instructions/acceptRental.d.ts +128 -0
- package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/cancelRental.d.ts +71 -0
- package/dist/types/codama/instructions/cancelRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/closeContract.d.ts +96 -0
- package/dist/types/codama/instructions/closeContract.d.ts.map +1 -0
- package/dist/types/codama/instructions/closeRental.d.ts +79 -0
- package/dist/types/codama/instructions/closeRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/createContract.d.ts +108 -0
- package/dist/types/codama/instructions/createContract.d.ts.map +1 -0
- package/dist/types/codama/instructions/index.d.ts +16 -0
- package/dist/types/codama/instructions/index.d.ts.map +1 -0
- package/dist/types/codama/instructions/normalizeAdmin.d.ts +67 -0
- package/dist/types/codama/instructions/normalizeAdmin.d.ts.map +1 -0
- package/dist/types/codama/instructions/payRental.d.ts +99 -0
- package/dist/types/codama/instructions/payRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/resetRental.d.ts +71 -0
- package/dist/types/codama/instructions/resetRental.d.ts.map +1 -0
- package/dist/types/codama/programs/index.d.ts +9 -0
- package/dist/types/codama/programs/index.d.ts.map +1 -0
- package/dist/types/codama/programs/srsly.d.ts +50 -0
- package/dist/types/codama/programs/srsly.d.ts.map +1 -0
- package/dist/types/codama/shared/index.d.ts +50 -0
- package/dist/types/codama/shared/index.d.ts.map +1 -0
- package/dist/types/codama/types/clockData.d.ts +29 -0
- package/dist/types/codama/types/clockData.d.ts.map +1 -0
- package/dist/types/codama/types/equality.d.ts +18 -0
- package/dist/types/codama/types/equality.d.ts.map +1 -0
- package/dist/types/codama/types/execContext.d.ts +48 -0
- package/dist/types/codama/types/execContext.d.ts.map +1 -0
- package/dist/types/codama/types/index.d.ts +17 -0
- package/dist/types/codama/types/index.d.ts.map +1 -0
- package/dist/types/codama/types/paymentFrequency.d.ts +22 -0
- package/dist/types/codama/types/paymentFrequency.d.ts.map +1 -0
- package/dist/types/codama/types/serializableAccount.d.ts +22 -0
- package/dist/types/codama/types/serializableAccount.d.ts.map +1 -0
- package/dist/types/codama/types/serializableInstruction.d.ts +30 -0
- package/dist/types/codama/types/serializableInstruction.d.ts.map +1 -0
- package/dist/types/codama/types/threadResponse.d.ts +42 -0
- package/dist/types/codama/types/threadResponse.d.ts.map +1 -0
- package/dist/types/codama/types/trigger.d.ts +98 -0
- package/dist/types/codama/types/trigger.d.ts.map +1 -0
- package/dist/types/codama/types/triggerContext.d.ts +75 -0
- package/dist/types/codama/types/triggerContext.d.ts.map +1 -0
- package/dist/types/contract/close.d.ts +56 -0
- package/dist/types/contract/close.d.ts.map +1 -0
- package/dist/types/contract/create.d.ts +73 -0
- package/dist/types/contract/create.d.ts.map +1 -0
- package/dist/types/contract/index.d.ts +3 -0
- package/dist/types/contract/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/rental/accept.d.ts +70 -0
- package/dist/types/rental/accept.d.ts.map +1 -0
- package/dist/types/rental/cancel.d.ts +39 -0
- package/dist/types/rental/cancel.d.ts.map +1 -0
- package/dist/types/rental/close.d.ts +44 -0
- package/dist/types/rental/close.d.ts.map +1 -0
- package/dist/types/rental/index.d.ts +5 -0
- package/dist/types/rental/index.d.ts.map +1 -0
- package/dist/types/rental/reset.d.ts +71 -0
- package/dist/types/rental/reset.d.ts.map +1 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +21 -0
- package/dist/types/utils/constants.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/profiles.d.ts +48 -0
- package/dist/types/utils/profiles.d.ts.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,72 @@
|
|
|
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, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getF64Decoder, getF64Encoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
export const RENTAL_STATE_DISCRIMINATOR = new Uint8Array([
|
|
10
|
+
97, 162, 29, 222, 251, 251, 180, 244,
|
|
11
|
+
]);
|
|
12
|
+
export function getRentalStateDiscriminatorBytes() {
|
|
13
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(RENTAL_STATE_DISCRIMINATOR);
|
|
14
|
+
}
|
|
15
|
+
export function getRentalStateEncoder() {
|
|
16
|
+
return transformEncoder(getStructEncoder([
|
|
17
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
18
|
+
['version', getU8Encoder()],
|
|
19
|
+
['borrower', getAddressEncoder()],
|
|
20
|
+
['thread', getAddressEncoder()],
|
|
21
|
+
['contract', getAddressEncoder()],
|
|
22
|
+
['ownerTokenAccount', getAddressEncoder()],
|
|
23
|
+
['rate', getF64Encoder()],
|
|
24
|
+
['startTime', getI64Encoder()],
|
|
25
|
+
['endTime', getI64Encoder()],
|
|
26
|
+
['cancelled', getBooleanEncoder()],
|
|
27
|
+
['bump', getU8Encoder()],
|
|
28
|
+
]), (value) => ({ ...value, discriminator: RENTAL_STATE_DISCRIMINATOR }));
|
|
29
|
+
}
|
|
30
|
+
export function getRentalStateDecoder() {
|
|
31
|
+
return getStructDecoder([
|
|
32
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
33
|
+
['version', getU8Decoder()],
|
|
34
|
+
['borrower', getAddressDecoder()],
|
|
35
|
+
['thread', getAddressDecoder()],
|
|
36
|
+
['contract', getAddressDecoder()],
|
|
37
|
+
['ownerTokenAccount', getAddressDecoder()],
|
|
38
|
+
['rate', getF64Decoder()],
|
|
39
|
+
['startTime', getI64Decoder()],
|
|
40
|
+
['endTime', getI64Decoder()],
|
|
41
|
+
['cancelled', getBooleanDecoder()],
|
|
42
|
+
['bump', getU8Decoder()],
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
export function getRentalStateCodec() {
|
|
46
|
+
return combineCodec(getRentalStateEncoder(), getRentalStateDecoder());
|
|
47
|
+
}
|
|
48
|
+
export function decodeRentalState(encodedAccount) {
|
|
49
|
+
return decodeAccount(encodedAccount, getRentalStateDecoder());
|
|
50
|
+
}
|
|
51
|
+
export async function fetchRentalState(rpc, address, config) {
|
|
52
|
+
const maybeAccount = await fetchMaybeRentalState(rpc, address, config);
|
|
53
|
+
assertAccountExists(maybeAccount);
|
|
54
|
+
return maybeAccount;
|
|
55
|
+
}
|
|
56
|
+
export async function fetchMaybeRentalState(rpc, address, config) {
|
|
57
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
58
|
+
return decodeRentalState(maybeAccount);
|
|
59
|
+
}
|
|
60
|
+
export async function fetchAllRentalState(rpc, addresses, config) {
|
|
61
|
+
const maybeAccounts = await fetchAllMaybeRentalState(rpc, addresses, config);
|
|
62
|
+
assertAccountsExist(maybeAccounts);
|
|
63
|
+
return maybeAccounts;
|
|
64
|
+
}
|
|
65
|
+
export async function fetchAllMaybeRentalState(rpc, addresses, config) {
|
|
66
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
67
|
+
return maybeAccounts.map((maybeAccount) => decodeRentalState(maybeAccount));
|
|
68
|
+
}
|
|
69
|
+
export function getRentalStateSize() {
|
|
70
|
+
return 163;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=rentalState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rentalState.js","sourceRoot":"","sources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B,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;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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, assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, getUtf8Decoder, getUtf8Encoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { getClockDataDecoder, getClockDataEncoder, getExecContextDecoder, getExecContextEncoder, getSerializableInstructionDecoder, getSerializableInstructionEncoder, getTriggerDecoder, getTriggerEncoder, } from '../types';
|
|
10
|
+
export const THREAD_DISCRIMINATOR = new Uint8Array([
|
|
11
|
+
186, 27, 154, 111, 51, 36, 159, 90,
|
|
12
|
+
]);
|
|
13
|
+
export function getThreadDiscriminatorBytes() {
|
|
14
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(THREAD_DISCRIMINATOR);
|
|
15
|
+
}
|
|
16
|
+
export function getThreadEncoder() {
|
|
17
|
+
return transformEncoder(getStructEncoder([
|
|
18
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
19
|
+
['authority', getAddressEncoder()],
|
|
20
|
+
['bump', getU8Encoder()],
|
|
21
|
+
['createdAt', getClockDataEncoder()],
|
|
22
|
+
['execContext', getOptionEncoder(getExecContextEncoder())],
|
|
23
|
+
['fee', getU64Encoder()],
|
|
24
|
+
['id', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],
|
|
25
|
+
['instructions', getArrayEncoder(getSerializableInstructionEncoder())],
|
|
26
|
+
['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
|
27
|
+
[
|
|
28
|
+
'nextInstruction',
|
|
29
|
+
getOptionEncoder(getSerializableInstructionEncoder()),
|
|
30
|
+
],
|
|
31
|
+
['paused', getBooleanEncoder()],
|
|
32
|
+
['rateLimit', getU64Encoder()],
|
|
33
|
+
['trigger', getTriggerEncoder()],
|
|
34
|
+
]), (value) => ({ ...value, discriminator: THREAD_DISCRIMINATOR }));
|
|
35
|
+
}
|
|
36
|
+
export function getThreadDecoder() {
|
|
37
|
+
return getStructDecoder([
|
|
38
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
39
|
+
['authority', getAddressDecoder()],
|
|
40
|
+
['bump', getU8Decoder()],
|
|
41
|
+
['createdAt', getClockDataDecoder()],
|
|
42
|
+
['execContext', getOptionDecoder(getExecContextDecoder())],
|
|
43
|
+
['fee', getU64Decoder()],
|
|
44
|
+
['id', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],
|
|
45
|
+
['instructions', getArrayDecoder(getSerializableInstructionDecoder())],
|
|
46
|
+
['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
|
47
|
+
['nextInstruction', getOptionDecoder(getSerializableInstructionDecoder())],
|
|
48
|
+
['paused', getBooleanDecoder()],
|
|
49
|
+
['rateLimit', getU64Decoder()],
|
|
50
|
+
['trigger', getTriggerDecoder()],
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
export function getThreadCodec() {
|
|
54
|
+
return combineCodec(getThreadEncoder(), getThreadDecoder());
|
|
55
|
+
}
|
|
56
|
+
export function decodeThread(encodedAccount) {
|
|
57
|
+
return decodeAccount(encodedAccount, getThreadDecoder());
|
|
58
|
+
}
|
|
59
|
+
export async function fetchThread(rpc, address, config) {
|
|
60
|
+
const maybeAccount = await fetchMaybeThread(rpc, address, config);
|
|
61
|
+
assertAccountExists(maybeAccount);
|
|
62
|
+
return maybeAccount;
|
|
63
|
+
}
|
|
64
|
+
export async function fetchMaybeThread(rpc, address, config) {
|
|
65
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
66
|
+
return decodeThread(maybeAccount);
|
|
67
|
+
}
|
|
68
|
+
export async function fetchAllThread(rpc, addresses, config) {
|
|
69
|
+
const maybeAccounts = await fetchAllMaybeThread(rpc, addresses, config);
|
|
70
|
+
assertAccountsExist(maybeAccounts);
|
|
71
|
+
return maybeAccounts;
|
|
72
|
+
}
|
|
73
|
+
export async function fetchAllMaybeThread(rpc, addresses, config) {
|
|
74
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
75
|
+
return maybeAccounts.map((maybeAccount) => decodeThread(maybeAccount));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=thread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread.js","sourceRoot":"","sources":["../../../../src/codama/accounts/thread.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,GAcjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,iCAAiC,EACjC,iBAAiB,EACjB,iBAAiB,GASlB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,UAAU,CAAC;IACjD,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;CACnC,CAAC,CAAC;AAEH,MAAM,UAAU,2BAA2B;IACzC,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC3E,CAAC;AAyDD,MAAM,UAAU,gBAAgB;IAC9B,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;Q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AAa,GAAG,MAAM,mBAAmB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACxE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACnC,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,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,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './srsly';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codama/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { isProgramError, } from '@solana/kit';
|
|
9
|
+
import { SRSLY_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
/** InvalidDurationMinimum: Invalid duration minimum. Must be between 1 and the duration maximum. */
|
|
11
|
+
export const SRSLY_ERROR__INVALID_DURATION_MINIMUM = 0x1770; // 6000
|
|
12
|
+
/** InvalidDurationMaximum: Invalid duration maximum. Must be greater than or equal to the duration minimum. */
|
|
13
|
+
export const SRSLY_ERROR__INVALID_DURATION_MAXIMUM = 0x1771; // 6001
|
|
14
|
+
/** InvalidRateCalculation: The contract rate multiplied by duration exceeds the payment amount. */
|
|
15
|
+
export const SRSLY_ERROR__INVALID_RATE_CALCULATION = 0x1772; // 6002
|
|
16
|
+
/** FleetAlreadyRented: Fleet is already rented (sub_profile is not empty). */
|
|
17
|
+
export const SRSLY_ERROR__FLEET_ALREADY_RENTED = 0x1773; // 6003
|
|
18
|
+
/** InvalidRate: Contract rate must be greater than or equal to 0. */
|
|
19
|
+
export const SRSLY_ERROR__INVALID_RATE = 0x1774; // 6004
|
|
20
|
+
/** InvalidPaymentFrequency: Invalid payment frequency. Must be one of: @hourly, @daily, @weekly, @monthly. */
|
|
21
|
+
export const SRSLY_ERROR__INVALID_PAYMENT_FREQUENCY = 0x1775; // 6005
|
|
22
|
+
/** InvalidSubProfileInvalidator: Invalid sub_profile invalidator. */
|
|
23
|
+
export const SRSLY_ERROR__INVALID_SUB_PROFILE_INVALIDATOR = 0x1776; // 6006
|
|
24
|
+
/** InsufficientCancellationNotice: Rental time remaining is less than minimum cancellation notice required. */
|
|
25
|
+
export const SRSLY_ERROR__INSUFFICIENT_CANCELLATION_NOTICE = 0x1777; // 6007
|
|
26
|
+
/** ContractClosed: The contract is closed. */
|
|
27
|
+
export const SRSLY_ERROR__CONTRACT_CLOSED = 0x1778; // 6008
|
|
28
|
+
/** DevOnlyFrequency: This frequency is only allowed in development. */
|
|
29
|
+
export const SRSLY_ERROR__DEV_ONLY_FREQUENCY = 0x1779; // 6009
|
|
30
|
+
/** ExpectedDailyFrequency: Expected daily frequency but contract is set differently. */
|
|
31
|
+
export const SRSLY_ERROR__EXPECTED_DAILY_FREQUENCY = 0x177a; // 6010
|
|
32
|
+
/** InvalidThreadContext: Thread has invalid context set. */
|
|
33
|
+
export const SRSLY_ERROR__INVALID_THREAD_CONTEXT = 0x177b; // 6011
|
|
34
|
+
/** RentalIsActive: Rental is still active. */
|
|
35
|
+
export const SRSLY_ERROR__RENTAL_IS_ACTIVE = 0x177c; // 6012
|
|
36
|
+
/** RentalStateExists: Rental reset requires rental state to not exist. */
|
|
37
|
+
export const SRSLY_ERROR__RENTAL_STATE_EXISTS = 0x177d; // 6013
|
|
38
|
+
let srslyErrorMessages;
|
|
39
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
+
srslyErrorMessages = {
|
|
41
|
+
[SRSLY_ERROR__CONTRACT_CLOSED]: `The contract is closed.`,
|
|
42
|
+
[SRSLY_ERROR__DEV_ONLY_FREQUENCY]: `This frequency is only allowed in development.`,
|
|
43
|
+
[SRSLY_ERROR__EXPECTED_DAILY_FREQUENCY]: `Expected daily frequency but contract is set differently.`,
|
|
44
|
+
[SRSLY_ERROR__FLEET_ALREADY_RENTED]: `Fleet is already rented (sub_profile is not empty).`,
|
|
45
|
+
[SRSLY_ERROR__INSUFFICIENT_CANCELLATION_NOTICE]: `Rental time remaining is less than minimum cancellation notice required.`,
|
|
46
|
+
[SRSLY_ERROR__INVALID_DURATION_MAXIMUM]: `Invalid duration maximum. Must be greater than or equal to the duration minimum.`,
|
|
47
|
+
[SRSLY_ERROR__INVALID_DURATION_MINIMUM]: `Invalid duration minimum. Must be between 1 and the duration maximum.`,
|
|
48
|
+
[SRSLY_ERROR__INVALID_PAYMENT_FREQUENCY]: `Invalid payment frequency. Must be one of: @hourly, @daily, @weekly, @monthly.`,
|
|
49
|
+
[SRSLY_ERROR__INVALID_RATE]: `Contract rate must be greater than or equal to 0.`,
|
|
50
|
+
[SRSLY_ERROR__INVALID_RATE_CALCULATION]: `The contract rate multiplied by duration exceeds the payment amount.`,
|
|
51
|
+
[SRSLY_ERROR__INVALID_SUB_PROFILE_INVALIDATOR]: `Invalid sub_profile invalidator.`,
|
|
52
|
+
[SRSLY_ERROR__INVALID_THREAD_CONTEXT]: `Thread has invalid context set.`,
|
|
53
|
+
[SRSLY_ERROR__RENTAL_IS_ACTIVE]: `Rental is still active.`,
|
|
54
|
+
[SRSLY_ERROR__RENTAL_STATE_EXISTS]: `Rental reset requires rental state to not exist.`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function getSrslyErrorMessage(code) {
|
|
58
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
59
|
+
return srslyErrorMessages[code];
|
|
60
|
+
}
|
|
61
|
+
return 'Error message not available in production bundles.';
|
|
62
|
+
}
|
|
63
|
+
export function isSrslyError(error, transactionMessage, code) {
|
|
64
|
+
return isProgramError(error, transactionMessage, SRSLY_PROGRAM_ADDRESS, code);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=srsly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"srsly.js","sourceRoot":"","sources":["../../../../src/codama/errors/srsly.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,cAAc,GAIf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,oGAAoG;AACpG,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,CAAC,OAAO;AACpE,+GAA+G;AAC/G,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,CAAC,OAAO;AACpE,mGAAmG;AACnG,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,CAAC,OAAO;AACpE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,CAAC,OAAO;AAChE,qEAAqE;AACrE,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,CAAC,OAAO;AACxD,8GAA8G;AAC9G,MAAM,CAAC,MAAM,sCAAsC,GAAG,MAAM,CAAC,CAAC,OAAO;AACrE,qEAAqE;AACrE,MAAM,CAAC,MAAM,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EAAE,yBAAyB;QAC1D,CAAC,gCAAgC,CAAC,EAAE,kDAAkD;KACvF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACnD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,OAAQ,kBAAiD,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,oDAAoD,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,KAAc,EACd,kBAEC,EACD,IAAwB;IAGxB,OAAO,cAAc,CACnB,KAAK,EACL,kBAAkB,EAClB,qBAAqB,EACrB,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './accounts';
|
|
9
|
+
export * from './errors';
|
|
10
|
+
export * from './instructions';
|
|
11
|
+
export * from './programs';
|
|
12
|
+
export * from './types';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codama/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,353 @@
|
|
|
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
|
+
feeTokenAccount: { value: input.feeTokenAccount ?? null, isWritable: true },
|
|
69
|
+
sageProgram: { value: input.sageProgram ?? null, isWritable: false },
|
|
70
|
+
antegenProgram: { value: input.antegenProgram ?? null, isWritable: false },
|
|
71
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
72
|
+
associatedTokenProgram: {
|
|
73
|
+
value: input.associatedTokenProgram ?? null,
|
|
74
|
+
isWritable: false,
|
|
75
|
+
},
|
|
76
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
77
|
+
};
|
|
78
|
+
const accounts = originalAccounts;
|
|
79
|
+
// Original args.
|
|
80
|
+
const args = { ...input };
|
|
81
|
+
// Resolve default values.
|
|
82
|
+
if (!accounts.mint.value) {
|
|
83
|
+
accounts.mint.value =
|
|
84
|
+
'ATLA5nAaVRfH6BNwD4SAyWp96EdQaAh6bBmGeTx956sx';
|
|
85
|
+
}
|
|
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.feeTokenAccount.value) {
|
|
148
|
+
accounts.feeTokenAccount.value = await getProgramDerivedAddress({
|
|
149
|
+
programAddress: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
|
|
150
|
+
seeds: [
|
|
151
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
152
|
+
200, 182, 122, 108, 74, 122, 176, 202, 84, 111, 116, 161, 175, 85,
|
|
153
|
+
111, 229, 188, 105, 205, 151, 154, 187, 178, 50, 133, 209, 48, 56,
|
|
154
|
+
107, 39, 184, 43,
|
|
155
|
+
])),
|
|
156
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
157
|
+
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,
|
|
158
|
+
121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,
|
|
159
|
+
126, 255, 0, 169,
|
|
160
|
+
])),
|
|
161
|
+
getAddressEncoder().encode(expectAddress(accounts.mint.value)),
|
|
162
|
+
],
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (!accounts.sageProgram.value) {
|
|
166
|
+
accounts.sageProgram.value =
|
|
167
|
+
'sAgezwJpDb1aHvzNr3o24cKjsETmFEKghBEyJ1askDi';
|
|
168
|
+
}
|
|
169
|
+
if (!accounts.antegenProgram.value) {
|
|
170
|
+
accounts.antegenProgram.value =
|
|
171
|
+
'AgThdyi1P5RkVeZD2rQahTvs8HePJoGFFxKtvok5s2J1';
|
|
172
|
+
}
|
|
173
|
+
if (!accounts.tokenProgram.value) {
|
|
174
|
+
accounts.tokenProgram.value =
|
|
175
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
176
|
+
}
|
|
177
|
+
if (!accounts.associatedTokenProgram.value) {
|
|
178
|
+
accounts.associatedTokenProgram.value =
|
|
179
|
+
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
|
|
180
|
+
}
|
|
181
|
+
if (!accounts.systemProgram.value) {
|
|
182
|
+
accounts.systemProgram.value =
|
|
183
|
+
'11111111111111111111111111111111';
|
|
184
|
+
}
|
|
185
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
186
|
+
const instruction = {
|
|
187
|
+
accounts: [
|
|
188
|
+
getAccountMeta(accounts.mint),
|
|
189
|
+
getAccountMeta(accounts.borrower),
|
|
190
|
+
getAccountMeta(accounts.borrowerProfile),
|
|
191
|
+
getAccountMeta(accounts.borrowerProfileFaction),
|
|
192
|
+
getAccountMeta(accounts.borrowerTokenAccount),
|
|
193
|
+
getAccountMeta(accounts.fleet),
|
|
194
|
+
getAccountMeta(accounts.gameId),
|
|
195
|
+
getAccountMeta(accounts.starbase),
|
|
196
|
+
getAccountMeta(accounts.starbasePlayer),
|
|
197
|
+
getAccountMeta(accounts.contract),
|
|
198
|
+
getAccountMeta(accounts.rentalState),
|
|
199
|
+
getAccountMeta(accounts.rentalAuthority),
|
|
200
|
+
getAccountMeta(accounts.rentalTokenAccount),
|
|
201
|
+
getAccountMeta(accounts.rentalThread),
|
|
202
|
+
getAccountMeta(accounts.feeTokenAccount),
|
|
203
|
+
getAccountMeta(accounts.sageProgram),
|
|
204
|
+
getAccountMeta(accounts.antegenProgram),
|
|
205
|
+
getAccountMeta(accounts.tokenProgram),
|
|
206
|
+
getAccountMeta(accounts.associatedTokenProgram),
|
|
207
|
+
getAccountMeta(accounts.systemProgram),
|
|
208
|
+
],
|
|
209
|
+
programAddress,
|
|
210
|
+
data: getAcceptRentalInstructionDataEncoder().encode(args),
|
|
211
|
+
};
|
|
212
|
+
return instruction;
|
|
213
|
+
}
|
|
214
|
+
export function getAcceptRentalInstruction(input, config) {
|
|
215
|
+
// Program address.
|
|
216
|
+
const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
|
|
217
|
+
// Original accounts.
|
|
218
|
+
const originalAccounts = {
|
|
219
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
220
|
+
borrower: { value: input.borrower ?? null, isWritable: true },
|
|
221
|
+
borrowerProfile: {
|
|
222
|
+
value: input.borrowerProfile ?? null,
|
|
223
|
+
isWritable: false,
|
|
224
|
+
},
|
|
225
|
+
borrowerProfileFaction: {
|
|
226
|
+
value: input.borrowerProfileFaction ?? null,
|
|
227
|
+
isWritable: false,
|
|
228
|
+
},
|
|
229
|
+
borrowerTokenAccount: {
|
|
230
|
+
value: input.borrowerTokenAccount ?? null,
|
|
231
|
+
isWritable: true,
|
|
232
|
+
},
|
|
233
|
+
fleet: { value: input.fleet ?? null, isWritable: true },
|
|
234
|
+
gameId: { value: input.gameId ?? null, isWritable: false },
|
|
235
|
+
starbase: { value: input.starbase ?? null, isWritable: false },
|
|
236
|
+
starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true },
|
|
237
|
+
contract: { value: input.contract ?? null, isWritable: true },
|
|
238
|
+
rentalState: { value: input.rentalState ?? null, isWritable: true },
|
|
239
|
+
rentalAuthority: {
|
|
240
|
+
value: input.rentalAuthority ?? null,
|
|
241
|
+
isWritable: false,
|
|
242
|
+
},
|
|
243
|
+
rentalTokenAccount: {
|
|
244
|
+
value: input.rentalTokenAccount ?? null,
|
|
245
|
+
isWritable: true,
|
|
246
|
+
},
|
|
247
|
+
rentalThread: { value: input.rentalThread ?? null, isWritable: true },
|
|
248
|
+
feeTokenAccount: { value: input.feeTokenAccount ?? null, isWritable: true },
|
|
249
|
+
sageProgram: { value: input.sageProgram ?? null, isWritable: false },
|
|
250
|
+
antegenProgram: { value: input.antegenProgram ?? null, isWritable: false },
|
|
251
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
252
|
+
associatedTokenProgram: {
|
|
253
|
+
value: input.associatedTokenProgram ?? null,
|
|
254
|
+
isWritable: false,
|
|
255
|
+
},
|
|
256
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
257
|
+
};
|
|
258
|
+
const accounts = originalAccounts;
|
|
259
|
+
// Original args.
|
|
260
|
+
const args = { ...input };
|
|
261
|
+
// Resolve default values.
|
|
262
|
+
if (!accounts.mint.value) {
|
|
263
|
+
accounts.mint.value =
|
|
264
|
+
'ATLA5nAaVRfH6BNwD4SAyWp96EdQaAh6bBmGeTx956sx';
|
|
265
|
+
}
|
|
266
|
+
if (!accounts.sageProgram.value) {
|
|
267
|
+
accounts.sageProgram.value =
|
|
268
|
+
'sAgezwJpDb1aHvzNr3o24cKjsETmFEKghBEyJ1askDi';
|
|
269
|
+
}
|
|
270
|
+
if (!accounts.antegenProgram.value) {
|
|
271
|
+
accounts.antegenProgram.value =
|
|
272
|
+
'AgThdyi1P5RkVeZD2rQahTvs8HePJoGFFxKtvok5s2J1';
|
|
273
|
+
}
|
|
274
|
+
if (!accounts.tokenProgram.value) {
|
|
275
|
+
accounts.tokenProgram.value =
|
|
276
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
277
|
+
}
|
|
278
|
+
if (!accounts.associatedTokenProgram.value) {
|
|
279
|
+
accounts.associatedTokenProgram.value =
|
|
280
|
+
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
|
|
281
|
+
}
|
|
282
|
+
if (!accounts.systemProgram.value) {
|
|
283
|
+
accounts.systemProgram.value =
|
|
284
|
+
'11111111111111111111111111111111';
|
|
285
|
+
}
|
|
286
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
287
|
+
const instruction = {
|
|
288
|
+
accounts: [
|
|
289
|
+
getAccountMeta(accounts.mint),
|
|
290
|
+
getAccountMeta(accounts.borrower),
|
|
291
|
+
getAccountMeta(accounts.borrowerProfile),
|
|
292
|
+
getAccountMeta(accounts.borrowerProfileFaction),
|
|
293
|
+
getAccountMeta(accounts.borrowerTokenAccount),
|
|
294
|
+
getAccountMeta(accounts.fleet),
|
|
295
|
+
getAccountMeta(accounts.gameId),
|
|
296
|
+
getAccountMeta(accounts.starbase),
|
|
297
|
+
getAccountMeta(accounts.starbasePlayer),
|
|
298
|
+
getAccountMeta(accounts.contract),
|
|
299
|
+
getAccountMeta(accounts.rentalState),
|
|
300
|
+
getAccountMeta(accounts.rentalAuthority),
|
|
301
|
+
getAccountMeta(accounts.rentalTokenAccount),
|
|
302
|
+
getAccountMeta(accounts.rentalThread),
|
|
303
|
+
getAccountMeta(accounts.feeTokenAccount),
|
|
304
|
+
getAccountMeta(accounts.sageProgram),
|
|
305
|
+
getAccountMeta(accounts.antegenProgram),
|
|
306
|
+
getAccountMeta(accounts.tokenProgram),
|
|
307
|
+
getAccountMeta(accounts.associatedTokenProgram),
|
|
308
|
+
getAccountMeta(accounts.systemProgram),
|
|
309
|
+
],
|
|
310
|
+
programAddress,
|
|
311
|
+
data: getAcceptRentalInstructionDataEncoder().encode(args),
|
|
312
|
+
};
|
|
313
|
+
return instruction;
|
|
314
|
+
}
|
|
315
|
+
export function parseAcceptRentalInstruction(instruction) {
|
|
316
|
+
if (instruction.accounts.length < 20) {
|
|
317
|
+
// TODO: Coded error.
|
|
318
|
+
throw new Error('Not enough accounts');
|
|
319
|
+
}
|
|
320
|
+
let accountIndex = 0;
|
|
321
|
+
const getNextAccount = () => {
|
|
322
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
323
|
+
accountIndex += 1;
|
|
324
|
+
return accountMeta;
|
|
325
|
+
};
|
|
326
|
+
return {
|
|
327
|
+
programAddress: instruction.programAddress,
|
|
328
|
+
accounts: {
|
|
329
|
+
mint: getNextAccount(),
|
|
330
|
+
borrower: getNextAccount(),
|
|
331
|
+
borrowerProfile: getNextAccount(),
|
|
332
|
+
borrowerProfileFaction: getNextAccount(),
|
|
333
|
+
borrowerTokenAccount: getNextAccount(),
|
|
334
|
+
fleet: getNextAccount(),
|
|
335
|
+
gameId: getNextAccount(),
|
|
336
|
+
starbase: getNextAccount(),
|
|
337
|
+
starbasePlayer: getNextAccount(),
|
|
338
|
+
contract: getNextAccount(),
|
|
339
|
+
rentalState: getNextAccount(),
|
|
340
|
+
rentalAuthority: getNextAccount(),
|
|
341
|
+
rentalTokenAccount: getNextAccount(),
|
|
342
|
+
rentalThread: getNextAccount(),
|
|
343
|
+
feeTokenAccount: getNextAccount(),
|
|
344
|
+
sageProgram: getNextAccount(),
|
|
345
|
+
antegenProgram: getNextAccount(),
|
|
346
|
+
tokenProgram: getNextAccount(),
|
|
347
|
+
associatedTokenProgram: getNextAccount(),
|
|
348
|
+
systemProgram: getNextAccount(),
|
|
349
|
+
},
|
|
350
|
+
data: getAcceptRentalInstructionDataDecoder().decode(instruction.data),
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
//# 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,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,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;CACtC,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC;IAC/C,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,2BAA2B,CAC5B,CAAC;AACJ,CAAC;AAqHD,MAAM,UAAU,qCAAqC;IACnD,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;QACf,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC3B,CAAC,UAAU,EAAE,aAAa,EAAE,CAAC;KAC9B,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CAAC,CAA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