@xitadel-fi/sdk 0.2.0 → 0.2.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.
@@ -250,6 +250,14 @@ export declare class XitadelProgram {
250
250
  * @returns Transaction instruction for withdrawing USDC
251
251
  */
252
252
  withdrawUsdc(lttId: PublicKey, withdrawer: PublicKey, amount: BN): Promise<TransactionInstruction>;
253
+ /**
254
+ * Claim protocol fees (1% of issuer withdrawals) for an LTT.
255
+ * Only the config manager can call this; claims the maximum claimable amount.
256
+ * @param lttId The LTT ID
257
+ * @param manager The manager's public key (must match config.manager)
258
+ * @returns Transaction instruction for claiming protocol fees
259
+ */
260
+ claimProtocolFees(lttId: PublicKey, manager: PublicKey): Promise<TransactionInstruction>;
253
261
  /**
254
262
  * Fetch LTT configuration
255
263
  * @param lttId The LTT ID
@@ -350,6 +350,34 @@ class XitadelProgram {
350
350
  })
351
351
  .instruction();
352
352
  }
353
+ /**
354
+ * Claim protocol fees (1% of issuer withdrawals) for an LTT.
355
+ * Only the config manager can call this; claims the maximum claimable amount.
356
+ * @param lttId The LTT ID
357
+ * @param manager The manager's public key (must match config.manager)
358
+ * @returns Transaction instruction for claiming protocol fees
359
+ */
360
+ async claimProtocolFees(lttId, manager) {
361
+ const configPda = this.getConfigPda();
362
+ const lttConfigPda = this.getLTTConfigPda(lttId);
363
+ const lttConfig = await this.program.account.lttConfiguration.fetch(lttConfigPda);
364
+ const fundingVaultAta = (0, spl_token_1.getAssociatedTokenAddressSync)(lttConfig.fundingTokenMint, lttConfigPda, true);
365
+ const protocolFeeReceiverAta = (0, spl_token_1.getAssociatedTokenAddressSync)(lttConfig.fundingTokenMint, manager, true);
366
+ return this.program.methods
367
+ .claimProtocolFees()
368
+ .accountsPartial({
369
+ config: configPda,
370
+ manager,
371
+ lttConfiguration: lttConfigPda,
372
+ fundingTokenMint: lttConfig.fundingTokenMint,
373
+ protocolFeeReceiverAta,
374
+ fundingVaultAta,
375
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
376
+ associatedTokenProgram: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID,
377
+ systemProgram: web3_js_2.SystemProgram.programId,
378
+ })
379
+ .instruction();
380
+ }
353
381
  /**
354
382
  * Fetch LTT configuration
355
383
  * @param lttId The LTT ID
@@ -860,6 +860,269 @@
860
860
  ],
861
861
  "args": []
862
862
  },
863
+ {
864
+ "name": "claim_protocol_fees",
865
+ "discriminator": [
866
+ 34,
867
+ 142,
868
+ 219,
869
+ 112,
870
+ 109,
871
+ 54,
872
+ 133,
873
+ 23
874
+ ],
875
+ "accounts": [
876
+ {
877
+ "name": "config",
878
+ "pda": {
879
+ "seeds": [
880
+ {
881
+ "kind": "const",
882
+ "value": [
883
+ 99,
884
+ 111,
885
+ 110,
886
+ 102,
887
+ 105,
888
+ 103
889
+ ]
890
+ }
891
+ ]
892
+ }
893
+ },
894
+ {
895
+ "name": "manager",
896
+ "writable": true,
897
+ "signer": true
898
+ },
899
+ {
900
+ "name": "ltt_configuration",
901
+ "pda": {
902
+ "seeds": [
903
+ {
904
+ "kind": "const",
905
+ "value": [
906
+ 108,
907
+ 116,
908
+ 116,
909
+ 95,
910
+ 99,
911
+ 111,
912
+ 110,
913
+ 102,
914
+ 105,
915
+ 103
916
+ ]
917
+ },
918
+ {
919
+ "kind": "account",
920
+ "path": "ltt_configuration.ltt_id",
921
+ "account": "LTTConfiguration"
922
+ }
923
+ ]
924
+ }
925
+ },
926
+ {
927
+ "name": "funding_token_mint"
928
+ },
929
+ {
930
+ "name": "protocol_fee_receiver_ata",
931
+ "writable": true,
932
+ "pda": {
933
+ "seeds": [
934
+ {
935
+ "kind": "account",
936
+ "path": "manager"
937
+ },
938
+ {
939
+ "kind": "const",
940
+ "value": [
941
+ 6,
942
+ 221,
943
+ 246,
944
+ 225,
945
+ 215,
946
+ 101,
947
+ 161,
948
+ 147,
949
+ 217,
950
+ 203,
951
+ 225,
952
+ 70,
953
+ 206,
954
+ 235,
955
+ 121,
956
+ 172,
957
+ 28,
958
+ 180,
959
+ 133,
960
+ 237,
961
+ 95,
962
+ 91,
963
+ 55,
964
+ 145,
965
+ 58,
966
+ 140,
967
+ 245,
968
+ 133,
969
+ 126,
970
+ 255,
971
+ 0,
972
+ 169
973
+ ]
974
+ },
975
+ {
976
+ "kind": "account",
977
+ "path": "ltt_configuration.funding_token_mint",
978
+ "account": "LTTConfiguration"
979
+ }
980
+ ],
981
+ "program": {
982
+ "kind": "const",
983
+ "value": [
984
+ 140,
985
+ 151,
986
+ 37,
987
+ 143,
988
+ 78,
989
+ 36,
990
+ 137,
991
+ 241,
992
+ 187,
993
+ 61,
994
+ 16,
995
+ 41,
996
+ 20,
997
+ 142,
998
+ 13,
999
+ 131,
1000
+ 11,
1001
+ 90,
1002
+ 19,
1003
+ 153,
1004
+ 218,
1005
+ 255,
1006
+ 16,
1007
+ 132,
1008
+ 4,
1009
+ 142,
1010
+ 123,
1011
+ 216,
1012
+ 219,
1013
+ 233,
1014
+ 248,
1015
+ 89
1016
+ ]
1017
+ }
1018
+ }
1019
+ },
1020
+ {
1021
+ "name": "funding_vault_ata",
1022
+ "writable": true,
1023
+ "pda": {
1024
+ "seeds": [
1025
+ {
1026
+ "kind": "account",
1027
+ "path": "ltt_configuration"
1028
+ },
1029
+ {
1030
+ "kind": "const",
1031
+ "value": [
1032
+ 6,
1033
+ 221,
1034
+ 246,
1035
+ 225,
1036
+ 215,
1037
+ 101,
1038
+ 161,
1039
+ 147,
1040
+ 217,
1041
+ 203,
1042
+ 225,
1043
+ 70,
1044
+ 206,
1045
+ 235,
1046
+ 121,
1047
+ 172,
1048
+ 28,
1049
+ 180,
1050
+ 133,
1051
+ 237,
1052
+ 95,
1053
+ 91,
1054
+ 55,
1055
+ 145,
1056
+ 58,
1057
+ 140,
1058
+ 245,
1059
+ 133,
1060
+ 126,
1061
+ 255,
1062
+ 0,
1063
+ 169
1064
+ ]
1065
+ },
1066
+ {
1067
+ "kind": "account",
1068
+ "path": "ltt_configuration.funding_token_mint",
1069
+ "account": "LTTConfiguration"
1070
+ }
1071
+ ],
1072
+ "program": {
1073
+ "kind": "const",
1074
+ "value": [
1075
+ 140,
1076
+ 151,
1077
+ 37,
1078
+ 143,
1079
+ 78,
1080
+ 36,
1081
+ 137,
1082
+ 241,
1083
+ 187,
1084
+ 61,
1085
+ 16,
1086
+ 41,
1087
+ 20,
1088
+ 142,
1089
+ 13,
1090
+ 131,
1091
+ 11,
1092
+ 90,
1093
+ 19,
1094
+ 153,
1095
+ 218,
1096
+ 255,
1097
+ 16,
1098
+ 132,
1099
+ 4,
1100
+ 142,
1101
+ 123,
1102
+ 216,
1103
+ 219,
1104
+ 233,
1105
+ 248,
1106
+ 89
1107
+ ]
1108
+ }
1109
+ }
1110
+ },
1111
+ {
1112
+ "name": "token_program",
1113
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
1114
+ },
1115
+ {
1116
+ "name": "associated_token_program",
1117
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
1118
+ },
1119
+ {
1120
+ "name": "system_program",
1121
+ "address": "11111111111111111111111111111111"
1122
+ }
1123
+ ],
1124
+ "args": []
1125
+ },
863
1126
  {
864
1127
  "name": "deactivate_ltt",
865
1128
  "discriminator": [
@@ -866,6 +866,269 @@ export type Xitadel = {
866
866
  ];
867
867
  "args": [];
868
868
  },
869
+ {
870
+ "name": "claimProtocolFees";
871
+ "discriminator": [
872
+ 34,
873
+ 142,
874
+ 219,
875
+ 112,
876
+ 109,
877
+ 54,
878
+ 133,
879
+ 23
880
+ ];
881
+ "accounts": [
882
+ {
883
+ "name": "config";
884
+ "pda": {
885
+ "seeds": [
886
+ {
887
+ "kind": "const";
888
+ "value": [
889
+ 99,
890
+ 111,
891
+ 110,
892
+ 102,
893
+ 105,
894
+ 103
895
+ ];
896
+ }
897
+ ];
898
+ };
899
+ },
900
+ {
901
+ "name": "manager";
902
+ "writable": true;
903
+ "signer": true;
904
+ },
905
+ {
906
+ "name": "lttConfiguration";
907
+ "pda": {
908
+ "seeds": [
909
+ {
910
+ "kind": "const";
911
+ "value": [
912
+ 108,
913
+ 116,
914
+ 116,
915
+ 95,
916
+ 99,
917
+ 111,
918
+ 110,
919
+ 102,
920
+ 105,
921
+ 103
922
+ ];
923
+ },
924
+ {
925
+ "kind": "account";
926
+ "path": "ltt_configuration.ltt_id";
927
+ "account": "lttConfiguration";
928
+ }
929
+ ];
930
+ };
931
+ },
932
+ {
933
+ "name": "fundingTokenMint";
934
+ },
935
+ {
936
+ "name": "protocolFeeReceiverAta";
937
+ "writable": true;
938
+ "pda": {
939
+ "seeds": [
940
+ {
941
+ "kind": "account";
942
+ "path": "manager";
943
+ },
944
+ {
945
+ "kind": "const";
946
+ "value": [
947
+ 6,
948
+ 221,
949
+ 246,
950
+ 225,
951
+ 215,
952
+ 101,
953
+ 161,
954
+ 147,
955
+ 217,
956
+ 203,
957
+ 225,
958
+ 70,
959
+ 206,
960
+ 235,
961
+ 121,
962
+ 172,
963
+ 28,
964
+ 180,
965
+ 133,
966
+ 237,
967
+ 95,
968
+ 91,
969
+ 55,
970
+ 145,
971
+ 58,
972
+ 140,
973
+ 245,
974
+ 133,
975
+ 126,
976
+ 255,
977
+ 0,
978
+ 169
979
+ ];
980
+ },
981
+ {
982
+ "kind": "account";
983
+ "path": "ltt_configuration.funding_token_mint";
984
+ "account": "lttConfiguration";
985
+ }
986
+ ];
987
+ "program": {
988
+ "kind": "const";
989
+ "value": [
990
+ 140,
991
+ 151,
992
+ 37,
993
+ 143,
994
+ 78,
995
+ 36,
996
+ 137,
997
+ 241,
998
+ 187,
999
+ 61,
1000
+ 16,
1001
+ 41,
1002
+ 20,
1003
+ 142,
1004
+ 13,
1005
+ 131,
1006
+ 11,
1007
+ 90,
1008
+ 19,
1009
+ 153,
1010
+ 218,
1011
+ 255,
1012
+ 16,
1013
+ 132,
1014
+ 4,
1015
+ 142,
1016
+ 123,
1017
+ 216,
1018
+ 219,
1019
+ 233,
1020
+ 248,
1021
+ 89
1022
+ ];
1023
+ };
1024
+ };
1025
+ },
1026
+ {
1027
+ "name": "fundingVaultAta";
1028
+ "writable": true;
1029
+ "pda": {
1030
+ "seeds": [
1031
+ {
1032
+ "kind": "account";
1033
+ "path": "lttConfiguration";
1034
+ },
1035
+ {
1036
+ "kind": "const";
1037
+ "value": [
1038
+ 6,
1039
+ 221,
1040
+ 246,
1041
+ 225,
1042
+ 215,
1043
+ 101,
1044
+ 161,
1045
+ 147,
1046
+ 217,
1047
+ 203,
1048
+ 225,
1049
+ 70,
1050
+ 206,
1051
+ 235,
1052
+ 121,
1053
+ 172,
1054
+ 28,
1055
+ 180,
1056
+ 133,
1057
+ 237,
1058
+ 95,
1059
+ 91,
1060
+ 55,
1061
+ 145,
1062
+ 58,
1063
+ 140,
1064
+ 245,
1065
+ 133,
1066
+ 126,
1067
+ 255,
1068
+ 0,
1069
+ 169
1070
+ ];
1071
+ },
1072
+ {
1073
+ "kind": "account";
1074
+ "path": "ltt_configuration.funding_token_mint";
1075
+ "account": "lttConfiguration";
1076
+ }
1077
+ ];
1078
+ "program": {
1079
+ "kind": "const";
1080
+ "value": [
1081
+ 140,
1082
+ 151,
1083
+ 37,
1084
+ 143,
1085
+ 78,
1086
+ 36,
1087
+ 137,
1088
+ 241,
1089
+ 187,
1090
+ 61,
1091
+ 16,
1092
+ 41,
1093
+ 20,
1094
+ 142,
1095
+ 13,
1096
+ 131,
1097
+ 11,
1098
+ 90,
1099
+ 19,
1100
+ 153,
1101
+ 218,
1102
+ 255,
1103
+ 16,
1104
+ 132,
1105
+ 4,
1106
+ 142,
1107
+ 123,
1108
+ 216,
1109
+ 219,
1110
+ 233,
1111
+ 248,
1112
+ 89
1113
+ ];
1114
+ };
1115
+ };
1116
+ },
1117
+ {
1118
+ "name": "tokenProgram";
1119
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1120
+ },
1121
+ {
1122
+ "name": "associatedTokenProgram";
1123
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1124
+ },
1125
+ {
1126
+ "name": "systemProgram";
1127
+ "address": "11111111111111111111111111111111";
1128
+ }
1129
+ ];
1130
+ "args": [];
1131
+ },
869
1132
  {
870
1133
  "name": "deactivateLtt";
871
1134
  "discriminator": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@xitadel-fi/sdk",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "description": "SDK for interacting with the Xitadel program",
6
6
  "main": "dist/sdk/src/index.js",
7
7
  "types": "dist/sdk/src/index.d.ts",