@manifest-network/manifest-mcp-core 0.1.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 (237) hide show
  1. package/dist/__test-utils__/callTool.d.ts +29 -0
  2. package/dist/__test-utils__/callTool.d.ts.map +1 -0
  3. package/dist/__test-utils__/callTool.js +45 -0
  4. package/dist/__test-utils__/callTool.js.map +1 -0
  5. package/dist/__test-utils__/mocks.d.ts +125 -0
  6. package/dist/__test-utils__/mocks.d.ts.map +1 -0
  7. package/dist/__test-utils__/mocks.js +146 -0
  8. package/dist/__test-utils__/mocks.js.map +1 -0
  9. package/dist/client.d.ts +67 -0
  10. package/dist/client.d.ts.map +1 -0
  11. package/dist/client.js +209 -0
  12. package/dist/client.js.map +1 -0
  13. package/dist/config.d.ts +30 -0
  14. package/dist/config.d.ts.map +1 -0
  15. package/dist/config.js +127 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/cosmos.d.ts +24 -0
  18. package/dist/cosmos.d.ts.map +1 -0
  19. package/dist/cosmos.js +85 -0
  20. package/dist/cosmos.js.map +1 -0
  21. package/dist/index.d.ts +19 -0
  22. package/dist/index.js +20 -0
  23. package/dist/lcd-adapter.d.ts +15 -0
  24. package/dist/lcd-adapter.d.ts.map +1 -0
  25. package/dist/lcd-adapter.js +98 -0
  26. package/dist/lcd-adapter.js.map +1 -0
  27. package/dist/logger.d.ts +20 -0
  28. package/dist/logger.d.ts.map +1 -0
  29. package/dist/logger.js +43 -0
  30. package/dist/logger.js.map +1 -0
  31. package/dist/modules.d.ts +63 -0
  32. package/dist/modules.d.ts.map +1 -0
  33. package/dist/modules.js +759 -0
  34. package/dist/modules.js.map +1 -0
  35. package/dist/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  36. package/dist/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  37. package/dist/node_modules/@vitest/expect/dist/index.d.ts +802 -0
  38. package/dist/node_modules/@vitest/expect/dist/index.d.ts.map +1 -0
  39. package/dist/node_modules/@vitest/expect/dist/index.js +1457 -0
  40. package/dist/node_modules/@vitest/expect/dist/index.js.map +1 -0
  41. package/dist/node_modules/@vitest/pretty-format/dist/index.d.ts +95 -0
  42. package/dist/node_modules/@vitest/pretty-format/dist/index.d.ts.map +1 -0
  43. package/dist/node_modules/@vitest/pretty-format/dist/index.js +877 -0
  44. package/dist/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  45. package/dist/node_modules/@vitest/runner/dist/chunk-tasks.js +91 -0
  46. package/dist/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  47. package/dist/node_modules/@vitest/runner/dist/index.js +1381 -0
  48. package/dist/node_modules/@vitest/runner/dist/index.js.map +1 -0
  49. package/dist/node_modules/@vitest/runner/dist/tasks.d-D2GKpdwQ.d.ts +540 -0
  50. package/dist/node_modules/@vitest/runner/dist/tasks.d-D2GKpdwQ.d.ts.map +1 -0
  51. package/dist/node_modules/@vitest/runner/dist/utils.js +1 -0
  52. package/dist/node_modules/@vitest/snapshot/dist/environment.d-DOJxxZV9.d.ts +16 -0
  53. package/dist/node_modules/@vitest/snapshot/dist/environment.d-DOJxxZV9.d.ts.map +1 -0
  54. package/dist/node_modules/@vitest/snapshot/dist/index.d.ts +89 -0
  55. package/dist/node_modules/@vitest/snapshot/dist/index.d.ts.map +1 -0
  56. package/dist/node_modules/@vitest/snapshot/dist/index.js +649 -0
  57. package/dist/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  58. package/dist/node_modules/@vitest/snapshot/dist/rawSnapshot.d-U2kJUxDr.d.ts +40 -0
  59. package/dist/node_modules/@vitest/snapshot/dist/rawSnapshot.d-U2kJUxDr.d.ts.map +1 -0
  60. package/dist/node_modules/@vitest/spy/dist/index.d.ts +343 -0
  61. package/dist/node_modules/@vitest/spy/dist/index.d.ts.map +1 -0
  62. package/dist/node_modules/@vitest/spy/dist/index.js +386 -0
  63. package/dist/node_modules/@vitest/spy/dist/index.js.map +1 -0
  64. package/dist/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +82 -0
  65. package/dist/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js.map +1 -0
  66. package/dist/node_modules/@vitest/utils/dist/diff.d.ts +14 -0
  67. package/dist/node_modules/@vitest/utils/dist/diff.d.ts.map +1 -0
  68. package/dist/node_modules/@vitest/utils/dist/diff.js +1297 -0
  69. package/dist/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  70. package/dist/node_modules/@vitest/utils/dist/display.d.ts +15 -0
  71. package/dist/node_modules/@vitest/utils/dist/display.d.ts.map +1 -0
  72. package/dist/node_modules/@vitest/utils/dist/display.js +558 -0
  73. package/dist/node_modules/@vitest/utils/dist/display.js.map +1 -0
  74. package/dist/node_modules/@vitest/utils/dist/error.js +30 -0
  75. package/dist/node_modules/@vitest/utils/dist/error.js.map +1 -0
  76. package/dist/node_modules/@vitest/utils/dist/helpers.js +181 -0
  77. package/dist/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  78. package/dist/node_modules/@vitest/utils/dist/offset.js +27 -0
  79. package/dist/node_modules/@vitest/utils/dist/offset.js.map +1 -0
  80. package/dist/node_modules/@vitest/utils/dist/serialize.js +77 -0
  81. package/dist/node_modules/@vitest/utils/dist/serialize.js.map +1 -0
  82. package/dist/node_modules/@vitest/utils/dist/source-map.js +367 -0
  83. package/dist/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  84. package/dist/node_modules/@vitest/utils/dist/timers.js +37 -0
  85. package/dist/node_modules/@vitest/utils/dist/timers.js.map +1 -0
  86. package/dist/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts +38 -0
  87. package/dist/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts.map +1 -0
  88. package/dist/node_modules/@vitest/utils/dist/types.d.ts +25 -0
  89. package/dist/node_modules/@vitest/utils/dist/types.d.ts.map +1 -0
  90. package/dist/node_modules/chai/index.js +2875 -0
  91. package/dist/node_modules/chai/index.js.map +1 -0
  92. package/dist/node_modules/magic-string/dist/magic-string.es.js +939 -0
  93. package/dist/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  94. package/dist/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +85 -0
  95. package/dist/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js.map +1 -0
  96. package/dist/node_modules/tinybench/dist/index.d.ts +91 -0
  97. package/dist/node_modules/tinybench/dist/index.d.ts.map +1 -0
  98. package/dist/node_modules/tinyrainbow/dist/index.d.ts +9 -0
  99. package/dist/node_modules/tinyrainbow/dist/index.d.ts.map +1 -0
  100. package/dist/node_modules/tinyrainbow/dist/index.js +86 -0
  101. package/dist/node_modules/tinyrainbow/dist/index.js.map +1 -0
  102. package/dist/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
  103. package/dist/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js.map +1 -0
  104. package/dist/node_modules/vitest/dist/chunks/benchmark.D0SlKNbZ.js +41 -0
  105. package/dist/node_modules/vitest/dist/chunks/benchmark.D0SlKNbZ.js.map +1 -0
  106. package/dist/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts +12 -0
  107. package/dist/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts.map +1 -0
  108. package/dist/node_modules/vitest/dist/chunks/global.d.x-ILCfAE.d.ts +100 -0
  109. package/dist/node_modules/vitest/dist/chunks/global.d.x-ILCfAE.d.ts.map +1 -0
  110. package/dist/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +57 -0
  111. package/dist/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js.map +1 -0
  112. package/dist/node_modules/vitest/dist/chunks/rpc.d.BFMWpdph.d.ts +13 -0
  113. package/dist/node_modules/vitest/dist/chunks/rpc.d.BFMWpdph.d.ts.map +1 -0
  114. package/dist/node_modules/vitest/dist/chunks/test.CTcmp4Su.js +2791 -0
  115. package/dist/node_modules/vitest/dist/chunks/test.CTcmp4Su.js.map +1 -0
  116. package/dist/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +44 -0
  117. package/dist/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js.map +1 -0
  118. package/dist/node_modules/vitest/dist/index.d.ts +9 -0
  119. package/dist/queries/auth.d.ts +15 -0
  120. package/dist/queries/auth.d.ts.map +1 -0
  121. package/dist/queries/auth.js +58 -0
  122. package/dist/queries/auth.js.map +1 -0
  123. package/dist/queries/bank.d.ts +15 -0
  124. package/dist/queries/bank.d.ts.map +1 -0
  125. package/dist/queries/bank.js +93 -0
  126. package/dist/queries/bank.js.map +1 -0
  127. package/dist/queries/billing.d.ts +15 -0
  128. package/dist/queries/billing.d.ts.map +1 -0
  129. package/dist/queries/billing.js +114 -0
  130. package/dist/queries/billing.js.map +1 -0
  131. package/dist/queries/distribution.d.ts +15 -0
  132. package/dist/queries/distribution.d.ts.map +1 -0
  133. package/dist/queries/distribution.js +73 -0
  134. package/dist/queries/distribution.js.map +1 -0
  135. package/dist/queries/gov.d.ts +15 -0
  136. package/dist/queries/gov.d.ts.map +1 -0
  137. package/dist/queries/gov.js +98 -0
  138. package/dist/queries/gov.js.map +1 -0
  139. package/dist/queries/group.d.ts +15 -0
  140. package/dist/queries/group.d.ts.map +1 -0
  141. package/dist/queries/group.js +159 -0
  142. package/dist/queries/group.js.map +1 -0
  143. package/dist/queries/index.d.ts +10 -0
  144. package/dist/queries/index.js +10 -0
  145. package/dist/queries/sku.d.ts +16 -0
  146. package/dist/queries/sku.d.ts.map +1 -0
  147. package/dist/queries/sku.js +85 -0
  148. package/dist/queries/sku.js.map +1 -0
  149. package/dist/queries/staking.d.ts +15 -0
  150. package/dist/queries/staking.d.ts.map +1 -0
  151. package/dist/queries/staking.js +127 -0
  152. package/dist/queries/staking.js.map +1 -0
  153. package/dist/queries/utils.d.ts +54 -0
  154. package/dist/queries/utils.d.ts.map +1 -0
  155. package/dist/queries/utils.js +74 -0
  156. package/dist/queries/utils.js.map +1 -0
  157. package/dist/retry.d.ts +48 -0
  158. package/dist/retry.d.ts.map +1 -0
  159. package/dist/retry.js +106 -0
  160. package/dist/retry.js.map +1 -0
  161. package/dist/server-utils.d.ts +61 -0
  162. package/dist/server-utils.d.ts.map +1 -0
  163. package/dist/server-utils.js +156 -0
  164. package/dist/server-utils.js.map +1 -0
  165. package/dist/tools/fundCredits.d.ts +8 -0
  166. package/dist/tools/fundCredits.d.ts.map +1 -0
  167. package/dist/tools/fundCredits.js +9 -0
  168. package/dist/tools/fundCredits.js.map +1 -0
  169. package/dist/tools/getBalance.d.ts +26 -0
  170. package/dist/tools/getBalance.d.ts.map +1 -0
  171. package/dist/tools/getBalance.js +59 -0
  172. package/dist/tools/getBalance.js.map +1 -0
  173. package/dist/tools/stopApp.d.ts +13 -0
  174. package/dist/tools/stopApp.d.ts.map +1 -0
  175. package/dist/tools/stopApp.js +15 -0
  176. package/dist/tools/stopApp.js.map +1 -0
  177. package/dist/transactions/bank.d.ts +11 -0
  178. package/dist/transactions/bank.d.ts.map +1 -0
  179. package/dist/transactions/bank.js +75 -0
  180. package/dist/transactions/bank.js.map +1 -0
  181. package/dist/transactions/billing.d.ts +11 -0
  182. package/dist/transactions/billing.d.ts.map +1 -0
  183. package/dist/transactions/billing.js +189 -0
  184. package/dist/transactions/billing.js.map +1 -0
  185. package/dist/transactions/distribution.d.ts +11 -0
  186. package/dist/transactions/distribution.d.ts.map +1 -0
  187. package/dist/transactions/distribution.js +60 -0
  188. package/dist/transactions/distribution.js.map +1 -0
  189. package/dist/transactions/gov.d.ts +11 -0
  190. package/dist/transactions/gov.d.ts.map +1 -0
  191. package/dist/transactions/gov.js +108 -0
  192. package/dist/transactions/gov.js.map +1 -0
  193. package/dist/transactions/group.d.ts +11 -0
  194. package/dist/transactions/group.d.ts.map +1 -0
  195. package/dist/transactions/group.js +347 -0
  196. package/dist/transactions/group.js.map +1 -0
  197. package/dist/transactions/index.d.ts +10 -0
  198. package/dist/transactions/index.js +10 -0
  199. package/dist/transactions/manifest.d.ts +11 -0
  200. package/dist/transactions/manifest.d.ts.map +1 -0
  201. package/dist/transactions/manifest.js +59 -0
  202. package/dist/transactions/manifest.js.map +1 -0
  203. package/dist/transactions/sku.d.ts +11 -0
  204. package/dist/transactions/sku.d.ts.map +1 -0
  205. package/dist/transactions/sku.js +191 -0
  206. package/dist/transactions/sku.js.map +1 -0
  207. package/dist/transactions/staking.d.ts +11 -0
  208. package/dist/transactions/staking.d.ts.map +1 -0
  209. package/dist/transactions/staking.js +79 -0
  210. package/dist/transactions/staking.js.map +1 -0
  211. package/dist/transactions/utils.d.ts +161 -0
  212. package/dist/transactions/utils.d.ts.map +1 -0
  213. package/dist/transactions/utils.js +272 -0
  214. package/dist/transactions/utils.js.map +1 -0
  215. package/dist/types.d.ts +390 -0
  216. package/dist/types.d.ts.map +1 -0
  217. package/dist/types.js +45 -0
  218. package/dist/types.js.map +1 -0
  219. package/dist/validation.d.ts +30 -0
  220. package/dist/validation.d.ts.map +1 -0
  221. package/dist/validation.js +53 -0
  222. package/dist/validation.js.map +1 -0
  223. package/dist/version.d.ts +5 -0
  224. package/dist/version.d.ts.map +1 -0
  225. package/dist/version.js +6 -0
  226. package/dist/version.js.map +1 -0
  227. package/dist/wallet/index.d.ts +4 -0
  228. package/dist/wallet/index.js +3 -0
  229. package/dist/wallet/mnemonic.d.ts +47 -0
  230. package/dist/wallet/mnemonic.d.ts.map +1 -0
  231. package/dist/wallet/mnemonic.js +97 -0
  232. package/dist/wallet/mnemonic.js.map +1 -0
  233. package/dist/wallet/sign-arbitrary.d.ts +12 -0
  234. package/dist/wallet/sign-arbitrary.d.ts.map +1 -0
  235. package/dist/wallet/sign-arbitrary.js +36 -0
  236. package/dist/wallet/sign-arbitrary.js.map +1 -0
  237. package/package.json +72 -0
@@ -0,0 +1,390 @@
1
+ import { OfflineSigner } from "@cosmjs/proto-signing";
2
+ import { CreditAccount, Lease, Params as BillingParams } from "@manifest-network/manifestjs/dist/codegen/liftedinit/billing/v1/types.js";
3
+ import { BaseAccount, ModuleAccount, Params as AuthParams } from "@manifest-network/manifestjs/dist/codegen/cosmos/auth/v1beta1/auth.js";
4
+ import { Metadata as BankMetadata, Params as BankParams, SendEnabled } from "@manifest-network/manifestjs/dist/codegen/cosmos/bank/v1beta1/bank.js";
5
+ import { DelegationDelegatorReward, Params as DistributionParams, ValidatorAccumulatedCommission, ValidatorOutstandingRewards, ValidatorSlashEvent } from "@manifest-network/manifestjs/dist/codegen/cosmos/distribution/v1beta1/distribution.js";
6
+ import { Deposit as GovDeposit, DepositParams, Params as GovParams, Proposal as GovProposal, TallyParams, TallyResult as GovTallyResult, Vote as GovVote, VotingParams } from "@manifest-network/manifestjs/dist/codegen/cosmos/gov/v1/gov.js";
7
+ import { GroupInfo, GroupMember, GroupPolicyInfo, Proposal as GroupProposal, TallyResult as GroupTallyResult, Vote as GroupVote } from "@manifest-network/manifestjs/dist/codegen/cosmos/group/v1/types.js";
8
+ import { DelegationResponse, HistoricalInfo, Params as StakingParams, Pool as StakingPool, RedelegationResponse, UnbondingDelegation, Validator } from "@manifest-network/manifestjs/dist/codegen/cosmos/staking/v1beta1/staking.js";
9
+ import { Any } from "@manifest-network/manifestjs/dist/codegen/google/protobuf/any.js";
10
+ import { QueryCreditEstimateResponse } from "@manifest-network/manifestjs/dist/codegen/liftedinit/billing/v1/query.js";
11
+ import { LeaseItemInput } from "@manifest-network/manifestjs/dist/codegen/liftedinit/billing/v1/tx.js";
12
+ import { Params as SkuParams, Provider, SKU } from "@manifest-network/manifestjs/dist/codegen/liftedinit/sku/v1/types.js";
13
+
14
+ //#region src/types.d.ts
15
+ /**
16
+ * Rate limiting configuration
17
+ */
18
+ interface RateLimitConfig {
19
+ /** Maximum requests per second (default: 10) */
20
+ readonly requestsPerSecond?: number;
21
+ }
22
+ /**
23
+ * Retry configuration for transient RPC failures
24
+ */
25
+ interface RetryConfig {
26
+ /** Maximum number of retry attempts (default: 3) */
27
+ readonly maxRetries?: number;
28
+ /** Base delay in milliseconds before first retry (default: 1000) */
29
+ readonly baseDelayMs?: number;
30
+ /** Maximum delay in milliseconds between retries (default: 10000) */
31
+ readonly maxDelayMs?: number;
32
+ }
33
+ /**
34
+ * Configuration for the Manifest MCP server
35
+ */
36
+ interface ManifestMCPConfig {
37
+ /** Chain ID (e.g., "manifest-ledger-testnet") */
38
+ readonly chainId: string;
39
+ /** RPC endpoint URL (required for transactions; optional if restUrl provided for query-only mode) */
40
+ readonly rpcUrl?: string;
41
+ /** Gas price with denomination (e.g., "1.0umfx"); required when rpcUrl is provided */
42
+ readonly gasPrice?: string;
43
+ /** REST/LCD endpoint URL for queries (e.g., "http://localhost:1317") */
44
+ readonly restUrl?: string;
45
+ /** Address prefix (e.g., "manifest") */
46
+ readonly addressPrefix?: string;
47
+ /** Rate limiting configuration */
48
+ readonly rateLimit?: RateLimitConfig;
49
+ /** Retry configuration for transient failures */
50
+ readonly retry?: RetryConfig;
51
+ }
52
+ /**
53
+ * Wallet provider interface for different wallet implementations
54
+ *
55
+ * Any wallet that provides an OfflineSigner works (Keplr, Web3Auth, Leap, cosmos-kit, etc.)
56
+ */
57
+ interface SignArbitraryResult {
58
+ readonly pub_key: {
59
+ readonly type: string;
60
+ readonly value: string;
61
+ };
62
+ readonly signature: string;
63
+ }
64
+ interface WalletProvider {
65
+ /** Get the wallet's address */
66
+ getAddress(): Promise<string>;
67
+ /** Get the offline signer for signing transactions */
68
+ getSigner(): Promise<OfflineSigner>;
69
+ /** Optional: Sign arbitrary data (ADR-036) for off-chain authentication */
70
+ signArbitrary?(address: string, data: string): Promise<SignArbitraryResult>;
71
+ /** Optional: Connect to the wallet */
72
+ connect?(): Promise<void>;
73
+ /** Optional: Disconnect from the wallet */
74
+ disconnect?(): Promise<void>;
75
+ }
76
+ /**
77
+ * Result from a Cosmos transaction
78
+ */
79
+ interface CosmosTxResult {
80
+ readonly module: string;
81
+ readonly subcommand: string;
82
+ readonly transactionHash: string;
83
+ readonly code: number;
84
+ readonly height: string;
85
+ readonly rawLog?: string;
86
+ readonly confirmed?: boolean;
87
+ readonly confirmationHeight?: string;
88
+ readonly gasUsed?: string;
89
+ readonly gasWanted?: string;
90
+ readonly events?: readonly {
91
+ readonly type: string;
92
+ readonly attributes: readonly {
93
+ readonly key: string;
94
+ readonly value: string;
95
+ }[];
96
+ }[];
97
+ }
98
+ /**
99
+ * Module information for discovery
100
+ */
101
+ interface ModuleInfo {
102
+ readonly name: string;
103
+ readonly description: string;
104
+ readonly args?: string;
105
+ }
106
+ /**
107
+ * Available modules listing
108
+ */
109
+ interface AvailableModules {
110
+ readonly queryModules: readonly ModuleInfo[];
111
+ readonly txModules: readonly ModuleInfo[];
112
+ }
113
+ /**
114
+ * Error codes for ManifestMCPError
115
+ */
116
+ declare enum ManifestMCPErrorCode {
117
+ INVALID_CONFIG = "INVALID_CONFIG",
118
+ MISSING_CONFIG = "MISSING_CONFIG",
119
+ WALLET_NOT_CONNECTED = "WALLET_NOT_CONNECTED",
120
+ WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED",
121
+ INVALID_MNEMONIC = "INVALID_MNEMONIC",
122
+ RPC_CONNECTION_FAILED = "RPC_CONNECTION_FAILED",
123
+ QUERY_FAILED = "QUERY_FAILED",
124
+ UNSUPPORTED_QUERY = "UNSUPPORTED_QUERY",
125
+ INVALID_ADDRESS = "INVALID_ADDRESS",
126
+ TX_FAILED = "TX_FAILED",
127
+ TX_BROADCAST_FAILED = "TX_BROADCAST_FAILED",
128
+ UNSUPPORTED_TX = "UNSUPPORTED_TX",
129
+ INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
130
+ UNKNOWN_MODULE = "UNKNOWN_MODULE"
131
+ }
132
+ /**
133
+ * Custom error class for Manifest MCP errors
134
+ */
135
+ declare class ManifestMCPError extends Error {
136
+ readonly code: ManifestMCPErrorCode;
137
+ readonly details?: Record<string, unknown>;
138
+ constructor(code: ManifestMCPErrorCode, message: string, details?: Record<string, unknown>);
139
+ toJSON(): Record<string, unknown>;
140
+ }
141
+ /**
142
+ * Account information
143
+ */
144
+ interface AccountInfo {
145
+ readonly address: string;
146
+ }
147
+ /**
148
+ * Pagination response from Cosmos SDK queries
149
+ */
150
+ interface PaginationResponse {
151
+ readonly nextKey?: Uint8Array;
152
+ readonly total?: bigint;
153
+ }
154
+ /**
155
+ * Base interface for paginated query results
156
+ */
157
+ interface PaginatedResult {
158
+ readonly pagination?: PaginationResponse;
159
+ }
160
+ /**
161
+ * Coin type from Cosmos SDK
162
+ */
163
+ interface Coin {
164
+ readonly denom: string;
165
+ readonly amount: string;
166
+ }
167
+ /**
168
+ * DecCoin type from Cosmos SDK (for rewards, commission, etc.)
169
+ *
170
+ * DecCoin has the same structure as Coin but represents decimal amounts
171
+ * used in distribution calculations. The amount string may contain decimals.
172
+ */
173
+ type DecCoin = Coin;
174
+ interface BalanceResult {
175
+ readonly balance?: Coin;
176
+ }
177
+ interface BalancesResult extends PaginatedResult {
178
+ readonly balances: readonly Coin[];
179
+ }
180
+ interface TotalSupplyResult extends PaginatedResult {
181
+ readonly supply: readonly Coin[];
182
+ }
183
+ interface SupplyOfResult {
184
+ readonly amount?: Coin;
185
+ }
186
+ interface DenomMetadataResult {
187
+ readonly metadata?: BankMetadata;
188
+ }
189
+ interface DenomsMetadataResult extends PaginatedResult {
190
+ readonly metadatas: readonly BankMetadata[];
191
+ }
192
+ interface SendEnabledResult extends PaginatedResult {
193
+ readonly sendEnabled: readonly SendEnabled[];
194
+ }
195
+ interface BankParamsResult {
196
+ readonly params?: BankParams;
197
+ }
198
+ interface DelegationResult {
199
+ readonly delegationResponse?: DelegationResponse;
200
+ }
201
+ interface DelegationsResult extends PaginatedResult {
202
+ readonly delegationResponses: readonly DelegationResponse[];
203
+ }
204
+ interface UnbondingDelegationResult {
205
+ readonly unbond?: UnbondingDelegation;
206
+ }
207
+ interface UnbondingDelegationsResult extends PaginatedResult {
208
+ readonly unbondingResponses: readonly UnbondingDelegation[];
209
+ }
210
+ interface RedelegationsResult extends PaginatedResult {
211
+ readonly redelegationResponses: readonly RedelegationResponse[];
212
+ }
213
+ interface ValidatorResult {
214
+ readonly validator?: Validator;
215
+ }
216
+ interface ValidatorsResult extends PaginatedResult {
217
+ readonly validators: readonly Validator[];
218
+ }
219
+ interface StakingPoolResult {
220
+ readonly pool?: StakingPool;
221
+ }
222
+ interface StakingParamsResult {
223
+ readonly params?: StakingParams;
224
+ }
225
+ interface HistoricalInfoResult {
226
+ readonly hist?: HistoricalInfo;
227
+ }
228
+ interface RewardsResult {
229
+ readonly rewards: readonly DecCoin[] | readonly DelegationDelegatorReward[];
230
+ readonly total?: readonly DecCoin[];
231
+ }
232
+ interface CommissionResult {
233
+ readonly commission?: ValidatorAccumulatedCommission;
234
+ }
235
+ interface CommunityPoolResult {
236
+ readonly pool: readonly DecCoin[];
237
+ }
238
+ interface DistributionParamsResult {
239
+ readonly params?: DistributionParams;
240
+ }
241
+ interface ValidatorOutstandingRewardsResult {
242
+ readonly rewards?: ValidatorOutstandingRewards;
243
+ }
244
+ interface SlashesResult extends PaginatedResult {
245
+ readonly slashes: readonly ValidatorSlashEvent[];
246
+ }
247
+ interface DelegatorValidatorsResult {
248
+ readonly validators: readonly string[];
249
+ }
250
+ interface DelegatorWithdrawAddressResult {
251
+ readonly withdrawAddress: string;
252
+ }
253
+ interface ProposalResult {
254
+ readonly proposal?: GovProposal;
255
+ }
256
+ interface ProposalsResult extends PaginatedResult {
257
+ readonly proposals: readonly GovProposal[];
258
+ }
259
+ interface VoteResult {
260
+ readonly vote?: GovVote;
261
+ }
262
+ interface VotesResult extends PaginatedResult {
263
+ readonly votes: readonly GovVote[];
264
+ }
265
+ interface DepositResult {
266
+ readonly deposit?: GovDeposit;
267
+ }
268
+ interface DepositsResult extends PaginatedResult {
269
+ readonly deposits: readonly GovDeposit[];
270
+ }
271
+ interface TallyResult {
272
+ readonly tally?: GovTallyResult;
273
+ }
274
+ interface GovParamsResult {
275
+ readonly votingParams?: VotingParams;
276
+ readonly depositParams?: DepositParams;
277
+ readonly tallyParams?: TallyParams;
278
+ readonly params?: GovParams;
279
+ }
280
+ interface AuthAccountResult {
281
+ readonly account?: BaseAccount | ModuleAccount | Any;
282
+ }
283
+ interface AuthAccountsResult extends PaginatedResult {
284
+ readonly accounts: readonly (BaseAccount | Any)[];
285
+ }
286
+ interface AuthParamsResult {
287
+ readonly params?: AuthParams;
288
+ }
289
+ interface ModuleAccountsResult {
290
+ readonly accounts: readonly (ModuleAccount | Any)[];
291
+ }
292
+ interface AddressBytesToStringResult {
293
+ readonly addressString: string;
294
+ }
295
+ interface AddressStringToBytesResult {
296
+ readonly addressBytes: string;
297
+ }
298
+ interface Bech32PrefixResult {
299
+ readonly bech32Prefix: string;
300
+ }
301
+ interface AccountInfoResult {
302
+ readonly info?: BaseAccount;
303
+ }
304
+ interface BillingParamsResult {
305
+ readonly params?: BillingParams;
306
+ }
307
+ interface LeaseResult {
308
+ readonly lease?: Lease;
309
+ }
310
+ interface LeasesResult extends PaginatedResult {
311
+ readonly leases: readonly Lease[];
312
+ }
313
+ interface CreditAccountResult {
314
+ readonly creditAccount?: CreditAccount;
315
+ }
316
+ interface CreditAccountsResult extends PaginatedResult {
317
+ readonly creditAccounts: readonly CreditAccount[];
318
+ }
319
+ interface CreditAddressResult {
320
+ readonly creditAddress: string;
321
+ }
322
+ interface WithdrawableAmountResult {
323
+ readonly amounts: readonly Coin[];
324
+ }
325
+ interface ProviderWithdrawableResult {
326
+ readonly amounts: readonly Coin[];
327
+ }
328
+ interface CreditEstimateResult {
329
+ readonly estimate: QueryCreditEstimateResponse;
330
+ }
331
+ interface GroupInfoResult {
332
+ readonly info?: GroupInfo;
333
+ }
334
+ interface GroupPolicyInfoResult {
335
+ readonly info?: GroupPolicyInfo;
336
+ }
337
+ interface GroupMembersResult extends PaginatedResult {
338
+ readonly members: readonly GroupMember[];
339
+ }
340
+ interface GroupsResult extends PaginatedResult {
341
+ readonly groups: readonly GroupInfo[];
342
+ }
343
+ interface GroupPoliciesResult extends PaginatedResult {
344
+ readonly groupPolicies: readonly GroupPolicyInfo[];
345
+ }
346
+ interface GroupProposalResult {
347
+ readonly proposal?: GroupProposal;
348
+ }
349
+ interface GroupProposalsResult extends PaginatedResult {
350
+ readonly proposals: readonly GroupProposal[];
351
+ }
352
+ interface GroupVoteResult {
353
+ readonly vote?: GroupVote;
354
+ }
355
+ interface GroupVotesResult extends PaginatedResult {
356
+ readonly votes: readonly GroupVote[];
357
+ }
358
+ interface GroupTallyQueryResult {
359
+ readonly tally?: GroupTallyResult;
360
+ }
361
+ interface SkuParamsResult {
362
+ readonly params?: SkuParams;
363
+ }
364
+ interface ProviderResult {
365
+ readonly provider?: Provider;
366
+ }
367
+ interface ProvidersResult extends PaginatedResult {
368
+ readonly providers: readonly Provider[];
369
+ }
370
+ interface SkuResult {
371
+ readonly sku?: SKU;
372
+ }
373
+ interface SkusResult extends PaginatedResult {
374
+ readonly skus: readonly SKU[];
375
+ }
376
+ /**
377
+ * Union type of all query results for type-safe handling
378
+ */
379
+ type QueryResult = BalanceResult | BalancesResult | TotalSupplyResult | SupplyOfResult | DenomMetadataResult | DenomsMetadataResult | SendEnabledResult | BankParamsResult | DelegationResult | DelegationsResult | UnbondingDelegationResult | UnbondingDelegationsResult | RedelegationsResult | ValidatorResult | ValidatorsResult | StakingPoolResult | StakingParamsResult | HistoricalInfoResult | RewardsResult | CommissionResult | CommunityPoolResult | DistributionParamsResult | ValidatorOutstandingRewardsResult | SlashesResult | DelegatorValidatorsResult | DelegatorWithdrawAddressResult | ProposalResult | ProposalsResult | VoteResult | VotesResult | DepositResult | DepositsResult | TallyResult | GovParamsResult | AuthAccountResult | AuthAccountsResult | AuthParamsResult | ModuleAccountsResult | AddressBytesToStringResult | AddressStringToBytesResult | Bech32PrefixResult | AccountInfoResult | BillingParamsResult | LeaseResult | LeasesResult | CreditAccountResult | CreditAccountsResult | CreditAddressResult | WithdrawableAmountResult | ProviderWithdrawableResult | CreditEstimateResult | SkuParamsResult | ProviderResult | ProvidersResult | SkuResult | SkusResult | GroupInfoResult | GroupPolicyInfoResult | GroupMembersResult | GroupsResult | GroupPoliciesResult | GroupProposalResult | GroupProposalsResult | GroupVoteResult | GroupVotesResult | GroupTallyQueryResult;
380
+ /**
381
+ * Result from a Cosmos query
382
+ */
383
+ interface CosmosQueryResult {
384
+ readonly module: string;
385
+ readonly subcommand: string;
386
+ readonly result: QueryResult;
387
+ }
388
+ //#endregion
389
+ export { AccountInfo, AccountInfoResult, AddressBytesToStringResult, AddressStringToBytesResult, type Any, AuthAccountResult, AuthAccountsResult, type AuthParams, AuthParamsResult, AvailableModules, BalanceResult, BalancesResult, type BankMetadata, type BankParams, BankParamsResult, type BaseAccount, Bech32PrefixResult, type BillingParams, BillingParamsResult, Coin, CommissionResult, CommunityPoolResult, CosmosQueryResult, CosmosTxResult, type CreditAccount, CreditAccountResult, CreditAccountsResult, CreditAddressResult, CreditEstimateResult, DecCoin, type DelegationDelegatorReward, type DelegationResponse, DelegationResult, DelegationsResult, DelegatorValidatorsResult, DelegatorWithdrawAddressResult, DenomMetadataResult, DenomsMetadataResult, type DepositParams, DepositResult, DepositsResult, type DistributionParams, DistributionParamsResult, type GovDeposit, type GovParams, GovParamsResult, type GovProposal, type GovTallyResult, type GovVote, type GroupInfo, GroupInfoResult, type GroupMember, GroupMembersResult, GroupPoliciesResult, type GroupPolicyInfo, GroupPolicyInfoResult, type GroupProposal, GroupProposalResult, GroupProposalsResult, GroupTallyQueryResult, type GroupTallyResult, type GroupVote, GroupVoteResult, GroupVotesResult, GroupsResult, type HistoricalInfo, HistoricalInfoResult, type Lease, type LeaseItemInput, LeaseResult, LeasesResult, ManifestMCPConfig, ManifestMCPError, ManifestMCPErrorCode, type ModuleAccount, ModuleAccountsResult, ModuleInfo, PaginatedResult, PaginationResponse, ProposalResult, ProposalsResult, type Provider, ProviderResult, ProviderWithdrawableResult, ProvidersResult, type QueryCreditEstimateResponse, QueryResult, RateLimitConfig, type RedelegationResponse, RedelegationsResult, RetryConfig, RewardsResult, type SKU, type SendEnabled, SendEnabledResult, SignArbitraryResult, type SkuParams, SkuParamsResult, SkuResult, SkusResult, SlashesResult, type StakingParams, StakingParamsResult, type StakingPool, StakingPoolResult, SupplyOfResult, type TallyParams, TallyResult, TotalSupplyResult, type UnbondingDelegation, UnbondingDelegationResult, UnbondingDelegationsResult, type Validator, type ValidatorAccumulatedCommission, type ValidatorOutstandingRewards, ValidatorOutstandingRewardsResult, ValidatorResult, type ValidatorSlashEvent, ValidatorsResult, VoteResult, VotesResult, type VotingParams, WalletProvider, WithdrawableAmountResult };
390
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;;;;;AAwHA;;UAAiB,eAAA;EAEN;EAAA,SAAA,iBAAA;AAAA;;;;UAMM,WAAA;EAIN;EAAA,SAFA,UAAA;EAIU;EAAA,SAFV,WAAA;EAQM;EAAA,SANN,UAAA;AAAA;;;;UAMM,iBAAA;EAQN;EAAA,SANA,OAAA;EAUA;EAAA,SARA,MAAA;EAUA;EAAA,SARA,QAAA;EAQmB;EAAA,SANnB,OAAA;EAcM;EAAA,SAZN,aAAA;;WAEA,SAAA,GAAY,eAAA;EAWZ;EAAA,SATA,KAAA,GAAQ,WAAA;AAAA;;;;AAanB;;UALiB,mBAAA;EAAA,SACN,OAAA;IAAA,SAAoB,IAAA;IAAA,SAAuB,KAAA;EAAA;EAAA,SAC3C,SAAA;AAAA;AAAA,UAGM,cAAA;EAUO;EARtB,UAAA,IAAc,OAAA;EAAd;EAEA,SAAA,IAAa,OAAA,CAAQ,aAAA;EAArB;EAEA,aAAA,EAAe,OAAA,UAAiB,IAAA,WAAe,OAAA,CAAQ,mBAAA;EAFlC;EAIrB,OAAA,KAAY,OAAA;EAFG;EAIf,UAAA,KAAe,OAAA;AAAA;;;;UAMA,cAAA;EAAA,SACN,MAAA;EA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AA;AAAA,UAGL,eAAA,SAAwB,eAAA;EAAA,SAC9B,SAAA,WAAoB,QAAA;AAAA;AAAA,UAGd,SAAA;EAAA,SACN,GAAA,GAAM,GAAA;AAAA;AAAA,UAGA,UAAA,SAAmB,eAAA;EAAA,SACzB,IAAA,WAAe,GAAA;AAAA;;;;KAMd,WAAA,GACR,aAAA,GACA,cAAA,GACA,iBAAA,GACA,cAAA,GACA,mBAAA,GACA,oBAAA,GACA,iBAAA,GACA,gBAAA,GACA,gBAAA,GACA,iBAAA,GACA,yBAAA,GACA,0BAAA,GACA,mBAAA,GACA,eAAA,GACA,gBAAA,GACA,iBAAA,GACA,mBAAA,GACA,oBAAA,GACA,aAAA,GACA,gBAAA,GACA,mBAAA,GACA,wBAAA,GACA,iCAAA,GACA,aAAA,GACA,yBAAA,GACA,8BAAA,GACA,cAAA,GACA,eAAA,GACA,UAAA,GACA,WAAA,GACA,aAAA,GACA,cAAA,GACA,WAAA,GACA,eAAA,GACA,iBAAA,GACA,kBAAA,GACA,gBAAA,GACA,oBAAA,GACA,0BAAA,GACA,0BAAA,GACA,kBAAA,GACA,iBAAA,GACA,mBAAA,GACA,WAAA,GACA,YAAA,GACA,mBAAA,GACA,oBAAA,GACA,mBAAA,GACA,wBAAA,GACA,0BAAA,GACA,oBAAA,GACA,eAAA,GACA,cAAA,GACA,eAAA,GACA,SAAA,GACA,UAAA,GACA,eAAA,GACA,qBAAA,GACA,kBAAA,GACA,YAAA,GACA,mBAAA,GACA,mBAAA,GACA,oBAAA,GACA,eAAA,GACA,gBAAA,GACA,qBAAA;;;;UAKa,iBAAA;EAAA,SACN,MAAA;EAAA,SACA,UAAA;EAAA,SACA,MAAA,EAAQ,WAAA;AAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,45 @@
1
+ //#region src/types.ts
2
+ /**
3
+ * Error codes for ManifestMCPError
4
+ */
5
+ let ManifestMCPErrorCode = /* @__PURE__ */ function(ManifestMCPErrorCode) {
6
+ ManifestMCPErrorCode["INVALID_CONFIG"] = "INVALID_CONFIG";
7
+ ManifestMCPErrorCode["MISSING_CONFIG"] = "MISSING_CONFIG";
8
+ ManifestMCPErrorCode["WALLET_NOT_CONNECTED"] = "WALLET_NOT_CONNECTED";
9
+ ManifestMCPErrorCode["WALLET_CONNECTION_FAILED"] = "WALLET_CONNECTION_FAILED";
10
+ ManifestMCPErrorCode["INVALID_MNEMONIC"] = "INVALID_MNEMONIC";
11
+ ManifestMCPErrorCode["RPC_CONNECTION_FAILED"] = "RPC_CONNECTION_FAILED";
12
+ ManifestMCPErrorCode["QUERY_FAILED"] = "QUERY_FAILED";
13
+ ManifestMCPErrorCode["UNSUPPORTED_QUERY"] = "UNSUPPORTED_QUERY";
14
+ ManifestMCPErrorCode["INVALID_ADDRESS"] = "INVALID_ADDRESS";
15
+ ManifestMCPErrorCode["TX_FAILED"] = "TX_FAILED";
16
+ ManifestMCPErrorCode["TX_BROADCAST_FAILED"] = "TX_BROADCAST_FAILED";
17
+ ManifestMCPErrorCode["UNSUPPORTED_TX"] = "UNSUPPORTED_TX";
18
+ ManifestMCPErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
19
+ ManifestMCPErrorCode["UNKNOWN_MODULE"] = "UNKNOWN_MODULE";
20
+ return ManifestMCPErrorCode;
21
+ }({});
22
+ /**
23
+ * Custom error class for Manifest MCP errors
24
+ */
25
+ var ManifestMCPError = class ManifestMCPError extends Error {
26
+ constructor(code, message, details) {
27
+ super(message);
28
+ this.name = "ManifestMCPError";
29
+ this.code = code;
30
+ this.details = details;
31
+ Object.setPrototypeOf(this, ManifestMCPError.prototype);
32
+ }
33
+ toJSON() {
34
+ return {
35
+ name: this.name,
36
+ code: this.code,
37
+ message: this.message,
38
+ details: this.details
39
+ };
40
+ }
41
+ };
42
+ //#endregion
43
+ export { ManifestMCPError, ManifestMCPErrorCode };
44
+
45
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { OfflineSigner } from '@cosmjs/proto-signing';\n// Auth module types\nimport type {\n Params as AuthParams,\n BaseAccount,\n ModuleAccount,\n} from '@manifest-network/manifestjs/dist/codegen/cosmos/auth/v1beta1/auth.js';\n// Bank module types\nimport type {\n Metadata as BankMetadata,\n Params as BankParams,\n SendEnabled,\n} from '@manifest-network/manifestjs/dist/codegen/cosmos/bank/v1beta1/bank.js';\n\n// Distribution module types\nimport type {\n DelegationDelegatorReward,\n Params as DistributionParams,\n ValidatorAccumulatedCommission,\n ValidatorOutstandingRewards,\n ValidatorSlashEvent,\n} from '@manifest-network/manifestjs/dist/codegen/cosmos/distribution/v1beta1/distribution.js';\n\n// Gov module types (v1 for newer chains)\nimport type {\n DepositParams,\n Deposit as GovDeposit,\n Params as GovParams,\n Proposal as GovProposal,\n TallyResult as GovTallyResult,\n Vote as GovVote,\n TallyParams,\n VotingParams,\n} from '@manifest-network/manifestjs/dist/codegen/cosmos/gov/v1/gov.js';\n// Group module types\nimport type {\n GroupInfo,\n GroupMember,\n GroupPolicyInfo,\n Proposal as GroupProposal,\n TallyResult as GroupTallyResult,\n Vote as GroupVote,\n} from '@manifest-network/manifestjs/dist/codegen/cosmos/group/v1/types.js';\n// Staking module types\nimport type {\n DelegationResponse,\n HistoricalInfo,\n RedelegationResponse,\n Params as StakingParams,\n Pool as StakingPool,\n UnbondingDelegation,\n Validator,\n} from '@manifest-network/manifestjs/dist/codegen/cosmos/staking/v1beta1/staking.js';\n// Protobuf Any type for polymorphic account types\nimport type { Any } from '@manifest-network/manifestjs/dist/codegen/google/protobuf/any.js';\n// Billing credit estimate response\nimport type { QueryCreditEstimateResponse } from '@manifest-network/manifestjs/dist/codegen/liftedinit/billing/v1/query.js';\nimport type { LeaseItemInput } from '@manifest-network/manifestjs/dist/codegen/liftedinit/billing/v1/tx.js';\n// Billing module types (Manifest-specific)\nimport type {\n Params as BillingParams,\n CreditAccount,\n Lease,\n} from '@manifest-network/manifestjs/dist/codegen/liftedinit/billing/v1/types.js';\n\n// SKU module types (Manifest-specific)\nimport type {\n Provider,\n SKU,\n Params as SkuParams,\n} from '@manifest-network/manifestjs/dist/codegen/liftedinit/sku/v1/types.js';\n\n// Re-export commonly used protobuf types for consumers\nexport type {\n Any,\n AuthParams,\n BankMetadata,\n BankParams,\n BaseAccount,\n BillingParams,\n CreditAccount,\n DelegationDelegatorReward,\n DelegationResponse,\n DepositParams,\n DistributionParams,\n GovDeposit,\n GovParams,\n GovProposal,\n GovTallyResult,\n GovVote,\n GroupInfo,\n GroupMember,\n GroupPolicyInfo,\n GroupProposal,\n GroupTallyResult,\n GroupVote,\n HistoricalInfo,\n Lease,\n LeaseItemInput,\n ModuleAccount,\n Provider,\n QueryCreditEstimateResponse,\n RedelegationResponse,\n SendEnabled,\n SKU,\n SkuParams,\n StakingParams,\n StakingPool,\n TallyParams,\n UnbondingDelegation,\n Validator,\n ValidatorAccumulatedCommission,\n ValidatorOutstandingRewards,\n ValidatorSlashEvent,\n VotingParams,\n};\n\n/**\n * Rate limiting configuration\n */\nexport interface RateLimitConfig {\n /** Maximum requests per second (default: 10) */\n readonly requestsPerSecond?: number;\n}\n\n/**\n * Retry configuration for transient RPC failures\n */\nexport interface RetryConfig {\n /** Maximum number of retry attempts (default: 3) */\n readonly maxRetries?: number;\n /** Base delay in milliseconds before first retry (default: 1000) */\n readonly baseDelayMs?: number;\n /** Maximum delay in milliseconds between retries (default: 10000) */\n readonly maxDelayMs?: number;\n}\n\n/**\n * Configuration for the Manifest MCP server\n */\nexport interface ManifestMCPConfig {\n /** Chain ID (e.g., \"manifest-ledger-testnet\") */\n readonly chainId: string;\n /** RPC endpoint URL (required for transactions; optional if restUrl provided for query-only mode) */\n readonly rpcUrl?: string;\n /** Gas price with denomination (e.g., \"1.0umfx\"); required when rpcUrl is provided */\n readonly gasPrice?: string;\n /** REST/LCD endpoint URL for queries (e.g., \"http://localhost:1317\") */\n readonly restUrl?: string;\n /** Address prefix (e.g., \"manifest\") */\n readonly addressPrefix?: string;\n /** Rate limiting configuration */\n readonly rateLimit?: RateLimitConfig;\n /** Retry configuration for transient failures */\n readonly retry?: RetryConfig;\n}\n\n/**\n * Wallet provider interface for different wallet implementations\n *\n * Any wallet that provides an OfflineSigner works (Keplr, Web3Auth, Leap, cosmos-kit, etc.)\n */\nexport interface SignArbitraryResult {\n readonly pub_key: { readonly type: string; readonly value: string };\n readonly signature: string;\n}\n\nexport interface WalletProvider {\n /** Get the wallet's address */\n getAddress(): Promise<string>;\n /** Get the offline signer for signing transactions */\n getSigner(): Promise<OfflineSigner>;\n /** Optional: Sign arbitrary data (ADR-036) for off-chain authentication */\n signArbitrary?(address: string, data: string): Promise<SignArbitraryResult>;\n /** Optional: Connect to the wallet */\n connect?(): Promise<void>;\n /** Optional: Disconnect from the wallet */\n disconnect?(): Promise<void>;\n}\n\n/**\n * Result from a Cosmos transaction\n */\nexport interface CosmosTxResult {\n readonly module: string;\n readonly subcommand: string;\n readonly transactionHash: string;\n readonly code: number;\n readonly height: string;\n readonly rawLog?: string;\n readonly confirmed?: boolean;\n readonly confirmationHeight?: string;\n readonly gasUsed?: string;\n readonly gasWanted?: string;\n readonly events?: readonly {\n readonly type: string;\n readonly attributes: readonly {\n readonly key: string;\n readonly value: string;\n }[];\n }[];\n}\n\n/**\n * Module information for discovery\n */\nexport interface ModuleInfo {\n readonly name: string;\n readonly description: string;\n readonly args?: string; // Usage hint for arguments\n}\n\n/**\n * Available modules listing\n */\nexport interface AvailableModules {\n readonly queryModules: readonly ModuleInfo[];\n readonly txModules: readonly ModuleInfo[];\n}\n\n/**\n * Error codes for ManifestMCPError\n */\nexport enum ManifestMCPErrorCode {\n // Configuration errors\n INVALID_CONFIG = 'INVALID_CONFIG',\n MISSING_CONFIG = 'MISSING_CONFIG',\n\n // Wallet errors\n WALLET_NOT_CONNECTED = 'WALLET_NOT_CONNECTED',\n WALLET_CONNECTION_FAILED = 'WALLET_CONNECTION_FAILED',\n INVALID_MNEMONIC = 'INVALID_MNEMONIC',\n\n // Client errors\n RPC_CONNECTION_FAILED = 'RPC_CONNECTION_FAILED',\n\n // Query errors\n QUERY_FAILED = 'QUERY_FAILED',\n UNSUPPORTED_QUERY = 'UNSUPPORTED_QUERY',\n INVALID_ADDRESS = 'INVALID_ADDRESS',\n\n // Transaction errors\n TX_FAILED = 'TX_FAILED',\n TX_BROADCAST_FAILED = 'TX_BROADCAST_FAILED',\n UNSUPPORTED_TX = 'UNSUPPORTED_TX',\n INSUFFICIENT_FUNDS = 'INSUFFICIENT_FUNDS',\n\n // Module errors\n UNKNOWN_MODULE = 'UNKNOWN_MODULE',\n}\n\n/**\n * Custom error class for Manifest MCP errors\n */\nexport class ManifestMCPError extends Error {\n public readonly code: ManifestMCPErrorCode;\n public readonly details?: Record<string, unknown>;\n\n constructor(\n code: ManifestMCPErrorCode,\n message: string,\n details?: Record<string, unknown>,\n ) {\n super(message);\n this.name = 'ManifestMCPError';\n this.code = code;\n this.details = details;\n\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, ManifestMCPError.prototype);\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n details: this.details,\n };\n }\n}\n\n/**\n * Account information\n */\nexport interface AccountInfo {\n readonly address: string;\n}\n\n// ============================================================================\n// Query Result Types\n// ============================================================================\n\n/**\n * Pagination response from Cosmos SDK queries\n */\nexport interface PaginationResponse {\n readonly nextKey?: Uint8Array;\n readonly total?: bigint;\n}\n\n/**\n * Base interface for paginated query results\n */\nexport interface PaginatedResult {\n readonly pagination?: PaginationResponse;\n}\n\n/**\n * Coin type from Cosmos SDK\n */\nexport interface Coin {\n readonly denom: string;\n readonly amount: string;\n}\n\n/**\n * DecCoin type from Cosmos SDK (for rewards, commission, etc.)\n *\n * DecCoin has the same structure as Coin but represents decimal amounts\n * used in distribution calculations. The amount string may contain decimals.\n */\nexport type DecCoin = Coin;\n\n// Bank query results\nexport interface BalanceResult {\n readonly balance?: Coin;\n}\n\nexport interface BalancesResult extends PaginatedResult {\n readonly balances: readonly Coin[];\n}\n\nexport interface TotalSupplyResult extends PaginatedResult {\n readonly supply: readonly Coin[];\n}\n\nexport interface SupplyOfResult {\n readonly amount?: Coin;\n}\n\nexport interface DenomMetadataResult {\n readonly metadata?: BankMetadata;\n}\n\nexport interface DenomsMetadataResult extends PaginatedResult {\n readonly metadatas: readonly BankMetadata[];\n}\n\nexport interface SendEnabledResult extends PaginatedResult {\n readonly sendEnabled: readonly SendEnabled[];\n}\n\nexport interface BankParamsResult {\n readonly params?: BankParams;\n}\n\n// Staking query results\nexport interface DelegationResult {\n readonly delegationResponse?: DelegationResponse;\n}\n\nexport interface DelegationsResult extends PaginatedResult {\n readonly delegationResponses: readonly DelegationResponse[];\n}\n\nexport interface UnbondingDelegationResult {\n readonly unbond?: UnbondingDelegation;\n}\n\nexport interface UnbondingDelegationsResult extends PaginatedResult {\n readonly unbondingResponses: readonly UnbondingDelegation[];\n}\n\nexport interface RedelegationsResult extends PaginatedResult {\n readonly redelegationResponses: readonly RedelegationResponse[];\n}\n\nexport interface ValidatorResult {\n readonly validator?: Validator;\n}\n\nexport interface ValidatorsResult extends PaginatedResult {\n readonly validators: readonly Validator[];\n}\n\nexport interface StakingPoolResult {\n readonly pool?: StakingPool;\n}\n\nexport interface StakingParamsResult {\n readonly params?: StakingParams;\n}\n\nexport interface HistoricalInfoResult {\n readonly hist?: HistoricalInfo;\n}\n\n// Distribution query results\n// Note: When querying all rewards, 'rewards' is DelegationDelegatorReward[] (per validator).\n// When querying specific validator, 'rewards' is DecCoin[] (direct reward coins).\nexport interface RewardsResult {\n readonly rewards: readonly DecCoin[] | readonly DelegationDelegatorReward[];\n readonly total?: readonly DecCoin[];\n}\n\nexport interface CommissionResult {\n readonly commission?: ValidatorAccumulatedCommission;\n}\n\nexport interface CommunityPoolResult {\n readonly pool: readonly DecCoin[];\n}\n\nexport interface DistributionParamsResult {\n readonly params?: DistributionParams;\n}\n\nexport interface ValidatorOutstandingRewardsResult {\n readonly rewards?: ValidatorOutstandingRewards;\n}\n\nexport interface SlashesResult extends PaginatedResult {\n readonly slashes: readonly ValidatorSlashEvent[];\n}\n\nexport interface DelegatorValidatorsResult {\n readonly validators: readonly string[];\n}\n\nexport interface DelegatorWithdrawAddressResult {\n readonly withdrawAddress: string;\n}\n\n// Gov query results\nexport interface ProposalResult {\n readonly proposal?: GovProposal;\n}\n\nexport interface ProposalsResult extends PaginatedResult {\n readonly proposals: readonly GovProposal[];\n}\n\nexport interface VoteResult {\n readonly vote?: GovVote;\n}\n\nexport interface VotesResult extends PaginatedResult {\n readonly votes: readonly GovVote[];\n}\n\nexport interface DepositResult {\n readonly deposit?: GovDeposit;\n}\n\nexport interface DepositsResult extends PaginatedResult {\n readonly deposits: readonly GovDeposit[];\n}\n\nexport interface TallyResult {\n readonly tally?: GovTallyResult;\n}\n\nexport interface GovParamsResult {\n readonly votingParams?: VotingParams;\n readonly depositParams?: DepositParams;\n readonly tallyParams?: TallyParams;\n readonly params?: GovParams;\n}\n\n// Auth query results\n// Note: Account types are polymorphic - the RPC can return BaseAccount, ModuleAccount, or other account types wrapped in Any\nexport interface AuthAccountResult {\n readonly account?: BaseAccount | ModuleAccount | Any;\n}\n\nexport interface AuthAccountsResult extends PaginatedResult {\n readonly accounts: readonly (BaseAccount | Any)[];\n}\n\nexport interface AuthParamsResult {\n readonly params?: AuthParams;\n}\n\nexport interface ModuleAccountsResult {\n readonly accounts: readonly (ModuleAccount | Any)[];\n}\n\nexport interface AddressBytesToStringResult {\n readonly addressString: string;\n}\n\nexport interface AddressStringToBytesResult {\n readonly addressBytes: string;\n}\n\nexport interface Bech32PrefixResult {\n readonly bech32Prefix: string;\n}\n\nexport interface AccountInfoResult {\n readonly info?: BaseAccount;\n}\n\n// Billing query results\nexport interface BillingParamsResult {\n readonly params?: BillingParams;\n}\n\nexport interface LeaseResult {\n readonly lease?: Lease;\n}\n\nexport interface LeasesResult extends PaginatedResult {\n readonly leases: readonly Lease[];\n}\n\nexport interface CreditAccountResult {\n readonly creditAccount?: CreditAccount;\n}\n\nexport interface CreditAccountsResult extends PaginatedResult {\n readonly creditAccounts: readonly CreditAccount[];\n}\n\nexport interface CreditAddressResult {\n readonly creditAddress: string;\n}\n\nexport interface WithdrawableAmountResult {\n readonly amounts: readonly Coin[];\n}\n\nexport interface ProviderWithdrawableResult {\n readonly amounts: readonly Coin[];\n}\n\nexport interface CreditEstimateResult {\n readonly estimate: QueryCreditEstimateResponse;\n}\n\n// Group query results\nexport interface GroupInfoResult {\n readonly info?: GroupInfo;\n}\n\nexport interface GroupPolicyInfoResult {\n readonly info?: GroupPolicyInfo;\n}\n\nexport interface GroupMembersResult extends PaginatedResult {\n readonly members: readonly GroupMember[];\n}\n\nexport interface GroupsResult extends PaginatedResult {\n readonly groups: readonly GroupInfo[];\n}\n\nexport interface GroupPoliciesResult extends PaginatedResult {\n readonly groupPolicies: readonly GroupPolicyInfo[];\n}\n\nexport interface GroupProposalResult {\n readonly proposal?: GroupProposal;\n}\n\nexport interface GroupProposalsResult extends PaginatedResult {\n readonly proposals: readonly GroupProposal[];\n}\n\nexport interface GroupVoteResult {\n readonly vote?: GroupVote;\n}\n\nexport interface GroupVotesResult extends PaginatedResult {\n readonly votes: readonly GroupVote[];\n}\n\nexport interface GroupTallyQueryResult {\n readonly tally?: GroupTallyResult;\n}\n\n// SKU query results\nexport interface SkuParamsResult {\n readonly params?: SkuParams;\n}\n\nexport interface ProviderResult {\n readonly provider?: Provider;\n}\n\nexport interface ProvidersResult extends PaginatedResult {\n readonly providers: readonly Provider[];\n}\n\nexport interface SkuResult {\n readonly sku?: SKU;\n}\n\nexport interface SkusResult extends PaginatedResult {\n readonly skus: readonly SKU[];\n}\n\n/**\n * Union type of all query results for type-safe handling\n */\nexport type QueryResult =\n | BalanceResult\n | BalancesResult\n | TotalSupplyResult\n | SupplyOfResult\n | DenomMetadataResult\n | DenomsMetadataResult\n | SendEnabledResult\n | BankParamsResult\n | DelegationResult\n | DelegationsResult\n | UnbondingDelegationResult\n | UnbondingDelegationsResult\n | RedelegationsResult\n | ValidatorResult\n | ValidatorsResult\n | StakingPoolResult\n | StakingParamsResult\n | HistoricalInfoResult\n | RewardsResult\n | CommissionResult\n | CommunityPoolResult\n | DistributionParamsResult\n | ValidatorOutstandingRewardsResult\n | SlashesResult\n | DelegatorValidatorsResult\n | DelegatorWithdrawAddressResult\n | ProposalResult\n | ProposalsResult\n | VoteResult\n | VotesResult\n | DepositResult\n | DepositsResult\n | TallyResult\n | GovParamsResult\n | AuthAccountResult\n | AuthAccountsResult\n | AuthParamsResult\n | ModuleAccountsResult\n | AddressBytesToStringResult\n | AddressStringToBytesResult\n | Bech32PrefixResult\n | AccountInfoResult\n | BillingParamsResult\n | LeaseResult\n | LeasesResult\n | CreditAccountResult\n | CreditAccountsResult\n | CreditAddressResult\n | WithdrawableAmountResult\n | ProviderWithdrawableResult\n | CreditEstimateResult\n | SkuParamsResult\n | ProviderResult\n | ProvidersResult\n | SkuResult\n | SkusResult\n | GroupInfoResult\n | GroupPolicyInfoResult\n | GroupMembersResult\n | GroupsResult\n | GroupPoliciesResult\n | GroupProposalResult\n | GroupProposalsResult\n | GroupVoteResult\n | GroupVotesResult\n | GroupTallyQueryResult;\n\n/**\n * Result from a Cosmos query\n */\nexport interface CosmosQueryResult {\n readonly module: string;\n readonly subcommand: string;\n readonly result: QueryResult;\n}\n"],"mappings":";;;;AA+NA,IAAY,uBAAL,yBAAA,sBAAA;AAEL,sBAAA,oBAAA;AACA,sBAAA,oBAAA;AAGA,sBAAA,0BAAA;AACA,sBAAA,8BAAA;AACA,sBAAA,sBAAA;AAGA,sBAAA,2BAAA;AAGA,sBAAA,kBAAA;AACA,sBAAA,uBAAA;AACA,sBAAA,qBAAA;AAGA,sBAAA,eAAA;AACA,sBAAA,yBAAA;AACA,sBAAA,oBAAA;AACA,sBAAA,wBAAA;AAGA,sBAAA,oBAAA;;KACD;;;;AAKD,IAAa,mBAAb,MAAa,yBAAyB,MAAM;CAI1C,YACE,MACA,SACA,SACA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,UAAU;AAGf,SAAO,eAAe,MAAM,iBAAiB,UAAU;;CAGzD,SAAkC;AAChC,SAAO;GACL,MAAM,KAAK;GACX,MAAM,KAAK;GACX,SAAS,KAAK;GACd,SAAS,KAAK;GACf"}
@@ -0,0 +1,30 @@
1
+ import { ManifestMCPErrorCode } from "./types.js";
2
+
3
+ //#region src/validation.d.ts
4
+ /**
5
+ * Require a non-empty string field from tool input.
6
+ */
7
+ declare function requireString(input: Record<string, unknown>, field: string, errorCode?: ManifestMCPErrorCode): string;
8
+ /**
9
+ * Require a string field that matches one of the allowed enum values.
10
+ */
11
+ declare function requireStringEnum<T extends string>(input: Record<string, unknown>, field: string, allowed: readonly T[]): T;
12
+ /**
13
+ * Parse raw args input into string array.
14
+ * Throws if a non-array, non-nullish value is provided (e.g., a bare string).
15
+ */
16
+ declare function parseArgs(rawArgs: unknown, errorCode?: ManifestMCPErrorCode): string[];
17
+ /** RFC 1123 DNS label pattern: 1-63 lowercase alphanumeric or hyphens, no leading/trailing hyphen */
18
+ declare const DNS_LABEL_RE: RegExp;
19
+ /**
20
+ * Require a non-empty string field that is a valid UUID.
21
+ */
22
+ declare function requireUuid(input: Record<string, unknown>, field: string, errorCode?: ManifestMCPErrorCode): string;
23
+ /**
24
+ * Extract an optional boolean field from tool input.
25
+ * Rejects non-boolean truthy values (e.g. string "true") to prevent unchecked casts.
26
+ */
27
+ declare function optionalBoolean(input: Record<string, unknown>, field: string, defaultValue?: boolean, errorCode?: ManifestMCPErrorCode): boolean;
28
+ //#endregion
29
+ export { DNS_LABEL_RE, optionalBoolean, parseArgs, requireString, requireStringEnum, requireUuid };
30
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","names":[],"sources":["../src/validation.ts"],"mappings":";;;;;AAKA;iBAAgB,aAAA,CACd,KAAA,EAAO,MAAA,mBACP,KAAA,UACA,SAAA,GAAW,oBAAA;;;;iBAeG,iBAAA,kBAAA,CACd,KAAA,EAAO,MAAA,mBACP,KAAA,UACA,OAAA,WAAkB,CAAA,KACjB,CAAA;;;;;iBAea,SAAA,CACd,OAAA,WACA,SAAA,GAAW,oBAAA;AArBb;AAAA,cA0Ca,YAAA,EAAY,MAAA;;;;iBAQT,WAAA,CACd,KAAA,EAAO,MAAA,mBACP,KAAA,UACA,SAAA,GAAW,oBAAA;;;;;iBAiBG,eAAA,CACd,KAAA,EAAO,MAAA,mBACP,KAAA,UACA,YAAA,YACA,SAAA,GAAW,oBAAA"}
@@ -0,0 +1,53 @@
1
+ import { ManifestMCPError, ManifestMCPErrorCode } from "./types.js";
2
+ //#region src/validation.ts
3
+ /**
4
+ * Require a non-empty string field from tool input.
5
+ */
6
+ function requireString(input, field, errorCode = ManifestMCPErrorCode.QUERY_FAILED) {
7
+ const val = input[field];
8
+ if (typeof val !== "string" || val.length === 0) throw new ManifestMCPError(errorCode, `${field} is required and must be a non-empty string`);
9
+ return val;
10
+ }
11
+ /**
12
+ * Require a string field that matches one of the allowed enum values.
13
+ */
14
+ function requireStringEnum(input, field, allowed) {
15
+ const val = requireString(input, field);
16
+ if (!allowed.includes(val)) throw new ManifestMCPError(ManifestMCPErrorCode.QUERY_FAILED, `${field} must be one of: ${allowed.join(", ")}`);
17
+ return val;
18
+ }
19
+ /**
20
+ * Parse raw args input into string array.
21
+ * Throws if a non-array, non-nullish value is provided (e.g., a bare string).
22
+ */
23
+ function parseArgs(rawArgs, errorCode = ManifestMCPErrorCode.QUERY_FAILED) {
24
+ if (rawArgs === void 0 || rawArgs === null) return [];
25
+ if (Array.isArray(rawArgs)) return rawArgs.map(String);
26
+ if (typeof rawArgs === "string") throw new ManifestMCPError(errorCode, `args must be an array of strings, not a single string. Use ["${rawArgs}"] instead of "${rawArgs}".`);
27
+ throw new ManifestMCPError(errorCode, `args must be an array of strings, got ${typeof rawArgs}`);
28
+ }
29
+ /** RFC 1123 DNS label pattern: 1-63 lowercase alphanumeric or hyphens, no leading/trailing hyphen */
30
+ const DNS_LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
31
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
32
+ /**
33
+ * Require a non-empty string field that is a valid UUID.
34
+ */
35
+ function requireUuid(input, field, errorCode = ManifestMCPErrorCode.QUERY_FAILED) {
36
+ const val = requireString(input, field, errorCode);
37
+ if (!UUID_PATTERN.test(val)) throw new ManifestMCPError(errorCode, `${field} must be a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000"), got "${val.length > 50 ? `${val.slice(0, 50)}...` : val}"`);
38
+ return val;
39
+ }
40
+ /**
41
+ * Extract an optional boolean field from tool input.
42
+ * Rejects non-boolean truthy values (e.g. string "true") to prevent unchecked casts.
43
+ */
44
+ function optionalBoolean(input, field, defaultValue = false, errorCode = ManifestMCPErrorCode.QUERY_FAILED) {
45
+ const val = input[field];
46
+ if (val === void 0 || val === null) return defaultValue;
47
+ if (typeof val === "boolean") return val;
48
+ throw new ManifestMCPError(errorCode, `${field} must be a boolean, got ${typeof val}`);
49
+ }
50
+ //#endregion
51
+ export { DNS_LABEL_RE, optionalBoolean, parseArgs, requireString, requireStringEnum, requireUuid };
52
+
53
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","names":[],"sources":["../src/validation.ts"],"sourcesContent":["import { ManifestMCPError, ManifestMCPErrorCode } from './types.js';\n\n/**\n * Require a non-empty string field from tool input.\n */\nexport function requireString(\n input: Record<string, unknown>,\n field: string,\n errorCode: ManifestMCPErrorCode = ManifestMCPErrorCode.QUERY_FAILED,\n): string {\n const val = input[field];\n if (typeof val !== 'string' || val.length === 0) {\n throw new ManifestMCPError(\n errorCode,\n `${field} is required and must be a non-empty string`,\n );\n }\n return val;\n}\n\n/**\n * Require a string field that matches one of the allowed enum values.\n */\nexport function requireStringEnum<T extends string>(\n input: Record<string, unknown>,\n field: string,\n allowed: readonly T[],\n): T {\n const val = requireString(input, field);\n if (!allowed.includes(val as T)) {\n throw new ManifestMCPError(\n ManifestMCPErrorCode.QUERY_FAILED,\n `${field} must be one of: ${allowed.join(', ')}`,\n );\n }\n return val as T;\n}\n\n/**\n * Parse raw args input into string array.\n * Throws if a non-array, non-nullish value is provided (e.g., a bare string).\n */\nexport function parseArgs(\n rawArgs: unknown,\n errorCode: ManifestMCPErrorCode = ManifestMCPErrorCode.QUERY_FAILED,\n): string[] {\n if (rawArgs === undefined || rawArgs === null) {\n return [];\n }\n if (Array.isArray(rawArgs)) {\n return rawArgs.map(String);\n }\n if (typeof rawArgs === 'string') {\n throw new ManifestMCPError(\n errorCode,\n `args must be an array of strings, not a single string. Use [\"${rawArgs}\"] instead of \"${rawArgs}\".`,\n );\n }\n throw new ManifestMCPError(\n errorCode,\n `args must be an array of strings, got ${typeof rawArgs}`,\n );\n}\n\n/** RFC 1123 DNS label pattern: 1-63 lowercase alphanumeric or hyphens, no leading/trailing hyphen */\nexport const DNS_LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;\n\nconst UUID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Require a non-empty string field that is a valid UUID.\n */\nexport function requireUuid(\n input: Record<string, unknown>,\n field: string,\n errorCode: ManifestMCPErrorCode = ManifestMCPErrorCode.QUERY_FAILED,\n): string {\n const val = requireString(input, field, errorCode);\n if (!UUID_PATTERN.test(val)) {\n const display = val.length > 50 ? `${val.slice(0, 50)}...` : val;\n throw new ManifestMCPError(\n errorCode,\n `${field} must be a valid UUID (e.g., \"550e8400-e29b-41d4-a716-446655440000\"), got \"${display}\"`,\n );\n }\n return val;\n}\n\n/**\n * Extract an optional boolean field from tool input.\n * Rejects non-boolean truthy values (e.g. string \"true\") to prevent unchecked casts.\n */\nexport function optionalBoolean(\n input: Record<string, unknown>,\n field: string,\n defaultValue = false,\n errorCode: ManifestMCPErrorCode = ManifestMCPErrorCode.QUERY_FAILED,\n): boolean {\n const val = input[field];\n if (val === undefined || val === null) return defaultValue;\n if (typeof val === 'boolean') return val;\n throw new ManifestMCPError(\n errorCode,\n `${field} must be a boolean, got ${typeof val}`,\n );\n}\n"],"mappings":";;;;;AAKA,SAAgB,cACd,OACA,OACA,YAAkC,qBAAqB,cAC/C;CACR,MAAM,MAAM,MAAM;AAClB,KAAI,OAAO,QAAQ,YAAY,IAAI,WAAW,EAC5C,OAAM,IAAI,iBACR,WACA,GAAG,MAAM,6CACV;AAEH,QAAO;;;;;AAMT,SAAgB,kBACd,OACA,OACA,SACG;CACH,MAAM,MAAM,cAAc,OAAO,MAAM;AACvC,KAAI,CAAC,QAAQ,SAAS,IAAS,CAC7B,OAAM,IAAI,iBACR,qBAAqB,cACrB,GAAG,MAAM,mBAAmB,QAAQ,KAAK,KAAK,GAC/C;AAEH,QAAO;;;;;;AAOT,SAAgB,UACd,SACA,YAAkC,qBAAqB,cAC7C;AACV,KAAI,YAAY,KAAA,KAAa,YAAY,KACvC,QAAO,EAAE;AAEX,KAAI,MAAM,QAAQ,QAAQ,CACxB,QAAO,QAAQ,IAAI,OAAO;AAE5B,KAAI,OAAO,YAAY,SACrB,OAAM,IAAI,iBACR,WACA,gEAAgE,QAAQ,iBAAiB,QAAQ,IAClG;AAEH,OAAM,IAAI,iBACR,WACA,yCAAyC,OAAO,UACjD;;;AAIH,MAAa,eAAe;AAE5B,MAAM,eACJ;;;;AAKF,SAAgB,YACd,OACA,OACA,YAAkC,qBAAqB,cAC/C;CACR,MAAM,MAAM,cAAc,OAAO,OAAO,UAAU;AAClD,KAAI,CAAC,aAAa,KAAK,IAAI,CAEzB,OAAM,IAAI,iBACR,WACA,GAAG,MAAM,6EAHK,IAAI,SAAS,KAAK,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC,OAAO,IAGmC,GAC/F;AAEH,QAAO;;;;;;AAOT,SAAgB,gBACd,OACA,OACA,eAAe,OACf,YAAkC,qBAAqB,cAC9C;CACT,MAAM,MAAM,MAAM;AAClB,KAAI,QAAQ,KAAA,KAAa,QAAQ,KAAM,QAAO;AAC9C,KAAI,OAAO,QAAQ,UAAW,QAAO;AACrC,OAAM,IAAI,iBACR,WACA,GAAG,MAAM,0BAA0B,OAAO,MAC3C"}
@@ -0,0 +1,5 @@
1
+ //#region src/version.d.ts
2
+ declare const VERSION = "0.1.16";
3
+ //#endregion
4
+ export { VERSION };
5
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","names":[],"sources":["../src/version.ts"],"mappings":";cAAa,OAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/version.ts
2
+ const VERSION = "0.1.16";
3
+ //#endregion
4
+ export { VERSION };
5
+
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["export const VERSION = '0.1.16';\n"],"mappings":";AAAA,MAAa,UAAU"}
@@ -0,0 +1,4 @@
1
+ import { WalletProvider } from "../types.js";
2
+ import { MnemonicWalletProvider } from "./mnemonic.js";
3
+ import { signArbitraryWithAmino } from "./sign-arbitrary.js";
4
+ export { MnemonicWalletProvider, type WalletProvider, signArbitraryWithAmino };
@@ -0,0 +1,3 @@
1
+ import { signArbitraryWithAmino } from "./sign-arbitrary.js";
2
+ import { MnemonicWalletProvider } from "./mnemonic.js";
3
+ export { MnemonicWalletProvider, signArbitraryWithAmino };