@indigoprotocol/indigo-mcp 0.2.0

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 (122) hide show
  1. package/README.md +324 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +26 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/resources/index.d.ts +3 -0
  7. package/dist/resources/index.d.ts.map +1 -0
  8. package/dist/resources/index.js +4 -0
  9. package/dist/resources/index.js.map +1 -0
  10. package/dist/tools/analytics-tools.d.ts +3 -0
  11. package/dist/tools/analytics-tools.d.ts.map +1 -0
  12. package/dist/tools/analytics-tools.js +127 -0
  13. package/dist/tools/analytics-tools.js.map +1 -0
  14. package/dist/tools/asset-tools.d.ts +3 -0
  15. package/dist/tools/asset-tools.d.ts.map +1 -0
  16. package/dist/tools/asset-tools.js +134 -0
  17. package/dist/tools/asset-tools.js.map +1 -0
  18. package/dist/tools/cdp-liquidation-tools.d.ts +3 -0
  19. package/dist/tools/cdp-liquidation-tools.d.ts.map +1 -0
  20. package/dist/tools/cdp-liquidation-tools.js +231 -0
  21. package/dist/tools/cdp-liquidation-tools.js.map +1 -0
  22. package/dist/tools/cdp-mint-burn-tools.d.ts +3 -0
  23. package/dist/tools/cdp-mint-burn-tools.d.ts.map +1 -0
  24. package/dist/tools/cdp-mint-burn-tools.js +161 -0
  25. package/dist/tools/cdp-mint-burn-tools.js.map +1 -0
  26. package/dist/tools/cdp-tools.d.ts +3 -0
  27. package/dist/tools/cdp-tools.d.ts.map +1 -0
  28. package/dist/tools/cdp-tools.js +174 -0
  29. package/dist/tools/cdp-tools.js.map +1 -0
  30. package/dist/tools/cdp-write-tools.d.ts +3 -0
  31. package/dist/tools/cdp-write-tools.d.ts.map +1 -0
  32. package/dist/tools/cdp-write-tools.js +284 -0
  33. package/dist/tools/cdp-write-tools.js.map +1 -0
  34. package/dist/tools/collector-tools.d.ts +3 -0
  35. package/dist/tools/collector-tools.d.ts.map +1 -0
  36. package/dist/tools/collector-tools.js +70 -0
  37. package/dist/tools/collector-tools.js.map +1 -0
  38. package/dist/tools/dex-tools.d.ts +3 -0
  39. package/dist/tools/dex-tools.d.ts.map +1 -0
  40. package/dist/tools/dex-tools.js +95 -0
  41. package/dist/tools/dex-tools.js.map +1 -0
  42. package/dist/tools/governance-tools.d.ts +3 -0
  43. package/dist/tools/governance-tools.d.ts.map +1 -0
  44. package/dist/tools/governance-tools.js +88 -0
  45. package/dist/tools/governance-tools.js.map +1 -0
  46. package/dist/tools/index.d.ts +3 -0
  47. package/dist/tools/index.d.ts.map +1 -0
  48. package/dist/tools/index.js +41 -0
  49. package/dist/tools/index.js.map +1 -0
  50. package/dist/tools/leverage-cdp-tools.d.ts +3 -0
  51. package/dist/tools/leverage-cdp-tools.d.ts.map +1 -0
  52. package/dist/tools/leverage-cdp-tools.js +143 -0
  53. package/dist/tools/leverage-cdp-tools.js.map +1 -0
  54. package/dist/tools/lrp-write-tools.d.ts +3 -0
  55. package/dist/tools/lrp-write-tools.d.ts.map +1 -0
  56. package/dist/tools/lrp-write-tools.js +221 -0
  57. package/dist/tools/lrp-write-tools.js.map +1 -0
  58. package/dist/tools/oracle-write-tools.d.ts +3 -0
  59. package/dist/tools/oracle-write-tools.d.ts.map +1 -0
  60. package/dist/tools/oracle-write-tools.js +135 -0
  61. package/dist/tools/oracle-write-tools.js.map +1 -0
  62. package/dist/tools/redemption-tools.d.ts +3 -0
  63. package/dist/tools/redemption-tools.d.ts.map +1 -0
  64. package/dist/tools/redemption-tools.js +91 -0
  65. package/dist/tools/redemption-tools.js.map +1 -0
  66. package/dist/tools/sp-request-tools.d.ts +3 -0
  67. package/dist/tools/sp-request-tools.d.ts.map +1 -0
  68. package/dist/tools/sp-request-tools.js +145 -0
  69. package/dist/tools/sp-request-tools.js.map +1 -0
  70. package/dist/tools/stability-pool-tools.d.ts +3 -0
  71. package/dist/tools/stability-pool-tools.d.ts.map +1 -0
  72. package/dist/tools/stability-pool-tools.js +76 -0
  73. package/dist/tools/stability-pool-tools.js.map +1 -0
  74. package/dist/tools/stability-pool-write-tools.d.ts +3 -0
  75. package/dist/tools/stability-pool-write-tools.d.ts.map +1 -0
  76. package/dist/tools/stability-pool-write-tools.js +121 -0
  77. package/dist/tools/stability-pool-write-tools.js.map +1 -0
  78. package/dist/tools/staking-reward-tools.d.ts +3 -0
  79. package/dist/tools/staking-reward-tools.d.ts.map +1 -0
  80. package/dist/tools/staking-reward-tools.js +43 -0
  81. package/dist/tools/staking-reward-tools.js.map +1 -0
  82. package/dist/tools/staking-tools.d.ts +3 -0
  83. package/dist/tools/staking-tools.d.ts.map +1 -0
  84. package/dist/tools/staking-tools.js +92 -0
  85. package/dist/tools/staking-tools.js.map +1 -0
  86. package/dist/tools/staking-write-tools.d.ts +3 -0
  87. package/dist/tools/staking-write-tools.d.ts.map +1 -0
  88. package/dist/tools/staking-write-tools.js +120 -0
  89. package/dist/tools/staking-write-tools.js.map +1 -0
  90. package/dist/types/tx-types.d.ts +12 -0
  91. package/dist/types/tx-types.d.ts.map +1 -0
  92. package/dist/types/tx-types.js +2 -0
  93. package/dist/types/tx-types.js.map +1 -0
  94. package/dist/utils/address.d.ts +2 -0
  95. package/dist/utils/address.d.ts.map +1 -0
  96. package/dist/utils/address.js +16 -0
  97. package/dist/utils/address.js.map +1 -0
  98. package/dist/utils/index.d.ts +7 -0
  99. package/dist/utils/index.d.ts.map +1 -0
  100. package/dist/utils/index.js +7 -0
  101. package/dist/utils/index.js.map +1 -0
  102. package/dist/utils/indexer-client.d.ts +4 -0
  103. package/dist/utils/indexer-client.d.ts.map +1 -0
  104. package/dist/utils/indexer-client.js +22 -0
  105. package/dist/utils/indexer-client.js.map +1 -0
  106. package/dist/utils/lucid-provider.d.ts +5 -0
  107. package/dist/utils/lucid-provider.d.ts.map +1 -0
  108. package/dist/utils/lucid-provider.js +39 -0
  109. package/dist/utils/lucid-provider.js.map +1 -0
  110. package/dist/utils/sdk-config.d.ts +4 -0
  111. package/dist/utils/sdk-config.d.ts.map +1 -0
  112. package/dist/utils/sdk-config.js +19 -0
  113. package/dist/utils/sdk-config.js.map +1 -0
  114. package/dist/utils/tx-builder.d.ts +4 -0
  115. package/dist/utils/tx-builder.d.ts.map +1 -0
  116. package/dist/utils/tx-builder.js +14 -0
  117. package/dist/utils/tx-builder.js.map +1 -0
  118. package/dist/utils/validators.d.ts +3 -0
  119. package/dist/utils/validators.d.ts.map +1 -0
  120. package/dist/utils/validators.js +3 -0
  121. package/dist/utils/validators.js.map +1 -0
  122. package/package.json +64 -0
@@ -0,0 +1,121 @@
1
+ import { z } from 'zod';
2
+ import { buildUnsignedTx } from '../utils/tx-builder.js';
3
+ import { getSystemParams } from '../utils/sdk-config.js';
4
+ import { createSpAccount, adjustSpAccount, closeSpAccount } from '@indigo-labs/indigo-sdk';
5
+ import { AssetParam } from '../utils/validators.js';
6
+ export function registerStabilityPoolWriteTools(server) {
7
+ server.tool('create_sp_account', 'Create a new stability pool account by depositing iAssets. Returns an unsigned transaction (CBOR hex) for client-side signing.', {
8
+ address: z.string().describe('User Cardano bech32 address'),
9
+ asset: AssetParam.describe('iAsset to deposit (iUSD, iBTC, iETH, or iSOL)'),
10
+ amount: z.string().describe('Amount of iAsset to deposit (in smallest unit)'),
11
+ }, async ({ address, asset, amount }) => {
12
+ try {
13
+ const result = await buildUnsignedTx(address, async (lucid) => {
14
+ const params = await getSystemParams();
15
+ const txBuilder = await createSpAccount(asset, BigInt(amount), params, lucid);
16
+ return txBuilder.complete();
17
+ }, {
18
+ type: 'create_sp_account',
19
+ description: `Create stability pool account for ${asset}`,
20
+ inputs: { address, asset, amount },
21
+ });
22
+ return {
23
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
24
+ };
25
+ }
26
+ catch (error) {
27
+ return {
28
+ content: [
29
+ {
30
+ type: 'text',
31
+ text: `Error creating SP account: ${error instanceof Error ? error.message : String(error)}`,
32
+ },
33
+ ],
34
+ isError: true,
35
+ };
36
+ }
37
+ });
38
+ server.tool('adjust_sp_account', 'Deposit to or withdraw from an existing stability pool account. Positive amount deposits, negative withdraws. Returns an unsigned transaction (CBOR hex) for client-side signing.', {
39
+ address: z.string().describe('User Cardano bech32 address'),
40
+ asset: AssetParam.describe('iAsset of the stability pool (iUSD, iBTC, iETH, or iSOL)'),
41
+ amount: z
42
+ .string()
43
+ .describe('Amount to adjust (positive = deposit, negative = withdraw, in smallest unit)'),
44
+ accountTxHash: z.string().describe('Transaction hash of the account UTxO'),
45
+ accountOutputIndex: z.number().describe('Output index of the account UTxO'),
46
+ }, async ({ address, asset, amount, accountTxHash, accountOutputIndex }) => {
47
+ try {
48
+ const result = await buildUnsignedTx(address, async (lucid) => {
49
+ const [accountUtxo] = await lucid.utxosByOutRef([
50
+ { txHash: accountTxHash, outputIndex: accountOutputIndex },
51
+ ]);
52
+ if (!accountUtxo)
53
+ throw new Error('Account UTxO not found on chain');
54
+ const params = await getSystemParams();
55
+ const txBuilder = await adjustSpAccount(asset, BigInt(amount), accountUtxo, params, lucid);
56
+ return txBuilder.complete();
57
+ }, {
58
+ type: 'adjust_sp_account',
59
+ description: `Adjust stability pool account for ${asset}`,
60
+ inputs: {
61
+ address,
62
+ asset,
63
+ amount,
64
+ accountTxHash,
65
+ accountOutputIndex: String(accountOutputIndex),
66
+ },
67
+ });
68
+ return {
69
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
70
+ };
71
+ }
72
+ catch (error) {
73
+ return {
74
+ content: [
75
+ {
76
+ type: 'text',
77
+ text: `Error adjusting SP account: ${error instanceof Error ? error.message : String(error)}`,
78
+ },
79
+ ],
80
+ isError: true,
81
+ };
82
+ }
83
+ });
84
+ server.tool('close_sp_account', 'Close a stability pool account and withdraw all deposited iAssets. Returns an unsigned transaction (CBOR hex) for client-side signing.', {
85
+ address: z.string().describe('User Cardano bech32 address'),
86
+ accountTxHash: z.string().describe('Transaction hash of the account UTxO'),
87
+ accountOutputIndex: z.number().describe('Output index of the account UTxO'),
88
+ }, async ({ address, accountTxHash, accountOutputIndex }) => {
89
+ try {
90
+ const result = await buildUnsignedTx(address, async (lucid) => {
91
+ const [accountUtxo] = await lucid.utxosByOutRef([
92
+ { txHash: accountTxHash, outputIndex: accountOutputIndex },
93
+ ]);
94
+ if (!accountUtxo)
95
+ throw new Error('Account UTxO not found on chain');
96
+ const params = await getSystemParams();
97
+ const txBuilder = await closeSpAccount(accountUtxo, params, lucid);
98
+ return txBuilder.complete();
99
+ }, {
100
+ type: 'close_sp_account',
101
+ description: 'Close stability pool account and withdraw all funds',
102
+ inputs: { address, accountTxHash, accountOutputIndex: String(accountOutputIndex) },
103
+ });
104
+ return {
105
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
106
+ };
107
+ }
108
+ catch (error) {
109
+ return {
110
+ content: [
111
+ {
112
+ type: 'text',
113
+ text: `Error closing SP account: ${error instanceof Error ? error.message : String(error)}`,
114
+ },
115
+ ],
116
+ isError: true,
117
+ };
118
+ }
119
+ });
120
+ }
121
+ //# sourceMappingURL=stability-pool-write-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stability-pool-write-tools.js","sourceRoot":"","sources":["../../src/tools/stability-pool-write-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,UAAU,+BAA+B,CAAC,MAAiB;IAC/D,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,gIAAgI,EAChI;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;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GAAG,MAAM,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;gBACnE,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC9B,CAAC,EACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,WAAW,EAAE,qDAAqD;gBAClE,MAAM,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,CAAC,EAAE;aACnF,CACF,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC5F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerStakingRewardTools(server: McpServer): void;
3
+ //# sourceMappingURL=staking-reward-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking-reward-tools.d.ts","sourceRoot":"","sources":["../../src/tools/staking-reward-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoDlE"}
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ import { distributeAda, findStakingManager } from '@indigo-labs/indigo-sdk';
3
+ import { buildUnsignedTx } from '../utils/tx-builder.js';
4
+ import { getSystemParams } from '../utils/sdk-config.js';
5
+ export function registerStakingRewardTools(server) {
6
+ server.tool('distribute_staking_rewards', 'Distribute collected ADA rewards from collector UTxOs to staking positions. This is a protocol maintenance operation that anyone can call. Returns an unsigned transaction (CBOR hex) for client-side signing.', {
7
+ address: z.string().describe('User Cardano bech32 address'),
8
+ collectorTxHashes: z
9
+ .array(z.object({
10
+ txHash: z.string().describe('Transaction hash of the collector UTxO'),
11
+ outputIndex: z.number().describe('Output index of the collector UTxO'),
12
+ }))
13
+ .describe('Array of collector UTxO references to distribute rewards from'),
14
+ }, async ({ address, collectorTxHashes }) => {
15
+ try {
16
+ const result = await buildUnsignedTx(address, async (lucid) => {
17
+ const params = await getSystemParams();
18
+ const stakingManagerOutput = await findStakingManager(params, lucid);
19
+ const txBuilder = await distributeAda(stakingManagerOutput.utxo, collectorTxHashes, params, lucid);
20
+ return txBuilder.complete();
21
+ }, {
22
+ type: 'distribute_staking_rewards',
23
+ description: 'Distribute ADA rewards from collector UTxOs to staking positions',
24
+ inputs: { address, collectorTxHashes: JSON.stringify(collectorTxHashes) },
25
+ });
26
+ return {
27
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
28
+ };
29
+ }
30
+ catch (error) {
31
+ return {
32
+ content: [
33
+ {
34
+ type: 'text',
35
+ text: `Error distributing staking rewards: ${error instanceof Error ? error.message : String(error)}`,
36
+ },
37
+ ],
38
+ isError: true,
39
+ };
40
+ }
41
+ });
42
+ }
43
+ //# sourceMappingURL=staking-reward-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking-reward-tools.js","sourceRoot":"","sources":["../../src/tools/staking-reward-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE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IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,uCAAuC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACtG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerStakingTools(server: McpServer): void;
3
+ //# sourceMappingURL=staking-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking-tools.d.ts","sourceRoot":"","sources":["../../src/tools/staking-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqG5D"}
@@ -0,0 +1,92 @@
1
+ import { z } from 'zod';
2
+ import { getIndexerClient } from '../utils/indexer-client.js';
3
+ import { extractPaymentCredential } from '../utils/address.js';
4
+ export function registerStakingTools(server) {
5
+ server.tool('get_staking_info', 'Get the current INDY staking manager state (slot, outputHash, totalStake, snapshotAda)', {}, async () => {
6
+ try {
7
+ const client = getIndexerClient();
8
+ const response = await client.get('/staking/');
9
+ return {
10
+ content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
11
+ };
12
+ }
13
+ catch (error) {
14
+ return {
15
+ content: [
16
+ {
17
+ type: 'text',
18
+ text: `Error fetching staking info: ${error instanceof Error ? error.message : String(error)}`,
19
+ },
20
+ ],
21
+ isError: true,
22
+ };
23
+ }
24
+ });
25
+ server.tool('get_staking_positions', 'Get all open INDY staking positions', {}, async () => {
26
+ try {
27
+ const client = getIndexerClient();
28
+ const response = await client.get('/staking/positions');
29
+ return {
30
+ content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
31
+ };
32
+ }
33
+ catch (error) {
34
+ return {
35
+ content: [
36
+ {
37
+ type: 'text',
38
+ text: `Error fetching staking positions: ${error instanceof Error ? error.message : String(error)}`,
39
+ },
40
+ ],
41
+ isError: true,
42
+ };
43
+ }
44
+ });
45
+ server.tool('get_staking_positions_by_owner', 'Get INDY staking positions for specific owners (accepts payment key hashes or bech32 addresses)', {
46
+ owners: z.array(z.string()).describe('Array of payment key hashes or bech32 addresses'),
47
+ }, async ({ owners }) => {
48
+ try {
49
+ const convertedOwners = owners.map((o) => extractPaymentCredential(o));
50
+ const client = getIndexerClient();
51
+ const response = await client.post('/staking/positions', { owners: convertedOwners });
52
+ return {
53
+ content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
54
+ };
55
+ }
56
+ catch (error) {
57
+ return {
58
+ content: [
59
+ {
60
+ type: 'text',
61
+ text: `Error fetching staking positions by owner: ${error instanceof Error ? error.message : String(error)}`,
62
+ },
63
+ ],
64
+ isError: true,
65
+ };
66
+ }
67
+ });
68
+ server.tool('get_staking_position_by_address', 'Get INDY staking positions for a single Cardano address', {
69
+ address: z.string().describe('Cardano bech32 address'),
70
+ }, async ({ address }) => {
71
+ try {
72
+ const pkh = extractPaymentCredential(address);
73
+ const client = getIndexerClient();
74
+ const response = await client.post('/staking/positions', { owners: [pkh] });
75
+ return {
76
+ content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
77
+ };
78
+ }
79
+ catch (error) {
80
+ return {
81
+ content: [
82
+ {
83
+ type: 'text',
84
+ text: `Error fetching staking position by address: ${error instanceof Error ? error.message : String(error)}`,
85
+ },
86
+ ],
87
+ isError: true,
88
+ };
89
+ }
90
+ });
91
+ }
92
+ //# sourceMappingURL=staking-tools.js.map
@@ -0,0 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';
2
+ export declare function registerStakingWriteTools(server: McpServer): void;
3
+ //# sourceMappingURL=staking-write-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking-write-tools.d.ts","sourceRoot":"","sources":["../../src/tools/staking-write-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8JjE"}
@@ -0,0 +1,120 @@
1
+ import { z } from 'zod';
2
+ import { openStakingPosition, adjustStakingPosition, closeStakingPosition, findStakingManager, } from '@indigo-labs/indigo-sdk';
3
+ import { buildUnsignedTx } from '../utils/tx-builder.js';
4
+ import { getSystemParams } from '../utils/sdk-config.js';
5
+ export function registerStakingWriteTools(server) {
6
+ server.tool('open_staking_position', 'Stake INDY tokens by creating a new staking position. Returns an unsigned transaction (CBOR hex) for client-side signing.', {
7
+ address: z.string().describe('User Cardano bech32 address'),
8
+ amount: z.string().describe('INDY amount to stake (in smallest unit)'),
9
+ }, async ({ address, amount }) => {
10
+ try {
11
+ const result = await buildUnsignedTx(address, async (lucid) => {
12
+ const params = await getSystemParams();
13
+ const stakingManagerOutput = await findStakingManager(params, lucid);
14
+ const txBuilder = await openStakingPosition(BigInt(amount), params, lucid, stakingManagerOutput.utxo);
15
+ return txBuilder.complete();
16
+ }, {
17
+ type: 'open_staking_position',
18
+ description: 'Create a new INDY staking position',
19
+ inputs: { address, amount },
20
+ });
21
+ return {
22
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
23
+ };
24
+ }
25
+ catch (error) {
26
+ return {
27
+ content: [
28
+ {
29
+ type: 'text',
30
+ text: `Error opening staking position: ${error instanceof Error ? error.message : String(error)}`,
31
+ },
32
+ ],
33
+ isError: true,
34
+ };
35
+ }
36
+ });
37
+ server.tool('adjust_staking_position', 'Adjust an existing INDY staking position (add or remove INDY). Returns an unsigned transaction (CBOR hex) for client-side signing.', {
38
+ address: z.string().describe('User Cardano bech32 address'),
39
+ amount: z
40
+ .string()
41
+ .describe('INDY amount to adjust (positive = stake more, negative = unstake)'),
42
+ positionTxHash: z.string().describe('Transaction hash of the staking position UTxO'),
43
+ positionOutputIndex: z.number().describe('Output index of the staking position UTxO'),
44
+ }, async ({ address, amount, positionTxHash, positionOutputIndex }) => {
45
+ try {
46
+ const result = await buildUnsignedTx(address, async (lucid) => {
47
+ const params = await getSystemParams();
48
+ const stakingManagerOutput = await findStakingManager(params, lucid);
49
+ const positionOutRef = {
50
+ txHash: positionTxHash,
51
+ outputIndex: positionOutputIndex,
52
+ };
53
+ const currentSlot = lucid.currentSlot();
54
+ const txBuilder = await adjustStakingPosition(positionOutRef, BigInt(amount), params, lucid, currentSlot, stakingManagerOutput.utxo);
55
+ return txBuilder.complete();
56
+ }, {
57
+ type: 'adjust_staking_position',
58
+ description: 'Adjust an existing INDY staking position',
59
+ inputs: {
60
+ address,
61
+ amount,
62
+ positionTxHash,
63
+ positionOutputIndex: String(positionOutputIndex),
64
+ },
65
+ });
66
+ return {
67
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
68
+ };
69
+ }
70
+ catch (error) {
71
+ return {
72
+ content: [
73
+ {
74
+ type: 'text',
75
+ text: `Error adjusting staking position: ${error instanceof Error ? error.message : String(error)}`,
76
+ },
77
+ ],
78
+ isError: true,
79
+ };
80
+ }
81
+ });
82
+ server.tool('close_staking_position', 'Close an INDY staking position and unstake all INDY. Returns an unsigned transaction (CBOR hex) for client-side signing.', {
83
+ address: z.string().describe('User Cardano bech32 address'),
84
+ positionTxHash: z.string().describe('Transaction hash of the staking position UTxO'),
85
+ positionOutputIndex: z.number().describe('Output index of the staking position UTxO'),
86
+ }, async ({ address, positionTxHash, positionOutputIndex }) => {
87
+ try {
88
+ const result = await buildUnsignedTx(address, async (lucid) => {
89
+ const params = await getSystemParams();
90
+ const stakingManagerOutput = await findStakingManager(params, lucid);
91
+ const positionOutRef = {
92
+ txHash: positionTxHash,
93
+ outputIndex: positionOutputIndex,
94
+ };
95
+ const currentSlot = lucid.currentSlot();
96
+ const txBuilder = await closeStakingPosition(positionOutRef, params, lucid, currentSlot, stakingManagerOutput.utxo);
97
+ return txBuilder.complete();
98
+ }, {
99
+ type: 'close_staking_position',
100
+ description: 'Close an INDY staking position and unstake all INDY',
101
+ inputs: { address, positionTxHash, positionOutputIndex: String(positionOutputIndex) },
102
+ });
103
+ return {
104
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
105
+ };
106
+ }
107
+ catch (error) {
108
+ return {
109
+ content: [
110
+ {
111
+ type: 'text',
112
+ text: `Error closing staking position: ${error instanceof Error ? error.message : String(error)}`,
113
+ },
114
+ ],
115
+ isError: true,
116
+ };
117
+ }
118
+ });
119
+ }
120
+ //# sourceMappingURL=staking-write-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking-write-tools.js","sourceRoot":"","sources":["../../src/tools/staking-write-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,2HAA2H,EAC3H;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QAC3D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;KACvE,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC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MAAM,CAAC,mBAAmB,CAAC,EAAE;aACtF,CACF,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAClG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface TxSummary {
2
+ type: string;
3
+ description: string;
4
+ inputs: Record<string, string>;
5
+ }
6
+ export interface UnsignedTxResult {
7
+ unsignedTx: string;
8
+ txHash: string;
9
+ fee: string;
10
+ summary: TxSummary;
11
+ }
12
+ //# sourceMappingURL=tx-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-types.d.ts","sourceRoot":"","sources":["../../src/types/tx-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,SAAS,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tx-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-types.js","sourceRoot":"","sources":["../../src/types/tx-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function extractPaymentCredential(input: string): string;
2
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/utils/address.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa9D"}
@@ -0,0 +1,16 @@
1
+ import { bech32 } from 'bech32';
2
+ export function extractPaymentCredential(input) {
3
+ // If 56-char hex, return as-is (payment key hash)
4
+ if (/^[0-9a-fA-F]{56}$/.test(input)) {
5
+ return input;
6
+ }
7
+ // If bech32 address, decode and extract payment credential hash (bytes 1-29)
8
+ if (input.startsWith('addr1') || input.startsWith('addr_test1')) {
9
+ const { words } = bech32.decode(input, 200);
10
+ const bytes = bech32.fromWords(words);
11
+ const pkhBytes = bytes.slice(1, 29);
12
+ return Buffer.from(pkhBytes).toString('hex');
13
+ }
14
+ throw new Error(`Invalid address or payment key hash: ${input}`);
15
+ }
16
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/utils/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,kDAAkD;IAClD,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,6EAA6E;IAC7E,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,KAAK,EAAE,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { getIndexerClient, getLiquidations } from './indexer-client.js';
2
+ export { AssetParam } from './validators.js';
3
+ export { extractPaymentCredential } from './address.js';
4
+ export { getLucid, getLucidNetwork, resetLucid } from './lucid-provider.js';
5
+ export { getSystemParams, resetSystemParamsCache } from './sdk-config.js';
6
+ export { buildUnsignedTx } from './tx-builder.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { getIndexerClient, getLiquidations } from './indexer-client.js';
2
+ export { AssetParam } from './validators.js';
3
+ export { extractPaymentCredential } from './address.js';
4
+ export { getLucid, getLucidNetwork, resetLucid } from './lucid-provider.js';
5
+ export { getSystemParams, resetSystemParamsCache } from './sdk-config.js';
6
+ export { buildUnsignedTx } from './tx-builder.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type AxiosInstance } from 'axios';
2
+ export declare function getIndexerClient(): AxiosInstance;
3
+ export declare function getLiquidations(): Promise<unknown>;
4
+ //# sourceMappingURL=indexer-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer-client.d.ts","sourceRoot":"","sources":["../../src/utils/indexer-client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAMlD,wBAAgB,gBAAgB,IAAI,aAAa,CAYhD;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAIxD"}
@@ -0,0 +1,22 @@
1
+ import axios from 'axios';
2
+ const INDEXER_URL = process.env.INDEXER_URL || 'https://analytics.indigoprotocol.io/api/v1';
3
+ let instance = null;
4
+ export function getIndexerClient() {
5
+ if (!instance) {
6
+ instance = axios.create({
7
+ baseURL: INDEXER_URL,
8
+ timeout: 15000,
9
+ headers: {
10
+ 'Content-Type': 'application/json',
11
+ Accept: 'application/json',
12
+ },
13
+ });
14
+ }
15
+ return instance;
16
+ }
17
+ export async function getLiquidations() {
18
+ const client = getIndexerClient();
19
+ const response = await client.get('/liquidations');
20
+ return response.data;
21
+ }
22
+ //# sourceMappingURL=indexer-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer-client.js","sourceRoot":"","sources":["../../src/utils/indexer-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,4CAA4C,CAAC;AAE5F,IAAI,QAAQ,GAAyB,IAAI,CAAC;AAE1C,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,KAAM;YACf,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { LucidEvolution, Network } from '@lucid-evolution/lucid';
2
+ export declare function getLucidNetwork(): Network;
3
+ export declare function getLucid(): Promise<LucidEvolution>;
4
+ export declare function resetLucid(): void;
5
+ //# sourceMappingURL=lucid-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lucid-provider.d.ts","sourceRoot":"","sources":["../../src/utils/lucid-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAItE,wBAAgB,eAAe,IAAI,OAAO,CAUzC;AAaD,wBAAsB,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC,CAaxD;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
@@ -0,0 +1,39 @@
1
+ import { Blockfrost, Lucid } from '@lucid-evolution/lucid';
2
+ let lucidInstance = null;
3
+ export function getLucidNetwork() {
4
+ const network = process.env.CARDANO_NETWORK || 'mainnet';
5
+ switch (network.toLowerCase()) {
6
+ case 'preprod':
7
+ return 'Preprod';
8
+ case 'preview':
9
+ return 'Preview';
10
+ default:
11
+ return 'Mainnet';
12
+ }
13
+ }
14
+ function getBlockfrostUrl(network) {
15
+ switch (network) {
16
+ case 'Preprod':
17
+ return 'https://cardano-preprod.blockfrost.io/api/v0';
18
+ case 'Preview':
19
+ return 'https://cardano-preview.blockfrost.io/api/v0';
20
+ default:
21
+ return 'https://cardano-mainnet.blockfrost.io/api/v0';
22
+ }
23
+ }
24
+ export async function getLucid() {
25
+ if (lucidInstance)
26
+ return lucidInstance;
27
+ const apiKey = process.env.BLOCKFROST_API_KEY;
28
+ if (!apiKey) {
29
+ throw new Error('BLOCKFROST_API_KEY environment variable is required for write operations');
30
+ }
31
+ const network = getLucidNetwork();
32
+ const url = getBlockfrostUrl(network);
33
+ lucidInstance = await Lucid(new Blockfrost(url, apiKey), network);
34
+ return lucidInstance;
35
+ }
36
+ export function resetLucid() {
37
+ lucidInstance = null;
38
+ }
39
+ //# sourceMappingURL=lucid-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lucid-provider.js","sourceRoot":"","sources":["../../src/utils/lucid-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG3D,IAAI,aAAa,GAA0B,IAAI,CAAC;AAEhD,MAAM,UAAU,eAAe;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,SAAS,CAAC;IACzD,QAAQ,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;QAC9B,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAgB;IACxC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS;YACZ,OAAO,8CAA8C,CAAC;QACxD,KAAK,SAAS;YACZ,OAAO,8CAA8C,CAAC;QACxD;YACE,OAAO,8CAA8C,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IAExC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;IAC9F,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;IAClC,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEtC,aAAa,GAAG,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAClE,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SystemParams } from '@indigo-labs/indigo-sdk';
2
+ export declare function getSystemParams(): Promise<SystemParams>;
3
+ export declare function resetSystemParamsCache(): void;
4
+ //# sourceMappingURL=sdk-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-config.d.ts","sourceRoot":"","sources":["../../src/utils/sdk-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAU5D,wBAAsB,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,CAS7D;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C"}