Skip to content

Commit 986b3a6

Browse files
committed
Sync with latest IDL source generator.
1 parent 5768f80 commit 986b3a6

8 files changed

Lines changed: 637 additions & 105 deletions

File tree

sdk/src/main/java/systems/glam/sdk/GlamAccountClientImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ public Instruction fulfill(final int mintId,
277277
vaultTokenAccount.publicKey(),
278278
escrowTokenAccount.publicKey(),
279279
baseAssetTokenProgram,
280+
solanaAccounts.token2022Program(),
280281
invokedProtocolProgram.publicKey(),
281282
limit
282283
);

sdk/src/main/java/systems/glam/sdk/idl/programs/glam/mint/gen/GlamMintProgram.java

Lines changed: 72 additions & 50 deletions
Large diffs are not rendered by default.

sdk/src/main/java/systems/glam/sdk/idl/programs/glam/staging/mint/gen/GlamMintError.java

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ public sealed interface GlamMintError extends ProgramError permits
1616
GlamMintError.RequestQueueNotEmpty,
1717
GlamMintError.InvalidRequestQueueData,
1818
GlamMintError.RequestQueueFull,
19-
GlamMintError.ProtocolFeesNotCrystallized {
19+
GlamMintError.ProtocolFeesNotCrystallized,
20+
GlamMintError.ManagerFeesNotCrystallized,
21+
GlamMintError.InsufficientEscrowBalance,
22+
GlamMintError.AmountBelowMinimum,
23+
GlamMintError.TokenAclManagesFreezeThaw,
24+
GlamMintError.InvalidMintState {
2025

2126
static GlamMintError getInstance(final int errorCode) {
2227
return switch (errorCode) {
@@ -34,6 +39,11 @@ static GlamMintError getInstance(final int errorCode) {
3439
case 6011 -> InvalidRequestQueueData.INSTANCE;
3540
case 6012 -> RequestQueueFull.INSTANCE;
3641
case 6013 -> ProtocolFeesNotCrystallized.INSTANCE;
42+
case 6014 -> ManagerFeesNotCrystallized.INSTANCE;
43+
case 6015 -> InsufficientEscrowBalance.INSTANCE;
44+
case 6016 -> AmountBelowMinimum.INSTANCE;
45+
case 6017 -> TokenAclManagesFreezeThaw.INSTANCE;
46+
case 6018 -> InvalidMintState.INSTANCE;
3747
default -> null;
3848
};
3949
}
@@ -62,7 +72,7 @@ record ActionPaused(int code, String msg) implements GlamMintError {
6272
record InvalidAsset(int code, String msg) implements GlamMintError {
6373

6474
public static final InvalidAsset INSTANCE = new InvalidAsset(
65-
6003, "Asset not allowed to subscribe"
75+
6003, "Invalid asset"
6676
);
6777
}
6878

@@ -135,4 +145,39 @@ record ProtocolFeesNotCrystallized(int code, String msg) implements GlamMintErro
135145
6013, "Protocol fees should be crystallized before updating"
136146
);
137147
}
148+
149+
record ManagerFeesNotCrystallized(int code, String msg) implements GlamMintError {
150+
151+
public static final ManagerFeesNotCrystallized INSTANCE = new ManagerFeesNotCrystallized(
152+
6014, "Manager fees should be crystallized before updating"
153+
);
154+
}
155+
156+
record InsufficientEscrowBalance(int code, String msg) implements GlamMintError {
157+
158+
public static final InsufficientEscrowBalance INSTANCE = new InsufficientEscrowBalance(
159+
6015, "Insufficient escrow balance for fee burn"
160+
);
161+
}
162+
163+
record AmountBelowMinimum(int code, String msg) implements GlamMintError {
164+
165+
public static final AmountBelowMinimum INSTANCE = new AmountBelowMinimum(
166+
6016, "Amount below minimum threshold"
167+
);
168+
}
169+
170+
record TokenAclManagesFreezeThaw(int code, String msg) implements GlamMintError {
171+
172+
public static final TokenAclManagesFreezeThaw INSTANCE = new TokenAclManagesFreezeThaw(
173+
6017, "Token ACL is enabled; freeze/thaw is managed by the Token ACL program"
174+
);
175+
}
176+
177+
record InvalidMintState(int code, String msg) implements GlamMintError {
178+
179+
public static final InvalidMintState INSTANCE = new InvalidMintState(
180+
6018, "Invalid mint state"
181+
);
182+
}
138183
}

sdk/src/main/java/systems/glam/sdk/idl/programs/glam/staging/mint/gen/GlamMintPDAs.java

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package systems.glam.sdk.idl.programs.glam.staging.mint.gen;
22

3-
import java.util.List;
4-
53
import software.sava.core.accounts.ProgramDerivedAddress;
64
import software.sava.core.accounts.PublicKey;
75

6+
import java.util.List;
7+
88
import static java.nio.charset.StandardCharsets.US_ASCII;
99

1010
public final class GlamMintPDAs {
@@ -81,6 +81,14 @@ public static ProgramDerivedAddress eventAuthorityPDA(final PublicKey program) {
8181
), program);
8282
}
8383

84+
public static ProgramDerivedAddress extraMetasPDA(final PublicKey program,
85+
final PublicKey glamMintAccount) {
86+
return PublicKey.findProgramAddress(List.of(
87+
"thaw_extra_account_metas".getBytes(US_ASCII),
88+
glamMintAccount.toByteArray()
89+
), program);
90+
}
91+
8492
public static ProgramDerivedAddress glamConfigPDA(final PublicKey program) {
8593
return PublicKey.findProgramAddress(List.of(
8694
"global-config".getBytes(US_ASCII)
@@ -109,6 +117,16 @@ public static ProgramDerivedAddress integrationAuthorityPDA(final PublicKey prog
109117
), program);
110118
}
111119

120+
public static ProgramDerivedAddress listConfigPDA(final PublicKey program,
121+
final PublicKey glamMintAccount,
122+
final byte[] seed) {
123+
return PublicKey.findProgramAddress(List.of(
124+
"list_config".getBytes(US_ASCII),
125+
glamMintAccount.toByteArray(),
126+
seed
127+
), program);
128+
}
129+
112130
public static ProgramDerivedAddress managerFeeAuthorityAtaPDA(final PublicKey program,
113131
final PublicKey managerFeeAuthorityAccount,
114132
final PublicKey depositTokenProgramAccount,
@@ -120,6 +138,14 @@ public static ProgramDerivedAddress managerFeeAuthorityAtaPDA(final PublicKey pr
120138
), program);
121139
}
122140

141+
public static ProgramDerivedAddress mintConfigPDA(final PublicKey program,
142+
final PublicKey glamMintAccount) {
143+
return PublicKey.findProgramAddress(List.of(
144+
"MINT_CONFIG".getBytes(US_ASCII),
145+
glamMintAccount.toByteArray()
146+
), program);
147+
}
148+
123149
public static ProgramDerivedAddress mintToPDA(final PublicKey program,
124150
final PublicKey recipientAccount,
125151
final PublicKey token2022ProgramAccount,
@@ -224,6 +250,16 @@ public static ProgramDerivedAddress vaultDepositAtaPDA(final PublicKey program,
224250
), program);
225251
}
226252

253+
public static ProgramDerivedAddress walletEntryPDA(final PublicKey program,
254+
final PublicKey listConfigAccount,
255+
final PublicKey walletAccount) {
256+
return PublicKey.findProgramAddress(List.of(
257+
"wallet_entry".getBytes(US_ASCII),
258+
listConfigAccount.toByteArray(),
259+
walletAccount.toByteArray()
260+
), program);
261+
}
262+
227263
private GlamMintPDAs() {
228264
}
229265
}

0 commit comments

Comments
 (0)